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-59579
Regression
No
Unused fields in constant buffers are removed when shaders are compiled
How to reproduce:
1. Open the attached “shader_issue” project
2. In the Project window, select the “sh” shader
3. In the Inspector, click “Compile and show code”
4. Using the search function (CTRL+F) find different entries for “UnityPerDraw”
5. Observe the amount of fields contained in each constant buffer
Expected result: All fields declared in the constant buffer are present
Actual result: Some fields are removed upon shader compilation
Reproducible in: 2021.3.34f1, 2022.3.17f1, 2023.2.4f1, 2023.3.0b1
Reproducible on: Windows 11
Not reproducible on: No other environments 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
- UI Toolkit throws warning and fails to clear references when fields are not typed as UnityEngine.Object
- "Shader warning in 'Hidden/Light2D': implicit truncation of vector type" is thrown when building Universal 2D template
- AI Assistant breaks compilation of packages using System.Runtime.CompilerServices.Unsafe via auto-referencing
- Unity Hub checks the "Documentation" module by default on the 6.4 and 6.5 streams despite that it was unchecked with the previous installs
- Shortcut that toggles between Dopesheet and Curves Views in the Animation Window's Timeline is mislabed
Resolution Note:
Unused fields from constant buffers should be stripped. What matters is the layout of the remaining fields - their offsets and the size of the constant buffer.
Resolution Note:
Unused fields from constant buffers should be stripped. What matters is the layout of the remaining fields - their offsets and the size of the constant buffer.