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
- Nested Canvases with the same Order in Layer ignore Z position for render order when sharing parent Canvas
- ShaderGraph Material subasset loses texture reference when reimporting all assets while using a scripted importer
- Values changed on a prefab are not retained when entering Play Mode
- Shadow Caster 2D shadows partially disappear in specific spots when used with Composite Collider 2D in the Game view
- Hierarchy and Library parts in UI Builder are inaccessible when UI Builder window is resized and these elements no longer fit in the window
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.