fix(agc): pair transparent-black table samplers with image numeric types #27648
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/27648"
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 Felipebmaitan on 2026-11-26T21:35:18Z.
What
Select a Vulkan transparent-black sampler according to the numeric type of the image selected by a guest sampler table. The driver keeps the four existing sampler variants and adds an integer point sampler for each eligible entry. The shader uses that descriptor when it samples an integer image. Vulkan defines the integer and floating-point border colors separately in the border replacement rules.
The driver reports an unsupported selected entry for opaque white, opaque black with its existing swizzle restriction, and entries requiring half-border or mirrored-border coordinate handling alongside Vulkan clamp-to-border. Rejected inactive entries leave the selected sample alone.
Tested
Windows 11 Pro build 26300, NVIDIA GeForce RTX 5080, driver 621.40. Ran
agc_driver_image_tablewith Vulkan required, the shader cache disabled and Khronos validation 1.4.363 active on main and the change. Both verbose logs show the layer inserted and both have zeroVUID-errors. The tests compare all four components for direct and table transparent-black sampling using floating-point and unsigned-integer views, and cover inactive and selected unsupported entries.On the same Windows bring-up checkout before and after this change, a strict replay of a 40-frame GTA VI loading capture (PPSA38500 01.002.001) completed 40 submissions with zero unfinished submissions or synthesized waits in both runs. The selected-sampler write-back error fell from one occurrence to zero. Replaying the longer transition reduced those errors from twelve to zero. Both longer runs ended at the capture boundary with 22 outstanding submissions. The first playable scene remains unverified.
Compared the open sampler and descriptor-table work, including #13928, #13929, #21776, #24793 and #26197. These address other lookup, execution-mask and border-color cases. The selected table sampler reads the existing driver status word after the upstream fault check.
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)Summary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-26T21:41:42Z.
Review: COMMENTED
Actionable comments posted: 1
44fc47e4-80b9-48d6-8355-2cb8c479d104Reviewing files that changed from the base of the PR and between
00b15fcbb0and40aa22515e.core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/tests/execution/ImageTable.cppcore/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hppcore/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cppcore/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvDescriptors.cppdocs/dev/debt/changes/fix-agc-table-sampler-border-class.mdIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-26T21:43:59Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
Changes are required before merge: avoid using rejected sampler poison codes as Vulkan descriptor indices for integer images.
What I ran
Read the prepared review description, commits, manifest and diff at head
40aa22515ebfd08db268d000b372e42cd617bacb. Read the full text of every changed file listed as reviewed exceptcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp, which was inspected through targeted ranges because it was excluded from the review folder as too large. No commands or tests were run.Results
Findings
Blocking
core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp:2599:driverFaultis assigned tointegerBorderSamplerfor every selected sampler-table entry, including entries rejected by the driver. Rejected entries store a poison code in that field;LoadSamplerDescriptortreats any nonzero value as a valid integer-border sampler index and selects it for Uint/Sint images (core/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvDescriptors.cpp:196-198). A selected rejected entry can therefore form an out-of-range sampler descriptor access despite also reporting a fault. Preserve a valid descriptor index only for a non-poison border override, or otherwise gate the override selection on a valid entry.Non-blocking
None.
Not verified
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppwas read only in targeted ranges, not in full.review/files.jsonwas not available through the reader. The manifest lists six changed files: five included and one excluded as too large. The five included files were read in full; the excluded file was inspected only around relevant code.To get this to a good state
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T21:02:27Z.
Review: COMMENTED
Could the table fixture exercise a sampler table with exactly one spare descriptor and request two transparent-black integer override records? The override index shares a word with table-fault IDs. Verifying one success, one deferred fault, and an inactive lane selecting the rejected record would cover the new capacity boundary and guard against indexing a descriptor past the allocated array.
Source review at
40aa22515e. The head trial-merges onto6ef4f2f73b. Focused Linux checks are queued.AI-assisted: yes.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.