Search Issue Tracker
Fixed in 2022.2.2f1, 2023.1.0a23
[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
-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")
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
- Double clicking script field no longer opens it in the external script editor
- [Android] Build fails with built-in PAD custom asset(s) when using sample Addressable
- [iOS] nw_read_request_report crash
- The serialized field value cannot be changed when trying to set it back to "None"
- The dropdown component breaks when the 31st Layer is used