Search Issue Tracker

Won't Fix

Votes

12

Found in

2022.2.17f1

2023.1.0b14

2023.2.0a12

Issue ID

UUM-34321

Regression

No

Depth readback renders a white rectangle when Game and Scene viewports are open

--

-

How to reproduce:
1. Open the “Depth_Readback_Bug” Project
2. Open the “SampleScene”
3. In the Toolbar, select the “2 by 3” layout
4. Enter Play Mode and observe the Game viewport

Expected result: a depth buffer is rendered in the top left corner
Actual result: a white rectangle is rendered in the top left corner and errors are logged to the Console

Reproduced with: 2021.3.24f1, 2022.2.17f1, 2023.1.0b14, 2023.2.0a12
Could not test with: 2020.3.47f1 (Could not resolve scripting errors)

Reproduced on: Windows 11

Errors logged to the Console:
Error Log #1:
{noformat}
AsyncGPUReadback - None (0) graphics format is not supported as source for async read back
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&){noformat}
Error Log #2:
{noformat}
asyncGPUReadbackRequest hasError is true
UnityEngine.Debug:LogError (object)
DepthReadbackPass:Callback (int,int,UnityEngine.Rendering.AsyncGPUReadbackRequest) (at Assets/Scripts/DepthReadbackPass.cs:54)
DepthReadbackPass/<>c__DisplayClass3_0:<Execute>b__0 (UnityEngine.Rendering.AsyncGPUReadbackRequest) (at Assets/Scripts/DepthReadbackPass.cs:36)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&){noformat}
Notes:
1. On some reproducible versions, the shadows disappear (see attached image)
2. On some reproducible versions, when using the “2 by 3” layout, the Scene viewport either flashes or becomes a solid color (see attached video)
3. On some reproducible versions, when using the “Default” layout, the Play viewport is black and has a white rectangle in the top left corner
4. On some reproducible versions, after the reproduction steps the Unity Editor crashes (stack trace provided in comment)
5. Could not test with HDRP and Built-in RP → scripts depend on URP
6. Not reproducible when only the Game view is open

  1. Resolution Note:

    Issue was caused by use of Shader.GetGlobalTexture which operates on a different timeline than SRP. The result of Shader.GetGlobalTexture was not updated at the time of the custom pass's execution and so the depth texture used belonged to the SceneView.

    The correct approach would be to use TextureHandle or RenderTargetIdentifier. A fixed version of the project was provided to the customer. Please reopen if still encountering issues.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.