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
Comments (1)
-
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
- There is no way to adjust the HDR Paper White value of the Unity Editor's interface, making it difficult/uncomfortable for some developers to work on very dark/bright scenes in HDR
- Animator window has a dropdown button that throws “MissingReferenceException” error on a new project when the previous project had a GameObject with an animation
- Animator State name overflows outside the visual box when the State has a long name
- UI Document file remains marked as Dirty after Undoing made changes
- Switching between UI Documents with different Canvas sizes marks the UXML file as dirty
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.