71 "Invalid ResourceKind for SRV constructor.");
113 bool GloballyCoherent,
bool IsROV,
117 "Invalid ResourceKind for UAV constructor.");
119 RI.
setUAV(GloballyCoherent,
false, IsROV);
124 bool GloballyCoherent,
bool IsROV) {
126 RI.
setUAV(GloballyCoherent,
false, IsROV);
133 bool GloballyCoherent,
bool IsROV,
138 RI.
setUAV(GloballyCoherent, HasCounter, IsROV);
146 bool GloballyCoherent) {
149 RI.
setUAV(GloballyCoherent,
false,
false);
158 bool GloballyCoherent) {
162 RI.
setUAV(GloballyCoherent,
false,
false);
171 RI.
setUAV(
false,
false,
false);
181 RI.
setUAV(
false,
false,
false);
201 if (std::tie(Symbol, Name, Binding, RC, Kind) !=
219 return MultiSample ==
RHS.MultiSample;
230 auto getIntMD = [&I32Ty](
uint32_t V) {
234 auto getBoolMD = [&I1Ty](
uint32_t V) {
239 MDVals.
push_back(getIntMD(Binding.UniqueID));
242 MDVals.
push_back(getIntMD(Binding.Space));
243 MDVals.
push_back(getIntMD(Binding.LowerBound));
244 MDVals.
push_back(getIntMD(Binding.Size));
290 bool IsUAV =
isUAV();
291 bool IsROV = IsUAV &&
UAVFlags.IsROV;
292 bool IsGloballyCoherent = IsUAV &&
UAVFlags.GloballyCoherent;
293 uint8_t SamplerCmpOrHasCounter = 0;
295 SamplerCmpOrHasCounter =
UAVFlags.HasCounter;
303 Word0 |= (AlignLog2 & 0xF) << 8;
304 Word0 |= (IsUAV & 1) << 12;
305 Word0 |= (IsROV & 1) << 13;
306 Word0 |= (IsGloballyCoherent & 1) << 14;
307 Word0 |= (SamplerCmpOrHasCounter & 1) << 15;
321 Word1 |= (CompType & 0xFF) << 0;
322 Word1 |= (CompCount & 0xFF) << 8;
323 Word1 |= (SampleCount & 0xFF) << 16;
326 return {Word0, Word1};
329#define DEBUG_TYPE "dxil-resource"
This file implements a class to represent arbitrary precision integral constant values and operations...
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Class for arbitrary precision integers.
static Constant * getIntegerValue(Type *Ty, const APInt &V)
Return the value for an integer or pointer constant, or a vector thereof, with the given scalar value...
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)
void push_back(const T &Elt)
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.
The instances of the Type class are immutable: once they are created, they are never changed.
static IntegerType * getInt1Ty(LLVMContext &C)
static IntegerType * getInt32Ty(LLVMContext &C)
LLVM Value Representation.
static ResourceInfo Texture2DMSArray(Value *Symbol, StringRef Name, dxil::ElementType ElementTy, uint32_t ElementCount, uint32_t SampleCount)
static ResourceInfo RawBuffer(Value *Symbol, StringRef Name)
void setUAV(bool GloballyCoherent, bool HasCounter, bool IsROV)
static ResourceInfo FeedbackTexture2D(Value *Symbol, StringRef Name, dxil::SamplerFeedbackType FeedbackTy)
static ResourceInfo Texture2DMS(Value *Symbol, StringRef Name, dxil::ElementType ElementTy, uint32_t ElementCount, uint32_t SampleCount)
static ResourceInfo RWTexture2DMS(Value *Symbol, StringRef Name, dxil::ElementType ElementTy, uint32_t ElementCount, uint32_t SampleCount, bool GloballyCoherent)
std::pair< uint32_t, uint32_t > getAnnotateProps() const
static ResourceInfo Sampler(Value *Symbol, StringRef Name, dxil::SamplerType SamplerTy)
bool isMultiSample() const
void setCBuffer(uint32_t Size)
static ResourceInfo UAV(Value *Symbol, StringRef Name, dxil::ElementType ElementTy, uint32_t ElementCount, bool GloballyCoherent, bool IsROV, dxil::ResourceKind Kind)
static ResourceInfo RWRawBuffer(Value *Symbol, StringRef Name, bool GloballyCoherent, bool IsROV)
dxil::SamplerType SamplerTy
static ResourceInfo SRV(Value *Symbol, StringRef Name, dxil::ElementType ElementTy, uint32_t ElementCount, dxil::ResourceKind Kind)
void setTyped(dxil::ElementType ElementTy, uint32_t ElementCount)
bool operator==(const ResourceInfo &RHS) const
void setMultiSample(uint32_t Count)
void setSampler(dxil::SamplerType Ty)
void setStruct(uint32_t Stride, MaybeAlign Alignment)
static ResourceInfo FeedbackTexture2DArray(Value *Symbol, StringRef Name, dxil::SamplerFeedbackType FeedbackTy)
static ResourceInfo RWTexture2DMSArray(Value *Symbol, StringRef Name, dxil::ElementType ElementTy, uint32_t ElementCount, uint32_t SampleCount, bool GloballyCoherent)
MDTuple * getAsMetadata(LLVMContext &Ctx) const
void setFeedback(dxil::SamplerFeedbackType Type)
static ResourceInfo StructuredBuffer(Value *Symbol, StringRef Name, uint32_t Stride, MaybeAlign Alignment)
static ResourceInfo CBuffer(Value *Symbol, StringRef Name, uint32_t Size)
static ResourceInfo RWStructuredBuffer(Value *Symbol, StringRef Name, uint32_t Stride, MaybeAlign Alignment, bool GloballyCoherent, bool IsROV, bool HasCounter)
#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.
constexpr std::underlying_type_t< Enum > to_underlying(Enum E)
Returns underlying integer value of an enum.
This struct is a compact representation of a valid (power of two) or undefined (0) alignment.