summaryrefslogtreecommitdiffstats
path: root/tests/metal/test_descriptor_handle.slang
blob: 1e9072a79f47333d367fab96dae87c2b17947857 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//TEST:SIMPLE(filecheck=METAL): -stage compute -entry computeMain -target metal

struct MyStruct
{
    uint value;
}
// METAL-NOT: DescriptorHandle
ParameterBlock<DescriptorHandle<Buffer<uint>>> param;
RWStructuredBuffer<uint> outputBuffer;
[numthreads(4, 1, 1)]
void computeMain(uint3 dtid : SV_DispatchThreadID)
{
    uint idx = dtid.x;
    // Load values from the buffer to verify correct access
    // METAL: {{.*}}outputBuffer{{.*}}=
    outputBuffer[idx] = param[0];
}