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:
Error Log #2:
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