Search Unity

Graphics Shader errors block build in 5.4b13

Discussion in '5.4 Beta' started by FriendAndFoeMatt, Apr 8, 2016.

  1. FriendAndFoeMatt

    FriendAndFoeMatt

    Joined:
    Jan 27, 2015
    Posts:
    11
    Hi,

    I'm trying to cut a build, and I'm getting a bunch of "maximum keywords exceeded" and psize0 max registers exceeded errors. I distinctly remember being able to build despite this in previous versions; is there an argument I can change somewhere to allow the build to proceed?

    As an aside, we're up against the keyword limit. Is there a way to remove the keywords from built-in-shaders that we're not using (ie speedtree etc)

    Thanks,
    -matt
     
  2. alexandre-fiset

    alexandre-fiset

    Joined:
    Mar 19, 2012
    Posts:
    332
    We encountered the same issue and had to reduce our number of keywords. Usually you can save a lot of them just deleting packages or shaders you don't use. For instance, we didn't use any of the metallic Uber shaders, so we deleted them all.

    As for SpeedTree shaders keyword, I think you could import them using the built-in shaders package and then strip out the keywords from the shader code.

    And Unity, needless to say that preventing the user to build because of some keywords limit is stupid :) Warning would be enough.
     
  3. FriendAndFoeMatt

    FriendAndFoeMatt

    Joined:
    Jan 27, 2015
    Posts:
    11
    I built again using 5.3 - the keyword limit doesn't block the build; in fact no shader errors do. Is there a way to re-enable this for 5.4?
     
  4. gilgm

    gilgm

    Joined:
    Dec 31, 2012
    Posts:
    7
    It's funny - I'm seeing the same thing here. No "maximum keywords exceeded" message, but it looks like errors in shaders that aren't conditionally rigged for d3d9 will tank the build as well.

    https://gyazo.com/decab24af24a7bca5ac657775cf1c308

    Huge blocker for us.
     
  5. alexandre-fiset

    alexandre-fiset

    Joined:
    Mar 19, 2012
    Posts:
    332
    Actually, according to a Unity employee on this thread:
    I guess we either have to fix these issues or wait for that "future beta" to arrive...
     
  6. FriendAndFoeMatt

    FriendAndFoeMatt

    Joined:
    Jan 27, 2015
    Posts:
    11
    Agreed, this is a big issue for us as well. Guess there's nothing for it but to clean up our shaders, but it's a patch at best since we use ShaderForge.

    I got around the d3d9 errors by disabling d3d9 in the player settings; you can unselect "auto-select API" for windows and choose only d3d11 which gets rid of the frustrating 12 register limitation.
     
    alexandre-fiset likes this.
  7. TDH_DrThirteen

    TDH_DrThirteen

    Joined:
    Jul 3, 2014
    Posts:
    42
    I hope the next beta will have that option available.
     
  8. TDH_DrThirteen

    TDH_DrThirteen

    Joined:
    Jul 3, 2014
    Posts:
    42
    This issue is still present in 5.4b14 btw.
     
  9. FriendAndFoeMatt

    FriendAndFoeMatt

    Joined:
    Jan 27, 2015
    Posts:
    11
    As an update: I did manage to get the build working but out of the 128 keywords I identified 70 or so that weren't in my project, related to things like SpeedTree or the Terrain system that we're not using at all. Unfortunately there's no way to remove these.

    But I did manage to get by with some changes to our postFX; several available image effects don't take advantage of the "_" multi-compile option and use keywords for off-states.
     
  10. superpig

    superpig

    Quis aedificabit ipsos aedificatores? Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,165
    Beta 19 will ship with the 'fail the build on any error' behaviour being optional again.