Queued occlusion counter dumps give alternating visibility in PPSA15657 (objects pop every other frame) #5215
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 johnmaia on 2026-10-13T14:49:41Z.
Summary
With the queued occlusion counter dumps from
7638c1184("keep occlusion counter dumps inside the open render pass"), Epic Mickey: Rebrushed (PPSA15657, UE 4.27) gets visibility results that flip from frame to frame. Level geometry is drawn every other frame, so objects visibly pop in and out.APS5_LABEL_RUNS_INLINE=1(which makesQueuesSampleDumps()false) removes it at no cost.Setup
3faa9cb40+ #5097 + #4551 + #5030; the last three fix unrelated rendering in this title.Evidence
1. The game itself stops issuing draws on alternate frames. A per-draw log (vertex/pixel shader, index count, index buffer), compared over 40 consecutive presents, shows many depth-prepass/base-pass pairs present only every other frame (
.1.1.1.1…, 211 such draws). They're the same meshes and index buffers each time, and draws per frame alternate between about 640 and 710. On screen, a stair wall is drawn in frames 6 and 8 but missing in 7 and 9.2. The alternation tracks occlusion queries. Same tree, same level:
r.AllowOcclusionQueries=0(engine.ini)APS5_LABEL_RUNS_INLINE=1APS5_SYNC_FLIP=13. Query volume and results. Reading back each dumped counter one present later (16 DB words,
end - beginper query):Ruled out
NoteSampledDrawin segment mode was instrumented per frame. Every sampled draw is onopen->commandswith counting on (e.g. 527 calls, 317 segments begun, 0 on another command buffer, 0 not counting).WriteLabelOnGpureturns 1 only whenRecorder::Idle(), and a queued dump keeps a batch open.QueuedWriteGroupsstarts a new group when a plain store overlaps an earlier dump.What I think is left
Recorded at once, the dumps are still asynchronous GPU work and the results are right. Queued, each dump's value is computed at
closeStoreRunfromdumpSegments(thependingSamplesindex at queue time) and the sharedsampleCounter. So my guess is that the per-dump segment accounting goes wrong when a batch holds many begin/end dumps with segments in between, or across batches. I haven't pinned down which yet.The title reuses query slots on a frame cycle and checks the ready bits itself, so a dump that lands with a stale or shifted total looks like a valid "0 samples" result.
Workaround
APS5_LABEL_RUNS_INLINE=1. On this title it's also slightly faster (5.08 vs 4.73 FPS in the same level).I can run builds or diagnostics on this title if that helps.
🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by johnmaia on 2026-10-13T15:18:52Z.
Root cause found; fix in #5232.
Recorder::QueuedWriteGroupsrecords a group's plain stores before its dumps, and a store started a new group only when it overlapped an earlier dump. So the label the title writes after its occlusion queries (different memory) joined the dumps' group and landed before them. The title polled the label and read the counters before the dumps were written. Splitting the group at any store after a dump removes the alternating draws and the popping in PPSA15657. TheQueuedWriteGroupstests now also run in ctest (agc_queued_write_groups); the updated one fails without the change.🤖 Generated with Claude Code