summaryrefslogtreecommitdiffstats
path: root/tests/bugs/gh-8659.slang
blob: 599c09b3be89a50b8dde46cb350321dbff3d33cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//TEST:COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type -emit-spirv-directly

//TEST_INPUT: set ptr = ubuffer(data=[0 0 0 0], stride=4)
uniform uint* ptr;

//TEST_INPUT: set outputBuffer = out ubuffer(data=[0 0 0 0], stride=4)
RWStructuredBuffer<uint> outputBuffer;

[numthreads(1,1,1)]
void computeMain()
{
    let indices = (uint*)&ptr[0];
    *indices = 100;
    // CHECK: 100
    outputBuffer[0] = ptr[0];
}