How to reproduce:
1. Open the attached “RenderingCommandBuffers50b22.zip“ project
2. Open the “_DeferredDecals“ Scene (Assets/DefferedDecals)
3. Enter Play Mode
Expected result: Decals don’t flicker
Actual result: Decals are flickering
Reproducible with: 2021.3.33f1, 2022.3.16f1, 2023.2.4f1, 2023.3.0b1
Reproducible on: macOS 14.0 Sonoma (Intel)
Not reproducible on: No other environment tested
Notes:
- Also reproducible in Player
- The user noted that his goal was to add per-instance data to command buffer drawn deferred decals. A maximum of 1023 items per call can be drawn to DrawMeshInstanced, but if the data is too large it will split the call into multiple batches, in the user’s case, it does batches of 511, 511, and 1. The user used the instanceID property to look up data in an array that is set on the MaterialPropertyBlock, but the subsequent batches started to flicker
- Selecting the "LevelManager" GameObject in the Hierarchy and changing the "Max Batch Size" to around 500 or below (may vary on the machine) in the Inspector will cause the issue to stop from happening