summaryrefslogtreecommitdiffstats
path: root/tests/spirv/ptr-vector-member.slang
blob: 0683d88389d0050c612f299df28400e9f036c230 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
//TEST:SIMPLE(filecheck=CHECK): -target spirv

// CHECK: %[[PTR:[0-9a-zA-Z_]+]] = OpAccessChain %_ptr_PhysicalStorageBuffer_uint %16 %int_0
// CHECK: %{{.*}} = OpAtomicIAdd %uint %[[PTR]] %uint_1 %uint_0 %uint_1

struct Push2
{
    uint4 * value;
};

[[vk::push_constant]] Push2 push2;

[shader("compute")]
[numthreads(1, 1, 1)]
void main()
{
    uint * v = &push2.value[0].x;
    InterlockedAdd(*v, 1);
}