Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SPIRV error for WorkGraphs #6423

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions source/slang/hlsl.meta.slang
Original file line number Diff line number Diff line change
Expand Up @@ -24407,9 +24407,7 @@ struct DispatchNodeInputRecord
case spirv:
return spirv_asm
{
%in_payload_t = OpTypeNodePayloadArrayAMDX $$T;
%in_payload_ptr_t = OpTypePointer NodePayloadAMDX %in_payload_t;
%var = OpVariable %in_payload_ptr_t NodePayloadAMDX;
%var = OpVariable $$NodePayloadPtr<T> NodePayloadAMDX;
result : $$NodePayloadPtr<T> = OpAccessChain %var $index;
};
}
Expand Down
2 changes: 1 addition & 1 deletion source/slang/slang-emit-spirv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1542,7 +1542,7 @@ struct SPIRVEmitContext : public SourceEmitterBase, public SPIRVEmitSharedContex
else if (storageClass == SpvStorageClassNodePayloadAMDX)
{
auto spvValueType = ensureInst(valueType);
auto spvNodePayloadType = emitOpTypeNodePayloadArray(inst, spvValueType);
auto spvNodePayloadType = emitOpTypeNodePayloadArray(nullptr, spvValueType);
valueTypeId = getID(spvNodePayloadType);
}
else
Expand Down
3 changes: 3 additions & 0 deletions tests/workgraphs/consumer.slang
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ void main(uint3 dispatchThreadId : SV_GroupThreadID)
int myData = recordData.myData;
}

//CHK: OpCapability ShaderEnqueueAMDX
//CHK: OpExtension "SPV_AMDX_shader_enqueue"

//CHK: ; Types, variables and constants
//CHK: [[MemberType:%[a-zA-Z_0-9]+]] = OpTypeInt 32 1
//CHK: [[StructType:%[a-zA-Z_0-9]+]] = OpTypeStruct [[MemberType]]
Expand Down
Loading