27 if (!Entry || Entry->getNumOperands() == 0)
31 for (
auto *Res : Entry->operands()) {
38 if (!Entry || Entry->getNumOperands() == 0)
42 for (
auto *Res : Entry->operands()) {
60 LowerBound(R.getResourceIndex()), RangeSize(1) {
172 return "fbtex2darray";
203 DimName += std::to_string(SampleCount);
218 std::string ResID = IDPrefix.
str();
219 ResID += std::to_string(
ID);
222 std::string Bind = BindingPrefix.
str();
225 Bind +=
",space" + std::to_string(
Space);
269 for (
auto &Res :
Data)
277 Entries.emplace_back(
308 Entries[10] = ExtProps.write(Ctx);
326 for (
auto &Res :
Data)
331 Entry->eraseFromParent();
337 Metadata *ResourceMDs[4] = {
nullptr,
nullptr,
nullptr,
nullptr};
339 ResourceMDs[1] = UAVs.write(M);
341 ResourceMDs[2] = CBuffers.write(M);
343 bool HasResource = ResourceMDs[0] !=
nullptr || ResourceMDs[1] !=
nullptr ||
344 ResourceMDs[2] !=
nullptr || ResourceMDs[3] !=
nullptr;
347 NamedMDNode *DXResMD = M.getOrInsertNamedMetadata(
"dx.resources");
351 NamedMDNode *Entry = M.getNamedMetadata(
"hlsl.uavs");
353 Entry->eraseFromParent();
358 <<
"; Resource Bindings:\n"
360 <<
"; Name Type Format Dim "
361 "ID HLSL Bind Count\n"
362 <<
"; ------------------------------ ---------- ------- ----------- "
363 "------- -------------- ------\n";
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
Module.h This file contains the declarations for the Module class.
This file implements the StringSwitch template, which mimics a switch() statement whose cases are str...
static GlobalVariable * getGlobalVariable(Module &M, Type *Ty, WebAssemblyTargetMachine &TM, const char *Name)
Type * getValueType() const
This provides a uniform API for creating instructions and inserting them into a basic block: either a...
This is an important class for using LLVM in a threaded context.
static MDTuple * get(LLVMContext &Context, ArrayRef< Metadata * > MDs)
static MDString * get(LLVMContext &Context, StringRef Str)
A Module instance is used to store all the information related to an LLVM module.
MutableArrayRef - Represent a mutable reference to an array (0 or more elements consecutively in memo...
void addOperand(MDNode *M)
reference emplace_back(ArgTypes &&... Args)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
std::string str() const
str - Get the contents as an std::string.
LLVMContext & getContext() const
All values hold a context through their type.
ConstantBuffer(uint32_t I, hlsl::FrontendResource R)
void setSize(CBufferDataLayout &DL)
void print(raw_ostream &O) const
static StringRef getElementTypeName(dxil::ElementType CompType)
void print(raw_ostream &O, StringRef IDPrefix, StringRef BindingPrefix) const
ResourceBase(uint32_t I, hlsl::FrontendResource R)
static void printElementType(dxil::ResourceKind Kind, dxil::ElementType CompType, unsigned Alignment, raw_ostream &OS)
static void printKind(dxil::ResourceKind Kind, unsigned Alignment, raw_ostream &OS, bool SRV=false, bool HasCounter=false, uint32_t SampleCount=0)
static StringRef getKindName(dxil::ResourceKind Kind)
void write(LLVMContext &Ctx, MutableArrayRef< Metadata * > Entries) const
void print(raw_ostream &O) const
MDNode * write(Module &M) const
LLVM_DUMP_METHOD void dump() const
void print(raw_ostream &O) const
void write(Module &M) const
void print(raw_ostream &O) const
This class implements an extremely fast bulk output stream that can only output to a stream.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
ResourceKind
The kind of resource for an SRV or UAV resource.
@ RTAccelerationStructure
ElementType
The element type of an SRV or UAV resource.
This is an optimization pass for GlobalISel generic memory operations.
FormattedString right_justify(StringRef Str, unsigned Width)
right_justify - add spaces before string so total output is Width characters.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
FormattedString left_justify(StringRef Str, unsigned Width)
left_justify - append spaces after string so total output is Width characters.
MDNode * write(LLVMContext &Ctx) const
std::optional< dxil::ElementType > ElementType