Search Issue Tracker
Fixed
Fixed in 2023.3.0b7
Votes
0
Found in
2023.3.0a7
Issue ID
UUM-49317
Regression
No
"maximum ps_4_0 sampler register index (16) exceeded" error is thrown on build when enabling LOD Cross-Fade
How to reproduce:
1. Open the attached project “Test”
2. Build And Run the project
Expected result: The project is successfully built
Actual result: The project building fails with the "maximum ps_4_0 sampler register index (16) exceeded" error
Reproducible with: 2022.3.7f1
Couldn’t test with: 2021.3.29f1, 2023.1.8f1, 2023.2.0b4 (The project becomes broken after changing the version)
Reproducible on: Windows 11 Pro
Not reproducible on: No other environment 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
- [iOS] "UnityBatchPlayerLoop()" causes a freeze in the iOS application when it is put to the background and brought back to the foreground
- "Perform Selected" of Shortcut Manager window does not perform the shortcut in some cases
- Crash on mono_get_hazardous_pointer when running Play Mode tests in a specific project
- [iOS] ‘확인’(Done) and '취소'(Cancel) text is displayed as '...' in the on-screen keyboard when the System preferred language is set to Korean
- [sw-unity-6-1] Shadergraph panning area size is constant regardless of the size or the zoom level
Resolution Note (fix version 2023.3.0b7):
This error is a hard limit from the graphics API and cannot be fixed or changed. Direct3D 11 supports only 16 active texture samplers in one shader. Unity creates a sampler per texture due to historical reasons. The solution is to reduce the number of textures used by the shader. Alternatively the samplers can be shared using hardcoded inline samplers (excluding OpenGL).
See: https://docs.unity3d.com/2023.3/Documentation/Manual/SL-SamplerStates.html
The bug is marked fixed. The fix turns several internal samplers into shared inline samplers. While this won't fix the underlying issue (limit of the graphics API and/or hardware), it should reduce the likelihood of hitting this limit.
If you hit this limit again, try to reduce the enabled textures or features in the (Lit) shader to workaround the issue.