Repository navigation
fix(agc): zero-fill a vertex fetch past the record count - #2573
Merged
Merged
Conversation
9 tasks done
This was referenced Oct 10, 2026
A strided vertex fetch whose index is at or past the descriptor's num_records threw and aborted the title. PPSA01325 draws its fullscreen composite as a 4-vertex strip over a 3-record buffer, so the fourth vertex past the records stopped presentation. Hardware returns (0, 0, 0, 0) for such a fetch with OOB_SELECT 0 and 1, measured on RDNA2 gfx1036 with tools/hw-oracle in boykopovar#2241. VertexBufferReadSize now spans the whole fetch, and the staging copy reads the record bytes then zero-fills from num_records * stride onward. Each such fetch gets its own copy, outside the shared copies of its sibling attributes, the host-import in-place path and the draw-snapshot cache. OOB_SELECT 2 and 3 keep throwing past num_records, since each needs its own rule. Recorded in docs/dev/TechnicalDebt.md.
oneandonlydean
force-pushed
the
fix/carry-2241
branch
from
October 10, 2026 07:58
2ec6f10 to
5e32689
Compare
Contributor
|
Validated the carried branch on real hardware: RTX 4050 laptop, Windows, MinGW 15.2 build of 5e32689, ANYPS5_GPU=4050. agc_driver_graphics passes in about 14s, including the vertexZeroFillTests and vertexZeroFillMergeTests. AI-assisted: yes. |
Collaborator
|
Checked on current main: build + ctest for libSceAgcDriver ( Note: this conflicts with #1426 ( |
9 tasks done
12 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Carrying @danzaio's fix for #2241 while PR intake is paused. The change is theirs (from
danzaio/AnyPS5:fix/2241-oob-vertex-fetch, fd3ac4e), with its three commits squashed and rebased onto currentmain.What
A strided vertex fetch at or past the descriptor's
num_recordsnow reads(0, 0, 0, 0)forOOB_SELECT0 and 1 instead of throwing.VertexBufferReadSizespans the whole fetch. The staging copy reads the record bytes and zero-fills fromnum_records * strideonward. Each such fetch gets its own copy, outside the shared copies of its sibling attributes, the host-import in-place path and the draw-snapshot cache.OOB_SELECT2 and 3 still throw pastnum_records, since each needs its own rule. Zero-stride descriptors keep their existing checks (#1769 and the laterOOB_SELECTrules for them).Rebase note: since the branch's base,
mainadded in-place vertex reads from host imports and a zero buffer for out-of-range zero-stride fetches. The past-records fetches go alongside these, are excluded from the in-place path, and get the same per-attribute handle and offset mapping. The zero-stride byte check keepsZeroStrideAvailableBytes.Why
Fixes #2241. Astro's Playroom (PPSA01325) draws its post-process and composite passes as a 4-vertex triangle strip over a 3-record vertex buffer, and aborts:
simonbbby measured the hardware result on RDNA2 (gfx1036) with
tools/hw-oraclein the issue. WithOOB_SELECT0 or 1, indices past the records return 0 in all four components, W included, unlike Vulkan'srobustBufferAccess(0, 0, 0, 1).OOB_SELECT2 and 3 follow other rules, measured in the same thread.Tested
VertexBufferReadSizeforOOB_SELECT0 to 3,vertexZeroFillTestscovers the zero-padded copy, andvertexZeroFillMergeTestscovers the split from shared copies. simonbbby'sagc_driver_vertex_fetch_past_recordsexecution test (on their branch) also passes on the author's branch, on an RTX 4050 on Windows. It covers an in-range draw that follows a past-records draw at the same address.main092e133: the branch merges cleanly andtools/check_conventions.pypasses. CI runs the build and tests.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)