35 static_cast<uint32_t>(dxbc::PSV::SemanticKind::Invalid);
37 static_cast<uint32_t>(dxbc::PSV::InterpolationMode::Invalid);
46 return makeError(
"expected integer operand " +
Twine(OpId));
47 return CI->getZExtValue();
61 return InterpolationMode::Undefined;
64 ? InterpolationMode::Constant
65 : InterpolationMode::Invalid;
70 return NoPerspective ? InterpolationMode::LinearNoperspectiveSample
71 : InterpolationMode::LinearSample;
73 return NoPerspective ? InterpolationMode::LinearNoperspectiveCentroid
74 : InterpolationMode::LinearCentroid;
78 : InterpolationMode::Linear;
89 return InterpolationMode::Undefined;
91 if (Mode == InterpolationMode::Undefined) {
99 Mode = InterpolationMode::Linear;
102 Mode = InterpolationMode::Constant;
107 if (Kind == dxbc::PSV::SemanticKind::Position) {
109 case InterpolationMode::Linear:
110 return InterpolationMode::LinearNoperspective;
111 case InterpolationMode::LinearCentroid:
112 return InterpolationMode::LinearNoperspectiveCentroid;
113 case InterpolationMode::LinearSample:
114 return InterpolationMode::LinearNoperspectiveSample;
124 return dxbc::PSV::SemanticKind::Arbitrary;
130 return dxbc::PSV::SemanticKind::Invalid;
135 switch (SemanticKind) {
136 case dxbc::PSV::SemanticKind::Arbitrary: {
137 static constexpr IOType OutOrPatchConstant =
149 case dxbc::PSV::SemanticKind::DispatchThreadID:
150 case dxbc::PSV::SemanticKind::GroupID:
151 case dxbc::PSV::SemanticKind::GroupIndex:
152 case dxbc::PSV::SemanticKind::GroupThreadID: {
161 case dxbc::PSV::SemanticKind::ViewID: {
162 static constexpr IOType InOrPatchConstant =
175 case dxbc::PSV::SemanticKind::StartVertexLocation:
176 case dxbc::PSV::SemanticKind::StartInstanceLocation: {
181 case dxbc::PSV::SemanticKind::RenderTargetArrayIndex:
182 case dxbc::PSV::SemanticKind::ViewPortArrayIndex: {
190 case dxbc::PSV::SemanticKind::StencilRef: {
195 case dxbc::PSV::SemanticKind::SampleIndex: {
200 case dxbc::PSV::SemanticKind::Barycentrics: {
205 case dxbc::PSV::SemanticKind::Target: {
210 case dxbc::PSV::SemanticKind::VertexID:
211 case dxbc::PSV::SemanticKind::InstanceID: {
216 case dxbc::PSV::SemanticKind::PrimitiveID: {
221 case dxbc::PSV::SemanticKind::IsFrontFace: {
227 case dxbc::PSV::SemanticKind::ShadingRate: {
238 case dxbc::PSV::SemanticKind::Coverage: {
244 case dxbc::PSV::SemanticKind::Position: {
260 case dxbc::PSV::SemanticKind::ClipDistance:
261 case dxbc::PSV::SemanticKind::CullDistance: {
277 case dxbc::PSV::SemanticKind::TessFactor:
278 case dxbc::PSV::SemanticKind::InsideTessFactor: {
296 "a single IOType is expected, not a mask of IOTypes");
298 if (Info.Stage == ShaderStage && any(Info.AllowedIOTypesMask & IOTy))
299 return Info.Interpretation;
306 enum class OpIdx :
unsigned {
322 const unsigned NumElementOperands =
to_underlying(OpIdx::LastEntry) + 1;
325 return makeError(
"signature element node is null");
326 if (
Node->getNumOperands() != NumElementOperands)
327 return makeError(
"signature element node has wrong number of operands");
333 return SigId.takeError();
339 return makeError(
"expected semantic name string");
347 return makeError(
"invalid component type");
355 return makeError(
"invalid semantic kind");
361 return makeError(
"expected semantic indices node");
362 for (
unsigned I = 0, E = Indices->getNumOperands();
I != E; ++
I) {
365 return Index.takeError();
374 return makeError(
"invalid interpolation mode");
379 return Rows.takeError();
384 return Cols.takeError();
386 return makeError(
"number of components per row must be within 1-4");
400 return makeError(
"start column must be within 0-3 or unallocated");
405 return makeError(
"start row and column sentinels must be set together");
412 return makeError(
"usage mask must be a 4-bit value");
420 return makeError(
"dynamic index mask must be a 4-bit value");
428 return makeError(
"geometry shader stream index must be within 0-3");
433 "number of semantic indices must equal the number of rows");
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file contains the declarations for the subclasses of Constant, which represent the different fla...
This file contains library features backported from future STL versions.
This file implements the C++20 <bit> header.
Represent a constant reference to an array (0 or more elements consecutively in memory),...
Lightweight error class with error context and mandatory checking.
Tagged union holding either a T or a Error.
This is an important class for using LLVM in a threaded context.
static MDTuple * get(LLVMContext &Context, ArrayRef< Metadata * > MDs)
static LLVM_ABI 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.
Represent a constant reference to a string, i.e.
bool equals_insensitive(StringRef RHS) const
Check for string equality, ignoring case.
bool consume_front_insensitive(StringRef Prefix)
Returns true if this StringRef has the given prefix, ignoring case, and removes that prefix.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
The instances of the Type class are immutable: once they are created, they are never changed.
static LLVM_ABI IntegerType * getInt32Ty(LLVMContext &C)
static LLVM_ABI IntegerType * getInt8Ty(LLVMContext &C)
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
LLVM_ABI EnumStrings< SemanticKind, 1 > getSemanticKinds()
ElementType
The element type of an SRV or UAV resource.
static constexpr uint32_t UnallocatedRow
@ PatchConstantOrPrimitive
LLVM_ABI SemanticInterpretation getInterpretationKind(dxbc::PSV::SemanticKind SemanticKind, Triple::EnvironmentType ShaderStage, IOType IOTy)
LLVM_ABI ArrayRef< SemanticStageInfo > getAvailableStages(dxbc::PSV::SemanticKind SemanticKind)
LLVM_ABI dxbc::PSV::InterpolationMode getInterpolationMode(InterpolationModifier Modifiers)
LLVM_ABI dxbc::PSV::InterpolationMode normalizeInterpolationMode(dxbc::PSV::InterpolationMode Mode, dxil::ElementType CompType, dxbc::PSV::SemanticKind Kind, Triple::EnvironmentType Stage, IOType IO)
LLVM_ABI InterpolationModifier getInterpolationSamplingLocation(InterpolationModifier Modifiers)
LLVM_ABI dxbc::PSV::SemanticKind getSemanticKind(StringRef SemanticName)
static constexpr uint8_t UnallocatedCol
std::enable_if_t< detail::IsValidPointer< X, Y >::value, X * > dyn_extract_or_null(Y &&MD)
Extract a Value from Metadata, if any, allowing null.
This is an optimization pass for GlobalISel generic memory operations.
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
LLVM_ABI std::error_code inconvertibleErrorCode()
The value returned by this function can be returned from convertToErrorCode for Error values where no...
Error createStringError(std::error_code EC, char const *Fmt, const Ts &... Vals)
Create formatted StringError object.
constexpr bool has_single_bit(T Value) noexcept
constexpr std::underlying_type_t< Enum > to_underlying(Enum E)
Returns underlying integer value of an enum.
static LLVM_ABI Expected< SemanticSignatureElement > fromMetadata(const MDNode *Node)
SmallVector< uint32_t > SemanticIndices
dxil::ElementType CompType
dxbc::PSV::SemanticKind SemanticKind
SemanticSignatureElement()=default
dxbc::PSV::InterpolationMode InterpMode
LLVM_ABI MDNode * toMetadata(LLVMContext &Ctx) const