Search Issue Tracker

Won't Fix

Won't Fix in 2022.3.X, 2023.2.X, 2023.3.X

Votes

17

Found in

2022.3.14f1

2023.2.2f1

2023.3.0a16

Issue ID

UUM-57113

Regression

No

Crash on D3D12Fence::Wait when using Forward+ Rendering Path with Better Shaders asset

--

-

Reproduction steps:
1. Open the attached “repro-project“
2. Open the “Packages/com.jbooth.better-shaders/Samples/Scene.unity“ scene
3. In the Project window select the “Assets/Settings/Renderer3D.asset“ Universal Renderer Data asset
4. In the Inspector switch the Rendering Path from Forward to Forward+

Alternatively:
1. Create a new 3D (URP) project
2. Download and import the Better Shaders asset from [https://assetstore.unity.com/packages/tools/visual-scripting/better-shaders-standard-urp-hdrp-187838|https://assetstore.unity.com/packages/tools/visual-scripting/better-shaders-standard-urp-hdrp-187838|smart-link]
3. Open the “Packages/com.jbooth.better-shaders/Samples/Scene.unity“ scene
4. In the Project window select the “Assets/Settings/URP-HighFidelity-Renderer.asset“ Universal Renderer Data asset
5. In the Inspector switch the Rendering Path from Forward to Forward+

Expected result: The Editor recompiles shaders and switches to the Forward+ Rendering Path without crashing
Actual result: The Editor crashes during the recompilation of shaders

Reproducible with: 2022.3.14f1, 2023.2.2f1, 2023.3.0a16
Could not test with: 2021.3.33f1 (no “Forward+“ Rendering Path option)

Reproduced on: Windows 10
Not reproducible on: No other environment tested

First few lines of the stack trace:
0x00007FF684CAD625 (Unity) D3D12Fence::Wait
0x00007FF684CDBC31 (Unity) GfxDeviceD3D12::QueuePresent
0x00007FF684C96949 (Unity) D3D12Window::EndRendering
0x00007FF686310535 (Unity) GfxDeviceWorker::RunCommand
0x00007FF68631249B (Unity) GfxDeviceWorker::RunExt

  1. Resolution Note:

    There are no fixes planned for this Bug

  2. Resolution Note (2023.3.X):

    The root cause of this crash seems to be that the Better Shaders package does not support Forward+.

    When Forward+ is enabled, URP supplies the lighting data to the shader in the format expected by Forward+, but the shader expects data in a completely different format and unluckily misbehaves badly enough to crash.

    Unfortunately, due to how Forward+ is implemented as a multi_compile keyword, Unity is currently unable to issue an error message in this situation.

    It seems that manually adding #pragma multi_compile _ _FORWARD_PLUS to the Better Shaders shaders fixes the issue, but since it's a third party package, this fix needs to be either done by the package author or the user of the package.

  3. Resolution Note (2023.2.X):

    The root cause of this crash seems to be that the Better Shaders package does not support Forward+.

    When Forward+ is enabled, URP supplies the lighting data to the shader in the format expected by Forward+, but the shader expects data in a completely different format and unluckily misbehaves badly enough to crash.

    Unfortunately, due to how Forward+ is implemented as a multi_compile keyword, Unity is currently unable to issue an error message in this situation.

    It seems that manually adding #pragma multi_compile _ _FORWARD_PLUS to the Better Shaders shaders fixes the issue, but since it's a third party package, this fix needs to be either done by the package author or the user of the package.

  4. Resolution Note (2022.3.X):

    The root cause of this crash seems to be that the Better Shaders package does not support Forward+.

    When Forward+ is enabled, URP supplies the lighting data to the shader in the format expected by Forward+, but the shader expects data in a completely different format and unluckily misbehaves badly enough to crash.

    Unfortunately, due to how Forward+ is implemented as a multi_compile keyword, Unity is currently unable to issue an error message in this situation.

    It seems that manually adding #pragma multi_compile _ _FORWARD_PLUS to the Better Shaders shaders fixes the issue, but since it's a third party package, this fix needs to be either done by the package author or the user of the package.

Comments (1)

  1. Fabraz

    Jan 23, 2024 09:01

    Getting this as well but without the shader package. Happens randomly during editor use. Newest 2022 LTS.

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.