fix(agc): apply a LOD bias beyond the device limit in the shader #14621
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/14621"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by danielhorngt on 2026-11-01T16:31:40Z.
What
An S# LOD bias field reaches -32 to +31.99, but Vulkan refuses a
mipLodBiasbeyondmaxSamplerLodBias(15 on an RTX 4080) and clamps the sum of sampler and shader bias to the same limit.Sampler::Validatetherefore threw on a value the guest may legally set. Neptunia ReVerse binds +31.67 and stops there, 271-285 s in, onguest sampler descriptor requests a LOD bias beyond the device limit.An S# bias beyond 15 now leaves the host sampler at 0 and reaches the shader through a per-sampler specialization constant. Implicit and gradient samples scale their derivatives by two to the summed bias, which gives the guest sum uncapped and keeps anisotropy. Explicit LOD samples add it to the LOD. A bias of 15 or less takes the same path as before, so the common case only gains a specialized-out branch.
Still throws, recorded in
docs/dev/debt/libSceAgcDriver.md: a sampler table entry beyond 15, a cube image, an LOD query or an adjusted sample with such a bias, and a bias of 15 or less above the device limit.mixyt mentioned a prepared follow-up for this on #10556; no pull request for it exists, and this one can be dropped if that one arrives. #12904 (open) rejects a bias beyond the limit. This PR is expected to land instead of that one check, so #12904 needs to drop it or its suite will assert the opposite.
Tested
Windows 11, i9-12900K, GCC 15.2.0, Release, at
470356ced9on mainf2d874c1fd. The title itself was not run: I don't have it, and it also needs #10556 to reach this point.Exact lowering, at
7b03f92ac9unless noted,ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1:agc_driver_image_sample_lod_bias_sum: a pixel-shaderimage_sample_bdraw on a 64x64 7-level view at implicit LOD near 2.1. Every pixel of all 9 cases reads the summed level on both GPUs, including S# +16/-14 (4), S# -16/+14 (0), S# +31.67/-29 (5), S# -32/+32 (2), S# +31.67/0 (6) and S# -32/0 (0).VK_LAYER_KHRONOS_validation1.4.363 on the RTX 4080 and UHD 770,ctest --test-dir build -R '^(agc_driver_image_sample_lod_bias_sum|agc_driver_image_sample_shared_sampler|agc_driver_image_sample_vcc_sampler|agc_driver_emulated_color_compare.*)$' -V: 5 of 5 pass, the loader inserts the layer in all 5, 0VUID-lines.ctest -R 'agc|shader|spirv|recompiler|image|sampler'on the RTX 4080 at9b752d9bf4, merged with maina4eca2a056: 1,274 passed, 11 skipped, 1 failed, 25 not built because their paths exceed the Windows limit here, includingagc_driver_image_plane_bias_on_single_level_volume, so those rely on the AMD and NVIDIA runs. The failure,agc_driver_direct_write_completion, also fails on this machine with this PR's sources reverted to main.agc_driver_graphics_tests(mock Vulkan): passes, withsamplerLodBiasTestscovering the host bias and the table rejections.The remaining measurements below are from the earlier clamp at
470356ced9and show the behaviour this replaces.agc_driver_graphics_tests(mock Vulkan): passes. NewsamplerLodBiasTestsat that commit checked decoded S# fields within, at and beyond the limit, including the title's +31.67 (field 0x1fac) and -32.guest sampler descriptor requests a LOD bias beyond the device limit.ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,agc_driver_image_sample_shared_sampler_testswith a temporary, uncommitted edit forcing every decoded S# to +31.67: this change passes, the old code stops with the title's error. Unedited, the test passes.ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation(1.4.363),ctest --test-dir build -R '^(agc_driver_image_sample_shared_sampler|agc_driver_image_sample_vcc_sampler|agc_driver_emulated_color_compare.*)$' -V. Each log shows the loader inserting the layer in all 4 tests and nowas not found but was requested by env var VK_INSTANCE_LAYERS:VUID-linesVUID-VkSamplerCreateInfo-mipLodBias-01069The last row shows the layer catches this bias, and that
ctestpasses regardless.ANYPS5_NO_SHADER_CACHE=1: a temporary, uncommitted pixel-shaderimage_sample_bdraw on a 64x64 7-level view with a point mip filter and an implicit LOD near 2.1. All 1024 pixels of each case read the level shown. "Sum" is the guest arithmetic, not a console measurement.Those bold cases are what this PR fixes. Whether Neptunia ReVerse pairs its +31.67 with a shader bias is not known.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-11-01T19:42:45Z.
Review: COMMENTED
The diagnosis and the measured table are good, and oneandonlydean's cancellation point is recorded. The remaining problem is the approach itself: this ships a result that is known to be wrong, and the description says so.
It is an approximation, and the repository rule is exact-or-throw. AGENTS.md: "if the general behaviour is unknown, throw and record it in
docs/dev/debt". Here the behaviour is known, and the PR substitutes a different one. The table shows +16 with shader bias -14 selecting level 4 on the guest arithmetic and level 3 here, and +31.67 with -29 selecting 5 and reading 0. That is a wrong mip, not a rounding difference, in exactly the case (a large sampler bias cancelled by a shader bias) that makes a title set a bias of that size. Recording it as debt does not change what the sampler returns.An exact lowering exists, and it only costs for the samplers that need it. Vulkan clamps the sum of sampler and shader bias to
maxSamplerLodBias, so passing the excess through the shader operand cannot work either, as the description says. What does work is a variant for samplers whose decoded bias exceeds the limit:mipLodBias = 0;lod = OpImageQueryLod(...).y + samplerBias + shaderBiasin full float, apply the S# min/max LOD clamp, and sample withOpImageSampleExplicitLodand theLodoperand.OpImageQueryLodreturns the implicit LOD from the quad's derivatives, so the result is the guest sum, uncapped. Only draws that bind a sampler over the limit get the variant (key it on a bit in the sampler state), so the common sampler path is unchanged and no per-draw cost is added elsewhere.If that is too large for this PR, the convention is to keep the throw (the Neptunia stop stays recorded) rather than land the clamp. If the clamp is kept, I'd ask for it to be limited to the case where it is provably exact: a shader bias that is a compile-time zero.
Smaller: #12904 pins rejecting a bias beyond the limit. Say in the description which one is expected to land, so the suite is not left asserting both.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T21:25:46Z.
Review: COMMENTED
Reviewed — no blocking findings
A guest LOD bias beyond the device limit is now clamped to the limit when the sampler is created, where the base refused it. The change matches what the agc debt entry describes. The device-limit values and the console behaviour in that entry are not verified here. The hosted Windows run passed
agc_driver_graphics, the binary that runssamplerLodBiasTests.What I ran
6834476a85042d915ec184e5e2ecf763901c48fa; basef2d874c1fdccf781c0fa5d86619bb5dd8894b958. 3 files, +26/-5:core/libs/prx/libSceAgcDriver/Graphics/src/Sampler.cpp(+ the clamp), the test inGraphics.cpp(newsamplerLodBiasTests, call at line 13228), anddocs/dev/debt/libSceAgcDriver.md.Sampler::Validatecheck (Sampler.cppline 12), and the new test's expectations:1.0,-1.0,15.0at the limit,15.0for an over-limit positive value, and-15.0for an under-limit negative value, with no leaked objects.mipLodBias(15 on an RTX 4080, 15.99 on Intel UHD 770), and that the shader bias is left unchanged. The entry says the effect on sampled levels is not measured on a console.core/libs/prxdeclares a new export; the test is internal).agc_driver_graphics(Test #1509).Results
Sampler::Validatepathstd::clampto the device limitagc_driver_graphics(hosted)samplerLodBiasTests(Graphics.cppline 13228)Commands and unedited precheck output
Commands:
python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14621 --output-dir <scratch>/precheck/14621p(report.md in that directory).git fetch https://github.com/boykopovar/AnyPS5.git pull/14621/head.gh api repos/boykopovar/AnyPS5/commits/6834476a85042d915ec184e5e2ecf763901c48fa/check-runs; Windows CTest:100% tests passed, 0 tests failed out of 39.Precheck table (unedited):
The precheck deliberately does not configure, build, or compile AnyPS5.git diff --check f2d874c1fdccf781c0fa5d86619bb5dd8894b958...6834476a85042d915ec184e5e2ecf763901c48fa/marc/DeusMachina_0x1914/.venv/bin/python3 tools/check_conventions.py --base f2d874c1fdccf781c0fa5d86619bb5dd8894b958 --head 6834476a85042d915ec184e5e2ecf763901c48fa --title fix(agc): clamp a guest LOD bias to the device limit --body /dev/shm/reviewer-run/precheck/14621p/pr-body.md/marc/DeusMachina_0x1914/.venv/bin/python3 tools/pr_abi_audit.py --base f2d874c1fdccf781c0fa5d86619bb5dd8894b958 --head 6834476a85042d915ec184e5e2ecf763901c48fa --jsonNo changed Python implementation files.No changed tools/ module has an existing sibling tools/tests/test_<module>.py suite.No changed test_*.py files./marc/DeusMachina_0x1914/.venv/bin/python3 /marc/AnyPS5/tools/pr_stack_check.py 14621 --repo boykopovar/AnyPS5 --output-dir /dev/shm/reviewer-run/precheck/14621p/stackNot run: C++ tests need exact-head binaries, which require a build; the precheck does not build./marc/DeusMachina_0x1914/.venv/bin/python3 /dev/shm/reviewer-run/precheck/14621p/head-6834476a8504-c67f1670/tools/pr_test_quality.py --root /dev/shm/reviewer-run/precheck/14621p/head-6834476a8504-c67f1670 --json core/libs/prx/libSceAgcDriver/Graphics/src/Sampler.cpp core/libs/prx/libSceAgcDriver/tests/Graphics.cpp docs/dev/debt/libSceAgcDriver.mdNo changed Python test module in tools/ can be run as a no-build base-source control.Negative control
Not run here. The test needs a build.
Findings
Blocking
None.
Non-blocking
Sources
github.com/boykopovar/AnyPS5@6834476a85/core/libs/prx/libSceAgcDriver/Graphics/src/Sampler.cppgithub.com/boykopovar/AnyPS5@6834476a85/core/libs/prx/libSceAgcDriver/tests/Graphics.cpp (L13228)github.com/boykopovar/AnyPS5@6834476a85/docs/dev/debt/libSceAgcDriver.mdNot verified
To get this to a good state
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-02T05:12:01Z.
Review: COMMENTED
Reviewed — no blocking findings
This is a re-review at the current head, which replaces the approach I reviewed at
6834476a85. Earlier, guest LOD biases beyond the device limit were clamped in the host sampler. Now biases beyond 15 keep the host sampler bias at 0 and reach the shader through a per-sampler specialization constant. Explicit LOD adds the bias before the minimum-LOD clamp. Implicit and gradient samples scale their derivatives by 2^bias, which shifts the LOD by the bias and leaves the anisotropy ratio unchanged. The checks read in this change are consistent. Two things are not verified here: the GPU execution test was Skipped in the hosted Windows run, and the argument order of the dref path was not traced.What I ran
7b03f92ac928475407ff2483bc3dfb68468a4b4b; basef2d874c1fdccf781c0fa5d86619bb5dd8894b958. 10 files, +302/-10: the sampler (Sampler.cpp,Sampler.hpp),ShaderResources.cpp,Resources.hpp(AppliesLodBiasInShader),DescriptorBindingBuilder.cpp,PipelineSpecialization.hpp(base 57600 and threshold 15.0),SpirvImageEmitter.cpp(+56),tests/Graphics.cpp(+34), the new execution testtests/execution/ImageSampleLodBiasSum.cpp(+196) and the debt line.emitBiasedSample: the explicit path adds the bias to the LOD and then applies the clamp; the implicit and gradient paths insert derivatives when none are given, scale them bypow(2, total), and emit an explicit-LOD sample. The specialization-constant branch is uniform across invocations, so the derivative operations sit in uniform control flow.PipelineSpecialization.hpp.libSceAgcDriver/CMakeLists.txt(line 556) asagc_driver_image_sample_lod_bias_sum.agc_driver_graphics(Passed). The execution testagc_driver_image_sample_lod_bias_sumwas Skipped on the Windows runner (no Vulkan device there).Results
DescriptorBindingBuilder.cppemitBiasedSampleemitSamplewas not tracedagc_driver_image_sample_lod_bias_sum(hosted)agc_driver_graphics(hosted)Read-only check output
Precheck was not run: no PR-head code is run here. Conventions: passed. Test-quality heuristic: flagged the new execution test, which the glob registers (false positive). Hosted:
gh api repos/boykopovar/AnyPS5/commits/7b03f92ac928475407ff2483bc3dfb68468a4b4b/check-runs.Negative control
Not run here. The execution test needs a Vulkan device, and code from this head is not run here.
Findings
Blocking
None.
Non-blocking
argumentsbefore scaling. Please confirm in the PR that the dref operand is not among the first two arguments for that opcode.Sources
github.com/boykopovar/AnyPS5@7b03f92ac9/core/libs/prx/libSceAgcDriver/Graphics/src/Sampler.cppgithub.com/boykopovar/AnyPS5@7b03f92ac9/core/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cppgithub.com/boykopovar/AnyPS5@7b03f92ac9/core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cppgithub.com/boykopovar/AnyPS5@7b03f92ac9/core/libs/prx/libSceAgcDriver/tests/execution/ImageSampleLodBiasSum.cppNot verified
emitSamplewas not traced.To get this to a good state
Imported from boykopovar/AnyPS5. Originally posted by BunnyFl on 2026-11-02T22:46:31Z.
Review: APPROVED
Reads right, and this fills the two gaps in MarcZX10's re-review: the GPU test on a real device, and the Dref operand order.
Dref order.
emitDirectSample(core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp) pushesdrefValueitself, right after the coordinate and before the image-operand mask. Soargumentsnever holds the depth reference, andemitBiasedSample'sbiased.front()is theLodorBiasoperand. The rewritten operands stay in mask-bit order, as the SPIR-V Image Operands rules require:Lodis first when present,Biasis removed from the front, and the addeddPdx/dPdygo to the front, sinceGradis then the lowest remaining bit, ahead of anyMinLod. An implicit compare sample becomesOpImageSampleDrefExplicitLodwithGrad, which that opcode allows. The derivatives sit inside theEmitValueIfElseon the per-sampler specialization constant, a uniform condition.Tested on Windows 11, WinLibs GCC 15.2.0, with this head merged onto current
main, on this machine's GPU:agc_driver_image_sample_lod_bias_sumandagc_driver_graphicspass, nothing skipped. The execution test is the one the hosted Windows runner skipped.CnRJay's objection was to the earlier host-sampler clamp. This head replaces it with the derivative scaling MarcZX10 describes, which gives the guest's summed bias rather than a clamped one, but CnRJay hasn't re-reviewed it yet.
Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-02T22:49:31Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
This pull request does not merge cleanly into
main(5cb015caaa): head9b752d9bf4conflicts incore/shader/recompiler/PipelineSpecialization.hppcore/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cppPlease rebase it onto current
main. I will review the change once it merges cleanly.Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-02T23:47:03Z.
Review: CHANGES_REQUESTED
Re-checked — changes still requested
Since my last review the branch was merged with
maintwice (9b752d9bf486and76d28cbd7e97). The merged tree builds and passes the mock tests and the convention checks. The new GPU execution testagc_driver_image_sample_lod_bias_sumfails on lavapipe, the device Linux CI runs Vulkan tests on. It fails at its first case, which has no S# or shader bias, and it fails the same way with the PR's production files reverted tomain.What changed since my last review
upstream/main(conflicts resolved inResources.hpp,DescriptorBindingBuilder.cpp,PipelineSpecialization.hpp,SpirvImageEmitter.cppand the debt file).SamplerLodBiasBaseis now 57664, becausemaintook 57600 forMinLodBase.EmitSampleOpnow shares itsclampLodhelper withmain's new T# MIN_LOD clamp.9b752d9bf4, and a reading of the Dref operand order, both in reply to MarcZX10. BunnyFl approved at9b752d9bf486.What I ran
Head
76d28cbd7e97edc44f2bc257671ed76c3f6a0ebe,main5cb015caaaaf83f8ee431414ee6a457b5b307d49, merged tree43e456e9a97bffb9d208f759e7a6074d99b55609. Debian 13 VM, GCC 14.2.0, lavapipe (Mesa 26.1.6, LLVM 19).git diff --checkcheck_conventions.pyagc_driver_graphics(mock, includessamplerLodBiasTests)agc_driver_image_sample_lod_bias_sumS# field 0 with shader bias 0.000000 read 120, expected level 2main's production filesagc_driver_image_sample_lod_clamp_shader_lanemain's production files, so it comes frommain(the script's baseline096c45570fpredates #12980), not this PRunwrap_self_..._destination_directory_groupos.chownEINVAL in the sandbox. This tools test is untouched by the PR, so I am not counting itVUID-lines compared withmainlavapipe output of the new test
Negative control
Sampler.hpp,Sampler.cppandShaderResources.cpprestored frommain,agc_driver_graphics_testsfails withguest sampler descriptor requests a LOD bias beyond the device limit. SosamplerLodBiasTestsdetects the change.--sampler-table-lod-bias-beyond-thresholdpasses onmain's code as well (see the non-blocking finding).Previous findings
My previous review's text is not available, so I cannot list its findings one by one. This re-check covers the whole change.
New findings
Blocking
core/libs/prx/libSceAgcDriver/tests/execution/ImageSampleLodBiasSum.cpp:174). Case{0u, 0.0f, 2u}has no S# bias and no shader bias, and lavapipe reads level 6 (red 120) in place of level 2. The result is the same with every PR production file reverted tomain, so the PR's lowering is not at fault. Either the test's LOD setup depends on the device, or lavapipe computes this shader's implicit LOD differently. CONTRIBUTING says Linux CI runs Vulkan tests on lavapipe, so this test would fail on every full Linux run. The AMD/NVIDIA runs and the author's Windows runs pass it, so it is specific to lavapipe. Suggested fix: find out why the baseline case selects level 6 on lavapipe. Candidates are derivatives across the recompiled wave64 pixel shader's quads, or the texture's mip layout. Then make the test agree with lavapipe, or, if this is a lavapipe limitation, have the test detect it and report a skip thattools/check_skips.pyaccepts.Non-blocking
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp:7276: the new sampler-table entry0x1000(+16) is rejected onmainalready, because the mock'smaxSamplerLodBiasis 0.5. The case passes withmain'sSampler.cpp/ShaderResources.cpp, so it does not test the new table check inShaderResources.cpp. RaisingmaxSamplerLodBiasabove 16 for this case would make it fail without the newRequire.core/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cpp:407adds a specialization constant for every non-table sampler with LOD uses, including in-range ones (value 0). This is correct, but it adds one more specialization entry per sampler on the common path. That cost is small and probably acceptable.Not verified
To get this to a good state
agc_driver_image_sample_lod_bias_sumpass on lavapipe, or have it report a device-limitation skip there, and say what lavapipe does differently.Imported from boykopovar/AnyPS5. Originally posted by BunnyFl on 2026-11-03T02:05:28Z.
Review: APPROVED
Re-review of
76d28cbd7e(main merged in after my approval at9b752d9bf4). I checked the conflict resolution:SamplerLodBiasBaseis now 57664 and main'sMinLodBaseis 57600 (core/shader/recompiler/PipelineSpecialization.hpp:52-53). The 64-wide range 57664-57727 overlaps no other base incore/shader/recompiler/PipelineSpecialization.hppbelowImageComponentBase(65536).clampLod(core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp:1674, used at:1687and:1766), which applies both the sampler clamp and main's view min-LOD clamp, the same as the explicit-LOD operand.Windows 11, AMD RX 9070 XT,
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1, merged onto currentmain:agc_driver_image_sample_lod_bias_sumandagc_driver_graphicspass.Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-03T19:53:02Z.
Review: DISMISSED
Re-checked — changes still requested
The only new commit is
d52b3c318487, a merge ofmain. In the PR's own change it alters one line:SamplerLodBiasBasemoves from 57664 to 57728, becausemainnow uses 57664 forVolumeGatherBase. The new GPU testagc_driver_image_sample_lod_bias_sumstill fails on lavapipe at its first, unbiased case, so my blocking finding is still open.What changed since my last review
d52b3c318487mergesupstream/main. I compared the PR's added and removed lines at76d28cbd7e97(against itsmain) with those atd52b3c318487(against the currentmain). The only difference isSamplerLodBiasBase = 57728uincore/shader/recompiler/PipelineSpecialization.hpp:54. The range diff of the three non-merge commits shows no change.VolumeGatherBase(57664–57727) and ends belowImageComponentBase(65536). OnlyDescriptorBindingBuilder.cpp:410andSpirvImageEmitter.cpp:1933use it. I found no collision.What I ran
Head
d52b3c31848750ae10c504f65e86b1924d591cea,main086c0686c8adff3ee648fdbe34e0b0b647e1d511, merged tree744f5ec39f06e1248f53ea8057f5cb639149986a. Debian 13 VM, GCC 14.2.0, lavapipe (Mesa 26.1.6, LLVM 19).git diff --checkcheck_conventions.pyagc_driver_graphics(mock)agc_driver_image_sample_lod_bias_sumS# field 0 with shader bias 0.000000 read 120, expected level 2main's production filesagc_driver_graphicswithmain's production filesguest sampler descriptor requests a LOD bias beyond the device limit(so the mock test detects the change)VUID-lines in any test that also ran onmain.agc_driver_image_gather_volumereportsVUID-VkSamplerCreateInfo-addressModeU-01079/-parameter, but it is marked "test not run on main" and came in withmain's volume-gather change, so I am not counting it against this PRmainPrevious findings
core/libs/prx/libSceAgcDriver/tests/execution/ImageSampleLodBiasSum.cpp:174). Still open. It fails the same way at this head (case{0u, 0.0f, 2u}reads red 120, which is level 6, where level 2 is expected), and again with all PR production files restored frommain. The PR's lowering is not the cause. The test's assumption about implicit LOD does not hold on lavapipe, which is the device Linux CI runs Vulkan tests on.0x1000does not test the new table check (core/libs/prx/libSceAgcDriver/tests/Graphics.cpp:7434). Still open. The test code has not changed, and the mock'smaxSamplerLodBiasis still 0.5 (Graphics.cpp:7449), soSampler::Validatealready rejects the entry onmain.core/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cpp:410). Still open. Unchanged, and acceptable.New findings
Blocking
None.
Non-blocking
None.
Not verified
76d28cbd7e97predate this merge. I had no hardware GPU.To get this to a good state
agc_driver_image_sample_lod_bias_sumpass on lavapipe, and say what lavapipe does differently for the baseline case. If that is a device limitation, have the test detect it and report a skip thattools/check_skips.pyaccepts.maxSamplerLodBiasabove 16 for the0x1000sampler-table case, so it fails without the newRequireinShaderResources.cpp.Imported from boykopovar/AnyPS5. Originally posted by BunnyFl on 2026-11-05T15:46:57Z.
Review: APPROVED
@danielhorngt re-checked at
169f433e6d.git range-difffrom76d28cbd7e, the head I approved, shows your three commits unchanged. The new commit only relaxes the per-pixel check ofagc_driver_image_sample_lod_bias_sumon llvmpipe, where the device name containsllvmpipe, to the expected level on at least three quarters of the pixels. Every other driver keeps the exact check, and no case's expected level changed.On
169f433e6dmerged ontomain78e4248fea(Windows 11, WinLibs GCC 15.2.0, Release, AMD Radeon RX 9070 XT, driver 32.0.32015.12012; the exact check applies there),ctest -VwithANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation:agc_driver_image_sample_lod_bias_sumpasses, with no missing-layer line and noVUID-message.check_conventions.pypasses.pr_overlap.py --branchfinds no shared exports; #10489, #12790, #14963 and #14964 share lines.One coordination point, not a blocker for this PR:
SamplerLodBiasBase = 57728u(core/shader/recompiler/PipelineSpecialization.hpp:54at169f433e6d) is free onmain, where the last base isVolumeGatherBase = 57664u. Two other open PRs claim the same base, though: #14964 addsHalfBorderUnnormalizedBase = 57728uat the same line, and #10489 movesFmaskFormatBaseto57728u(andVolumeGatherBaseto57856u, which #12790'sGatherLodBasealso takes). The edits touch neighbouring lines, and I expect the second to land to get a conflict there.mainhas nostatic_assertthat the 64-wide ranges don't overlap (core/shader/recompiler/PipelineSpecialization.hpp:48-53onmain): a resolution that keeps both lines would build, with two features on the same specialization IDs. I'm flagging it on #14964 as well.Approving again at
169f433e6d.AI-assisted: yes (Claude Code)