Is there a way to debug what’s causing this? I’m using Frame Debugger to track down draw calls, and it seems one of the shader passes do not SRP batch correctly:
However, shader inspector shows that it is compatible:
Here’s how CBUFFER of Depth Only pass looks like:
CBUFFER_START( UnityPerMaterial )
float4 _ST_WindTurbulences;
float4 _ST_WindLeaf1Tumble;
float4 _ST_WindAnimation;
float4 _ST_WindFrondRipple;
int _Cull;
float4 _ST_WindBranchWhip;
float4 _ST_WindLeaf1Twitch;
float4 _ST_WindBranch;
float4 _ST_WindLeaf2Tumble;
float4 _ST_WindBranchAdherences;
float4 _ST_WindLeaf2Ripple;
float4 _ST_WindLeaf2Twitch;
float4 _ST_WindLeaf1Ripple;
float4 _ST_WindBranchTwitch;
float4 _ST_WindGlobal;
int _WindQuality;
int _GlobalTimerId;
float4 _Color;
float4 _ST_WindVector;
float4 _ST_WindBranchAnchor;
float _Cutoff;
float _Metallic;
float _Smoothness;
float4 _EmissionColor;
float _RenderQueueType;
float _StencilRef;
float _StencilWriteMask;
float _StencilRefDepth;
float _StencilWriteMaskDepth;
float _StencilRefMV;
float _StencilWriteMaskMV;
float _StencilRefDistortionVec;
float _StencilWriteMaskDistortionVec;
float _StencilWriteMaskGBuffer;
float _StencilRefGBuffer;
float _ZTestGBuffer;
float _RequireSplitLighting;
float _ReceivesSSR;
float _SurfaceType;
float _BlendMode;
float _SrcBlend;
float _DstBlend;
float _AlphaSrcBlend;
float _AlphaDstBlend;
float _ZWrite;
float _CullMode;
float _TransparentSortPriority;
float _CullModeForward;
float _TransparentCullMode;
float _ZTestDepthEqualForOpaque;
float _ZTestTransparent;
float _TransparentBackfaceEnable;
float _AlphaCutoffEnable;
float _AlphaCutoff;
float _UseShadowThreshold;
float _DoubleSidedEnable;
float _DoubleSidedNormalMode;
float4 _DoubleSidedConstants;
CBUFFER_END
Is there a way to debug what’s causing this alike when shader isn’t compatble?
Or is there any other limitation that can cause SRP batch to break?