LLVM 19.0.0git
HLSLResource.h
Go to the documentation of this file.
1//===- HLSLResource.h - HLSL Resource helper objects ----------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8///
9/// \file This file contains helper objects for working with HLSL Resources.
10///
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_FRONTEND_HLSL_HLSLRESOURCE_H
14#define LLVM_FRONTEND_HLSL_HLSLRESOURCE_H
15
16#include "llvm/IR/Metadata.h"
18
19namespace llvm {
20class GlobalVariable;
21
22namespace hlsl {
23
24enum class ResourceClass : uint8_t {
25 SRV = 0,
26 UAV,
27 CBuffer,
28 Sampler,
29 Invalid,
31};
32
33// For now we use DXIL ABI enum values directly. This may change in the future.
36
38 MDNode *Entry;
39
40public:
42 assert(Entry->getNumOperands() == 6 && "Unexpected metadata shape");
43 }
44
45 FrontendResource(GlobalVariable *GV, ResourceKind RK, ElementType ElTy,
46 bool IsROV, uint32_t ResIndex, uint32_t Space);
47
50 ResourceKind getResourceKind();
51 ElementType getElementType();
52 bool getIsROV();
55 MDNode *getMetadata() { return Entry; }
56};
57} // namespace hlsl
58} // namespace llvm
59
60#endif // LLVM_FRONTEND_HLSL_HLSLRESOURCE_H
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
This file contains the declarations for metadata subclasses.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Metadata node.
Definition: Metadata.h:1067
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
GlobalVariable * getGlobalVariable()
ResourceKind
The kind of resource for an SRV or UAV resource.
Definition: DXILABI.h:44
ElementType
The element type of an SRV or UAV resource.
Definition: DXILABI.h:68
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18