Search Issue Tracker

Fixed in 5.4.0

Votes

4

Found in

5.1.0p1

Issue ID

704501

Regression

Yes

[compute] HLSLcc times out compiling complex shaders (bad perf on complex shaders)

Shaders

-

Since Unity 5.1 many complex compute shaders fail importing due to timeout. Looks like HLSLcc cross compiler (for OpenGL 4.3 / OpenGL ES 3.1) has bad performance for shaders with many branch instructions.

Comments (9)

  1. tim from amplitude

    Sep 29, 2015 09:26

    Still not working with 5.2.0f3...

  2. hicks

    Jul 27, 2015 17:29

    Sorry for those typos in the last sentence..

    But please, Unity, add an option or some pragmas to let us decide for which platform to use a compute shader (since exclude_renderers is not working)..

  3. hicks

    Jul 27, 2015 17:27

    Just tried it with the newest patch release 5.1.2p1. The compiler still fails with the same error messages..
    BUT it is working on my target platform (Win DX11) like in Unity 5.0 when pressing play, in spite of those error messages. So I guess the compiler is not failing for all platforms and is then working for the ones that compiled just fine.
    Now, I just ignore those errors popping up every time (annoying!). But please, Unity, add an or some pragmas to let us decide for which platform to use a compute shader (since exclude_renderers ist not working)..

  4. jimhug

    Jun 26, 2015 21:10

    This is still an issue in 5.1.1f1. For my version of the problem, the compute shader is actually compiled correctly from DirectX11 and runs successfully. However, whenever I make a change to the compute shader, a fatal debug error window pops up twice and I see errors in the console showing:
    Compute Shader compiler: internal error compiling shader platform=15: Error waiting for read in external process

    This is shown for both platform=15 and platform=9.
    As a quick fix to the problem, I would love to be able to just disable compilation of my compute shader on all platforms except DirectX11. More generally, I would really like to be able to do this completely during my rapid prototyping phases so that I can see fast compilation times for my test platform without having to wait around for additional passes that I don't need.

    I REALLY want to move the the 5.1.x platform (for the new VR support and the 1.0 version of FinalIK). This is a blocking bug for that move. While a complete fix seems hard, providing some option, somewhere to disable the new Compute Shader to OpenGL compilation seems quite simple to provide.

  5. hicks

    Jun 26, 2015 17:04

    I just tested the new patch 5.1.1p2 with my complex compute shaders. This is not fixed! It shows exactly the same behaviour as before. In the release notes, it says you increased the timeout for the compiler. This is not the problem here! The compiler seems to be trapped somewhere because I don't see changes in the process resources. After a few minutes, it stays at 13% CPU usage (1 of 8 cores) and a few hundred MB of RAM. Those numbers will be fixed forever (hours) until you stop the process or close Unity. During normal compilation work, those numbers are constantly changing. For me, it seems like the compiler is trapped in a loop or something. NF!

  6. hicks

    Jun 23, 2015 23:30

    Also see this forum thread for more information about the bug: http://forum.unity3d.com/threads/the-latest-unity-5-1-rc-and-compute-shaders.328738/
    I also filed a bug Report: Case 706098

  7. Nobuu-Nakata

    Jun 23, 2015 15:03

    Compute Shader has stopped working since version 5.1.

  8. CKahler

    Jun 22, 2015 09:11

    It also happens with the latest 5.1.1 version

  9. CKahler

    Jun 22, 2015 09:09

    It happens with complex compute shaders e.g. with for loops that have continue functions. It crashes because of an internal compiling error timeout:
    http://forum.unity3d.com/attachments/computeshadererror-jpg.142089/

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.