forked from shader-slang/slang
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconsumer.slang
35 lines (28 loc) · 1.04 KB
/
consumer.slang
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//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: 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]]
//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]]