Search Issue Tracker
Fixed
Fixed in 2022.2.2f1, 2023.1.0a23
Votes
8
Found in
2022.2.0b2
Issue ID
UUM-20505
Regression
Yes
[Shader Graph] Shader instance property gets added to CBUFFER, which causes GPU instancing with instanced properties to not work
Steps to reproduce:
1. Open the attached user's project "HDRP Tests.zip"
2. Open the "Assets/OutdoorsScene.unity" Scene
3. Open Frame Debugger
4. Enter Play Mode
5. In the Frame Debugger, enable it and one of the Draw Mesh calls
6. Observe it no longer getting instanced and message "Non-instanced properties set for instanced shader"
Expected results: Shader instance property gets correctly declared using UNITY_DEFINE_INSTANCED_PROP and GPU instancing works
Actual Results: Shader instance property gets added to CBUFFER, which causes GPU instancing with instanced properties to not work
Reproducible on: 2022.1.11f1, 2022.2.0b2, 2023.1.0a4
Not reproducible on: 2021.3.8f1
Could not test on 2020.3.37f1 and below 2022.1.0f1 due to project errors when downgrading or shader compilation errors
Notes:
-The test project spawns 20k instances of a model, and a shader graph shader that uses instance properties to modulate their emissive intensity on a per-instance basis using SetPropertyBlock(). The property is defined in the shader blackboard as "shader declaration = hybrid per instance". The material is set to enable GPU instancing
-This works correctly in 2021.3, all the instances got GPU instanced, and drawn in a few dozen passes (see images "Screenshot A 1.png" and "Screenshot A 2.png")
-However, in 2022.1.x, this no longer works and each individual building gets drawn in its own draw call, resulting in more than 10,000 passes (see images "Screenshot B 1.png" and "Screenshot B 2.png")
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
- [APV] Impossible to switch between multiple Baking Set when multiple scenes are loaded additively
- [Linux] Low project loading speed when using Ubuntu 24.10
- [VFX Graph] URP ShaderGraph integration issue with VFX and Fog.
- The Editor is slowed down when a Volume Profile with many Overrides is open in the Inspector window
- Lightmap "View" button is not symmetric and has an empty space
Resolution Note (fix version 2023.1.0a23):
Replaced the hardcoded dots defines in our property collector to use the defines provided by UnityInstancing.cs
Resolution Note (fix version 2022.2.2f1):
Backported this fix from the 2023.1 development branch. Should land in time for 2022.2.0f1.