Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Bug Reflection Probe Baking causes "maximum ps_5_0 sampler register index (16) exceeded" error

Discussion in 'High Definition Render Pipeline' started by Passeridae, Feb 20, 2021.

  1. Passeridae

    Passeridae

    Joined:
    Jun 16, 2019
    Posts:
    395
    Unity 2020.2.0f1 and HDRP 10.2.2

    So, I have a shader made in the shader graph. It works just fine, no errors in the inspector tab, nothing wrong in the scene itself, it looks and works as expected. But as soon as I bake any reflection probe that touches an object with this shader I get:

    "Shader error in 'Shader Graphs/PasteYourMaterialNameHere': maximum ps_5_0 sampler register index (16) exceeded at line 10238 (on d3d11)"

    Or

    "Shader error in 'Master': maximum ps_5_0 sampler register index (16) exceeded at line 3783 (on d3d11)"

    Or both.

    And the reflection probe captures this object as completely pink (a.k.a broken shader). The shader gets the same error listed in the inspector tab after that but otherwise continues to work just fine. Of course, I can hook up a sampler state node to a few of texture samplers in this material, bake a reflection probe (bakes just fine in this case), then delete the sampler state node and go on working. But this is not how a normal workflow is supposed to look like, correct?

    Thanks!
     
  2. PetraCephas

    PetraCephas

    Joined:
    Mar 27, 2014
    Posts:
    16
    Same here.
     
  3. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    695
    An error in console or in the inspector is never a normal workflow :)

    It's hard to figure out without anything on hand. It would help if you'd able to share the problematic graph and/or a simplified version of it that still repro the issue. Thanks
     
  4. DarkGate

    DarkGate

    Joined:
    Jan 26, 2016
    Posts:
    33
    I have a similar issue but maybe related? My builds worked fine until I started lightmap baking. Then all of a sudden, I'm getting this error when attempting to build to android.

    Code (CSharp):
    1. Shader error in 'Universal Render Pipeline/Lit': maximum ps_5_0 sampler register index (16) exceeded at /Adrift/Library/PackageCache/com.unity.render-pipelines.universal@12.1.5/ShaderLibrary/LightCookie/LightCookieInput.hlsl(12) (on vulkan)
     
    stellamocha likes this.