Search Issue Tracker
By Design
Votes
0
Found in
6000.0.58f1
6000.2.6f1
6000.3.0b3
6000.4.0a1
Issue ID
UUM-119598
Regression
No
ComputeBuffer readback fails when Render Graph is enabled
Reproduction steps:
1. Open the attached “BugRepro” project
2. Open the “Assets/Scenes/SampleScene.unity“ Scene
3. Make sure that Compatibility Mode is disabled (Edit > Project Settings > Graphics > Render Graph > Compatibility Mode (Render Graph Disabled)
4. Enter the Play Mode
5. Observe the Game view
Expected result: Script reads back ComputeBuffer values: 1=24, 2=24, 3=6
Actual result: Script reads back zeros for all values: 1=0, 2=0, 3=0
Reproducible with: 6000.0.58f1, 6000.2.6f1, 6000.3.0b3, 6000.4.0a1
Reproducible on: Windows 11
Not reproducible on: No other environment tested
Note: Not reproducible when “Compatibility Mode (Render Graph Disabled)” is enabled
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- “Remove Unused Overrides” available on not loaded Scene and throws “ArgumentException: The scene is not loaded” warning
- Adaptive Probe Volume occlusion edge is calculated incorrectly when viewing probes near geometry edges
- Sampling a texture using an HLSL file throws shader errors and the code does not compile
- "Graphics.CopyTexture called with null source texture" error when Base Camera of an Overlay Camera is removed with DX11 Graphics API and Compatibility Mode enabled
- WebGL sends wrong value with large numbers when SendMessage function is used
Resolution Note:
Graphics.SetRandomWriteTarget() is not supported with URP Render Graph. This lack of support is by design, because on some graphics API these buffers share the same binding slot-space with other type of buffers. So setting them globally can generate rendering issues in SRP.
It is recommended to implement a URP Scriptable Renderer Feature (custom pass) with an async GPU readback instead. You can implement it within the render function of your Render Graph pass:
using (var builder = renderGraph.AddUnsafePass<ReadbackPassData>("ReadbackPass", out var passData))
{
builder.AllowPassCulling(false);
// Which buffer to read from
passData.bufferHandle = m_OutputBuffer;
builder.UseBuffer(passData.bufferHandle, AccessFlags.Read);
builder.SetRenderFunc(static (ReadbackPassData data, UnsafeGraphContext ctx) =>
{
ctx.cmd.RequestAsyncReadback(data.bufferHandle, (AsyncGPUReadbackRequest request) =>
{
var result = request.GetData<int>();
Debug.Log(string.Join(",", result));
});
});
Check URP Render Graph documentation and URP Render Graph samples for more information. We are planning to include an async readback sample in the coming month.