-
Notifications
You must be signed in to change notification settings - Fork 860
[2020.2] [10.x.x] [Bugfix 1296776] Enforce SRP Batcher and Hybrid renderer compatibility by always using a consolidated property list #3577
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…g/fix/1296776 # Conflicts: # com.unity.shadergraph/CHANGELOG.md
jessebarker
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
ghost
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug filed to deal with case that was unable to be fixed (both targets built in URP): https://fogbugz.unity3d.com/f/cases/1307728/
With that I'll approve.
* [HDRP] Make Decal shader compatible with SRP batcher (#3806) * Fix SRP batcher with decal * Update CHANGELOG.md * Update CHANGELOG.md (cherry picked from commit 5a88bb8) * Added DOTS_INSTANCING_ON variants to the "HDRP/Decal" shader to support mesh decals using it in the Hybrid Renderer. (#4284) (cherry picked from commit fa2ff6e) * [2020.2] [10.x.x] [Bugfix 1296776] Enforce SRP Batcher and Hybrid renderer compatibility by always using a consolidated property list (#3577) * Make all passes in a subshader use the same HLSL proeprty declarations * Adding changelog * Better fix for Targets accessing the current blocks (cherry picked from commit 26a1096) Co-authored-by: sebastienlagarde <[email protected]> Co-authored-by: Chris Tchou <[email protected]>
Purpose of this PR
Fix for bug https://fogbugz.unity3d.com/f/cases/1296776/
and https://fogbugz.unity3d.com/f/cases/1310624/
PR links:
2021.2: #3625
Backport 2021.1: #3623
Backport 2020.2: #3577
Previously, we built a global list of properties to populate the Property{} block in the shaderlab shader, but we built a separate list of properties per pass, that was used to build the HLSL declarations of those properties.
The per-pass properties would only include properties declared by the active Target and the active nodes used by the pass, so they could result in different properties for different passes.
The SRP Batcher requires all passes within a SubShader to use an identical UnityPerMaterial cbuffer declaration, which was often broken by the different property lists. (Also in the future the new BindSets will have a similar requirement for object resources (textures, samplers, etc) to be the same across all passes).
This change switches the HLSL declarations to use a per-sub-shader calculated list of properties. It gathers properties from any nodes upstream of blocks used by the Target, as well as graph and Target properties.
Testing status
Discovered Issues:
Yamato:
ShaderGraph PR Job: 🟢
https://yamato.cds.internal.unity3d.com/jobs/902-Graphics/tree/10.x.x%252Fsg%252Ffix%252F1296776/.yamato%252Fall-shadergraph.yml%2523PR_ShaderGraph_2020.2/5458668/job/pipeline
HDRP PR Job: 🟢
https://yamato.cds.internal.unity3d.com/jobs/902-Graphics/tree/10.x.x%252Fsg%252Ffix%252F1296776/.yamato%252Fall-hdrp.yml%2523PR_HDRP_2020.2/5460524/job
Universal PR Job: 🟢
https://yamato.cds.internal.unity3d.com/jobs/902-Graphics/tree/10.x.x%252Fsg%252Ffix%252F1296776/.yamato%252Fall-universal.yml%2523PR_Universal_2020.2/5458736/job/pipeline
Corresponding 10.x.x/release: a64da1f
https://yamato.cds.internal.unity3d.com/jobs/902-Graphics/tree/10.x.x%252Frelease/.yamato%252Fall-universal.yml%2523PR_Universal_2020.2/5442672/job/pipeline
Comments to reviewers
Notes for the reviewers you have assigned.