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< unsigned > packSignatureStacked (MutableArrayRef< SemanticSignatureElement > Elements, Triple::EnvironmentType ShaderStage, IOType IOTy)
 Packs eligible signature elements into consecutive rows.
LLVM_ABI Expected< unsigned > packSignaturePrefixStable (MutableArrayRef< SemanticSignatureElement > Elements, Triple::EnvironmentType ShaderStage, IOType IOTy, bool UseNative16BitTypes)
 Packs eligible signature elements without moving previously placed elements.
LLVM_ABI Expected< unsigned > packSignatureIndexed (MutableArrayRef< SemanticSignatureElement > Elements, Triple::EnvironmentType ShaderStage, IOType IOTy)
 Packs eligible signature elements at rows selected by semantic index.
LLVM_ABI Expected< unsigned > packSignatureOptimized (MutableArrayRef< SemanticSignatureElement > Elements, Triple::EnvironmentType ShaderStage, IOType IOTy, bool UseNative16BitTypes)
 Packs eligible signature elements in an optimized order by reordering elements into an optimal packing order and allowing clip/cull to share compatible rows.
 LLVM_ENABLE_BITMASK_ENUMS_IN_NAMESPACE ()
LLVM_ABI dxbc::PSV::SemanticKind getSemanticKind (StringRef SemanticName)
LLVM_ABI ArrayRef< SemanticStageInfo > getAvailableStages (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 unsigned MaxClipCullRows = 2
static constexpr unsigned MaxGeometryStreams = 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()

◆ getSemanticKind()

◆ LLVM_ENABLE_BITMASK_ENUMS_IN_NAMESPACE()

llvm::hlsl::LLVM_ENABLE_BITMASK_ENUMS_IN_NAMESPACE ( )

◆ packSignatureIndexed()

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

Packs eligible signature elements at rows selected by semantic index.

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

Requires each eligible element to occupy exactly one row and have exactly one semantic index. Semantic indices must be unique among eligible elements.

Returns one past the highest allocated row, or zero if no elements were allocated. Gaps between semantic indices count towards this row extent.

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 702 of file SemanticSignaturePacking.cpp.

References assert(), llvm::enumerate(), getInterpretationKind(), llvm::make_error(), MaxSignatureCols, MaxSignatureRows, NotAllocated, Out, llvm::Triple::Pixel, llvm::hlsl::SignaturePackingError::SemanticIndexOutOfRange, Target, UnallocatedCol, and UnallocatedRow.

◆ packSignatureOptimized()

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

Packs eligible signature elements in an optimized order by reordering elements into an optimal packing order and allowing clip/cull to share compatible rows.

Only StartRow and StartCol are modified.

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

Returns the number of allocated rows, or zero if no elements were allocated. For geometry outputs this is the maximum extent of any stream, not the sum of their extents.

On failure, Elements are 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 749 of file SemanticSignaturePacking.cpp.

References assert(), llvm::SmallVectorTemplateCommon< T, typename >::begin(), ClipCull, llvm::SmallVectorTemplateCommon< T, typename >::end(), llvm::enumerate(), llvm::Triple::Geometry, getOptimizedPackingGroup(), In, llvm::InnerAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs... >::Key, llvm::Left, llvm::make_range(), llvm::map_range(), MaxGeometryStreams, Out, packOptimizedClipCull(), packSignatureInOrder(), llvm::partition_point(), llvm::Triple::Pixel, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::SmallVectorImpl< T >::reserve(), llvm::Right, llvm::sort(), llvm::Expected< T >::takeError(), and llvm::Triple::Vertex.

◆ packSignaturePrefixStable()

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

Packs eligible signature elements without moving previously placed elements.

Only StartRow and StartCol are modified.

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

Returns one past the highest allocated row, or zero if no elements were allocated. For geometry outputs this is the maximum extent of any stream, not the sum of their extents.

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 685 of file SemanticSignaturePacking.cpp.

References assert(), llvm::Triple::Geometry, In, MaxGeometryStreams, Out, packSignatureInOrder(), llvm::Triple::Pixel, llvm::seq(), and llvm::Triple::Vertex.

◆ 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 589 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().

◆ MaxClipCullRows

unsigned llvm::hlsl::MaxClipCullRows = 2
staticconstexpr

◆ MaxGeometryStreams

unsigned llvm::hlsl::MaxGeometryStreams = 4
staticconstexpr

◆ MaxSignatureCols

◆ MaxSignatureRows

unsigned llvm::hlsl::MaxSignatureRows = 32
staticconstexpr

◆ UnallocatedCol

◆ UnallocatedRow