RWBuffer and Buffer in compute shaders when they binding with the same resource

Thats nice!
To read the buffer on the gpu its just these minor changes.

where you define the Compute-Shader use:

SHADER_PARAMETER_SRV( StructuredBuffer<float>, BufferSource )

When setting the resource in the Shader-Parameters, just pass the FStructuredBuffer instead of the FUnorderedAccessView:

ShaderParameters.BufferSource = BufferSource;

in the .usf

StructuredBuffer<float> BufferSource;

besides this, you can read from the RWBuffer too anyway^^

1 Like