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
- Texture2D hash changes inside of an AssetBundle when rebuilding a SpriteAtlas bundle with an empty AssetPostprocessor Script enabled
- Aniso Level still applies when Generate MipMap is disabled in Texture Import Settings
- Mipmap Limit Groups long names are not truncated when creating a new Mipmap Limit Group with a long name
- “ArgumentException: Invalid double parameter.” error is thrown when Infinity is typed into the Fixed Timestep field
- GameObject becomes gray when using HDRP and STP together on macOS
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.