High on Life (PPSA15388): occlusion-query results hide walls and props in view (all fine when every query reports visible) #5488
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-13T21:02:15Z.
High on Life (PPSA15388) now renders its home base fully lit on
main18c438b10(plus #4487, #5156, #5003 and the closed #3202). But its occlusion culling hides things that are in view. Walls disappear on the stairs, so the sky outside shows through where the wall should be, and furniture and props pop in and out as the camera moves. The scene looks like the PC version except for these gaps.It's the occlusion-query results. For a test I made every query answer "visible". Locally,
DumpSamplesOnGpudeclines, and the CPU path (Driver::dumpSampleCounters) writes a total that grows by1 << 24at everyEVENT_WRITEZPASS_DONE, so each query's end-minus-begin is nonzero. With that, nothing vanishes. A 25-minute run through the living room, stairs, hallway and upstairs showed no gaps and exited normally. Without it, the same route shows the gaps within seconds.So somewhere the pass counts the title reads for some queries are zero, or smaller than they should be. I haven't found where. The two paths are:
VulkanDevice::DumpSamplesOnGpu→Recorder::DumpSamples, which is normally taken;Driver::dumpSampleCounters, which writesSamplesTotal()into DB 0's slot with the ready bit and zeros into the other 15.Next, I'll compare the CPU path with real counts against the GPU path, then log per-query begin/end values for one occluder that vanishes. If either path is already known to be approximate for begin/end pairs across draws, or across
EVENT_WRITEs on different queues, a pointer would help.Setup
Linux, RTX 4090 (NVIDIA 615.78,
occlusionQueryPreciseavailable), GCC 16, Release. The local test switch isAPS5_OCCLUSION_ALL_VISIBLE:DumpSamplesOnGpureturns false, anddumpSampleCounterswrites(++step) << 24as the total. Related: #4736 (the same scenes, which were black before #4551).Tested and written by Claude (AI assistant) on a contributor's machine.
Imported from boykopovar/AnyPS5. Originally posted by Tamalero on 2026-10-13T21:38:56Z.
BEFORE:
https://youtu.be/IcGY8xYMRY0
AFTER:
https://youtu.be/ehP87kT4OEg
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-13T21:47:35Z.
Thanks, the before/after captures make the symptom and the all-visible workaround clear. The next useful discriminator is the per-query begin/end values you mentioned: could you capture one occluder that disappears on the normal GPU path, then compare those same values on the CPU path with real counts? Please include the query slot/index and the corresponding begin/end EVENT_WRITE values (and queue/submission if they differ). That should tell us whether the error is in query association/order or in how the GPU dump reports the count.
Imported from boykopovar/AnyPS5. Originally posted by Tamalero on 2026-10-13T22:49:11Z.
The begin/end values you asked for, from both paths, standing at the same upstairs window in the home base.
Setup. A local trace records every
EVENT_WRITEZPASS_DONE dump (address, queue, which path wrote it). At each flip it waits for the GPU and reads back both dumps of every query. The begin dump is atAand the end dump atA + 8, and the total is the sum of the 16 DB slots (ready bits were set on all of them). All dumps come from queue 0, and every query's begin and end are consecutive dumps (#k, #k+1). So pairing and ordering look straightforward.Normal GPU path (
DumpSamplesOnGpu): the window flickers frame to frame between its frame, nothing (sky showing through) and its blinds.Per frame, 24–42 queries, of which about 75 % read exactly 0.
Over 19 traced frames, 14 of 40 query slots flip between zero and nonzero. The clearest one is a slot that reads about 10,400 samples almost every frame and 0 in 3 of them:
A steadily visible object is reported fully occluded in some frames, which matches the flicker. Since association is simple, the samples between those two dumps seem to get lost in how the GPU path counts or folds them, not in which query they belong to.
Within one frame, about 20 consecutive queries often share one unchanged total:
CPU path with real counts (
DumpSamplesOnGpudeclined,dumpSampleCounterswritingSamplesTotal()): no flicker at all. Windows and doors are stable in the same spots, even though the per-query numbers are wrong in a different way.So both paths are wrong per query. The GPU path is close but drops a visible object's samples in some frames, which makes this title flicker. The CPU path lags behind, which in this title happens not to flicker. A per-query count tied to the draws between each begin/end pair would fix both. Doing that without the GPU path's cost looks like the useful direction.
Trace details
main18c438b10plus #4487, #5156, #5003, #5494 and local diagnostics.DumpSamplesOnGpureturns false, so every dump takesdumpSampleCounterswith realSamplesTotal(); 12 frames traced. The trace adds aWaitIdleper flip only while armed; the FPS numbers above are with it disarmed.Tested and written by Claude (AI assistant) on a contributor's machine.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-13T23:12:23Z.
Thanks, these traces answer the association question. Consecutive begin/end dumps on queue 0 make a pairing/order mix-up much less likely; the slot that usually reads about 10.4k and intermittently reads zero points toward the GPU dump/counting path. The CPU path’s repeated total across many queries also shows it is not a per-query reference, even though it removes the flicker and runs faster in this title. Since you have not verified whether the counted samples are complete, I would treat this as a strong localization of the measurement problem rather than a confirmed per-draw fix. The trace is useful evidence for separating query association, counter accumulation, and dump cost.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T00:09:44Z.
Could you try #5232 on the same route? It fixes queued occlusion dumps landing after the label the title polls (#5215, the same flicker in PPSA15657).
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-14T00:15:48Z.
I can’t run PPSA15388 on the reported Windows/GPU route from this Linux workspace, so I can’t provide a same-title before/after result for #5232. The patch’s local tests can check the queue-order behavior, but the title run would need the existing Windows setup. If you can run it, please keep the shader cache and route settings fixed and compare the occlusion result with and without #5232.
Imported from boykopovar/AnyPS5. Originally posted by Tamalero on 2026-10-14T03:23:47Z.
The same symptom on AMD, so it doesn't depend on the GPU vendor. I ran High on Life (PPSA15388) with the same build, the same save and the same spot, on an AMD Radeon Pro V620 (RDNA2) with RADV:
dumpSampleCounterswith realSamplesTotal())The CPU path doing worse here fits the earlier trace. Its totals only count work that has already finished, and this machine runs at about 1 FPS, so more queries are read before their draws complete and come back as 0. The CPU path's result depends on timing, so it isn't a fix on any vendor.
One more data point from NVIDIA, for whoever picks this up: a local variant that waits for the GPU to go idle before each count (exact totals, slow) still left a few items behind windows popping in and out. Those may be the same white blinds that also pop in with every query reported visible, so they may not be occlusion at all. I haven't separated the two.
@oneandonlydean, thanks for the pointer. I'll run #5232 at the same window and report back. (My setup is Linux, not Windows.)
Details
main18c438b10plus #4487, #5156, #5003, #5494 and local diagnostics, the same stack as my trace above.Tested and written by Claude (AI assistant) on a contributor's machine.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T07:02:26Z.
#5232 is on main now. Could you run the home base route on current main and say whether walls and props still vanish?
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-17T01:27:37Z.
Following up on the current-main check requested after #5232: did the walls or props still vanish on the same High on Life route? If the symptom remains, please share the exact main SHA and whether the all-visible control still removes it so the remaining path can be isolated. I cannot run this title from my Linux workspace, so I do not have a local A/B result to report.
Imported from boykopovar/AnyPS5. Originally posted by Tamalero on 2026-10-17T03:52:05Z.
A second title where scene objects blink from one frame to the next, but here reporting every occlusion query as visible doesn't make it go away, so it's probably not (only) this issue.
Title: LEGO Batman: Legacy of the Dark Knight (PPSA16833 v01.010.000), first level (Wayne Manor garden) and the title-screen flyover.
Build:
main5d9dcc42d(has #5213 and #5232) + #6694 + #6699 + thesceWebBrowserDialogOpenForPredeterminedContenthunk of #6447, plus two input-only changes. Linux, RTX 4090.Screenshots (the frame number is in the window title):
So in this title occlusion queries look like part of it at most. I don't have the cause of the rest yet. If someone recognises the pattern (a different subset of objects every frame, with a still camera, on a build with #5213 and #5232), I'm happy to run a branch.
Details
mainyet; that run is next.Tested and written by Claude (AI assistant) on a contributor's machine.
Imported from boykopovar/AnyPS5. Originally posted by Tamalero on 2026-10-17T04:20:46Z.
@oneandonlydean sorry for the delay. High on Life (PPSA15388) on
mainf26eb67c8(has #5213 and #5232) withAPS5_PLAYGO_UNLISTED_CHUNKS=installed(#6236), home base route, Linux, RTX 4090: once the house has finished loading, nothing blinks. Standing still on the stairs facing the portal, and walking down the stairs, through the bedroom and back, everything stays in place, including the windows and doors that used to blink the most. The only blinking is during the first load, while the scene streams in with an empty shader cache. The purple light that used to leak into the house from the portal's destination map isn't there any more either. So for this title the symptom in this issue is gone onmain, and I think it can be closed for PPSA15388.The LEGO Batman case in my previous comment is a different picture (objects keep blinking with the camera still, even with every query reported visible), so it probably shouldn't keep this issue open. I can open a separate issue for it if that's easier to track.
Tested and written by Claude (AI assistant) on a contributor's machine.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-18T02:21:05Z.
Thanks for retesting. With the reporter's confirmation on main (
f26eb67c8, which has #5213 and #5232), closing as fixed for High on Life. The LEGO Batman case looks like a different cause, so a separate issue for it would be welcome.