fix(agc): handle typed vertex descriptors that always fetch zeros #19065
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/19065"
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 JJenkx on 2026-11-12T18:26:50Z.
What
Typed vertex descriptors that always read zeros could throw or fetch stored data, including a null base that needs no memory access. This implements the constant-zero range cases for strided
OOB_SELECT2 (NUM_RECORDS == 0) and 3 (fewer records than the typed fetch bytes), and allows a null or unaligned address only when the fetch is provably zero.The host binding uses stride 0 and a four-component 32-bit format of the shader input's numeric class. That preserves zero W for narrow guest formats, instead of acquiring Vulkan's default W of 1. Component selectors still apply. Layout-cache comparisons and draw-recipe proofs account for transitions between live and constant-zero bindings; retained layouts are never mutated. The range helpers return the constant binding's size. Mixed in-range/out-of-range zero-stride select-1 fetches retain their documented limitation; gfx1013 remains unmeasured.
The range semantics follow the external RX 6700 XT (gfx1031) raw-ISA measurements in #8299 and the related #2241 investigation. This PR does not claim a new console/gfx1013 hardware measurement.
Tested
Fresh matched Linux validation, 2026-11-20: main
0af6acc89ea28aabf48733f41624c55ef8413d47plus the exact five fixture files (private controla50678b6f5f29c101f6e9357b59a40f8a0ca594e) versus main plus the existing PR (private integration80043105562261b3203ef35a2928469baa2aa69f). Public reviewed headb63c571b544d0d0a887f7493b2a14c7f98fca090is unchanged. Both private source trees reconstruct exactly from public main and the attached patches/tree hashes; all 74 added/removed production lines match the reviewed public patch.Both full SDK/relinker/fixture builds pass, with source/configuration/submodules restored. Same seven focused CTest cases: main plus fixtures: 3 passes / 4 expected failures; change: 7 passes. The two CPU failures reach the intended select-2/select-3 record-count refusals; the two GPU range modes fail at the corresponding unsupported fetches, rather than loader errors. This is a negative control, not a passing main suite.
Each of the four device-backed cases per arm independently selects the AMD Radeon RX 6650 XT / RADV and inserts Khronos validation 1.4.363 (compiled Vulkan-Headers version 335). Zero skips, missing layers or
VUID-errors. Exact settings includeANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer; direct fixtures use the frozen raw SDK first, and bank hashes remain unchanged.Current-main build, verbose CPU/GPU results, source patches and manifests, 220,779 bytes, SHA-256
396561a100bf33205ea5b466ef17843f9cdd1ea6a4917ebc03cc6b895c45491e. Downloaded archive and all 50 payload hashes verified. No new game, FPS, Windows, macOS or console/gfx1013 result is claimed; earlier independent reports retain their original scope.Current-main refresh, 2026-11-15: rebased without merge commits onto main
2d74858c14c4, new headb63c571b544d. The sole conflict was the already-coordinated #18287 fixture tail: retain main'sThreadVertexPlanScratchlifetime assertion alongside this PR's shared-pointer diagnostics call. All 74 added/removed production lines are identical to the former public patch; move the unchanged debt entry into the required fragment.Fresh matched Linux qualification on RX 6650 XT / RADV Mesa 26.2.7, kernel 7.2.14-arch1-1, validation 1.4.363: main plus exact fixtures (
8fb51eebe3ff) has 3 passes / 4 expected failures; this head has 7 passes. Same three CPU/mock cases and four physical-GPU cases, including both 109-positive/two-negative range modes and native multisample input. Each arm records four device selections and validation-layer insertions, zero skips and zero VUIDs, withANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layerandctest -V.Both full SDK/relinker builds pass; both 836-file frozen banks remain unchanged after tests. Conventions pass. Clean merge-tree against later main
e34613c7767cis compatibility evidence only; that later tree was not executed. No new Windows, console/gfx1013 or title/FPS claim.Evidenced source refresh, full verbose tests, build logs and manifests, SHA-256
d1e1f1715a323bf4b947a0f8f181c22db8dc02e8816e31d6c5c1671f00ab5c2f; downloaded archive and all 33 members verified.Independent NVIDIA report: @Doorriiaann's run on RTX 3070 (8 GB), driver 610.57.04, Debian 13, validation 1.4.335: this PR at
f9d5e37898passes all nine selected cases three times, including both 109-range vertex checks; the merge-based4d6b64710with matched fixtures reproduces the four expected failures three times. The report records no VUID or missing-layer lines. These are the contributor's measurements, not a local rerun.Linux, GCC 16 Release, RX 6650 XT / RADV Mesa 26.2.6. Matched frozen qualification: upstream main
d4d6b6471013c5b43d68102b79547f7b0a98d4f2plus only the identical fixture sources (a757f20e9d9dbc629060275dcd2d22e299b29e41), againstf9d5e3789876c5da6c328b5cf3bf88bacd6cdadd. Main: 3 pass / 4 expected failures (vertex fetch exceeds descriptor record count); change: 7 pass. Both: 0 skipped, 0 VUID errors. Each of the four physical Vulkan cases in each arm records insertion of validation 1.4.363; the other three are CPU/mock cases. Frozen provider banks and fixture binaries were unchanged after both runs. The full SDK libraries and relinker built in both arms. Conventions pass, and a merge-tree check is clean against newer mainb2986bd1ced27f6b7eac3854a221f2406158be29. Windows runtime testing was not performed.Same seven focused cases on main with matched fixtures and on this change,
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer, validation layer 1.4.363. New execution cases check the shader-written words for all four components: per-vertex and per-instance input; direct and indirect draws; float, narrow, RGB, unsigned and signed formats; null/unaligned zero addresses; selectors 0/1; large first indices; live→zero→live layout transitions; and refusal of in-range null addresses. Each range mode runs 109 positive checks and two negative-address checks. The plan-verification mode repeats them withAPS5_VERIFY_DRAW_PLAN=1.The existing 20 zero-stride cases, CPU graphics/input/validation cases and native multisample vertex-input case are included. The multisample positive fixture now supplies 48 records for its three 16-byte elements instead of a select-3 range shorter than one element. The argument block is aligned at runtime inside a larger 4 KiB-aligned static array for MinGW portability.
Overlap with #9915 is coordinated in that thread. Its nonzero strided fetches past the record count are a separate case; this PR works on main without it. The additional rejection assertions in #9915 need to become positive zero-value coverage when combined with this implementation. #9604 changes diagnostics. No new public export is introduced. The official scan covered 1,718 open PRs. I manually compared all 61 reported shared-file branches at verified heads; no duplicate zero-fetch implementation was found. #18287 has one fixture-tail conflict: retain its scratch-lifetime assertion alongside this fixture's shared-pointer device call and
--rangesmode. Its scratch-backedzeroedvector and this early zero-binding path are compatible in scope; neither PR requires the other. #9875 changes nonzero copy windows; keep the zero path ahead of guest-copy planning when combining. The device-heap branches (#7642, #9508, #10193, #13928 and #13929) useDrawVertexAttributes(shader); their eventual composition must use that same live accessor for the new recipe proof. This is a static overlap review; these combinations have not all been built or GPU-tested.Qualification logs, exact commands, source patch, frozen-bank manifests and full overlap review — SHA-256
774428191afe79a895bfae9dcc513a1f3c72dd0cd856913284eee2ded8c801c6. The downloaded artifact and all 38 members were verified against the upload. No game assets, executables or saves are included. No FPS or native title-unblock 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-19T06:15:38Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the points below are optional.
What I ran
Reviewed head
b63c571b544d0d0a887f7493b2a14c7f98fca090using the pinnedrepo_read.pyreader. No commands or tests were run locally. The qualification results in the PR description are author supplied.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The full
core/libs/prx/libSceAgcDriver/tests/Graphics.cppwas excluded as too large; only the changed hunk was read through the reader. No build, test, Windows, console, or gfx1013 run was performed here. The remaining changed files were read:VertexInput.hpp,Draw.cpp,tests/VertexInput.cpp,tests/cmake/agc_driver_zero_stride_vertex_fetch_tests.cmake,tests/execution/SampleMultisampleTarget.cpp,tests/execution/ZeroStrideVertexFetch.cpp, and the new debt entry. The PR description, commits, manifest, and prepared diff were also read.files.jsonwas not available through the reader.To get this to a good state
Nothing is required. Optional: run the focused tests and builds on the new head; the author reports existing Linux and NVIDIA qualification.