LLVM 22.0.0git
llvm::hlsl::rootsig Namespace Reference

Classes

struct  DescriptorTable
struct  DescriptorTableClause
class  GenericRSMetadataError
class  InvalidRSMetadataFormat
class  InvalidRSMetadataValue
class  MetadataBuilder
class  MetadataParser
struct  Register
struct  RootConstants
struct  RootDescriptor
class  RootSignatureValidationError
struct  StaticSampler

Typedefs

using RootElement
 Models RootElement : RootFlags | RootConstants | RootParam | DescriptorTable | DescriptorTableClause | StaticSampler.

Enumerations

enum class  RegisterType { BReg , TReg , UReg , SReg }
enum class  RootSignatureElementKind {
  Error = 0 , RootFlags = 1 , RootConstants = 2 , SRV = 3 ,
  UAV = 4 , CBV = 5 , DescriptorTable = 6 , StaticSamplers = 7
}

Functions

LLVM_ABI raw_ostreamoperator<< (raw_ostream &OS, const dxbc::RootFlags &Flags)
 The following contains the serialization interface for root elements.
LLVM_ABI raw_ostreamoperator<< (raw_ostream &OS, const RootConstants &Constants)
LLVM_ABI raw_ostreamoperator<< (raw_ostream &OS, const DescriptorTableClause &Clause)
LLVM_ABI raw_ostreamoperator<< (raw_ostream &OS, const DescriptorTable &Table)
LLVM_ABI raw_ostreamoperator<< (raw_ostream &OS, const RootDescriptor &Descriptor)
LLVM_ABI raw_ostreamoperator<< (raw_ostream &OS, const StaticSampler &StaticSampler)
LLVM_ABI raw_ostreamoperator<< (raw_ostream &OS, const RootElement &Element)
LLVM_ABI void dumpRootElements (raw_ostream &OS, ArrayRef< RootElement > Elements)
LLVM_ABI bool verifyRootFlag (uint32_t Flags)
LLVM_ABI bool verifyVersion (uint32_t Version)
LLVM_ABI bool verifyRegisterValue (uint32_t RegisterValue)
LLVM_ABI bool verifyRegisterSpace (uint32_t RegisterSpace)
LLVM_ABI bool verifyRootDescriptorFlag (uint32_t Version, uint32_t FlagsVal)
LLVM_ABI bool verifyRangeType (uint32_t Type)
LLVM_ABI bool verifyDescriptorRangeFlag (uint32_t Version, dxil::ResourceClass Type, dxbc::DescriptorRangeFlags FlagsVal)
LLVM_ABI bool verifyNumDescriptors (uint32_t NumDescriptors)
LLVM_ABI bool verifySamplerFilter (uint32_t Value)
LLVM_ABI bool verifyAddress (uint32_t Address)
LLVM_ABI bool verifyMipLODBias (float MipLODBias)
LLVM_ABI bool verifyMaxAnisotropy (uint32_t MaxAnisotropy)
LLVM_ABI bool verifyComparisonFunc (uint32_t ComparisonFunc)
LLVM_ABI bool verifyBorderColor (uint32_t BorderColor)
LLVM_ABI bool verifyLOD (float LOD)
LLVM_ABI bool verifyBoundOffset (uint32_t Offset)
LLVM_ABI bool verifyNoOverflowedOffset (uint64_t Offset)
LLVM_ABI uint64_t computeRangeBound (uint32_t Offset, uint32_t Size)
template<typename T>
static raw_ostreamprintFlags (raw_ostream &OS, const T Value, ArrayRef< EnumEntry< T > > Flags)
static raw_ostreamoperator<< (raw_ostream &OS, const Register &Reg)
static raw_ostreamoperator<< (raw_ostream &OS, const llvm::dxbc::ShaderVisibility &Visibility)
static raw_ostreamoperator<< (raw_ostream &OS, const llvm::dxbc::SamplerFilter &Filter)
static raw_ostreamoperator<< (raw_ostream &OS, const dxbc::TextureAddressMode &Address)
static raw_ostreamoperator<< (raw_ostream &OS, const dxbc::ComparisonFunc &CompFunc)
static raw_ostreamoperator<< (raw_ostream &OS, const dxbc::StaticBorderColor &BorderColor)
static raw_ostreamoperator<< (raw_ostream &OS, const dxil::ResourceClass &Type)
static raw_ostreamoperator<< (raw_ostream &OS, const dxbc::RootDescriptorFlags &Flags)
static raw_ostreamoperator<< (raw_ostream &OS, const llvm::dxbc::DescriptorRangeFlags &Flags)
static std::optional< uint32_textractMdIntValue (MDNode *Node, unsigned int OpId)
static std::optional< float > extractMdFloatValue (MDNode *Node, unsigned int OpId)
static std::optional< StringRefextractMdStringValue (MDNode *Node, unsigned int OpId)
static Expected< dxbc::ShaderVisibilityextractShaderVisibility (MDNode *Node, unsigned int OpId)

