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
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[HDRP] Build failed: error X4567: maximum cbuffer exceeded

Discussion in 'Graphics Experimental Previews' started by PixelMind, Aug 1, 2018.

  1. PixelMind

    PixelMind

    Joined:
    Aug 16, 2013
    Posts:
    101
    Hey,
    Anyone else getting following error when trying to make a HDRP build?
    Code (CSharp):
    1. Shader error in 'HDRenderPipeline/Lit': Program 'Frag', error X4567: maximum cbuffer exceeded. target has 14 slots (on d3d11)

    Code (CSharp):
    1. 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
    2. 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).

    Unity version: 2018.2.0f2
    HDRP: 3.0.0. preview (downloaded via Package Manager)
    Shader Graph: 3.0.0 preview (downloaded via Package Manager)
    Post-processing: 2.0.10 preview
     
    SunnyChow and Retr028 like this.
  2. petersx

    petersx

    Joined:
    Mar 5, 2015
    Posts:
    239
    I'am using 2018.2.1f1 and the same packages as you, and everything is ok.
     
    PixelMind likes this.
  3. PixelMind

    PixelMind

    Joined:
    Aug 16, 2013
    Posts:
    101
    Thanks @petersx

    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.
     
  4. Retr028

    Retr028

    Joined:
    Mar 25, 2017
    Posts:
    3
    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?
     
  5. PixelMind

    PixelMind

    Joined:
    Aug 16, 2013
    Posts:
    101
    @GamerRO28 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.
     
  6. PixelMind

    PixelMind

    Joined:
    Aug 16, 2013
    Posts:
    101
    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.
     
  7. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,221
    I believe this has been fixed for 3.3.0 which will be available in 18.3 beta 1 (hopefully later this week or early next week)
     
  8. PixelMind

    PixelMind

    Joined:
    Aug 16, 2013
    Posts:
    101
    @Tim-C Awesome! Thanks for the fix and reply :)
     
  9. SunnyChow

    SunnyChow

    Joined:
    Jun 6, 2013
    Posts:
    360
    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.
     
  10. GeoEuclid

    GeoEuclid

    Joined:
    Sep 14, 2013
    Posts:
    20
    Its back! upload_2022-12-14_0-51-13.png
     
    NopSledRacer likes this.
  11. thelebaron

    thelebaron

    Joined:
    Jun 2, 2013
    Posts:
    851
    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.
     
  12. DrSuviel

    DrSuviel

    Joined:
    Mar 19, 2022
    Posts:
    1
    Same here. Unity version 2022.2.2f1, cannot build due to this error displaying numerous times. I've never had it previously. URP, not HDRP.
     
    Angelo13C likes this.
  13. Angelo13C

    Angelo13C

    Joined:
    Feb 16, 2020
    Posts:
    11
    Me too, Unity 2022.2.7f1 and URP 14.0.6 (cannot build my game)
     
  14. Angelo13C

    Angelo13C

    Joined:
    Feb 16, 2020
    Posts:
    11
    Have you found any solution?
     
  15. Foreverplane_

    Foreverplane_

    Joined:
    Nov 11, 2018
    Posts:
    11
    Same here. 2022.2.8f1
     
  16. Doodums

    Doodums

    Joined:
    Feb 19, 2011
    Posts:
    25
    I've just hit this error after updating to the latest version of DOTS (1.0.0-pre.44) on Editor 2022.2.8f1
    ss_build_01.png

    Shader error in 'Universal Render Pipeline/Lit': Program 'LitPassFragment', error x4567: maximum cbuffer exceeded. target has 14 slots at line 98 (on d3d11)
     
  17. Angelo13C

    Angelo13C

    Joined:
    Feb 16, 2020
    Posts:
    11
  18. Ondrej98

    Ondrej98

    Joined:
    Oct 18, 2016
    Posts:
    21
    Same, also can't build after updating unity to 2022.2.8f1.
     
  19. Doodums

    Doodums

    Joined:
    Feb 19, 2011
    Posts:
    25
    Just tested this with 2022.2.9f1 and the error still happens.
     
    Angelo13C, Cadmos and Foreverplane_ like this.
  20. Doodums

    Doodums

    Joined:
    Feb 19, 2011
    Posts:
    25
    Just tested this with 2022.2.10f1 and the error still happens.
     
    Foreverplane_ and Angelo13C like this.
  21. nettamenteBoss

    nettamenteBoss

    Joined:
    Jun 16, 2013
    Posts:
    2
    I have the same error on Unity 2022.2.9 with entites 1.0.0.pre47
     
    Doodums and Angelo13C like this.
  22. NopSledRacer

    NopSledRacer

    Joined:
    Feb 26, 2023
    Posts:
    2
    Same on:
    Unity 2022.2.11f1 Linux(Ubuntu 22.10), URP, with and without Entites 1.0.0.pre47 and Entities Graphics 1.0.0-pre.44
    22.2.11.png
    Unity 2023.1.0b7 Linux(Ubuntu 22.10),URP with Entites 1.0.0.pre47 and Entities Graphics 1.0.0-pre.44
    Unity 2023.1.0b8 Linux(Ubuntu 22.10),URP with Entites 1.0.0.pre47 and Entities Graphics 1.0.0-pre.44
    2023-03-17_14-39.png
     
  23. pbhogan

    pbhogan

    Joined:
    Aug 17, 2012
    Posts:
    377
    I'm getting this error with 2022.2.12f, URP, Entities, Entities Graphics on macOS

    Shader error in 'Universal Render Pipeline/Lit': Program 'LitPassFragment', error X4567: maximum cbuffer exceeded. target has 14 slots at line 98 (on metal)

    Any ETA on a fix landing for the 2022.2?
     
  24. AbrakaDabraSutra

    AbrakaDabraSutra

    Joined:
    Sep 3, 2021
    Posts:
    6
    Setting rendering path on URP Balanced Renderer, URP High Fidelity Rendererm, URP Performant Renderer to Forward + got rid of the error. But the build still crashes when I launch it.

    2022.2.10f1, URP, Entities Graphics, Windows

    Correction: It didnt get rid of the error. It built only once and it was not launchable. Any further builds failed...
     
    Foreverplane_ likes this.
  25. pbhogan

    pbhogan

    Joined:
    Aug 17, 2012
    Posts:
    377
    I'm already using Forward+. Still get the error on builds.
     
    Foreverplane_ likes this.
  26. Foreverplane_

    Foreverplane_

    Joined:
    Nov 11, 2018
    Posts:
    11
    Guys, did anyone report this bug? It looks like the unity may not know about it. How to call their QA here?
    I just don't understand how such a critical bug can exist for so long.
     
  27. Pabi

    Pabi

    Joined:
    Feb 13, 2016
    Posts:
    48
    I have the same problem and I don't know what to do.
     
  28. Angelo13C

    Angelo13C

    Joined:
    Feb 16, 2020
    Posts:
    11
    It has been fixed (or at least for me) in Unity 2022.2.13
     
  29. Pabi

    Pabi

    Joined:
    Feb 13, 2016
    Posts:
    48
    Yes! I just updated yesterday to the lastest unity 2022.2.13 and confirm it's fixed.
     
  30. xKosta

    xKosta

    Joined:
    Oct 15, 2014
    Posts:
    28
    I can confirm this too
     
  31. MidnightCow

    MidnightCow

    Joined:
    Jun 2, 2017
    Posts:
    30
    Same problem here trying to build with URP + Entities/EntitiesGraphics on 2022.2.12
    Going to install 2022.2.13 and try..
     
    NopSledRacer likes this.
  32. Doodums

    Doodums

    Joined:
    Feb 19, 2011
    Posts:
    25
    I installed 2022.2.13 and it worked for me. Thanks for the fix!
     
  33. MidnightCow

    MidnightCow

    Joined:
    Jun 2, 2017
    Posts:
    30
    2022.2.13 fixed this for me.
     
  34. NopSledRacer

    NopSledRacer

    Joined:
    Feb 26, 2023
    Posts:
    2
    2022.2.13 fixed it in Linux as well