yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

Yong HeSupport all integer typed indices in StructuredBuffer Load/Store/[]. (#4311)b5cdd8322

master
444 B16 linesraw
1//TEST:SIMPLE(filecheck=CHECK): -stage compute -target spirv -emit-spirv-directly -entry main
2
3RWStructuredBuffer<float> output;
4
5// Check that 64bit integer index can be used in structured buffers without conversion to int.
6
7// CHECK: %[[INDEX:[A-Za-z0-9_]+]] = OpLoad %long %{{.*}}
8// CHECK: OpAccessChain %_ptr_StorageBuffer_float %output %int_0 %[[INDEX]]
9
10uniform int64_t index;
11
12[numthreads(1,1,1)]
13void main()
14{
15    output[index] = 1;
16}