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

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 :
5656795--588529--Screenshot from 2020-04-01 14-45-21.png
2019.3.7f1 :
5656795--588523--Screenshot from 2020-04-01 14-03-38.jpg
2020.1.0b3 :
5656795--588526--Screenshot from 2020-04-01 14-36-37.jpg

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?

1 Like

Hi!
Could you please submit a bug report?
Thanks!

@Matthi which version of the pipeline are you using?

It's using URP version 8.0.1.
I've now submitted the bug report for this, Case 1233237.

1 Like

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.

Also running into this with: Ubuntu 20.04, Unity 2020.1.0b6.3521, OpenGL 4.5, nvidia-driver-440, URP

Could you please try updating to URP 8.1.0 and check if that resolves the issue?

That fixed the issue for me; Apologies for not noticing there was a newer version available. Thanks!

1 Like


No worries, glad this fixed the issue for you!


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.


Could you please submit a bug report for this issue with a reproduction project?


I did. Case: 1262602
Happens with URP 8.1.x, doesn't happen with 9.0.0-35.

1 Like

Did this get fixed? It is happening for me on Windows, GL ES 3.2

Yes, it got fixed back then.

Why are you using GLES on Windows? :)

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.


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.

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.


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.

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?


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 :)

1 Like