summaryrefslogtreecommitdiffstats
path: root/tests/front-end/uav-write.slang
blob: c70af26a36031f36b49e97749e7d9560294bfb3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// uav-write.slang
//TEST:SIMPLE:

// Just confirming that code that writes to a UAV will type-check.

RWTexture2D<float4> gOutput;

float4 test(uint2 coord, float4 value)
{
	// read
    value = value + gOutput[coord];

    // write
    gOutput[coord] = value;

    // read-modify-write
    gOutput[coord] += value;
	
	return value;
}