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
- Automatic LOD fails and SRP Batcher incompatibility occurs when using spline-based quad-topology meshes
- Editor crashes on D3D12GetInterface when repeatedly enabling and disabling 256 text components
- Flickering bright white dots in the Scene when the Android Platform is selected and DX11 Graphics API is used with Iris(R) Xe Graphics GPU
- Inconsistent capitalization and misaligned text in multiple query blocks in Search window
- “Remove Unused Overrides” available on not loaded Scene and throws “ArgumentException: The scene is not loaded” warning
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.