AGC: an indirect indexed draw binds its whole INDEX_BUFFER_SIZE range, so Guardians of the Galaxy (PPSA01748) stops when the title declares 0x10000000 indices over a 54 MiB buffer ("guest memory is not readable") #6526
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 Tamalero on 2026-10-15T18:46:39Z.
Guardians of the Galaxy stops during its first level load, with music already playing. It issues a
DRAW_INDEX_INDIRECT_MULTIafter settingINDEX_BUFFER_SIZEto0x10000000(16-bit indices, so 512 MiB). For indirect indexed draws,resolveIndirectDrawbinds that whole declared range andCheckRangerequires all of it to be readable. Only the first ~54 MiB behind the index base is mapped, so the draw fails:Title: Marvel's Guardians of the Galaxy (PPSA01748 v01.006.000)
Where it stops: the level-1 load, a few minutes after START GAME, on main
03c4cb5e7plus #6232. #6232 is needed to get past the #6191 stop, which comes earlier on plainmain. Linux, RTX 4090. 5 of 5 runs, at the same range each time; the first unreadable page is0x386590000(once0x3865a0000).What the draw is
A local print before the
CheckRangeinresolveIndirectDraw(not pushed):A native stack from the throw:
Driver::draw→Pm4::ResolveDraw(the indirect branch, inlined) →GuestMemory::CheckRange→require.So the 512 MiB is not a size the title reads. It's the declared upper bound, which the CP uses to clamp
firstIndex + indexCountper record. The 144 records, 20 bytes each, are the usual (count, instances, first index, base vertex, first instance) and select ranges inside it. On the console, index fetches past those ranges never happen, so the unmapped tail doesn't matter. Here the driver needs the tail to be readable because it binds the declared range as the index buffer (Pm4.cpp: "the declared range is the hardware's view of the index buffer, so that is what gets bound").Possible directions (not tried)
INDEX_BUFFER_SIZE, when the records are CPU-visible at packet time. That doesn't work if the GPU writes the records, which is usual for indirect draws, so the first option looks safer.I haven't picked one or written a fix. I can run either on the title the same day.
Details
--to-intelby the relinker at03c4cb5e7. No local patches except the two diagnostic prints above, which were added for the last run only.DRAW_INDEX_2/DRAW_INDEX_OFFSET_2) checkscount × index sizeand isn't involved here. The print on that path never fired.Tested and written by Claude (AI assistant) on a contributor's machine.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-15T21:23:27Z.
I traced the suggested readable-prefix approach through current
main(e16b2bc). Cappingdraw.indexCountinPm4::resolveIndirectDrawwould avoid the initial full-range check, butDraw.cppthen uses that count to validate and prepare the index input, while the GPU multi-draw path submits the guest indirect records without applying that cap to each record. Since the records can be GPU-written, a generic fix needs to preserve the valid prefix without letting a record fetch beyond it or copying/scanning the entire declared range. I have not found a safe implementation yet, so I have not opened a PR. The title repro remains a useful target for validating a bounded design.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T00:30:08Z.
Update to my earlier note that I had not found a safe generic design: PR #6606 now implements a focused fallback for indexed indirect draws whose declared index range is not fully readable. It preserves the original declared limit, reads the indirect records through the checked CPU path, and validates/prepares only the index ranges each record actually selects; fully readable buffers keep the existing GPU path. The PR reports focused regression coverage for holes, GPU-written records/counts, limit clamping, and an active range that is genuinely unreadable, with its Windows AMD and Linux lavapipe test results recorded there.
I have not run the title myself, and #6606 explicitly leaves the next Guardians of the Galaxy startup milestone unverified. I found no separate change to prepare for this issue, so I will not duplicate that work.