yum-mirror/slang

Making it easier to work with shaders

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

skallweitNVenable more metal tests (#4326)712ce653d

master
554 B28 linesraw
1//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj
2
3// Confirm that calling a mutating method to write to a buffer location doesn't
4// get DCE'd.
5
6struct C
7{
8    int a;
9    [mutating]
10    void set(int val)
11    {
12        a = val;
13    }
14}
15
16//TEST_INPUT:ubuffer(data=[0], stride=4):out, name outputBuffer
17RWStructuredBuffer<C> outputBuffer;
18void writeOutput(int tid)
19{
20    outputBuffer[tid].set(1);
21}
22
23[numthreads(1, 1, 1)]
24void computeMain(int3 dispatchThreadID : SV_DispatchThreadID)
25{
26    int tid = dispatchThreadID.x;
27    writeOutput(tid);
28}