PPSA01325: a 4-vertex strip over a 3-record vertex buffer stops on "vertex fetch exceeds descriptor record count" #2241
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 orbz22 on 2026-10-09T12:52:14Z.
What happens
Astro's Playroom (PPSA01325) draws its post-process and composite passes as a fullscreen triangle stored in a 3-record vertex buffer. It submits that triangle as a 4-vertex triangle strip. The 4th vertex is past the descriptor's
num_records. AnyPS5 refuses the fetch and the title aborts from presentation:The check is
Require(stride == 0 || index < records, ...)inGraphics/include/VertexInput.hpp.The draw, traced locally:
firstVertex0, 4 vertices, triangle stripnum_records3, stride 24, 2 attributes0x0004dfac(OOB_SELECT0,DST_SELx, y, z, w)num_records; the bytes in memory there are unrelatedSeen on
main745b775ewith the earlier PPSA01325 blockers applied (#1836, #1837, #1395 rebased). It is the next stop after #1395.What the hardware does is the open question
The first triangle (v0, v1, v2) already covers the screen. What the second one (v1, v2, v3) does depends on what the fetch of v3 returns:
num_recordswithOOB_SELECT0 returns 0 in every component, v3's position is (0, 0, 0, 0). The second triangle has a vertex with w = 0 and adds nothing. I believe this is what the console does.robustBufferAccessinstead returns (0, 0, 0, 1) for an out-of-bounds vertex attribute. The second triangle becomes a visible wedge from v1 and v2 to the screen centre. I saw this wedge locally when the fetch was let through that way.I have not found a primary source for what a structured
buffer_load_format_xyzwreturns pastnum_recordswithOOB_SELECT0, in particular whether W is 0 or 1 for a float format. Without that source I have not opened a PR. The local workaround I run cuts this draw's vertex count down to the records (4 to 3, since the first triangle is the whole image), and the title then renders correctly.Ask
Could someone with an RDNA2 GPU on Linux run this through
tools/hw-oracle(docs/dev/HW_ORACLE.md)?buffer_load_format_xyzwwithidxen, an index of 3 andnum_records3, and the word 3 above (0x0004dfac).That settles which value the fetch should return. The fix is then either to fetch past the records with that value (0s) or to keep throwing, with this case documented.
Setup: Windows 11, RTX 3060 Laptop (NVIDIA 616.92), WinLibs GCC 15.2.
🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by simonbbby on 2026-10-09T17:19:54Z.
Measured on RDNA2 with
tools/hw-oracleatmaind70b8998: gfx1036 (Ryzen 9 9950X iGPU), Linux 7.0 (Ubuntu 24.04), ROCm HSA runtime 5.7.1, LLVM 18.1.3. Float controls:ieee 0,dx10_clamp 1,denorm32 3,denorm16 3,round32 0,round16 0,fp16_overflow 0.Body, with the vertex buffer passed as
extraafter the rows:The buffer holds your three records (position, uv), then 72 bytes of 7.0, 8.0, 9.0, … where records 3 to 5 would be.
v4is the index, 0 to 5.bf800000 bf800000 00000000 3f800000(-1, -1, 0, 1)40400000 bf800000 00000000 3f800000(3, -1, 0, 1)bf800000 40400000 00000000 3f800000(-1, 3, 0, 1)00000000 00000000 00000000 00000000Index 3 returns 0 in all four components, W included: (0, 0, 0, 0), not (0, 0, 0, 1).
The result past the records is the same in wave32 and wave64, in two runs each, and with
RESOURCE_LEVEL1 (0x0104dfac),OOB_SELECT1 (0x1004dfac) and FORMAT 7432_32_32_FLOAT(0x0004afac). As a control, the same descriptor withnum_records6 returns the stored values for indices 3 to 5 (7, 8, 9, 10 / 13, 14, 15, 16 / 19, 20, 21, 22), so the zeros come from the record check, not from memory.gfx1036 is gfx10.3;
docs/dev/HW_ORACLE.mdlists the MUBUF encodings as shared with gfx1013.If you're not already on the fix, I can open a PR that returns zeros past
num_recordsinstead of throwing.Imported from boykopovar/AnyPS5. Originally posted by danzaio on 2026-10-09T19:27:14Z.
Implementing this now (zeros past num_records per your measurement). Work is on my fork, will hold the branch until intake reopens. Shout if you were already on it.
Imported from boykopovar/AnyPS5. Originally posted by simonbbby on 2026-10-09T19:49:09Z.
I have a fix for this as well:
fix/agc-vertex-fetch-past-records, one commit (26df70ea) onmaind70b8998. It also applies cleanly to the currentmain,8b393b6e. Neither of us can open a PR right now, so it seems worth comparing the two before one gets carried. I built yourfix/2241-oob-vertex-fetch(e18e0935) and found two differences that change results.1. The zero-padded copy goes into the draw-snapshot cache.
KeepDrawInputstores it, andReusableDrawSnapshotgives a vertex snapshot to any later copy at the same address that is no larger. After a draw that reads pastnum_records, an in-range draw at the same address gets those zeros back.My branch's execution test,
agc_driver_vertex_fetch_past_records, covers this. It draws through a fetch shader over write-watched guest memory, three times:On your branch the third draw reads zeros:
an in-range vertex attribute read the zeros of an earlier fetch past num_records at the same address. That happens on an RTX 3090, RADV gfx1036 and llvmpipe, in 2 of 2 runs each. The third draw alone passes. My branch builds these copies outside the cache and passes on all three. Onmainthe test stops at the second draw with this issue's message.2.
OOB_SELECT2 and 3 don't return zeros pastnum_records. I measured both withtools/hw-oracleon the same gfx1036 setup, 3-record buffer and 24-byte stride as my measurement above:OOB_SELECT2 (0x2004dfac): indices 3 to 5 return the stored values (7, 8, 9, 10 / 13, 14, 15, 16 / 19, 20, 21, 22), so the record count isn't checked. Withnum_records0, every index returns 0.OOB_SELECT3 (0x3004dfac):num_recordsis compared with the byte offset, and the index is ignored. Withnum_records3, every index returns 0, index 0 included. Withnum_records72, all six indices return the stored values.Wave32 and wave64 agree, in two runs each. Your branch zero-fills past
num_records * stridefor everyOOB_SELECT. Mine returns zeros for 0 and 1, and still throws pastnum_recordsfor 2 and 3, since they need a different rule.Full ctest with the commit on
8b393b6e: RADV and lavapipe 518/518, NVIDIA 517/518 (only #2188).I'm fine with whichever branch goes forward. If you keep yours, these two points are what I'd change.
Imported from boykopovar/AnyPS5. Originally posted by danzaio on 2026-10-09T20:40:15Z.
Both fixed on my branch. Out-of-range copies stay out of the snapshot cache now, neither read nor written. OOB_SELECT 2 and 3 keep throwing, each needs its own rule. Your execution test passes here too (RTX 4050, Windows). Thanks for measuring all of this.