feat(agc): support sampler border colour tables #26197
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/26197"
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 mihai1859 on 2026-11-23T12:50:53Z.
What
This carries forward YossiYad’s implementation from #6804 at Dean’s request. YossiYad remains the commit author.
For a sampler that reads a table-based border colour, the driver carries the graphics or compute table address through immediate and queued work, reads the selected floating-point entry, and creates a Vulkan custom-border sampler. Integer entries and devices without the required Vulkan feature follow the explicit unsupported paths recorded in the debt fragment.
The overlap check found shared lines with #12904, #16935, #18369, #22434, #23722, #24793, and #26084. I also compared the changed files from the 86 branches the tool could not merge into main. The border-table change is independent of those PRs.
Tested
Windows 11 x64, WinLibs GCC 16.2, NVIDIA GeForce RTX 5060 Laptop GPU (610.60), Khronos validation layer 1.4.368. Compared main
709342e209and this commit78191dd8a2.agc_driver_graphicsand the hardwareagc_driver_image_sample_border_colorpassed on both. The two new tests,agc_driver_border_color_tableandagc_driver_border_color_table_registers, also passed.VUID-validation error. Both ran withANYPS5_REQUIRE_VULKAN=1andANYPS5_NO_SHADER_CACHE=1.b16988fb8b, whose intervening changes touch none of the graphics-driver, shader-recompiler, or VideoOut paths.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 mihiii1337 on 2026-11-23T13:43:29Z.
Review: CHANGES_REQUESTED
AI-assisted review of exact head
78191dd8a2a457c2b2352e282e5dd0c9bdf98ca9.I found two correctness blockers:
SamplerCache::Getconstructs the new custom-border sampler before evicting an old cache-only entry. A native fixture using the productionSampler.cppandGuestSamplerResource.cpp(only Vulkan create/destroy callbacks were faked) simulated the Vulkan-minimum limit of 32 custom-border samplers. The 33rd sequential unique color was rejected while all prior 32 samplers were held only by the cache. The evict-before-create control accepted the 33rd color, kept 32 live, and destroyed all 34 handles at shutdown.dispatchSplitTableCallbefore the new table-base read below. ItsPrepareDispatch,DispatchIndirect, andDispatchcalls still use the defaultnullopt, so a split part that reads a table sampler reports that the base register was never written even whenCOMPUTE_BORDER_COLOR_BASEis set.Positive coverage: I built this exact head in Release and ran
BorderColorTable,BorderColorTableRegisters, andImageSampleBorderColoron both physical notebook adapters: Intel RaptorLake-S Mobile A78B (101.6127) and NVIDIA RTX 4070 Laptop 2860 (621.01). All 3/3 passed on each adapter with Khronos validation 1.4.369 inserted; no VUID, validation error, device loss, Display 4101, LiveKernelEvent, or new Defender detection appeared. The register suite's deliberate missing-base case produced the expected handled driver refusal. Hosted Windows is also green. These identity-path GPU tests do not exercise the cache-limit or split-dispatch cases above.Imported from boykopovar/AnyPS5. Originally posted by mihiii1337 on 2026-11-23T14:34:52Z.
Review: APPROVED
Re-reviewed exact head
57132013f2d9afa80088e3bea1f1883db0d145d3. Both blockers from my prior review are fixed.RunCustomBorderCacheLimitTests, productionSampler.cpp/GuestSamplerResource.cpp, and Vulkan test doubles atmaxCustomBorderColorSamplers = 32. The previous sampler path exited 1 on the 33rd unique color. This head exited 0 and covered eviction of the LRU cache-only sampler, preservation of retained and ordinary entries, the all-pinned refusal, retry after release, and zero live objects at teardown.WithBorderColorTable, and the shader-resource read path.git diff --checkpassed and no new Microsoft Defender detection was recorded. I did not run a new physical-GPU test; the author's reported RTX 5060 run is not counted as mine. Hosted jobs for this head are still queued and are not counted here. This approval is limited to the exact commit above.AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T08:23:40Z.
Review: COMMENTED
Reviewed — comments
Nothing blocks this review; the resource cache and recipe paths need to account for the per-draw table base and table contents.
What I ran
Reviewed head
57132013f2d9afa80088e3bea1f1883db0d145d3. No commands or tests were run;repo_read.pywas used to inspect the prepared diff and targeted source ranges.Results
Findings
Blocking
None.
Non-blocking
DrawFromRecipecallsDrawWithRecipeusinggraphicsContext()without applying the currentborderColorTable(VulkanDevice.cpp:5811-5812); the ordinary draw path applies it atVulkanDevice.cpp:5241. If a table-based draw has a recipe hit, the cached template can therefore bind samplers built with an earlier table base or no base, despite the changed entry being meant to take effect on the next draw. Thread the current table base through the recipe path, or disable recipe reuse for draws that read the table. The changed-line citation iscore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp:1447.Not verified
Tests were not run. The author-reported Windows hardware checks and game run were not independently verified. Read changed lines in all included changed files. The full texts of
VulkanDevice.cpp,ShaderResources.cpp, andtests/Graphics.cppwere excluded from the prepared folder; relevant ranges were read throughrepo_read.py. No other changed files were excluded.To get this to a good state
Please ensure draw recipe hits receive the current border table base (or bypass recipes for table-reading draws), then rerun the reported hardware and game checks on the new head.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T14:28:15Z.
Review: DISMISSED
Reviewed — changes requested
Changes are required before merge: handle border color tables in sampler table bindings.
What I ran
Reviewed prepared diff at head
2e4386b095d5bdffe6679a64f67a64d2f106ac32. No tests or builds were run;repo_read.pywas used to inspect targeted source ranges.Results
Findings
Blocking
addSamplerTabledecodes entries without passing a table color and then rejects any border clamp mode. Consequently, a shader using aSamplerTablebinding cannot use the feature this change adds; the entry is rejected or treated without its table value instead of sampling the table. Add table color reads and custom sampler creation to this path, or explicitly constrain the feature and description if sampler tables are unsupported. Evidence:core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp:6376andcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp:6381.Non-blocking
None.
Not verified
No tests or builds were run. The full text of
Execution/src/VulkanDevice.cpp,Graphics/src/ShaderResources.cpp, andtests/Graphics.cppwas excluded from the review folder as too large; only targeted ranges were read. The remaining changed files marked included inmanifest.jsonwere not read in full. Author-reported hardware and game runs were not independently verified.To get this to a good state
Implement table-backed border colors for sampler table bindings and add coverage for that path. Then rerun the relevant tests and build on the updated head.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-29T22:07:38Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks approval; the inspected implementation carries border-table addresses into queued draw and dispatch work, reads table-backed colors into custom Vulkan samplers, and bypasses resource reuse for builds that read the table.
What I ran
Reviewed head
4eaacfd3391b5d2a23352accf9a8a4451802aa12using the prepared description, commit list, manifest, diff, and pinned readerrepo_read.py. No build or tests were run. The description reports Windows 11 x64, WinLibs GCC 16.2, an NVIDIA RTX 5060 Laptop GPU with driver 610.60, and Vulkan validation runs; those results were not independently verified.Results
Findings
Blocking
None.
Non-blocking
None.
Sources
Behavior claims were checked against the prepared diff and source at the pinned head, including the sampler decoding and creation paths, register-base extraction, table read and reuse decision, and device feature setup.
Not verified
Builds, tests, GPU behavior, validation output, and performance were not independently run. Full text was unavailable in the review folder for
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp,core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp, andcore/libs/prx/libSceAgcDriver/tests/Graphics.cpp; changed lines and relevant source ranges were read throughrepo_read.py. The other 20 changed files were included in the review folder, but not every added line in each was inspected. The review bundle lists all 23 changed files.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-29T22:15:43Z.
Review: COMMENTED
Actionable comments posted: 2
f8decca9-c9ed-47ea-a69b-1926158c7bb8Reviewing files that changed from the base of the PR and between
bb89b8a4f5and4eaacfd339.core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hppcore/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Dispatch/Dispatch.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/Context.hppcore/libs/prx/libSceAgcDriver/Graphics/include/GuestSamplerResource.hppcore/libs/prx/libSceAgcDriver/Graphics/include/Sampler.hppcore/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hppcore/libs/prx/libSceAgcDriver/Graphics/include/State.hppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestSamplerResource.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Sampler.cppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/Graphics/src/State.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/GuestSamplerResource.cppcore/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_draw_recipe_buffers_tests.cmakecore/libs/prx/libSceAgcDriver/tests/execution/BorderColorTable.cppcore/libs/prx/libSceAgcDriver/tests/execution/BorderColorTableRegisters.cppcore/libs/prx/libSceAgcDriver/tests/execution/DrawRecipeBuffers.cppcore/libs/prx/libSceAgcDriver/tests/shaders/DrawRecipeBuffers.fragdocs/dev/debt/changes/feat-agc-border-colour-table.mdIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.