Search Issue Tracker
Third Party Issue
Votes
1
Found in
2017.4
2019.2.21f1
2020.2
Issue ID
1232436
Regression
No
[FXC Freeze] Specific Compute Shader compiles infinitely and causes a memory leak when imported
How to reproduce:
1. Download the user's attached Compute Shader
2. Create a new project with the default 3D template
3. Import the Compute Shader by dragging it into the Assets folder
4. Wait for the Shader to compile
Expected result: Compute Shader is compiled
Actual result: Compute Shader is compiling infinitely
Reproducible with: 2017.4.39f1, 2018.4.20f1, 2019.3.8f1, 2020.1.0b4, 2020.2.0a5
Note: In addition, Unity Shader Compiler leaks memory, and it's not released when the Editor is closed
-
SLGSimon
Apr 01, 2020 15:30
From my investigation this is a bug with the fxc compiler, that doesn't exist in the new dxc compiler. It seems like you are already working on integrating the new compiler.
I was able to work around the issue by changing:
[loop]
for (int z = 0; z < quadsPerTile; ++z)
{
[loop]
for (int x = 0; x < quadsPerTile; ++x)
{to
[loop]
for (uint t = 0; t < quadsPerTile * quadsPerTile; ++t)
{
uint z = t / quadsPerTile;
uint x = t % quadsPerTile;
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Any small change in UI Builder Inspector refreshes Editor Inspector
- Inaccurate Box Collider boundaries on a rotated child Cube when the parent GameObject Scale is non-uniform
- [Android] "SHADOWS_SCREEN" set as shader Keyword when no "_ShadowMapTexture" is bound leads to freeze on a build on some Mali GPU devices
- The global scene list is overridden in a project built with command line when the Override Global Scene List setting is disabled in the build profile
- Global Scenes are not included in the Build when building multiple Build Profiles at the same time
Resolution Note (2020.2.X):
There seems to be a bug in the Microsoft D3D compiler that is triggered with this particular shader. Unfortunately we can't do much anything with this sort of issues as we use the compiler dll as a binary and it is not under active development anymore. You can either try refactoring the shader to avoid this issue or in the future use an alternative compiler path when it's available.