yum-mirror/slang

Making it easier to work with shaders

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

Yong HeProperly compile `gl_WorkgroupSize`. (#3925)a6d59d0e1

master
381 B16 linesraw
1import "glsl";
2
3//TEST:SIMPLE(filecheck=CHECK): -target spirv -emit-spirv-directly -O0
4
5// CHECK-DAG: %[[CONST:[A-Za-z0-9_]+]] = OpConstantComposite %v3int %int_1 %int_2 %int_3
6// CHECK: OpBitcast %v3uint %[[CONST]]
7
8RWStructuredBuffer<int> outputBuffer;
9
10[shader("compute")]
11[numthreads(1u, 2u, 3)]
12void compute()
13{
14    const int x = gl_WorkGroupSize.x;
15    outputBuffer[0] = x;
16}