fix(shader): plan masked descriptor table offsets with addends #23778
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/23778"
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 Serph91P on 2026-11-19T16:30:16Z.
What
Preserve an outer constant addend when matching a masked runtime descriptor-table offset. The affine matcher already handles constant addends; the masked fallback previously received the entire addition and rejected the expression before planning the table. Reuse
SplitImmediateAddendfor that fallback and keep the existing table bounds and unsupported-path behavior.Synthetic cases check sampler and pointer-backed image tables, the selected records and descriptor words, and an out-of-range sampler start. This PR does not add border-color-table or presentation changes. Refs #21586; that issue remains open as the title tracker.
Overlap
main.Tested
abc3e4a692(main) andb101272a42(this PR) withctest --test-dir build -R '^agc_shader_bindless$' -Vandctest --test-dir build -R '^agc_driver_image_table_reuse_records$' -V: both tests passed on both revisions.a1c0fea96c:agc_shader_bindlessfailed onGetSamplerResource dword 0 is not a valid runtime valuefor a masked sampler offset with an outer addend. The same test passed with the patch. This is the synthetic sampler case, not the Windows title log.ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer. The hardware test loaded Khronos validation 1.4.363 on both sides and neither run reported validation warnings, errors or VUIDs. The synthetic shader test does not initialize a Vulkan instance.40206fe50dand with this PR head merged into it, with the validation layer inserted for the driver test and no VUIDs. The new sampler case failed with the planner from main.9b377461ec, testing the fix commitfc1fec142fbefore the main sync. The reported descriptor error dropped from 170 shaders to zero across both index forms, and the title began presenting. Captured frames remained black. This was not a title test on the exact PR head. No gameplay or performance claim.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)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-19T16:44:21Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this change; the reviewed code and added synthetic cases support merging.
What I ran
Reviewed head
b101272a4206ab1a3613903f71064ffde5c06af1. I read the prepared description, commit list, manifest and diff, plus targeted ranges ofResourceTracker.cpp. No tests or builds were run.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppis listed as changed but its full text was excluded from the review folder because it was too large; I did not read it through the repository reader. The code paths and behavior of those added tests are therefore not independently verified. Tests and build were not run. The author reports Linux test runs; Windows/NVIDIA and gameplay remain unverified.To get this to a good state
Nothing is required.