Commit d5901a2
Graphics/SRP/RPF - [UUM 54329] UI Scale incorrectly on Happy Harvest when URP + NRP RG (Vulkan/DX12)
Two coupled fixes:
1. GfxDeviceClient fix:
In `GfxDeviceClient`, unlike other `GfxDevice` implementations, native render pass workflow is not correctly supported by `GetActiveRenderSurfaceWidth()`/`GetActiveREnderSurfaceHeight()`/`IsRenderingToBackBuffer()`. For those calls, even if made in a middle of a render pass, `GfxDeviceClient` will analyze the current render target and not the color attachment of the native render pass currently rendered.
Thus, it can generate visual mismatch if the non-active render target size differs from the color attachment size of the current active render pass. It was noticeable within UI Overlay native render pass in URP where the UI items were overstretched because of that.
2. URP Fix :
When a game was launched with an initial scene with no camera, UI Overlay was wrongly always rendered later in the engine and not in URP for the subsequent scenes. This means a loss in performance due to the absence of pass merging between Final Blit and UI Overlay pass (extra framebuffer load/store) in those scenes. To prevent this, we now enforce, at every frame, UI overlay in URP except if XR or no camera. We used to set this as the initial behavior but only enforcing it at every frame for HDR scenes.
Because of this, UI was rendered after URP in some cases like HappyHarvest with an initial menu with no camera, and rendering UI outside of URP meant rendering it after NRPs (m_ActiveRenderPassIndex == -1) so the canvas was wrongly retrieving RenderTarget size and not NRP one.
To be fully transparent, this second fix is not the perfect one for this situation but 1. it should prevent the bug from happening again except in some obscure corner cases (user forcing UI outside of URP + NRP + UITK), 2. we need to tackle this URP bug anyway, 3. it fixes the initial bug while still limiting changes at GfxDeviceClient level which are a bit more risky.1 parent 21a1411 commit d5901a2
1 file changed
Lines changed: 6 additions & 4 deletions
Lines changed: 6 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2333 | 2333 | | |
2334 | 2334 | | |
2335 | 2335 | | |
2336 | | - | |
2337 | | - | |
| 2336 | + | |
| 2337 | + | |
2338 | 2338 | | |
2339 | 2339 | | |
2340 | 2340 | | |
2341 | 2341 | | |
2342 | | - | |
2343 | | - | |
| 2342 | + | |
2344 | 2343 | | |
| 2344 | + | |
| 2345 | + | |
| 2346 | + | |
2345 | 2347 | | |
2346 | 2348 | | |
2347 | 2349 | | |
| |||
0 commit comments