summaryrefslogtreecommitdiffstats
path: root/tests/ir/dce-rw-buffer-load.slang
blob: 01a14ee4514787b0f35a96b768fa0f8e4cc43059 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//TEST:SIMPLE(filecheck=CHECK): -target hlsl -profile cs_5_0 -entry computeMain -line-directive-mode none

// Test that we can DCE load of a rw buffer.

RWStructuredBuffer<float> gOutputBuffer;

float test()
{
    return gOutputBuffer[0];
}

[numthreads(1, 1, 1)]
void computeMain(uint3 dispatchThreadID: SV_DispatchThreadID)
{
    test();
}

// CHECK: void computeMain
// CHECK-NOT: test
// CHECK: }