summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/workgraphs/consumer.slang32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/workgraphs/consumer.slang b/tests/workgraphs/consumer.slang
new file mode 100644
index 000000000..5e211a2a1
--- /dev/null
+++ b/tests/workgraphs/consumer.slang
@@ -0,0 +1,32 @@
+//TEST:SIMPLE(filecheck=CHK): -target spirv-asm -stage compute -entry main -skip-spirv-validation
+struct RecordData
+{
+ int myData;
+};
+
+[shader("compute")]
+[numthreads(1, 1, 1)]
+void main(uint3 dispatchThreadId : SV_GroupThreadID)
+{
+ spirv_asm
+ {
+ OpExecutionMode $main ShaderIndexAMDX $(0);
+ OpExecutionMode $main StaticNumWorkgroupsAMDX $(1) $(1) $(1);
+ };
+
+ DispatchNodeInputRecord<RecordData> inputData;
+
+ let recordData = inputData.Get();
+ int myData = recordData.myData;
+}
+
+//CHK: ; Types, variables and constants
+//CHK: [[MemberType:%[a-zA-Z_0-9]+]] = OpTypeInt 32 1
+//CHK: [[StructType:%[a-zA-Z_0-9]+]] = OpTypeStruct [[MemberType]]
+//CHK: [[PayloadType:%[a-zA-Z_0-9]+]] = OpTypeNodePayloadArrayAMDX [[StructType]]
+//CHK: [[PtrType:%[a-zA-Z_0-9]+]] = OpTypePointer NodePayloadAMDX [[PayloadType]]
+
+//CHK: ; Function
+//CHK: [[VarName:%[a-zA-Z_0-9]+]] = OpVariable [[PtrType]] NodePayloadAMDX
+//CHK: = OpAccessChain [[PtrType]] [[VarName]]
+