Skip to content

Commit f203597

Browse files
committed
Adding comments
1 parent 9ebc84c commit f203597

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

source/slang/slang-emit-spirv-ops.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -2590,7 +2590,7 @@ SpvInst* emitOpConstantString(IRInst* inst, const UnownedStringSlice& str)
25902590
str);
25912591
}
25922592

2593-
// https://registry.khronos.org/SPIR-V/specs/unified1/SPIRV.html#OpDecorateId
2593+
// https://github.khronos.org/SPIRV-Registry/extensions/AMD/SPV_AMDX_shader_enqueue.html#_decorations
25942594
template<typename T1, typename T2>
25952595
SpvInst* emitOpDecoratePayloadNodeName(IRInst* inst, const T1& target, const T2& id)
25962596
{

source/slang/slang-emit-spirv.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -1914,6 +1914,8 @@ struct SPIRVEmitContext : public SourceEmitterBase, public SPIRVEmitSharedContex
19141914
auto newType = emitOpTypeNodePayloadArray(
19151915
inst, nodePayloadArrayType->getRecordType());
19161916

1917+
// TODO: This is a temporary hack.
1918+
// The NodeID must come from an attribute [NodeID("name")].
19171919
Slang::StringBuilder str;
19181920
str << "NodeID_" << uint32_t(nodePayloadArrayType->getNodeID()->getValue());
19191921
SpvInst* spvStr = emitOpConstantString(nullptr, str.getUnownedSlice());
@@ -7767,7 +7769,6 @@ struct SPIRVEmitContext : public SourceEmitterBase, public SPIRVEmitSharedContex
77677769
return getSection(SpvLogicalSectionID::Annotations);
77687770
case SpvOpTypeNodePayloadArrayAMDX:
77697771
return getSection(SpvLogicalSectionID::ConstantsAndTypes);
7770-
77717772
default:
77727773
return defaultParent;
77737774
}

source/slang/slang-ir.h

+2
Original file line numberDiff line numberDiff line change
@@ -1757,6 +1757,8 @@ struct IRSPIRVNodePayloadArrayType : IRType
17571757
IR_LEAF_ISA(SPIRVNodePayloadArrayType)
17581758

17591759
IRType* getRecordType() { return static_cast<IRType*>(getOperand(0)); }
1760+
1761+
// TODO: getNodeID needs to return `IRStringLit*`.
17601762
IRIntLit* getNodeID() { return static_cast<IRIntLit*>(getOperand(1)); }
17611763
};
17621764

0 commit comments

Comments
 (0)