Variables

static const uint32_t NumDescriptorsUnbounded = 0xffffffff
static const uint32_t DescriptorTableOffsetAppend = 0xffffffff
static const EnumEntry< RegisterTypeRegisterNames []
template<typename T>
char RootSignatureValidationError< T >::ID

Typedef Documentation

◆ RootElement

Initial value:

Models RootElement : RootFlags | RootConstants | RootParam | DescriptorTable | DescriptorTableClause | StaticSampler.

A Root Signature is modeled in-memory by an array of RootElements. These aim to map closely to their DSL grammar reprsentation defined in the spec.

Each optional parameter has its default value defined in the struct, and, each mandatory parameter does not have a default initialization.

For the variants RootFlags, RootConstants, RootParam, StaticSampler and DescriptorTableClause: each data member maps directly to a parameter in the grammar.

The DescriptorTable is modelled by having its Clauses as the previous RootElements in the array, and it holds a data member for the Visibility parameter.

Definition at line 152 of file HLSLRootSignature.h.

Enumeration Type Documentation

◆ RegisterType

Enumerator
BReg 
TReg 
UReg 
SReg 

Definition at line 31 of file HLSLRootSignature.h.

◆ RootSignatureElementKind

Enumerator
Error 
RootFlags 
RootConstants 
SRV 
UAV 
CBV 
DescriptorTable 
StaticSamplers 

Definition at line 130 of file RootSignatureMetadata.h.

Function Documentation

◆ computeRangeBound()

uint64_t llvm::hlsl::rootsig::computeRangeBound ( uint32_t Offset,
uint32_t Size )

Definition at line 177 of file RootSignatureValidations.cpp.

References assert(), NumDescriptorsUnbounded, llvm::Offset, and Size.

◆ dumpRootElements()

void llvm::hlsl::rootsig::dumpRootElements ( raw_ostream & OS,
ArrayRef< RootElement > Elements )

Definition at line 203 of file HLSLRootSignature.cpp.

References llvm::First.

◆ extractMdFloatValue()

std::optional< float > llvm::hlsl::rootsig::extractMdFloatValue ( MDNode * Node,
unsigned int OpId )
static

Definition at line 40 of file RootSignatureMetadata.cpp.

References llvm::mdconst::dyn_extract().

◆ extractMdIntValue()

std::optional< uint32_t > llvm::hlsl::rootsig::extractMdIntValue ( MDNode * Node,
unsigned int OpId )
static

Definition at line 32 of file RootSignatureMetadata.cpp.

References llvm::mdconst::dyn_extract().

Referenced by extractShaderVisibility().

◆ extractMdStringValue()

std::optional< StringRef > llvm::hlsl::rootsig::extractMdStringValue ( MDNode * Node,
unsigned int OpId )
static

Definition at line 47 of file RootSignatureMetadata.cpp.

References llvm::dyn_cast(), and llvm::MDString::getString().

◆ extractShaderVisibility()

