yum-mirror/slang

Making it easier to work with shaders

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

Yong HeFix SPIRV pointer codegen. (#3664)f8c540560

master
383 B25 linesraw
1//TEST:SIMPLE(filecheck=CHECK): -target spirv -entry main -stage compute -emit-spirv-directly
2
3
4struct Tester
5{
6    uint i;
7};
8
9struct Push
10{
11    Tester* ptr_array[2];
12    uint * out_ptr;
13};
14
15[[vk::push_constant]] Push p;
16
17// CHECK: OpEntryPoint
18
19[shader("compute")]
20[numthreads(1, 1, 1)]
21void main(int id : SV_DispatchThreadID)
22{
23    uint i = p.ptr_array[0].i;
24    *p.out_ptr = i;
25}