feat(agc): support dynamic texture numeric-class pairing for border sampler table entries #28090
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/28090"
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 gurtgg on 2026-11-28T13:53:47Z.
What
Unblocks
PPSA38500(#20383) entering gameplay past the configuration screen, where deferred write-back repeatedly rejectedCLAMP_TO_BORDERsampler table entries:PPSA38500:deferred write-back failed: image table: shader 0x105f8bba00 stage 2 pc 0x55c(andpc 0x318) selecting sampler table descriptor00000036 00fff000 0a500000 00000000(CLAMP_TO_BORDER,borderColorType = 0transparent black) failed withrejected by the driver: AGC graphics: a sampler table entry with a border needs dynamic texture numeric-class pairing, which is not implemented.ResourceMaterializeremitted 4VkSamplerelements per sampler table entry ({compare × point}), all hardcoded withintegerBorder = false, soShaderResources::addSamplerTablehad to reject everyVK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDERsampler table entry.ImageTableAbi::SamplerEntryElementsfrom4to5(and bumpImageTableAbi::Versionfrom4to5) to emit a fifth point-filtered integer-border variant (compare=false, point=true, integerBorder=true) at offset+4inResourceMaterializer(core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp). Using 5 elements instead of 8 avoids allocating 3 unreachableVkSamplers per entry (integer textures always use point filtering and never depth comparison) and keeps 204 unique sampler entries withinSamplerElementBudget = 1024.integerBorderintoDescriptorBinding::samplerIntegerBorderinDescriptorBindingBuilder(core/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cpp).SpirvImageEmitter(OpUDivbyImageTableAbi::SamplerEntryElementsfor sampler fault indexing) andSpirvDescriptors::LoadSamplerDescriptor(select offset+4when the pairedimage->numericClassisUintorSint).ShaderResources::addSamplerTable(core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp) to validatesamplerIntegerBorder.size() == binding.count, remove the blanketVK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDERrejection (while keepingReadsOpaqueBlackBorderand border-table descriptors rejected), passintegerBorderintoDecodeSamplerResource,SamplerCache::Get, andsamplerSources, and replace the hardcoded/ 4umap truncation check with/ SamplerEntryElements.Graphics.cpp,ShaderMemory.cpp, andtests/execution/ImageTable.cppto cover 5-element sampler table entries and verify both in-bounds texels and out-of-bounds UV border colors (0x3f800000float vs0x00000001uint/sint forOPAQUE_WHITE,0forTRANS_BLACK) across directT#/tableS#and tableT#/tableS#.Tested
PPSA38500on Windows 10 (NVIDIA GeForce GTX 1660 SUPER, driver596.36): eliminated allnumeric-class pairing/deferred write-back failedfaults on gameplay entry (0occurrences after change).agc_driver_image_table,agc_driver_nested_sampler_table,agc_driver_pointer_phi_sampler_tableon Windows 10 (NVIDIA GeForce GTX 1660 SUPER, driver596.36) withANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation(1.4.363),VK_LOADER_DEBUG=layer(withDISABLE_VULKAN_OBS_CAPTURE=1andDISABLE_RTSS_LAYER=1): all 3 passed on bothmainand this change, withInsert instance layer "VK_LAYER_KHRONOS_validation"logged,0not founderrors, and0VUID-validation errors on bothmainand this change.agc_shader_memory,agc_shader_disk_cache, andagc_driver_graphics_tests(--sampler-table-lod-bias,--sampler-table-anisotropy,--sampler-table-reduction-compare) passed.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-28T14:03:14Z.
Review: COMMENTED
ab21d663-040f-4845-8f10-a1f87660d666Reviewing files that changed from the base of the PR and between
411f71c6eaand873a5471cf.core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/tests/execution/ImageTable.cppcore/shader/recompiler/ImageTableAbi.hppcore/shader/recompiler/Optimization/include/Optimization/ResourceMaterializer.hppcore/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cppcore/shader/recompiler/Optimization/src/ResourceMaterializer.cppcore/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cppcore/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvDescriptors.cppIncluded 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-28T14:07:55Z.
Review: COMMENTED
Reviewed — no blocking findings
The inspected changes consistently add a fifth point-filtered integer-border sampler variant and select it for integer textures; the full review is incomplete because three changed files were not read.
What I ran
8192068b40dc6f89e30209d6e86221e67173a188using the prepared diff andrepo_read.py.Results
Findings
Blocking
None identified in the code inspected.
Non-blocking
None.
Not verified
Full text was read for
ImageTableAbi.hpp,DescriptorBindingBuilder.cpp, andSpirvDescriptors.cpp. Relevant ranges were read fromResourceMaterializer.cppandShaderResources.cpp; the remaining portions of those files were not reviewed. The includedImageTable.cppfile was not read.Graphics.cppandShaderMemory.cppwere excluded from the review folder and not read. I did not run tests, validate the author-reported results, or verify runtime behavior on hardware.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-01T16:37:09Z.
Review: APPROVED
Reviewed — looks good
The changed code and targeted source context at head
c81d913f4f27ef09fc3d8c7950310b5cea06507fsupport merging; I found no verified blocking defects.What I ran
Read the prepared diff and manifest, then used
repo_read.pyat the pinned head to inspect changed code and related references. No tests or builds were run.Files reviewed (10):
ShaderResources.cpp,Graphics.cpp,ShaderMemory.cpp,execution/ImageTable.cpp,ImageTableAbi.hpp,ResourceMaterializer.hpp,DescriptorBindingBuilder.cpp,ResourceMaterializer.cpp,SpirvImageEmitter.cpp, andSpirvDescriptors.cpp. Targeted ranges were read for large files.files.jsonlists no excluded changed files.Results
Negative control
Not run; no tests were executed or modified for an independent negative-control check.
Findings
Blocking
None.
Non-blocking
None.
Sources
Not verified
The author-reported game and test results were not independently verified. No runtime, hardware, or operating-system checks were run.
To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by Plyxen on 2026-12-03T06:05:58Z.
Review: APPROVED
I read the diff at
c81d913f4f. Windows 11, GCC 15.2, merged intomainatcf556db18c3together with other open PRs (so not an isolated build), withANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1andVK_LAYER_KHRONOS_validationon an RTX 5080 (621.24) and a Radeon iGPU (26.11.2).agc_shader_memory_tests,agc_driver_graphics_testsandagc_driver_image_table_tests: pass on both GPUs. The loader log shows the layer inserted and no "was not found" line, and neither run has aVUID-orSYNC-HAZARDline.main's): the first two don't compile without the new sampler fields;agc_driver_image_tablefails on both GPUs, but that tree also lacks #27947 and #28483.Not checked: a title.
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T20:46:04Z.
Review: COMMENTED
The border fixtures cover float, signed and unsigned images in separate dispatches. Could one dispatch select different image numeric classes in different groups while reusing the same table sampler entry and verify each group's border value? That would test the fifth sampler element selection within one live descriptor table.
Source review at
c81d913f4f. The head trial-merges onto700fae9438. Paired Vulkan execution is 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.