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. 26792a12fc6338f02d51c6f2e204f507?d=mm

    tim from amplitude

    Sep 29, 2015 09:26

    Still not working with 5.2.0f3...

  2. 54c2040118d3671520d4fbdde29e9f12?d=mm

    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. 54c2040118d3671520d4fbdde29e9f12?d=mm

    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. F158a527f27f60eba0364a7b824a8300?d=mm

    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. 54c2040118d3671520d4fbdde29e9f12?d=mm

    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. 54c2040118d3671520d4fbdde29e9f12?d=mm

    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. 5a466b4fb72bdc74de1ca9945a623871?d=mm

    Nobuu-Nakata

    Jun 23, 2015 15:03

    Compute Shader has stopped working since version 5.1.

  8. E3cce312ea6f66a07d4d027c8c1fc3f6?d=mm

    CKahler

    Jun 22, 2015 09:11

    It also happens with the latest 5.1.1 version

  9. E3cce312ea6f66a07d4d027c8c1fc3f6?d=mm

    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/

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.