Search Issue Tracker
By Design
Votes
0
Found in
2021.3.34f1
2022.3.17f1
2023.2.4f1
2023.3.0b1
6000.0.0b11
7000.0.0a1
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
- 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:
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.