Repository navigation
Mesh runs while occlusion query counting is on: in Donkey Kong Bananza no draw had joined a run - #1099
Mesh runs while occlusion query counting is on: in Donkey Kong Bananza no draw had joined a run#1099AdyaGMD wants to merge 1 commit into
Conversation
…a no draw had joined a run The first version refused runs while samples-passed counting was on, and counting stays on for the rest of the game after the first reset (mtl_exec sets g_vis_counting and nothing clears it). Bananza resets that counter once, so its log read "0 of them in 0 runs" in every heavy frame. A report ends a run (geo_mesh_keeps) and a pass keeps one query slot, so a query's interval holds whole runs, and whether any of its samples passed is the same in any order (the nearest fragment of each pixel passes whatever the order); only the exact count can differ. A draw that cannot join a run now logs why, once per reason. In the heavy area (handheld, MetalFX upscaler): 142,000-155,000 mesh draws in 300 runs per 300 frames, one run of about 475 draws a frame. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks. The diagnosis is right: |
…ays on for the rest of a game after its first reset, so Donkey Kong Bananza's depth prepass drew every geometry draw alone (#1099) A report ends a run before it executes and a pass keeps one query slot, so a query's interval holds whole runs; whether any of its samples passed is the same in any order. A refused draw's reason is logged once. t_geometry_mesh draws its runs again with a counter reset before them and a report after: the draws join runs and the report holds every sample they passed. Co-authored-by: AdyaGMD <114347520+AdyaGMD@users.noreply.github.com>
|
Landed on main as 53ab7a9, with you credited as co-author, plus the test I asked for, which I wrote myself: |
…ays on for the rest of a game after its first reset, so Donkey Kong Bananza's depth prepass drew every geometry draw alone (seedds#1099) A report ends a run before it executes and a pass keeps one query slot, so a query's interval holds whole runs; whether any of its samples passed is the same in any order. A refused draw's reason is logged once. t_geometry_mesh draws its runs again with a counter reset before them and a report after: the draws join runs and the report holds every sample they passed. Co-authored-by: AdyaGMD <114347520+AdyaGMD@users.noreply.github.com>
What and why
Follow-up to #1087 (landed as 84ec307): in Donkey Kong Bananza its mesh draw runs never form. The log reads
0 of them in 0 runsin every heavy frame.Cause:
geo_mesh_run_fitsrefused runs while samples-passed counting was on (g_vis_counting), and counting stays on for the rest of the game after the first samples-passed reset:mtl_execsets the flag and nothing clears it (only a deferred-pass replay does, for its own replay). Bananza resets that counter once, so every geometry draw of its depth prepass was dispatched alone, although the heavy frames have no samples-passed report at all.Fix: runs are allowed while counting is on. A report ends a run before it executes (it is not in
geo_mesh_keeps), and a pass keeps one query slot (g_vis_cur), so each query's interval holds whole runs, never part of one. Whether any of its samples passed is then the same in any order of the run's draws (the nearest fragment of each pixel passes whatever the order), which is what occlusion tests and conditional rendering ask; only the exact count can differ by fragments another order rejects. The other conditions stay (no colour or stencil writes, an order-free depth test, a fragment shader with no resources). A draw that cannot join a run now logs why, once per reason (geometry mesh run: a draw of vertex … draws alone: …), so a refusal cannot hide again.Reference: Mesh geometry draws gathered into one dispatch, updated.
Checked
040074A01BF12000v458752, handheld, the heaviest view of its heavy area, with the MetalFX upscaler (A game's own upscaler drawn by MetalFX, the player's choice in the launcher: Donkey Kong Bananza's NDSR network 3.5-5 ms → about 1 ms a frame on an M1 #1086) and the border-colour change (Pixel shaders without the border-colour correction in their main library: it spilled registers in every pixel where it never ran #1032),DM_NVN_GPUPROF=every:60:0 of them in 0 runs;check_t_geometry_meshdoes not turn occlusion counting on, so it does not cover this case; a case with a samples-passed reset before the draws would.scripts/regress.py: not run; the shader chain does not change (host only).Docs
docs/reference/shaders.mdentry;python3 dm/tools/docs_symptoms.pywas run🤖 Generated with Claude Code