Shader errors block build in 5.4b13

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

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 :slight_smile: Warning would be enough.

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?

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.

Huge blocker for us.

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…

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.

1 Like

I hope the next beta will have that option available.

This issue is still present in 5.4b14 btw.

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.

Beta 19 will ship with the ‘fail the build on any error’ behaviour being optional again.