Expected< dxbc::ShaderVisibility > llvm::hlsl::rootsig::extractShaderVisibility ( MDNode * Node,
unsigned int OpId )
static

◆ operator<<() [1/16]

◆ operator<<() [2/16]

raw_ostream & llvm::hlsl::rootsig::operator<< ( raw_ostream & OS,
const DescriptorTableClause & Clause )

Definition at line 139 of file HLSLRootSignature.cpp.

References DescriptorTableOffsetAppend, and NumDescriptorsUnbounded.

◆ operator<<() [3/16]

raw_ostream & llvm::hlsl::rootsig::operator<< ( raw_ostream & OS,
const dxbc::ComparisonFunc & CompFunc )
static

◆ operator<<() [4/16]

raw_ostream & llvm::hlsl::rootsig::operator<< ( raw_ostream & OS,
const dxbc::RootDescriptorFlags & Flags )
static

Definition at line 102 of file HLSLRootSignature.cpp.

References llvm::dxbc::getRootDescriptorFlags(), and printFlags().

◆ operator<<() [5/16]

raw_ostream & llvm::hlsl::rootsig::operator<< ( raw_ostream & OS,
const dxbc::RootFlags & Flags )

The following contains the serialization interface for root elements.

Definition at line 116 of file HLSLRootSignature.cpp.

References llvm::dxbc::getRootFlags(), and printFlags().

◆ operator<<() [6/16]

raw_ostream & llvm::hlsl::rootsig::operator<< ( raw_ostream & OS,
const dxbc::StaticBorderColor & BorderColor )
static

◆ operator<<() [7/16]

raw_ostream & llvm::hlsl::rootsig::operator<< ( raw_ostream & OS,
const dxbc::TextureAddressMode & Address )
static

◆ operator<<() [8/16]

raw_ostream & llvm::hlsl::rootsig::operator<< ( raw_ostream & OS,
const dxil::ResourceClass & Type )
static

Definition at line 96 of file HLSLRootSignature.cpp.

References llvm::dxil::getResourceClassName().

◆ operator<<() [9/16]

raw_ostream & llvm::hlsl::rootsig::operator<< ( raw_ostream & OS,
const llvm::dxbc::DescriptorRangeFlags & Flags )
static

Definition at line 109 of file HLSLRootSignature.cpp.

References llvm::dxbc::getDescriptorRangeFlags(), and printFlags().

◆ operator<<() [10/16]

raw_ostream & llvm::hlsl::rootsig::operator<< ( raw_ostream & OS,
const llvm::dxbc::SamplerFilter & Filter )
static

◆ operator<<() [11/16]

raw_ostream & llvm::hlsl::rootsig::operator<< ( raw_ostream & OS,
const llvm::dxbc::ShaderVisibility & Visibility )
static

◆ operator<<() [12/16]

raw_ostream & llvm::hlsl::rootsig::operator<< ( raw_ostream & OS,
const Register & Reg )
static

Definition at line 55 of file HLSLRootSignature.cpp.

References llvm::enumToStringRef(), Reg, and RegisterNames.

◆ operator<<() [13/16]

raw_ostream & llvm::hlsl::rootsig::operator<< ( raw_ostream & OS,
const RootConstants & Constants )

Definition at line 124 of file HLSLRootSignature.cpp.

◆ operator<<() [14/16]

◆ operator<<() [15/16]

raw_ostream & llvm::hlsl::rootsig::operator<< ( raw_ostream & OS,
const RootElement & Element )

Definition at line 190 of file HLSLRootSignature.cpp.

◆ operator<<() [16/16]

raw_ostream & llvm::hlsl::rootsig::operator<< ( raw_ostream & OS,
const StaticSampler & StaticSampler )

Definition at line 164 of file HLSLRootSignature.cpp.

◆ printFlags()

template<typename T>
raw_ostream & llvm::hlsl::rootsig::printFlags ( raw_ostream & OS,
const T Value,
ArrayRef< EnumEntry< T > > Flags )
static

◆ verifyAddress()

