LLVM 24.0.0git
SemanticSignaturePacking.cpp File Reference
#include "llvm/Frontend/HLSL/SemanticSignaturePacking.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/Sequence.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/bit.h"
#include <algorithm>
#include <array>
#include <cassert>
#include <cstdint>
#include <limits>
#include <optional>

Go to the source code of this file.

Functions

static uint8_t getStartColumn (uint8_t ColumnMask)
static PackingGroup getOptimizedPackingGroup (const SemanticSignatureElement &Element, Triple::EnvironmentType ShaderStage, IOType IOTy)
static unsigned getComponentWidth (dxil::ElementType ComponentType, bool UseNative16BitTypes)
static ElementPlacement getElementPlacement (const SemanticSignatureElement &Element, SemanticInterpretation Interpretation, bool UseNative16BitTypes)
static SemanticInterpretation getComponentOrder (SemanticInterpretation Interpretation)
static bool canCoPack (const SignatureRow &Row, const ElementPlacement &Placement, IndexedRowRange IndexedRange)
static std::optional< uint8_t > canPlaceAt (ArrayRef< SignatureRow > Rows, unsigned StartRow, const ElementPlacement &Placement)
static void placeRowsAt (MutableArrayRef< SignatureRow > Rows, unsigned StartRow, const ElementPlacement &Placement, uint8_t ColumnMask)
static void placeAt (MutableArrayRef< SignatureRow > Rows, unsigned StartRow, const ElementPlacement &Placement, uint8_t ColumnMask, ElementLocation &Location)
static bool prefixPackElement (ElementLocation &Location, MutableArrayRef< SignatureRow > Rows, const ElementPlacement &Placement)
static ElementPlacement getClipCullReservation (const ElementPlacement &Placement, unsigned RowCount)
static bool reserveClipCullRows (MutableArrayRef< SignatureRow > Rows, unsigned StartRow, const ElementPlacement &Reservation)
static std::optional< unsigned > reserveNextClipCullRows (MutableArrayRef< SignatureRow > Rows, const ElementPlacement &Reservation)
static std::optional< SignaturePackingError::ErrorKind > reserveClipCullSignatureRows (MutableArrayRef< SignatureRow > SignatureRows, ClipCullState &State, const ElementPlacement &Placement, unsigned NewRowsUsed)
static std::optional< SignaturePackingError::ErrorKind > packClipCullElement (ElementLocation &Location, MutableArrayRef< SignatureRow > SignatureRows, ClipCullState &State, const ElementPlacement &Placement)
static Error packOptimizedClipCullStream (MutableArrayRef< OptimizedClipCullElement > Elements, MutableArrayRef< SignatureRow > Rows)
static Expected< unsigned > packOptimizedClipCull (MutableArrayRef< SemanticSignatureElement > Elements, ArrayRef< unsigned > Order, MutableArrayRef< SignatureRows > Rows, bool UseNative16BitTypes)
template<typename IndexRange>
static Expected< unsigned > packSignatureInOrder (MutableArrayRef< SemanticSignatureElement > Elements, const IndexRange &Order, Triple::EnvironmentType ShaderStage, IOType IOTy, bool UseNative16BitTypes, MutableArrayRef< SignatureRows > Rows)

Function Documentation

◆ canCoPack()

bool canCoPack ( const SignatureRow & Row,
const ElementPlacement & Placement,
IndexedRowRange IndexedRange )
static

◆ canPlaceAt()

std::optional< uint8_t > canPlaceAt ( ArrayRef< SignatureRow > Rows,
unsigned StartRow,
const ElementPlacement & Placement )
static

◆ getClipCullReservation()

ElementPlacement getClipCullReservation ( const ElementPlacement & Placement,
unsigned RowCount )
static

Definition at line 343 of file SemanticSignaturePacking.cpp.

References llvm::hlsl::MaxSignatureCols, and Placement.

Referenced by reserveClipCullSignatureRows().

◆ getComponentOrder()

SemanticInterpretation getComponentOrder ( SemanticInterpretation Interpretation)
static

Definition at line 206 of file SemanticSignaturePacking.cpp.

References llvm::hlsl::ClipCull, and llvm::hlsl::SV.

Referenced by canCoPack().

◆ getComponentWidth()

◆ getElementPlacement()

◆ getOptimizedPackingGroup()

◆ getStartColumn()

uint8_t getStartColumn ( uint8_t ColumnMask)
static

Definition at line 127 of file SemanticSignaturePacking.cpp.

References assert(), and llvm::countr_zero().

Referenced by packClipCullElement(), and placeAt().

◆ packClipCullElement()

std::optional< SignaturePackingError::ErrorKind > packClipCullElement ( ElementLocation & Location,
MutableArrayRef< SignatureRow > SignatureRows,
ClipCullState & State,
const ElementPlacement & Placement )
static

◆ packOptimizedClipCull()

◆ packOptimizedClipCullStream()

◆ packSignatureInOrder()

◆ placeAt()

void placeAt ( MutableArrayRef< SignatureRow > Rows,
unsigned StartRow,
const ElementPlacement & Placement,
uint8_t ColumnMask,
ElementLocation & Location )
static

◆ placeRowsAt()

void placeRowsAt ( MutableArrayRef< SignatureRow > Rows,
unsigned StartRow,
const ElementPlacement & Placement,
uint8_t ColumnMask )
static

◆ prefixPackElement()

bool prefixPackElement ( ElementLocation & Location,
MutableArrayRef< SignatureRow > Rows,
const ElementPlacement & Placement )
static

◆ reserveClipCullRows()

bool reserveClipCullRows ( MutableArrayRef< SignatureRow > Rows,
unsigned StartRow,
const ElementPlacement & Reservation )
static

◆ reserveClipCullSignatureRows()

std::optional< SignaturePackingError::ErrorKind > reserveClipCullSignatureRows ( MutableArrayRef< SignatureRow > SignatureRows,
ClipCullState & State,
const ElementPlacement & Placement,
unsigned NewRowsUsed )
static

◆ reserveNextClipCullRows()

std::optional< unsigned > reserveNextClipCullRows ( MutableArrayRef< SignatureRow > Rows,
const ElementPlacement & Reservation )
static