yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
55ff4686e
master
1//TEST:SIMPLE(filecheck=CHK): -target spirv-asm -stage compute -entry main -skip-spirv-validation 2struct RecordData 3{ 4 int myData; 5}; 6 7[shader("compute")] 8[numthreads(1, 1, 1)] 9void main(uint3 dispatchThreadId : SV_GroupThreadID) 10{ 11 spirv_asm 12 { 13 OpExecutionMode $main ShaderIndexAMDX $(0); 14 OpExecutionMode $main StaticNumWorkgroupsAMDX $(1) $(1) $(1); 15 }; 16 17 DispatchNodeInputRecord<RecordData> inputData; 18 19 let recordData = inputData.Get(); 20 int myData = recordData.myData; 21} 22 23//CHK: ; Types, variables and constants 24//CHK: [[MemberType:%[a-zA-Z_0-9]+]] = OpTypeInt 32 1 25//CHK: [[StructType:%[a-zA-Z_0-9]+]] = OpTypeStruct [[MemberType]] 26//CHK: [[PayloadType:%[a-zA-Z_0-9]+]] = OpTypeNodePayloadArrayAMDX [[StructType]] 27//CHK: [[PtrType:%[a-zA-Z_0-9]+]] = OpTypePointer NodePayloadAMDX [[PayloadType]] 28 29//CHK: ; Function 30//CHK: [[VarName:%[a-zA-Z_0-9]+]] = OpVariable [[PtrType]] NodePayloadAMDX 31//CHK: = OpAccessChain [[PtrType]] [[VarName]] 32