feat(agc): apply a T#'s MIN_LOD clamp in the shader without VK_EXT_image_view_min_lod #12662
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/12662"
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 Gonic0 on 2026-10-29T00:52:00Z.
What
MoltenVK has no
VK_EXT_image_view_min_lod. Since #130, the first T# whose MIN_LOD clamp sits above its base level throws there. ASTRO BOT (PPSA21564 01.007.000) hits this on the title screen. MoltenVK does offershaderResourceMinLod, which turns the SPIR-VMinLodoperand into Metal'smin_lod_clamp.A new target flag,
shaderImageMinLod, moves the clamp into the shader. It is set on devices that haveshaderResourceMinLod, lack the extension, and do not use graphics pipeline libraries.DescriptorBindingBuilderwrites the clamp of each direct image as a float specialization constant atMinLodBase + image. The value is relative to the view's base level and bounded by its last level.MinLodoperand, or as anFMaxon an explicit LOD that is skipped when the clamp is 0. It combines with an instruction's_clclamp.image_get_lod;APS5_NO_IMAGE_VIEW_MIN_LODdisables the extension, so devices that have it can run this lane._shader_laneentry skips when its environment does not produce that lane.ValidateShadersnow acceptsCapabilityMinLodwhen the device enablesshaderResourceMinLod. This also changes devices with the extension: graphics shaders that use an instruction_clclamp threw "unsupported device capability 42" on every device before.shaderImageMinLodwritten afterhostInterpolationFirst.maintook 51 (#13807) and 52 (#10547), and rejects 50, which several open pull requests write.The remaining gaps are recorded in
docs/dev/debt/shader.md:Tested
Machine: macOS 27.2, Apple M5 Pro, MoltenVK 1.4.2 (Vulkan SDK 1.4.363), x86_64 build under Rosetta.
Build tree: upstream
maindoes not build on macOS without the open macOS port PRs (libkernel). Builds and tests therefore ran onmainmerged with those, plus this commit. On this branch alone, the touched recompiler and libSceAgcDriver translation units compile andrequest_serializer_testspasses.agc_driver_image_sample_lod_clamp_tests: passes in the shader lane. It also has a new_shader_laneCTest entry that forces that lane withAPS5_NO_IMAGE_VIEW_MIN_LOD=1andAPS5_NO_GPL=1. It now covers:_d_cl,_cl,_d_cl_o,_land_lz;Each mutation fails it: writing 0, an absolute clamp, a truncated fractional clamp, dropping the MAX_LOD check, or an unconditional
FMaxon an explicit LOD.Other tests:
agc_driver_graphics_testsandagc_shader_disk_cache_testspass on the current head, andagc_shader_memory_testson the first commit.agc_driver_recorder_testsdid not load Vulkan here, and itsminLodTestsskips without the extension anyway.PPSA21564 01.007.000:
guest texture descriptor uses a minimum LOD clamp, which needs VK_EXT_image_view_min_lodat about 250 s.v_permlanex16_b32in a vertex shader.Not verified: a Linux build, lavapipe (no lavapipe on this Mac; the two lavapipe failures from the CI review are what
e006bc1f78addresses), and the image-view lane.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)main, which rejects 50, so this PR takes 53, the next free version. The specialization constants move toMinLodBase = 57600, aftermain'sMirrorUnnormalizedBase.🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-29T01:18:55Z.
Review: CHANGES_REQUESTED
Agreeing with @oneandonlydean's review; the points below are still open on this head:
DescriptorBindingBuilder.cpp:366-370writes the T# clamp intoMinLodBase + imageregardless of the S#. With T# MIN_LOD above S# MAX_LOD,MinLodexceedslod_max, which Vulkan leaves undefined, while the old view clamp applied after the sampler's LOD limit. The debt line indocs/dev/debt/shader.mddescribes the gap but the code accepts it: either reject that combination (throw) or reproduce the late-clamp semantics.SpirvImageEmitter.cpp: theFMaxon an explicit LOD runs before the sampler's limit too, so it has the same problem.ImageSampleLodClamp.cpp.agc_driver_image_sample_lod_clamp_testsskips unlessshaderResourceMinLodis present but never forces the no-extension lane on a device that has the extension, so CI (lavapipe) doesn't exerciseshaderImageMinLod. Please add a way to run that lane explicitly.The rest (relative clamp, base-level handling, v50 serialization,
MinLodcapability inValidateShaders) reads correctly.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T01:19:21Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
The current head does not build in the Linux Release configuration, and the fallback clamp still differs from Vulkan’s defined LOD behavior in several reachable sampling cases.
What I ran
agc_driver_image_sample_lod_clamp_tests,agc_shader_memory_tests, andagc_driver_graphics_tests.python3 tools/check_conventions.py --base upstream/main --head HEAD.git diff --check upstream/main...HEAD.git merge-tree --write-tree upstream/main HEAD.9d42922fc0d218f0bf7581e2d2a8a1955a75e730.Results
ShaderDiskCache.cpp; diagnostics belowmaine1e7de7a2f442c0e40b52c674e5f71f8ab8eb416Raw compiler diagnostic excerpt
Negative control
Not run. The build stops at the new Linux structure-size assertions before the focused test binaries can be built.
Findings
Blocking
Linux build fails on the new artifact field. The PR adds
shaderImageMinLodto bothCompiledShaderArtifactandSpirvTarget, and updates the artifact encoder, but the Linux-only size assertions remain at 288 and 552 bytes. GCC reports actual sizes of 296 and 560. Update the assertions/encoding contract as appropriate and rerun the build.Explicit LOD is clamped before sampler bias. At
EmitSampleOp, the explicit Lod operand is replaced withFMax(lod, clamp); Vulkan then addssampler.mipLodBiasto that operand before applying the LOD bounds. For example, explicit LOD 2, T# MIN_LOD 2, and S# bias -1 produce an effective LOD of 1, below the requested clamp. The guest sampler path accepts negative bias. Preserve the clamp after bias, or reject this combination, and add an explicit-LOD regression case with negative bias.T# MIN_LOD above S# MAX_LOD yields undefined shader-operand behavior. Vulkan sets
lodmin = max(sampler.minLod, shaderOp.minLod),lodmax = sampler.maxLod, and declares the result undefined whenlodmin > lodmax. The current shader path emits the T# clamp asshaderOp.minLodwithout checking the paired sampler’s maximum. The PR’s debt note acknowledges this case, but the runtime currently accepts it. Preserve the view-clamp result or reject the incompatible pair; include the no-mip-filter / maxLOD 0 case.Emulated sample paths bypass this clamp.
EmitSampleOpreturns toEmitEmulatedSamplefor emulated depth comparison and converted 11:11:10 samples before reaching the descriptor-clamp logic. That implementation fetches mip 0 for its texels. Apply the T# clamp to these emulated sample paths or reject the combination explicitly, with focused tests.The new serializer version collides with three other open PRs. This change moves request serialization from version 49 to 50, as do open #10547 (head
2b1908e3621c0e7a6e62b7f8729cda06d6c5de87), #11483 (headb81b8a12ff1e0b0ccaae3c7e11baebaac54b5e18), and #10846 (headd21510c5d279c8dd35392fa88b453c1e6b180eac), each for a different trailing field. Coordinate a merge order, declare the dependency required by the repository rules, and assign this field a unique version after rebasing onto the resultingmain.Non-blocking
Sources
9d42922fc0d218f0bf7581e2d2a8a1955a75e730: explicit LOD handling and descriptor clamp, emulated sample dispatch, mip-0 fetches, Linux size assertions, and request serializer version bump.lodmin > lodmaxcase.Not verified
To get this to a good state
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T02:57:49Z.
Review: APPROVED
Reviewed — approved
The current head resolves the blocking build and LOD-semantics findings from my previous review. I approve commit
279911dd95b25dc56cff05e7708ed103bf556446.What I ran
BUILD_TESTING=ON.agc_driver_image_sample_lod_clamp_testsand its dependencies.python3 tools/check_conventions.py --base upstream/main --head HEAD,git diff --check upstream/main...HEAD, and a merge preview against currentupstream/main.Results
request_serializerf299f5db8359900a0bbb67fe4d50ced8dd9e7b43agc_driver_image_sample_lod_clamp_shader_laneagc_driver_image_sample_lod_clampThe local GPU test runner stopped before opening Vulkan:
The author reports that the shader lane and title scenario pass on an Apple M5 Pro with MoltenVK 1.4.2. I did not independently reproduce those GPU/title results.
Negative control
Findings
Blocking
None found at this head.
The earlier Linux size-assertion failure is fixed; the focused target now builds. The descriptor binding path rejects sampler combinations where shader MinLod would differ from the view clamp, and the tests now include explicit LOD/bias, fractional clamps, cache re-specialization, and the unsupported MAX_LOD/no-mip-filter cases.
Non-blocking
mainremains at 49, so this head is valid against the current base; if another version-50 change lands first, rebase and advance the version before merging this one.Sources
All code links point to the reviewed commit
279911dd95b25dc56cff05e7708ed103bf556446.Not verified
To get to a good state
The current implementation is in good state for review. Reassign the serializer version if another version-50 change reaches
mainbefore this PR.Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-10-29T03:17:17Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
The shader-clamp lane works on an NVIDIA RTX 4070 Ti SUPER, but one new test case asks for a rounding that Vulkan leaves to the implementation. Because of it, both
agc_driver_image_sample_lod_clampand the newagc_driver_image_sample_lod_clamp_shader_lanefail on this GPU, and the first one passes onmain.What I ran
a8f8087cb5789322d750562faa66f6ba944d4b87main:3a2b91981651569163768854a1fcdc7193b6667bmain: clean (ab662524130a8d8f1aa9dd85e0ac43238aaf9203)Results
maingit diff --checkcheck_conventions.pyAll conventions checks passed.request_serializer,agc_shader_memory,agc_shader_disk_cache,agc_driver_graphicsagc_driver_image_sample_lod_clamponmainagc_driver_image_sample_lod_clampon the merged tree (image-view lane)agc_driver_image_sample_lod_clamp_shader_laneon the merged treepassed in the shader-clamp laneInsert instance layer "VK_LAYER_KHRONOS_validation"). Nowas not found but was requested by env var VK_INSTANCE_LAYERS. NoVUID-lines onmainor on the merged treeMerged tree, both entries fail on the same case
main, same machine
Negative control
On the merged tree, with the tie-free test from the diagnosis run, I restored
core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cppfromorigin/mainand rebuilt.a target with the shader clamp does not declare exactly the image's minimum LOD specialization constant.image_sample_d_cl with T# MIN_LOD 512 over BASE_LEVEL 0 ... thread 0 component 0 is 0.000000, expected 2. The image-view lane passes, as it should.The test therefore catches a missing shader clamp at run time. I restored every file afterwards.
Findings
Blocking
core/libs/prx/libSceAgcDriver/tests/execution/ImageSampleLodClamp.cpp:283,Case{0x100u, 1u, 0xfffu, 1u, -128}runsCode. Itsimage_sample_clandimage_sample_lresults use integer LODs and integer clamps, and the S# bias is -128/256 = -0.5. Every λ is therefore a half-integer. For thread 3, the explicit LOD is 0, the instruction clamp is 1 and the view clamp is 0, so λ = max(0, 1) − 0.5 = 0.5.Level()(line 98) usesceil(λ + 0.5) − 1and expects relative level 0. The Vulkan spec allows⌈d′ + 0.5⌉ − 1(preferred) or⌊d′ + 0.5⌋(alternative) forVK_SAMPLER_MIPMAP_MODE_NEAREST(Image Level(s) Selection inchapters/textures.adoc). The RTX 4070 Ti SUPER takes the alternative and returns level 1 (absolute 2). This breaksagc_driver_image_sample_lod_clamp, which passes onmain, and the new shader-lane entry. Neither failure comes from the driver code: with -96 in place of -128, both entries pass on this GPU.Fix: use a bias that keeps λ off .5 for every integer LOD and clamp, such as -96 (verified here) or -64. Alternatively, accept either level when λ is within a small epsilon of a half-integer. The fractional MIN_LOD cases look tie-free, but check them for the same pattern.
Non-blocking
preparedBindingPlan(Recompiler.cpp) already includes the T# MIN_LOD bits (dwords[1] & ~0xff) and every S# word, so a cached plan cannot reuse a stale clamp.variantId, so both target settings can share one process.toVkFilter(aniso point is NEAREST, aniso bilinear is LINEAR).shaderImageMinLodis computed after bothimageViewMinLodandgraphicsPipelineLibraryare final.Not verified
VK_EXT_image_view_min_lodnatively. I reached the shader lane only throughAPS5_NO_IMAGE_VIEW_MIN_LOD=1andAPS5_NO_GPL=1.To get this to a good state
agc_driver_image_sample_lod_clampentries pass on a non-Apple GPU.Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-10-29T03:34:16Z.
Review: APPROVED
Re-checked — approved
a2ece0bdacmoves theCodebias case off the nearest-mip rounding tie and makesLevel()reject any expected LOD that sits on a tie. Bothagc_driver_image_sample_lod_clampentries now pass on an NVIDIA RTX 4070 Ti SUPER, with no validation errors.What changed since my last review
a2ece0bdac("test(agc): keep the LOD clamp test off nearest-mip rounding ties"). It changes onlycore/libs/prx/libSceAgcDriver/tests/execution/ImageSampleLodClamp.cpp(+11/−3):Codebias case is nowCase{0x100u, 1u, 0xfffu, 1u, -96}instead of-128.Level()nowRequires that the expected LOD lies more than 1/512 from a half-integer.Check()computes the expected level only for the results a case reads, so the gradient-only runs (one result) keep their-128bias.mainmoved to3f23b35ccein the meantime, and that range touchesSpirvImageEmitter.cppanddocs/dev/debt/shader.md. The merge is still clean.What I ran
a2ece0bdac63d6e5b89af7c4bd3f0bfa32b9fb0bmain:3f23b35cce4029d1ef08cf6b69091d96b87fe462main: clean (7757d04229833176b4631d01f6cf239e3519e067). A merge preview against the newermainb433c40f2f, which landed during the run, is also clean.maingit diff --checkcheck_conventions.pyAll conventions checks passed.agc_driver_image_sample_lod_clamp(image-view lane)image sample LOD clamp tests passed in the image-view laneagc_driver_image_sample_lod_clamp_shader_laneimage sample LOD clamp tests passed in the shader-clamp laneInsert instance layer "VK_LAYER_KHRONOS_validation"in both runs. Nowas not found but was requested by env var VK_INSTANCE_LAYERS. 0VUID-linesrequest_serializer,agc_shader_memory,agc_shader_disk_cache,agc_driver_graphicsI did not rerun
mainwith the validation layer this time. The merged-tree log has noVUID-lines, so the change cannot add any, and my previous review already recorded themainbaseline.Negative control
SpirvImageEmitter.cpprestored frommain(the rest of the PR kept), both entries fail:a target with the shader clamp does not declare exactly the image's minimum LOD specialization constant.-128, both entries fail on the new guard before any GPU comparison:image sample LOD clamp: an expected LOD of 0.500000 sits on a nearest-mip rounding tie, which Vulkan leaves to the implementation. The guard therefore catches the case that failed in my last review.Restoring every production file from
mainat once does not work as a control: the test no longer compiles, becausePipelineSpecialization::MinLodBaseandSpirvTarget::shaderImageMinLodare missing. All files were restored afterwards.Previous findings
-96. With it, an explicit λ has a fractional part of .625 and the sampled λ .375, both 1/8 from a tie. Both entries pass here, and the new guard rejects the old value (control 2).mainis still at 49, so it only needs attention at rebase time.variantId, filter-bit andshaderImageMinLodordering checks): No longer applies. No production code changed.New findings
Blocking
None.
Non-blocking
ImageSampleLodClamp.cpp:182: the tie margin of 1/512 is finer than Vulkan's minimummipmapPrecisionBitsof 4. An implementation may snap λ to 1/16 steps before it selects a level, so a future case within 1/32 of a tie could still round either way. Every current case is at least 1/8 away, so nothing fails today. Consider a margin of 1/16 so the guard covers every conformant device.Not verified
a2ece0bdac), Windows and lavapipe.VK_EXT_image_view_min_lodnatively. I reached the shader lane only through the_shader_laneentry (APS5_NO_IMAGE_VIEW_MIN_LOD=1,APS5_NO_GPL=1).Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T05:26:27Z.
Review: APPROVED
Re-checked — approved
The latest change corrects the test inputs that landed on implementation-dependent nearest-mip ties. The production change is unchanged from the implementation I reviewed previously, and the author and an independent reviewer report the adjusted shader-lane test passes on this exact head.
What I ran
52c09d567dand git diff --check.Results
Negative control
Findings
No blocking issue found in this exact diff. The test now rejects expected LODs near half-integers, moves the Code case to a bias whose checked LODs are not ties, and computes expected levels only for results the case actually checks.
The console behavior and image-view lane remain unverified as recorded in the PR. The serializer-version coordination with other open PRs also remains a rebase-time integration task.
Sources
Not verified
To get this to a good state
No further change is required for the findings in this review. Rebase and resolve the serializer-version coordination if another competing version-50 PR lands first.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T08:32:48Z.
Review: CHANGES_REQUESTED
Re-reviewed exact head
a2ece0bdac63d6e5b89af7c4bd3f0bfa32b9fb0bafter the new integration comment. The reported current-main conflict incore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppreproduces in my merge preview. Please merge currentmainand retain both test changes. The request-serialization version also needs coordination with the open #10547, #11483, and #10846 work: record the agreed landing order, allocate the next unused version if needed, and update the serializer tests. The earlier shader-lane evidence remains useful, but I cannot keep approval while these integration points are unresolved. I did not run GPU tests locally.Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-10-29T15:48:31Z.
Review: APPROVED
Re-checked — approved
9d6ffe5ed2merges currentmaininto the branch and resolves theShaderMemory.cppconflict without changing any other line of the PR. The merged tree builds, and the LOD clamp lanes and the serializer and shader-memory tests pass on an NVIDIA RTX 4070 Ti SUPER with no validation errors.What changed since my last review
9d6ffe5ed2ofmainatbb04a4f1ea. It has no new PR-authored code.a2ece0bdacagainst3a2b919816) with its diff after the merge (9d6ffe5ed2againstbb04a4f1ea). The only difference is the conflict region incore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp. That region now holdsmain's color target blend checks (ShaderMemory.cpp:6688-6696), followed by the PR's existing edit to the version 43 fixture line (ShaderMemory.cpp:6697). This confirms the author's statement that nothing else changed.mainstill writes 49.What I ran
9d6ffe5ed273dec63d7ae5fceaea4f52fb747eb6main:bb04a4f1ea0175e9e4f149f0359a764d62ff3296(the merge base, so the head already containsmain)main: clean (a48d686bf5d47c199af6789f0467134a5fb8bd55, same tree as the head)Results
maingit diff --checkcheck_conventions.pyAll conventions checks passed.agc_driver_image_sample_lod_clamp(image-view lane)agc_driver_image_sample_lod_clamp_shader_laneInsert instance layer "VK_LAYER_KHRONOS_validation"in both runs. Nowas not found but was requested by env var VK_INSTANCE_LAYERS. 0VUID-linesrequest_serializer,agc_shader_memory,agc_shader_disk_cache,agc_driver_graphicsagc_shader_memory_testsentries (agc_shader_bindless,agc_shader_selected_records_*,agc_shader_result_memo_budget*,agc_shader_layout_pair*, …)LOD clamp run excerpt
I did not rerun
mainwith the validation layer. The merged-tree log has noVUID-lines, so the change cannot add any, and my first review recorded themainbaseline.Negative control
The merge only touched the serialization checks in
ShaderMemory.cpp, so I tested them. Withcore/shader/recompiler/ControlFlow/src/RequestSerializer.cpprestored frommainand the rest of the merged tree kept,agc_shader_memoryfails withnew requests did not use serialization version 50. After I restored the file, it passes again.Previous findings
mainwrites 49, so 50 is correct as long as this PR lands first.ImageSampleLodClamp.cpp:182is finer than the minimummipmapPrecisionBitsof 4: Still open, unchanged and not addressed in the reply. Every current case is at least 1/8 from a tie, so nothing fails today. A 1/16 margin would make the guard hold on any conformant device.maininShaderMemory.cpp: Resolved. The merge is clean, and both sides' checks are kept and pass.New findings
Blocking
None.
Non-blocking
None.
Not verified
request_serializer_testsand theagc_shader_memory_testsentries on this merge), Windows and lavapipe.VK_EXT_image_view_min_lodnatively. I reached the shader lane only through the_shader_laneentry.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T21:29:40Z.
Review: CHANGES_REQUESTED
Re-checked — new head, changes requested
The merge onto
951f374c87adds useful Mac/MoltenVK results, but livemainhas since changedShaderMemory.cpp, and request format 50 is also used by the still-open #10846.What I ran
Reviewed exact PR head
3584348ef95fab99be2788113fd221d03ee7d719against livemainfc9240dbc5dc89a6b17a739703e00d26318c7716on Linux x86-64 using Git and GitHub CLI. The merge preview is clean. I rangit diff --checkand the repository convention checker; I did not build or run shader/GPU tests locally.Results
main1ebc94351dc51486573fb0cf091a3de578282030git diff --checkcheck_conventions.py951f374c87, livemainadded a guarded nested-pointer regression in the sameShaderMemory.cppthis PR changes3584348ef9,request_serializer_testsand 20agc_shader_memory_testsentries pass on macOS under Rosetta; the comment also reports conventions passingUnedited local output
git diff --checkproduced no output and exited successfully.Findings
Blocking
mainin a changed test file. Head3584348ef9incorporates951f374c87; currentmainfc9240dbc5adds a guarded nested-pointer test incore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp, which this PR also changes. The merge preview is clean, but the report does not cover the merged test file. Please update onto livemain, keep both changes, and rerunagc_shader_memory_testsplusrequest_serializer_testson the resulting exact head.Non-blocking
Sources
fc9240dbc5dc89a6b17a739703e00d26318c7716ShaderMemory.cppchange atfc9240dbc5dc89a6b17a739703e00d26318c77163584348ef95fab99be2788113fd221d03ee7d719c21a1ee10cdd902758c36e8b13f99c6acc84b604Not verified
I did not build the current-main merge, rerun the focused tests or mutations, run on Linux, validate the image-view lane, or reproduce the MoltenVK title result. The current macOS relinker jobs are pending.
To get this to a good state
Integrate live
main, preserve the new upstream test, resolve the request-format landing order, and rerun the focused serializer and shader-memory tests. I will recheck the same commands and exact head after that update.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T21:36:46Z.
Review: CHANGES_REQUESTED
Re-checked — new head, changes requested
The updated head now includes current
mainand the author reports rerunning the focused tests, but its checklist still leaves the overlapping serializer-version PR unordered.What I ran
Reviewed head
34eccba19d22a88a224c891e6b9d151e21afd682, based on currentmainfc9240dbc5dc89a6b17a739703e00d26318c7716. The merge preview is clean. I inspected the 27-lineShaderMemory.cppaddition, current checklist, latest author report, and hosted check statuses. No local build or tests were run.Results
mainrequest_serializer_testsand 20agc_shader_memory_testsentries pass on this merged head (Apple M5 Pro, macOS 27.2, x86-64 under Rosetta); not independently rerunUnedited local command output
Findings
Blocking
Depends on: none, while this PR and open #10846 both change the request serialization version from 49 to 50. The checklist's “whichever lands second moves to 51” is a contingency, not an agreed landing order. The repository asks authors of overlapping PRs to agree which lands first and record the dependency. Please coordinate with #10846's author, name the first PR, and update this checklist toDepends on: #Nas appropriate. See the contribution rule at the reviewed main commit.Non-blocking
Not verified
I did not build locally or independently rerun the focused tests. The four hosted checks listed above were still pending; Linux and specialized jobs were skipped.
To get this to a good state
Please agree and record the serializer-version landing order with #10846, then ensure the pending checks complete. I will recheck the same paths and checks on the resulting head.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-30T05:58:30Z.
Review: APPROVED
Re-checked — new head, looks good
The refreshed branch resolves the current-main merge conflicts while preserving the shader MIN_LOD change, and the reviewed implementation and reported focused tests show no remaining blocker.
What I ran
Reviewed exact head
242aacc3c1e3ee30c9e9a420ec0c3d90565f7a88against currentmain88e2d98f49c949380b45c9cfa266687e28d4443c; the merge preview is clean (fd03fbef49171bdc713628561673471ab323b137). Environment: Linux x86-64. No local build or tests were run.Results
All conventions checks passed.fd03fbef49171bdc713628561673471ab323b137request_serializerandagc_shader_memorytests passed on Apple M5 Pro/macOS 27.2 under x86-64 Rosetta; I did not independently run themFindings
Blocking
None found in the reviewed head. The prior merge-conflict blocker is resolved, and the current-main merge is clean.
Non-blocking
The focused macOS test results are author-reported. I did not independently run a local build, CTest, GPU test, console run, or other-OS validation.
Sources
Not verified
No local build or tests were run. Linux product and specialized hosted jobs are skipped. No console behavior or game-level output was verified.
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-30T15:38:49Z.
Review: CHANGES_REQUESTED
The full Build for this head (run 41071165756,
linuxjob on CI's lavapipe: llvmpipe LLVM 20.1.2, graphics pipeline libraries on, noVK_EXT_image_view_min_lod) fails two tests thatmainpasses:agc_driver_image_sample_lod_clamp_shader_lane:image_sample_d_cl with T# MIN_LOD 512 over BASE_LEVEL 0 with S# MAX_LOD 4095, mip filter 1 and LOD bias -256: thread 0 component 0 is 1.000000, expected 2. The gradient case with a negative S# bias gives a different level on llvmpipe than on MoltenVK and NVIDIA. Either the shader must not depend on how the driver ordersMinLodand the sampler bias (reject or reproduce that combination), or the case must stay off it.agc_driver_image_sample_lod_clamp(default lane): the device hasshaderResourceMinLodsoImageSampleLodClamp.cpp:281does not skip, but with pipeline libraries and no extension neither lane exists and the first clamped descriptor throwsguest texture descriptor uses a minimum LOD clamp, which needs VK_EXT_image_view_min_lod, or shaderResourceMinLod without graphics pipeline libraries. The test should skip (exit 77, with a reason matchingcheck_skips.py) when!shaderImageMinLodand the view clamp is unavailable, and the shader-lane entry should skip likewise if the forced environment doesn't produce that lane.Please rerun both entries on lavapipe (
ANYPS5_REQUIRE_VULKAN=1, no shader cache) before pushing again.Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-31T03:19:03Z.
Review: COMMENTED
Linux lavapipe run of head
22cc617ebe:agc_driver_image_sample_lod_clamp_shader_lanestill fails, on two S# bias cases that22cc617ebeleft in the shader lane. Thelinuxjob is skipped for this head, so CI hasn't shown it. adriadam10's report one006bc1f78named the -256 case; the test stops at its first failure, so later cases didn't show there.Setup: i7-8700, Ubuntu 26.04, GCC 15.2, Release. lavapipe (Mesa 26.0.3, LLVM 21.1.8) has
shaderResourceMinLodand graphics pipeline libraries, but noVK_EXT_image_view_min_lod, like CI's.ANYPS5_NO_SHADER_CACHE=1. Runs on the head alone, and on the head merged--no-ffontomain2a1ae91175, 3 runs each, with the same result.agc_driver_image_sample_lod_clamp: skipped (no extension, GPL on), as intended.agc_driver_image_sample_lod_clamp_shader_lane: fails 3/3:With that case moved under
!shaderClamp, the next one fails 3/3:Cause. Both results match the llvmpipe order that the debt entry now describes: llvmpipe adds the S# bias after the
MinLodclamp. Here the clamp is the instruction's own_cloperand. In the second case the T# clamp is 0, so the shader clamp has no effect: theimage_sample_d_clresult depends only on how the driver orders the_clclamp and the bias. On lavapipe the image-view lane is skipped, so the shader lane is the only entry that runs these cases.!shaderClampin22cc617ebe.Codecase with bias -96 passes.Change I checked: run these two cases only when
!shaderClamp, like the -256 one:With it, the shader-lane entry passes 3/3 on lavapipe (head merged onto
main2a1ae91175). This drops the shader-lane coverage of those two biases on MoltenVK and NVIDIA. If you want to keep it there, the cases need inputs where the_clclamp doesn't bind under a bias. I didn't try that.GPUs tested: lavapipe (Mesa 26.0.3, Linux).
Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-31T04:38:50Z.
Review: COMMENTED
Re-run of head
bb9fae9d5dmerged ontomain0835ec8bdcon lavapipe, the device where the two bias cases failed: fixed.agc_driver_image_sample_lod_clamp_shader_lane: passes 3/3 with VVL 1.4.341 and 1/1 with no layer, noVUID-lines.agc_driver_image_sample_lod_clampstill skips (noVK_EXT_image_view_min_lod, GPL on), as intended.agc_shader_memory,agc_driver_graphics,agc_driver_graphics_maps_fallback,request_serializer) pass 3/3.The test change in
bb9fae9d5dis the same as the one I checked, so the red run is the one from my earlier review on22cc617ebe.GPUs tested: lavapipe (Mesa 26.0.3, LLVM 21.1.8, Linux).
Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-31T06:51:13Z.
Review: COMMENTED
Re-checked — new head, baseline evidence still needed
The new lavapipe report says the shader-lane test passes on
bb9fae9d5d8b0b8024c34840bb4c40e68530eed2, but the required matched run against currentmainis not documented and Linux CI is skipped.Please run
agc_driver_image_sample_lod_clampandagc_driver_image_sample_lod_clamp_shader_laneon currentmain(ddd99fdadb399867211fc1c33fed62e5a4b73d9f) and this PR head on the same lavapipe machine, withANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1, andVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation. Include the exact commands and logs, confirm the requested validation layer was loaded, and compare the logs for newVUID-errors. I have not built or run these GPU tests locally.Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-02T19:12:10Z.
Review: APPROVED
Re-checked — approved
The branch is now one squashed commit (
fe18496c95) on currentmain. It moves request serialization to version 53 and the specialization IDs toMinLodBase = 57600. It no longer rejects an S# bias on implicit or gradient samples, recorded as debt, and it skips on devices that have neither lane. On lavapipe the shader lane passes with no validation errors, and the negative control fails.What changed since my last review
main0278ca9831. Compared with9d6ffe5ed2, these are the changes:hostInterpolationFirst.mainalready writes 52 and rejects 50, so the version-50 plan no longer applies.RequestSerializerTestscovers the version 53 field both ways and reads 52 as false. It also moves every tail offset by one.MinLodBaseis 57600. That is directly afterMirrorUnnormalizedBase(57536, which takes up to 32 samplers).MinLodBase+ 64 images stays belowImageComponentBase(65536), so the IDs don't overlap.22cc617ebe/bb9fae9d5dfrom the discussion. Only the bias on an explicit LOD is rejected (DescriptorBindingBuilder.cpp:228). The llvmpipe ordering difference is now recorded indocs/dev/debt/shader.md. The three gradient and implicit bias cases that fail on llvmpipe run only in the image-view lane (ImageSampleLodClamp.cpp:305-307)._shader_laneentry exits 77 when the forced environment doesn't produce the shader lane (ImageSampleLodClamp.cpp:294-301).Depends on: none, version 53.What I ran
Head
fe18496c95ae0b0f03c6956b8b77649c679314f0,maina4eca2a056bf3bbbec98ab42e9d28163e4ea9cb8, merged treee1be4dac1100e7bdaa6b503e2a400b0356ad6b9f. Debian 13 VM, GCC 14.2.0, Release, lavapipe (Mesa 26.1.6, LLVM 19): noVK_EXT_image_view_min_lod, graphics pipeline libraries on.git diff --checkcheck_conventions.pyAll conventions checks passed.mainfailures, and 2main_sync_renames_*tests that fail onmainnow pass.agc_driver_image_sample_lod_clamp_shader_laneimage sample LOD clamp tests passed in the shader-clamp laneagc_driver_image_sample_lod_clampskipped, the device has no VK_EXT_image_view_min_lod, and graphics pipeline libraries keep T# minimum LODs out of the shader.check_skips.pyaccepts it.request_serializer,agc_shader_memory,agc_shader_disk_cache,agc_driver_graphicsInsert instance layer "VK_LAYER_KHRONOS_validation"in both tests. Nowas not found but was requested, 0VUID-lines.git status --porcelainemptyNegative control
I restored
SpirvImageEmitter.cppfrommainand kept the rest of the merged tree, which leaves the target flag and the specialization values without the shader clamp.agc_driver_image_sample_lod_clamp_shader_lanethen fails witha target with the shader clamp does not declare exactly the image's minimum LOD specialization constant. With the merged file restored, it passes again.Previous findings
mainnow writes 52 and rejects 50, and this PR takes 53, the next free number (RequestSerializer.cpp,WriteU32(53u), and theversion >= 53uread).request_serializerandagc_shader_memorypass.ImageSampleLodClamp.cpp:190is finer than the minimummipmapPrecisionBitsof 4: still open, non-blocking. The code is unchanged. Every current case still sits at least 1/8 away from a tie, so nothing fails today. A 1/16 margin would hold on any conformant device.New findings
Blocking
None.
Non-blocking
None. The S# bias on implicit and gradient samples (
DescriptorBindingBuilder.cpp:228rejects only explicit LODs) follows the Vulkan order: the sampler bias comes first, then theMinLodandmaxLodclamp. llvmpipe differs from that order, and the debt entry records it. On lavapipe the bias cases that depend on this run only in the image-view lane, so CI does not depend on llvmpipe's ordering.Not verified
VK_EXT_image_view_min_lod, soagc_driver_image_sample_lod_clampskipped. The RADV and NVIDIA reports in the discussion cover that lane.main: the script's baseline has no validation run yet, and the shader-lane test does not exist onmain. The merged-tree run has noVUID-lines.agc_driver_graphicstook 34.7 s here, running in parallel with other tests. This PR only adds one small capability-validation block to that test (Graphics.cpp). The NVIDIA report from the discussion lists the same test at about 30 s, so I don't count the time against this PR, but I did not time it onmain.