Skip to content

Commit 1678622

Browse files
author
Greg Roth
authored
Add clarifying comments for default vtx/prim IDs (#6539)
MS outputs require vertex or primitive ID parameters and so do not require an undefined value to be set to initialize the parameter value This just adds comments to clarify the potentially confusing code. Fixes #6486
1 parent 2835e80 commit 1678622

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

lib/HLSL/HLSignatureLower.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,6 +1138,7 @@ void HLSignatureLower::GenerateDxilInputsOutputs(DXIL::SignatureKind SK) {
11381138
DXASSERT_NOMSG(0);
11391139
}
11401140
bool bInput = SK == DXIL::SignatureKind::Input;
1141+
// vertex or primitive IDs are required for GS/DS/HS inputs and MS outputs
11411142
bool bNeedVertexOrPrimID =
11421143
bInput && (props.IsGS() || props.IsDS() || props.IsHS());
11431144
bNeedVertexOrPrimID |= !bInput && (props.IsMS() || props.IsMeshNode());
@@ -1154,6 +1155,9 @@ void HLSignatureLower::GenerateDxilInputsOutputs(DXIL::SignatureKind SK) {
11541155

11551156
Constant *constZero = hlslOP->GetU32Const(0);
11561157

1158+
// Default value of vertexidx mainly used for LoadInput where it's optional
1159+
// Mesh outputs require this to be set and so need no default.
1160+
// They will be set correctly in GenerateInputOutputUserCall
11571161
Value *undefVertexIdx = props.IsMS() || props.IsMeshNode() || !bInput
11581162
? nullptr
11591163
: UndefValue::get(Type::getInt32Ty(HLM.GetCtx()));

0 commit comments

Comments
 (0)