yum-mirror/slang

Making it easier to work with shaders

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

James Helferty (NVIDIA)Enable metal tests (#8446)8086adc90

master
716 B21 linesraw
1// Test that Buffer<T> maps to texture_buffer<uint, access::read> in Metal
2
3//TEST:SIMPLE(filecheck=METAL): -stage compute -entry computeMain -target metal
4//TEST:SIMPLE(filecheck=METALLIB): -stage compute -entry computeMain -target metallib
5
6// No COMPARE_COMPUTE test; currently the test framework can't setup a Buffer<>
7// TODO: github issue #8456
8
9// METAL: texture_buffer<uint, access::read> inputBuffer_{{.*}}
10Buffer<uint> inputBuffer;
11
12RWStructuredBuffer<uint> outputBuffer;
13
14// METALLIB: @computeMain
15[numthreads(4, 1, 1)]
16void computeMain(uint3 dtid : SV_DispatchThreadID)
17{
18    uint idx = dtid.x;
19    // Load values from the buffer to verify correct access
20    outputBuffer[idx] = inputBuffer.Load(idx);
21}