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
- Unity CIL Linker fails on Player build when persistent listeners have "<" and ">" in their XML attribute names
- ”Lighting data asset ‘LightingData’ is incompatible with the current Unity version…” warnings are thrown when saving Indoors (URP) and Outdoors (URP) Scenes as Scene Templates
- [iOS] The screen blinks when transitioning from custom to Unity splash screen
- [macOS] ”Ignoring depth surface load action as it is memoryless” warnings are thrown when taking Game View Snapshot
- UI Builder Inspector scrolls back up when changes on an expanded but not fully displayed Inspector tab are saved
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.