Search Issue Tracker
By Design
Votes
0
Found in
2021.3.34f1
2022.3.17f1
2023.2.4f1
2023.3.0b1
6000.0.0b11
Issue ID
UUM-60286
Regression
No
SRP Batch call gets split when two GameObjects are using the same shader with no Keywords
Reproduction steps:
1. Open the attached “BatchBreak” project
2. Open the “Assets/SampleScene” Scene
3. Open the Window > Analysis > Frame Debugger window
4. In the Frame Debugger window press the “Enable” button
5. In the Frame Debugger window Hierarchy inspect the {DrawCall} element
Expected result: There is only one “SRP Batch” draw call
Actual result: There are two “SRP Batch” calls with a reason: “SRP: Node use different shader keyword” for the second draw call
Reproducible with: 2021.3.34f1, 2022.3.17f1, 2023.2.4f1, 2023.3.0b1
Reproducible on: macOS 13.6.3
Not reproducible on: No other environment tested
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
- Crash on memcpy when using ScreenCapture.CaptureScreenshot with superSize set to zero
- [URP] Package Samples - Missing scripts in Unity 2022+
- [URP][Package Samples] Continuous "Renderer at index _ is missing for camera _" warnings when opening sample scene
- [URP] Package Samples - Missing scripts in Unity 6
- [URP] Package samples - scenes using FirstPersonController not working in Unity 6
Resolution Note:
Internally batching happens based somewhat on renderer setting. In this situation you have two cubes that are light mapped and a ball that is rendered using probes for it's global illumination. Internally the render loop will look at this and batch the cubes together before looking at the sphere and realising that it needs to use a different configuration.
Internally this activates a new keyword causing the batch break. The frame debugger only shows keywords as used by the shader and in this case there are no keywords. Essentially the global keyword state has changed between these calls.
This is intentional as we try to batch lightmapped objects that share a lightmap together and then probe GI objects together. If there was actual other objects that used probe lighting they would be batched with this ball.