LLVM 24.0.0git
llvm::hlsl Namespace Reference

Namespaces

namespace  rootsig

Classes

struct  Binding
class  BindingInfo
 BindingInfo represents the ranges of bindings and free space for each dxil::ResourceClass. More...
class  BindingInfoBuilder
 Builder class for creating a /c BindingInfo. More...
class  BoundRegs
struct  CBufferMapping
struct  CBufferMember
struct  SemanticSignatureElement
struct  SemanticStageInfo
class  SignaturePackingError
 Denotes the element that could not be packed and why. More...

Enumerations

enum class  IOType {
  In = 0b001 , Out = 0b010 , InOut = 0b011 , PatchConstantOrPrimitive = 0b100 ,
  All = 0b111 , LLVM_MARK_AS_BITMASK_ENUM =(PatchConstantOrPrimitive)
}
enum class  SemanticInterpretation {
  Invalid , NotAllocated , Arbitrary , SV ,
  SGV , ClipCull , TessFactor , Target
}
enum class  ResourceClass
enum class  ResourceDimension

Functions

LLVM_ABI dxil::ElementType getDXILElementType (Type *Ty, bool IsSigned)
 Converts a scalar or vector LLVM type to its DXIL element type.
LLVM_ABI Expected< unsignedpackSignatureStacked (MutableArrayRef< SemanticSignatureElement > Elements, Triple::EnvironmentType ShaderStage, IOType IOTy)
 Packs eligible signature elements into consecutive rows.
 LLVM_ENABLE_BITMASK_ENUMS_IN_NAMESPACE ()
LLVM_ABI dxbc::PSV::SemanticKind getSemanticKind (StringRef SemanticName)
LLVM_ABI ArrayRef< SemanticStageInfogetAvailableStages (dxbc::PSV::SemanticKind SemanticKind)
LLVM_ABI SemanticInterpretation getInterpretationKind (dxbc::PSV::SemanticKind SemanticKind, Triple::EnvironmentType ShaderStage, IOType IOTy)

Variables

const unsigned CBufferRowSizeInBytes = 16U
static constexpr unsigned MaxSignatureRows = 32
static constexpr unsigned MaxSignatureCols = 4
static constexpr uint32_t UnallocatedRow = ~0U
static constexpr uint8_t UnallocatedCol = 0xFF

Enumeration Type Documentation

◆ IOType

enum class llvm::hlsl::IOType
strong
Enumerator
In 
Out 
InOut 
PatchConstantOrPrimitive 
All 
LLVM_MARK_AS_BITMASK_ENUM 

Definition at line 42 of file SemanticSignatures.h.

◆ ResourceClass

enum class llvm::dxil::ResourceClass : uint8_t
strong

Definition at line 26 of file DXILABI.h.

◆ ResourceDimension

Definition at line 34 of file DXILABI.h.

◆ SemanticInterpretation

Enumerator
Invalid 
NotAllocated 
Arbitrary 
SV 
SGV 
ClipCull 
TessFactor 
Target 

Definition at line 52 of file SemanticSignatures.h.

Function Documentation

◆ getAvailableStages()

◆ getDXILElementType()

dxil::ElementType llvm::hlsl::getDXILElementType ( Type * Ty,
bool IsSigned )

Converts a scalar or vector LLVM type to its DXIL element type.

Integer signedness must be supplied separately because LLVM integer types are signless.

Definition at line 19 of file HLSLResource.cpp.

References llvm::dxil::F16, llvm::dxil::F32, llvm::dxil::F64, llvm::dxil::I16, llvm::dxil::I32, llvm::dxil::I64, llvm::dxil::Invalid, llvm::dxil::U16, llvm::dxil::U32, and llvm::dxil::U64.

Referenced by formatTypeName(), and llvm::dxil::ResourceTypeInfo::getTyped().

◆ getInterpretationKind()

SemanticInterpretation llvm::hlsl::getInterpretationKind ( dxbc::PSV::SemanticKind SemanticKind,
Triple::EnvironmentType ShaderStage,
IOType IOTy )

Definition at line 169 of file SemanticSignatures.cpp.

References assert(), getAvailableStages(), llvm::has_single_bit(), and Invalid.

Referenced by packSignatureStacked().

◆ getSemanticKind()

◆ LLVM_ENABLE_BITMASK_ENUMS_IN_NAMESPACE()

llvm::hlsl::LLVM_ENABLE_BITMASK_ENUMS_IN_NAMESPACE ( )

◆ packSignatureStacked()

Expected< unsigned > llvm::hlsl::packSignatureStacked ( MutableArrayRef< SemanticSignatureElement > Elements,
Triple::EnvironmentType ShaderStage,
IOType IOTy )

Packs eligible signature elements into consecutive rows.

See llvm/docs/DirectX/SemanticSignatures.md#stacked-packing for details.

On failure, Elements is left partially packed: the elements preceding the one reported by the returned SignaturePackingError keep the locations they were assigned, while that element and the ones following it retain the unallocated row and column sentinels.

Definition at line 31 of file SemanticSignaturePacking.cpp.

References Arbitrary, assert(), llvm::enumerate(), getInterpretationKind(), In, llvm::make_error(), MaxSignatureCols, MaxSignatureRows, NotAllocated, SGV, llvm::hlsl::SignaturePackingError::SignatureOverflow, SV, UnallocatedCol, UnallocatedRow, and llvm::Triple::Vertex.

Variable Documentation

◆ CBufferRowSizeInBytes

const unsigned llvm::hlsl::CBufferRowSizeInBytes = 16U

Definition at line 27 of file HLSLResource.h.

Referenced by createCBufferLoad().

◆ MaxSignatureCols

unsigned llvm::hlsl::MaxSignatureCols = 4
staticconstexpr

Definition at line 25 of file SemanticSignaturePacking.h.

Referenced by packSignatureStacked().

◆ MaxSignatureRows

unsigned llvm::hlsl::MaxSignatureRows = 32
staticconstexpr

◆ UnallocatedCol

uint8_t llvm::hlsl::UnallocatedCol = 0xFF
staticconstexpr

◆ UnallocatedRow

uint32_t llvm::hlsl::UnallocatedRow = ~0U
staticconstexpr