Search Issue Tracker

Won't Fix

Under Consideration for 2022.3.X, 6000.0.X, 6000.1.X, 6000.2.X, 6000.3.X

Votes

2

Found in

2022.3.59f1

6000.0.40f1

6000.1.0b8

6000.2.0a5

6000.3.0a1

Issue ID

UUM-98282

Regression

No

"Shader error in 'Universal Render Pipeline/Lit': maximum ps_5_0 sampler register index (16) exceeded" error thrown after a build is completed when the "LOD Cross Fade" parameter is enabled

-

Reproduction steps:
1. Open the attached “repro_IN-92431“ project
2. Make sure that the “LOD Cross Fade” parameter is enabled in the Inspector of the “Assets/_GAME/Graphics/URP Settings/URP-High.asset”
3. Open the Build Profiles window (“File → Build Profiles“)
4. Build the project (the “Build“ button)
5. Once the build is completed, observe the Editor Console

Expected result: No shader errors are thrown
Actual result: “Shader error in 'Universal Render Pipeline/Lit': maximum ps_5_0 sampler register index (16) exceeded at /Users/…/<projectPath>/Library/PackageCache/com.unity.render-pipelines.universal@bd2aa618476e/ShaderLibrary/LightCookie/LightCookieInput.hlsl(12) (on d3d11)“ error is thrown

Reproducible with: 2022.3.59f1, 6000.0.40f1, 6000.1.0b8, 6000.2.0a5

Reproducible on: Windows 10 (22H2)
Not reproducible on: No other environments tested

Notes:

  • Error doesn’t appear when the “LOD Cross Fade” parameter is disabled
  • The build consistently fails alongside the error for the user who reported the issue
  • The build always succeeded alongside the error while testing by CQA
  1. Resolution Note:

    Thanks for reporting the bug, but we won't be able to fix it.

    The bug isn't in just URP. It's a hard limitation of D3D11, which supports max 16 active samplers. Active here means used in one shader. There's nothing we can do about it directly.Also it's not about "light cookies" it's just the last feature included pushing the total above the limit. Only way to fix it is to reduce the number of samplers somehow—maybe by using less keywords that use texture samplers, or maybe by switching to an API that doesn't have the limit.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.