Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

GLSL Link Errors on using URP: "Constant register limit exceeded" [Linux]

Discussion in '2020.1 Beta' started by Matthi, Apr 1, 2020.

  1. Matthi

    Matthi

    Joined:
    Jun 7, 2013
    Posts:
    11
    My system setup:
    * Ubuntu 19.10
    * Geforce 970
    * nvidia-driver-435​

    Hey everyone,

    When using 2020.1.0b3, I get several variations of the following error on loading the example URP project:

    -------- GLSL link error: Fragment info
    -------------
    (0) : error C6020: Constant register limit exceeded at _MainLightPosition; more than 1024 registers needed to compile program
    (0) : error C6020: Constant register limit exceeded at _MainLightColor; more than 1024 registers needed to compile program
    (0) : error C6020: Constant register limit exceeded at _DrawObjectPassData; more than 1024 registers needed to compile program
    (0) : error C6020: Constant register limit exceeded at _AdditionalLightsCount; more than 1024 registers needed to compile program
    (0) : error C6020: Constant register limit exceeded at unity_FogColor; more than 1024 registers needed to compile program
    (0) : error C6020: Constant register limit exceeded at _CascadeShadowSplitSpheres0; more than 1024 registers needed to compile program
    (0) : error C6020: Constant register limit exceeded at _CascadeShadowSplitSpheres1; more than 1024 registers needed to compile program
    (0) : error C6020: Constant register limit exceeded at _CascadeShadowSplitSpheres2; more than 1024 registers needed to compile program
    (0) : error C6020: Constant register limit exceeded at _CascadeShadowSplitSpheres3; more than 1024 registers needed to compile program
    (0) : error C6020: Constant register limit exceeded at _CascadeShadowSplitSphereRadii; more than 1024 registers needed to compile program
    (0) : error C6020: Constant register limit exceeded at _MainLightShadowParams; more than 1024 registers needed to compile program
    (0) : error C6020: Constant register limit exceeded at _MainLightShadowmapSize; more than 1024 registers needed to compile program
    (0) : error C6020: Constant register limit exceeded at _AdditionalShadowmapSize; more than 1024 registers needed to compile program
    (0) : error C6020: Constant register limit exceeded at unity_SpecCube0; more than 1024 registers needed to compile program
    (0) : error C6020: Constant register limit exceeded at _BaseMap; more than 1024 registers needed to compile program
    (0) : error C6020: Constant register limit exceeded at _BumpMap; more than 1024 registers needed to compile program
    (0) : error C6020: Constant register limit exceeded at _MetallicGlossMap; more than 1024 registers needed to compile program
    (0) : error C6020: Constant register limit exceeded at hlslcc_zcmp_MainLightShadowmapTexture; more than 1024 registers needed to compile program
    (0) : error C6020: Constant register limit exceeded at hlslcc_zcmp_AdditionalLightsShadowmapTexture; more than 1024 registers needed to compile program​

    This results in glitched graphics (see screenshots below).
    This error does not occur in 2019.3.7f1, so I don't think it's a linux issue.
    I can also work around this error in 2020.1.0b3 by switching the graphics API to "Vulkan" in the Player Settings.

    I attached screenshots comparing the behaviour of both editor versions.

    2020.1.0b3 <OpenGL 4.5>:
    Screenshot from 2020-04-01 14-45-21.png
    2019.3.7f1 <OpenGL 4.5>:
    Screenshot from 2020-04-01 14-03-38.png
    2020.1.0b3 <Vulkan>:
    Screenshot from 2020-04-01 14-36-37.png

    I spent some time trying to find causes or an explanation online. Unfortunately, I did not find information that would explain how this error is related to Unity, so I decided to post it to these forums first.
    Am I correct in assuming that this is a bug introduced with 2020.1.0b3?
     
    BHSPitMonkey likes this.
  2. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    3,028
    Hi!
    Could you please submit a bug report?
    Thanks!
     
  3. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    584
    @Matthi which version of the pipeline are you using?
     
  4. Matthi

    Matthi

    Joined:
    Jun 7, 2013
    Posts:
    11
    It's using URP version 8.0.1.
    I've now submitted the bug report for this, Case 1233237.

     
    LeonhardP likes this.
  5. Elektordi

    Elektordi

    Joined:
    Dec 3, 2016
    Posts:
    2
    Same problem here with Unity 2020.1.0b4.3439 and URP 8.0.1
    (Using Ubuntu 18.04.4 and nvidia-430)

    I did some tests, and the only materials that are working are unlit ones, all lit materials are pink.
     
  6. BHSPitMonkey

    BHSPitMonkey

    Joined:
    Sep 14, 2016
    Posts:
    10
    Also running into this with: Ubuntu 20.04, Unity 2020.1.0b6.3521, OpenGL 4.5, nvidia-driver-440, URP
     
  7. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
    Could you please try updating to URP 8.1.0 and check if that resolves the issue?
     
  8. BHSPitMonkey

    BHSPitMonkey

    Joined:
    Sep 14, 2016
    Posts:
    10
    That fixed the issue for me; Apologies for not noticing there was a newer version available. Thanks!
     
    LeonhardP likes this.
  9. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
    No worries, glad this fixed the issue for you!
     
  10. drallcom3

    drallcom3

    Joined:
    Feb 12, 2017
    Posts:
    165
    URP 8.1.0 doesn't fix it for me. I still get pink shaders and warnings spam.

    Edit: This seems to occur if you have many objects in the scene. When I disable most of them the bug disappears.
    Edit: It's point lights with many objects. If I disable all point lights it works.
     
    Last edited: May 7, 2020
  11. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
    Could you please submit a bug report for this issue with a reproduction project?
     
  12. drallcom3

    drallcom3

    Joined:
    Feb 12, 2017
    Posts:
    165
    I did. Case: 1262602
    Happens with URP 8.1.x, doesn't happen with 9.0.0-35.
     
    LeonhardP likes this.
  13. joshuacwilde

    joshuacwilde

    Joined:
    Feb 4, 2018
    Posts:
    731
    Did this get fixed? It is happening for me on Windows, GL ES 3.2
     
  14. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    3,028
    Yes, it got fixed back then.

    Why are you using GLES on Windows? :)
     
  15. joshuacwilde

    joshuacwilde

    Joined:
    Feb 4, 2018
    Posts:
    731
    yeah, we are writing a mobile game, but I found it's a lot easier to test GL ES specific issues in Windows rather than waiting on builds and testing on Android.
     
  16. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    3,028
    The problem with this approach is that the HW is fundamentally different. You won't necessarily see GL ES specific issues there, but rather issues with this particular driver that your end users won't see anyway.
     
  17. joshuacwilde

    joshuacwilde

    Joined:
    Feb 4, 2018
    Posts:
    731
    Yes I recognize that, but for example it helped me last week when debugging why shadows weren't working (inverted Z buffer). So I get what you are saying, but for some issues, it definitely helps.
     
  18. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    3,028
    But that's not specific to OpenGL ES, it's specific to Open GL in general.
    I understand that it may help with some issues, but you may also end up spending time on some issue that's specific to your setup and never happens on Android.
     
  19. joshuacwilde

    joshuacwilde

    Joined:
    Feb 4, 2018
    Posts:
    731

    iirc, in this case the issue wasn't reproduced in GL. Well actually now that I remember, the issue turned out to be I was checking for GL ES, not GL ES 3 (GL ES maps to ES 2 in the shader).

    Is GL ES just not supported at all on Windows?
     
  20. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    3,028
    That's because it's in fact Open GL ES 2.0. The version before that (GLES 1.1) didn't have programmable shaders :)

    I wouldn't say it is. For one, it doesn't work on all HW (needs certain extensions, and some vendors said "nope, we're not going to support this") and it's basically emulation of some kind. It's also nearly not used by anyone, hence my questions on your use case :)
     
    joshuacwilde likes this.
  21. joshuacwilde

    joshuacwilde

    Joined:
    Feb 4, 2018
    Posts:
    731
    I was surprised it worked to begin with tbh, but I understand. Thanks.