Hey,
Anyone else getting following error when trying to make a HDRP build?
Shader error in 'HDRenderPipeline/Lit': Program 'Frag', error X4567: maximum cbuffer exceeded. target has 14 slots (on d3d11)
Compiling Fragment program with DIRLIGHTMAP_COMBINED DYNAMICLIGHTMAP_ON LOD_FADE_CROSSFADE INSTANCING_ON _NORMALMAP _ALPHATEST_ON _DOUBLESIDED_ON _NORMALMAP_TANGENT_SPACE _SURFACE_TYPE_TRANSPARENT _BLENDMODE_ALPHA _BLENDMODE_PRESERVE_SPECULAR_LIGHTING _ENABLE_FOG_ON_TRANSPARENT _MATERIAL_FEATURE_TRANSMISSION USE_CLUSTERED_LIGHTLIST
Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_RGBM_ENCODIN
Ive been struggling with this for a while now. The error does not appear if I make a fresh project.
I have quite a few external asset store assets included in the project but Iām not sure if they could be related to this in any way. There are half a dozen custom shader graphs included with custom nodes but they are fairly basic too.
Iāve been trying to build with various settings but each build takes about 30 minutes (it looks like it recompiles all shader variants every time) so testing this is tedious. Iād post a bug but I canāt reproduce this in any other project and I canāt really upload the whole project with the report.
The error references to d3d11 so I also tried to remove dx11 build target by replacing it with Vulkan and dx12 but still got the same error (dx12 only doesnāt seem to be possible since its experimental).
I finally somehow got it to build by disabling āEnable Depth Prepass With Deferred Renderingā in HDRP assetās Rendering settings. However Iām sure it wasnāt just this setting alone. In an empty project enabling that setting builds just fine.
There is something strange with the project Iām working on that causes cbuffers to tip over that hard limit. Iāll investigate it some more and file a bug report if I figure out what caused it or if I can reproduce it in a fresh project.
I have the same issue! I already had āEnable Depth Prepass With Deferred Renderingā disabled and I canāt find anything! Have you found another fix?
@Retr028 unfortunately no.
I actually have the same error back for some reason. It worked fine all day yesterday. I didnāt include anything new to my knowledge and its the same project.
Same project and same error is back. Canāt build. Still no idea why itās so random or whatās causing it.
A bit of an update to this issue.
The error still surfaces rather randomly. Do some work with a scene, add some prefabs and or edit some shader graphs. At some point you canāt make a build anymore (error in the first post).
I canāt pinpoint what exactly causes it. But I suspect its actually related to shader graph after all because Iāve found a fairly reliable way to get rid of it at least in my case:
I remove all my custom shader graphs from the project (scenes go pink). Then rebuild the project with only one almost empty debug level and it usually successfully finishes. The weird part is that I can then just revert my graphs and levels back and build again and build is successful again.
It seems like something goes wrong while editing shader graphs and removing them clears / resets something internally. And then the same assets work once again.
I got some similar errors, but in my case, it seems even the built in shaders can cause the problem.
I tried to convert one mode of my existing project to HDRP. Unity automatically convert all Standard material to HDRP Lit material. It works well in editor, but it canāt build. I am so sure these material trigger the problem, because i tested it by importing those materials to a new created project.
Relief that Iām not the only one getting this error(with urp), though its terrible to not be able to build. Exact same error, reported as IN-24251 though it appears no one has looked at it yet.
Shader error in āUniversal Render Pipeline/Litā: Program āLitPassFragmentā, error x4567: maximum cbuffer exceeded. target has 14 slots at line 98 (on d3d11)