https://github.com/shader-slang/slang
Raw File
Tip revision: 6ab0baf910dea838dca2d29557c3361297180a34 authored by jsmall-nvidia on 22 August 2022, 21:39:56 UTC
Improve binary compatibility for DownstreamCompiler types (#2371)
Tip revision: 6ab0baf
uav-write.slang
// 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;
}
back to top