Repository navigation
Conversation
…s every candidate With DM_NVN_TBDR=1 the submission index (sdx_walk) noted a draw's texture reads only from its bound slots. A handle read from a uniform buffer (NVN_RB_TEXU), an array of handles (TEXA, TEXD), or a shader the reflection calls bindless or dynamic gave no read event, so sdx_decide could meet the attachment's next full clear first and drop the store of an attachment that only such a draw samples later. Such a draw (and one with no program) is now noted as needing every candidate texture known at that point (SDX_NEED): the store is kept, the ledger counts it as a read, and no pass merge starts on it (fz_prefilter looks for SDX_READ). Slot reads and the rest of the decision are unchanged, and the lookahead stays off by default: this makes it correct for bindless readers, which docs/agents/04-graphics.md gives as the reason it is off, without measuring its gain in a game. Checked: the new t_lookahead_bindless indexes a three-pass submission with the production mtl_sub_index and asks sdx_decide at the end of the first pass; 5 of its 22 checks fail on main (TEXU, TEXA, TEXD, bindless and dynamic reflection), none with the change, and a draw with no texture read or a slot read of another texture still drops the store. make -C dm/gfx/tests GAME=01007EF00011E000 run on an Apple M5, macOS 26.6.2: every other target passes as on main; t_border, t_transform_feedback and t_pso_archive fail on main and with the change in a checkout whose path has a space, and t_nvn aborts on both. No game was run (the default replay is unchanged: tbdr_on() is still off). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… read a texture through a handle needs every candidate
|
The same save was put back before each run, in Kokiri Forest by the stream. I didn't touch the controller after the load; each run went 2 minutes past it, with Picture. With
With Speed, the periodic lines after the load:
Otherwise both runs logged only the title movie's AV1 red line and exited cleanly. |
|
Thank you for the run — exactly what these two PRs needed. Two conclusions, and a request. Speed. No gain where it counts: frame time p50 35.5 ms both ways, GPU p50 62.1 → 63.3 ms, attachment traffic −10 % loads / −4 % stores. In this scene the TBDR mode does not pay for itself, with or without these PRs; neither changes the default ( The red line. The stream. Its wrong look in every screenshot after the load (not just around frame 651) suggests something besides that one skipped store. Could you run the same save with
Whichever one makes the stream dark and see-through again names the part to fix; if none does, the store lookahead itself (this PR's 🤖 Generated with Claude Code |

What and why
The TBDR optimizations are off by default because the store lookahead "would miss bindless readers" (
docs/agents/04-graphics.md§4,tbdr_on()). The cause is insdx_walk: a draw's reads are noted only from its bound slots (NVN_RB_TEX,TBUF,IMG), so a handle read from a uniform buffer (TEXU), an array of handles (TEXA/TEXD), or a shader the reflection calls bindless or dynamic gives no read event, andsdx_decidecan meet the attachment's next full clear first and drop a store that a later bindless draw needs.Such a draw (and one with no program) is now noted as needing every candidate texture known at that point (
SDX_NEED): the store is kept, the ledger counts it as a read, and no pass merge starts on it (fz_prefilterlooks forSDX_READ). Slot reads and the rest of the decision are unchanged. This makesDM_NVN_TBDR=1correct for bindless readers; it does not turn the lookahead on by default (its other costs — deferred uniform updates and lazy clears off in TBDR mode — and its gain in a game are still to be measured). A step toward #159.Reference entry:
docs/reference/rendering.md, "Store lookahead and bindless readers".Checked
make -C dm/gfx/tests GAME=01007EF00011E000 check_t_lookahead_bindless(productionmtl_sub_index+sdx_decideon a synthetic three-pass submission, no GPU work): 5 of its 22 checks fail onmain(TEXU, TEXA, TEXD, bindless and dynamic reflection), none with the change; a draw with no texture read, or a slot read of another texture, still drops the store.make -C dm/gfx/tests GAME=01007EF00011E000 run: every other target passes as onmain;t_border,t_transform_feedbackandt_pso_archivefail onmaintoo in a checkout whose path has a space (separate issue), andt_nvnaborts on both.tbdr_on()still off), soscripts/regress.pywas not run.Docs
docs/reference/rendering.mdentry, andpython3 dm/tools/docs_symptoms.pywas run (the symptom index)