bool llvm::hlsl::rootsig::verifyAddress ( uint32_t Address)

Definition at line 129 of file RootSignatureValidations.cpp.

References llvm::Address.

◆ verifyBorderColor()

bool llvm::hlsl::rootsig::verifyBorderColor ( uint32_t BorderColor)

Definition at line 157 of file RootSignatureValidations.cpp.

◆ verifyBoundOffset()

bool llvm::hlsl::rootsig::verifyBoundOffset ( uint32_t Offset)

Definition at line 169 of file RootSignatureValidations.cpp.

References NumDescriptorsUnbounded, and llvm::Offset.

◆ verifyComparisonFunc()

bool llvm::hlsl::rootsig::verifyComparisonFunc ( uint32_t ComparisonFunc)

Definition at line 147 of file RootSignatureValidations.cpp.

◆ verifyDescriptorRangeFlag()

bool llvm::hlsl::rootsig::verifyDescriptorRangeFlag ( uint32_t Version,
dxil::ResourceClass Type,
dxbc::DescriptorRangeFlags FlagsVal )

◆ verifyLOD()

bool llvm::hlsl::rootsig::verifyLOD ( float LOD)

Definition at line 167 of file RootSignatureValidations.cpp.

◆ verifyMaxAnisotropy()

bool llvm::hlsl::rootsig::verifyMaxAnisotropy ( uint32_t MaxAnisotropy)

Definition at line 143 of file RootSignatureValidations.cpp.

◆ verifyMipLODBias()

bool llvm::hlsl::rootsig::verifyMipLODBias ( float MipLODBias)

Definition at line 139 of file RootSignatureValidations.cpp.

◆ verifyNoOverflowedOffset()

bool llvm::hlsl::rootsig::verifyNoOverflowedOffset ( uint64_t Offset)

Definition at line 173 of file RootSignatureValidations.cpp.

References llvm::Offset.

◆ verifyNumDescriptors()

bool llvm::hlsl::rootsig::verifyNumDescriptors ( uint32_t NumDescriptors)

Definition at line 114 of file RootSignatureValidations.cpp.

◆ verifyRangeType()

LLVM_ABI bool llvm::hlsl::rootsig::verifyRangeType ( uint32_t Type)

◆ verifyRegisterSpace()

bool llvm::hlsl::rootsig::verifyRegisterSpace ( uint32_t RegisterSpace)

Definition at line 31 of file RootSignatureValidations.cpp.

◆ verifyRegisterValue()

bool llvm::hlsl::rootsig::verifyRegisterValue ( uint32_t RegisterValue)

Definition at line 25 of file RootSignatureValidations.cpp.

◆ verifyRootDescriptorFlag()

bool llvm::hlsl::rootsig::verifyRootDescriptorFlag ( uint32_t Version,
uint32_t FlagsVal )

◆ verifyRootFlag()

bool llvm::hlsl::rootsig::verifyRootFlag ( uint32_t Flags)

Definition at line 21 of file RootSignatureValidations.cpp.

◆ verifySamplerFilter()

bool llvm::hlsl::rootsig::verifySamplerFilter ( uint32_t Value)

Definition at line 118 of file RootSignatureValidations.cpp.

◆ verifyVersion()

bool llvm::hlsl::rootsig::verifyVersion ( uint32_t Version)

Definition at line 23 of file RootSignatureValidations.cpp.

References llvm::Version.

Variable Documentation

◆ DescriptorTableOffsetAppend

const uint32_t llvm::hlsl::rootsig::DescriptorTableOffsetAppend = 0xffffffff
static

Definition at line 85 of file HLSLRootSignature.h.

Referenced by operator<<().

◆ NumDescriptorsUnbounded

const uint32_t llvm::hlsl::rootsig::NumDescriptorsUnbounded = 0xffffffff
static

Definition at line 84 of file HLSLRootSignature.h.

Referenced by computeRangeBound(), operator<<(), and verifyBoundOffset().

◆ RegisterNames

◆ RootSignatureValidationError< T >::ID