Repository navigation
fix(agc): apply GE_INDX_OFFSET as the base vertex of direct indexed draws - #176
Merged
boykopovar merged 1 commit intoSep 30, 2026
Conversation
…raws The GE adds GE_INDX_OFFSET to every index it fetches. The driver applied it to auto draws only, so DRAW_INDEX_2 and DRAW_INDEX_OFFSET_2 fetched from vertex 0 whatever the register held. Both packets now take it as their base vertex, and like an auto draw they refuse a queue state without the register (its reset value, 0, is part of the initial state).
oneandonlydean
added a commit
to oneandonlydean/AnyPS5
that referenced
this pull request
Oct 1, 2026
…opovar#208 test layout, our merged PRs) into astrobot Conflicts resolved: - Driver.cpp: upstream split it into Execution/src/Driver/*; astrobot's driver changes are ported into the split files (flip throttle APS5_MAX_QUEUED_FLIPS, dispatch tolerance, NoteProgram, metadata-pass switch and DB HTILE blits, depth state in the draw register key, HTILE fill clears, wait outcome counters, opt-in deferred EOP interrupts). boykopovar#192's KnownDrawRejection is taken. - Our merged PRs take upstream's reviewed versions: boykopovar#124 shader fusion, boykopovar#128 videoout open param, boykopovar#132 CB metadata passes, boykopovar#138 EOP events, boykopovar#176 GE_INDX_OFFSET, boykopovar#136/boykopovar#137 pixel inputs and NoPerspective by I/J pair, boykopovar#133 mesh tests. boykopovar#142's interpolation validation is upstream's. - Depth: astrobot's DepthTarget model stays; upstream's DepthSurface module is dropped again, boykopovar#188's 16-bit depth-bit reads are kept on top. - Videodec2: upstream's ffmpeg-core version (boykopovar#42 rework); 3rdparty/FFmpeg stays for libSceAvPlayer only. - Tests follow boykopovar#208's layout (add_test_executable, build/tests); the AvPlayer, GDS and wave tests are defined the same way. - Shader disk cache format 5 and request serialization version 7 cover both sides' fields. - Duplicates the auto-merge produced (state decoders, RequestInputInfo, structurizer helpers, image offsets, opcode enum, tests) are removed.
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.
What
The GE adds
GE_INDX_OFFSET(user config register 0x24a) to every index it fetches.Pm4::ResolveDrawapplied it toDRAW_INDEX_AUTOonly, soDRAW_INDEX_2andDRAW_INDEX_OFFSET_2always fetched from vertex 0, whatever the register held.Both indexed packets now return the register as the draw's
firstVertex, whichDraw.cppalready passes tovkCmdDrawIndexedas the vertex offset and adds to the vertex range it copies. Like an auto draw, an indexed draw now throws when the queue state has noGE_INDX_OFFSET;QueueStatestarts with it at its reset value, 0, so this only fires on a state that dropped it.On main's mesh path, an indexed draw with a nonzero offset now reaches the existing "mesh draw offsets are unsupported" check instead of drawing without the offset (#133 lifts that check).
In PPSA21564 the title's star field shares one vertex buffer between layers and sets
GE_INDX_OFFSET(0xd4d4, 0x11354) for the two layers that start past vertex 65535. Without the offset those layers drew other layers' stars.Tested
agc_driver_pm4(testIndexedDraw) resolvesDRAW_INDEX_OFFSET_2andDRAW_INDEX_2with the register at 0 and at 0xd4d4 and checks the base vertex, and checks that a state without the register throws. On main it fails with "DRAW_INDEX_OFFSET_2 ignored GE_INDX_OFFSET".ctest: 64/64 pass.agc_driver_recorder_testspasses.agc_driver_graphics_testspasses on a throwaway merge with test(agc): link agc_driver_graphics_tests again, run it under ctest and bring its stale expectations up to date #113 (which links it again).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