Search Issue Tracker
By Design
Votes
4
Found in
2020.3
2020.3.0f1
2021.1
2021.2
Issue ID
1323721
Regression
No
SRP Batcher is not compatible due to property being declared outside of shader property section when it's actually inside it
How to reproduce:
1. Create a new project using the Universal RP template
2. Import the provided Shader
3. In the Project Window, select the imported Shader
4. In the Inspector, view the provided information
Expected result: There's no message regarding the "shader property section"
Actual result: There's a message that a property is declared outside the "shader property section", thus SRP Batcher is not compatible
Reproducible with: 2020.3.4f1, 2021.1.3f1, 2021.2.0a13
Couldn't test with: 2018.4.34f1, 2019.4.24f1 (user's provided Shader throws errors when downgrading)
Comments (5)
-
HexGrimm
Sep 13, 2021 15:35
-
HexGrimm
Sep 13, 2021 15:34
Guys! Seems most of shaders from URP package have the same error. Please check Lit shader in URP 10.5 and Unity 2020.3.12f1
-
JasonBooth
Apr 12, 2021 23:08
Yes, it appears to come from the CBUFFER_START(UnityPerDraw) in ShaderVariables.hlsl which is included.
-
JasonBooth
Apr 12, 2021 23:06
So following this more; there was a misnamed variable in the cbuffer, however, after fixing that I get:
"The builtin property isn't supported by the SRP Batcher [unity_lightmapindex]"
However, that string does not exist in this shader - and I would guess is coming from a Unity include. Also, even though several variations of the shader are built from the same source, some show these errors and some don't. (IE: The non-tessellated ones show no errors, even though they had the same misnamed cbuffer variable).
-
JasonBooth
Apr 12, 2021 22:45
But the shader is declared as a property as well, did you even look at the shader?
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Test Runner’s vertical scrollbar overlaps with the up and down arrows and upper toolbar tabs when the window is minimized
- The Input Field view is not updated when deleting lines of text
- The scrollbar does not respect empty lines in the Input Field
- “Texture Atlas Viewer“ button text overlaps another button when the UI Toolkit Debugger is narrowed
- Thresholds are no longer automatically calculated after deleting Motion fields in Blendtrees
Resolution Note:
Uniforms in the UnityPerMaterial cbuffer have to be declared as properties as well. The error clearly indicates that.