Search Unity

Bug URP SRP batch breaking bug in 13.1+

Discussion in 'Universal Render Pipeline' started by bnmguy, Aug 7, 2022.

  1. bnmguy

    bnmguy

    Joined:
    Oct 31, 2020
    Posts:
    137
    Originally posted in the Shader Graph forum, but it likely belongs here instead, since the problem was cause by changes in URP.

    I'm in middle of switching engines, but thought I would report this bug while it is on my mind.
    After baking lights with a shader graph shader in URP, the SRP compatibility breaks stating the builtin property unity_ProbesOcclusion cannot be half.

    This stems from this commit 32ea6be2c6a695c37a0ce2c2fe417a135701d256 in URP. For some reason the devs decided to hardwire change UnityInput in the URP library to be declared as "half4 unityProbesOcclusion", and then removed all the casting from the other parts of the URP shader library.

    However, Shader Graph defines this as "float4 unityProbesOcclusion" (as does the instancing code) and since Shader Graph relies on other parts of the URP shader library that were changed to half, it breaks SRP batching.

    HDRP should be fine, since it is still defined float4.

    This should be auto checked in the future to avoid breakages that can be hard to trace. Not sure how this was overlooked to start with.

    Not including a project to reproduce since the code is self explanatory.
     
  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,043
    Make a bug report if this is an issue
     
  3. bnmguy

    bnmguy

    Joined:
    Oct 31, 2020
    Posts:
    137
    I have already. No activity happening though.
     
  4. qweredell

    qweredell

    Joined:
    Feb 8, 2022
    Posts:
    3
    Whereabouts is the bug report link? I cant seem to find it. I'm having the same problem atm
     
    Last edited: Dec 13, 2022