LLVM 18.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"
17
18namespace llvm {
19class GlobalVariable;
20
21namespace hlsl {
22
23enum class ResourceClass : uint8_t {
24 SRV = 0,
25 UAV,
26 CBuffer,
27 Sampler,
28 Invalid,
30};
31
32// The value ordering of this enumeration is part of the DXIL ABI. Elements
33// can only be added to the end, and not removed.
34enum class ResourceKind : uint32_t {
35 Invalid = 0,
48 CBuffer,
49 Sampler,
50 TBuffer,
55};
56
58 MDNode *Entry;
59
60public:
62 assert(Entry->getNumOperands() == 5 && "Unexpected metadata shape");
63 }
64
66 uint32_t ResIndex, uint32_t Space);
67
73 MDNode *getMetadata() { return Entry; }
74};
75} // namespace hlsl
76} // namespace llvm
77
78#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:950
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
GlobalVariable * getGlobalVariable()
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18