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
- Mono Windows Builds don't produce full log callstacks when generating logs
- AssetBundles fail to load when running in Built Players for Mobile Devices
- UI elements with text gets bigger and grey when Player window is moved to another screen with different resolution
- System name accepts multiline text but crops it on confirmation, duplicates input, and shrinks the field when empty
- UI element scale and position are wrong in project build when DRS is changed with HDR and Software Dynamic Resolution enabled
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.