summaryrefslogtreecommitdiffstats
path: root/tests/spirv/pointer-bug.slang
blob: 404da286faf99d26ab4d3dfa00c37c33f42210c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//TEST:SIMPLE(filecheck=CHECK): -target spirv -emit-spirv-directly
struct Foo {
  float4 *positions;
};

struct Params {
  Foo *foo;
};

// CHECK: OpTypePointer PushConstant %_ptr_PhysicalStorageBuffer_Foo_natural

[[vk::push_constant]] Params params;

[shader("compute")]
[numthreads(1,1,1)]
void main() {
  params.foo.positions[10] += float4(1, 1, 1, 1);
}