Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:43:55

0001 //===- HLSLResource.h - HLSL Resource helper objects ----------------------===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 ///
0009 /// \file This file contains helper objects for working with HLSL Resources.
0010 ///
0011 //===----------------------------------------------------------------------===//
0012 
0013 #ifndef LLVM_FRONTEND_HLSL_HLSLRESOURCE_H
0014 #define LLVM_FRONTEND_HLSL_HLSLRESOURCE_H
0015 
0016 #include "llvm/ADT/StringRef.h"
0017 #include "llvm/Support/DXILABI.h"
0018 
0019 namespace llvm {
0020 class GlobalVariable;
0021 class MDNode;
0022 
0023 namespace hlsl {
0024 
0025 // For now we use DXIL ABI enum values directly. This may change in the future.
0026 using dxil::ResourceClass;
0027 using dxil::ElementType;
0028 using dxil::ResourceKind;
0029 
0030 class FrontendResource {
0031   MDNode *Entry;
0032 
0033 public:
0034   FrontendResource(MDNode *E);
0035   FrontendResource(GlobalVariable *GV, ResourceKind RK, ElementType ElTy,
0036                    bool IsROV, uint32_t ResIndex, uint32_t Space);
0037 
0038   GlobalVariable *getGlobalVariable();
0039   StringRef getSourceType();
0040   ResourceKind getResourceKind();
0041   ElementType getElementType();
0042   bool getIsROV();
0043   uint32_t getResourceIndex();
0044   uint32_t getSpace();
0045   MDNode *getMetadata() { return Entry; }
0046 };
0047 } // namespace hlsl
0048 } // namespace llvm
0049 
0050 #endif // LLVM_FRONTEND_HLSL_HLSLRESOURCE_H