Search Issue Tracker

Third Party Issue

Votes

0

Found in

2021.3.42f1

2022.3.41f1

6000.0.14f1

Issue ID

UUM-77825

Regression

No

"Compiler timed out" is thrown when compiling a Compute shader

--

-

How to reproduce:
1. Open the attached project "IN-82004.zip"
2. Select Assets/RTMain.compute in the Project window
3. Click "Show compiled code" in the Inspector window

Expected results: Compiled code is shown
Actual results: "Shader compiler: Compile RTMain.compute - RTMain: Compiler timed out." is thrown

Reproducible with: 2021.3.42f1, 2022.3.41f1, 6000.0.14f1

Reproducible on: Windows 10 22H2
Not reproducible on: No other environment tested

  1. Resolution Note:

    This is unfortunately a bug in the Microsoft DirectX shader compiler (FXC). Having multiple levels of loop nesting can cause the compiler to go into an extremely slow processing path and there is nothing we can do about it. There are couple of workarounds to try though:
    1) Add #pragma use_dxc in the shader to force the compilation to use the newer DXC compiler instead. This is not the default compiler atm but can be used for overcoming some of these issues. The shader code might need some tweaking though since DXC can be more strict on some things that FXC just happily took in.
    2) Increase the shader compiler timeout value by setting UNITY_SHADER_COMPILER_TASK_TIMEOUT_MINUTES environment variable. The shader compilation should finish eventually. But of course this is not very helpful for iteration type work. I'd suggest using the DXC workaround for iteration and only use this other workaround in the end if using FXC is necessary for the release process.

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.