fix(agc): bind a null index buffer to non-indexed mesh draws #1134
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1134"
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 alfalfa-star on 2026-10-07T13:25:59Z.
What
Non-indexed mesh draws no longer fail with
writable guest memory overlaps an immutable snapshot(orguest snapshot differs from the writable memory it overlaps).For a non-indexed draw (DRAW_INDEX_AUTO, or a non-indexed indirect record),
MeshIndexBufferDescriptorgave the mesh program's hidden index-buffer V# (user words 4..7) a 4-byte range at the program's own code address. The prologue never loads through it, because the load is predicated on the draw's index size. But the descriptor still had a guest address, soShaderResourcesbound it from live guest memory (AddReadable). When the same program also reads guest memory by address, the address build captures the program's code as an immutable snapshot, andUploadPreparerefuses a live region that overlaps a snapshot. If the guest had rewritten the bytes at the code address since the capture, the draw failed in the snapshot compare instead.MeshIndexBufferDescriptorreturns a null V# for a non-indexed draw: base and size 0, same format word.ShaderResourcesbinds that to its empty placeholder buffer, so no guest range is involved. The function no longer takes the unread address.Tested
Linux 7.2.9 (Arch), Mesa 26.2.4 RADV, RX 9070 XT.
agc_driver_graphics: newmeshIndexBufferTests(a non-indexed draw gets the null V#, an indexed draw keeps its address and rounded size, a null indexed buffer still throws).agc_driver_mesh_tests(not in CI; needsVK_EXT_mesh_shader) passes. Its non-indexed draws now bind the null V#.ctest: 396 of 396 pass.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)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-08T08:15:07Z.
Checked on current main: build and ctest green,
addGuestBufferbinds a V# with base 0 or size 0 to the empty placeholder, indexed draws keep their address/rounded size and the invalid-range throw, and the newmeshIndexBufferTestscan't pass on main (signature change). CI green; merging.