WIP: fix(vk): leave out the depth draws of a mesh the game no longer shows: no ghosting with the camera inside Link (#1370) #1447

Draft
pmwork-personal wants to merge 2 commits from pmwork-personal/Longshot:fix/hidden-mesh-depth into main
Member

Type: fix · Risk: low · Tested on: Windows 11, RTX 5090 · Needs: Linux (build and a quick run), AMD and Intel (any GPU with a temporal upscaler)

Why

When the camera is pushed into Link (the top of a vine wall, a crawl tunnel), the game stops drawing his colour but goes on
drawing his body into the scene's depth. DLSS, DLAA and frame generation take that depth and the actor motion drawn over it,
so they follow an invisible body: the picture smears, with dark blotches and copies that move with the camera. The reporter
of #1370 found the cause and posted a patch; this is that patch, made into a PR with their credit.

How to reproduce

Seen on: Windows 11 (build 26300), RTX 5090, driver 621.24
Settings and switches: Upscaler DLAA (5120x2160), DLSS frame generation on; no switches
Steps: Inside the Deku Tree, climb the vine wall on 1F to its top and turn the camera so that it goes into Link.
Expected: the room behind Link, sharp.
Actual: on main, dark blotches, flat watercolour patches and a veil over the picture that move with the camera.

What changed

A skinned mesh (a vertex buffer) that had colour, and then for 3 frames in a row only depth draws into the scene and no
colour anywhere, is hidden: its depth draws into the scene are left out until its colour comes back. Only the game's own
draws are left out; nothing is added.

  • gpu/vk/hidden_mesh.h (new, no Vulkan calls): the rule, hidden_mesh::Tracker, and the reasons for each part of it.
  • gpu/vk/vk_draw.cpp: hidden_depth_draw() gives each draw to the rule right after skin_check(), before actor motion
    takes it and before its descriptors are built; skin_check() now fills a SkinnedDraw and draw() gives it to actor
    motion only if it was not left out. Never left out: a draw the game asks about with an occlusion query, a draw into
    another depth target (shadows, other views), a mesh that never had colour.
  • gpu/vk/vk_temporal.cpp: temporal_hidden_mesh_mode() (the switches, read once, off with the parallel replay) and
    temporal_scene_depth_is().
  • Changes from the reporter's patch: it waits 3 frames instead of 1 (the colour pass tests depth EQUAL against these draws,
    so with 1 a mesh that blinks would be lost for good, and a colour lost for one frame would be lost for two); the decision
    comes before actor motion; one table for every drawing thread (the game submits from several); a stream-0 check on the key;
    logging.

Measurements

Verdict: the smear is gone at the spot in both runs with this PR, and present in both runs of main (interleaved). No
numbers: this is a picture fix. The rule adds one table lookup to each skinned draw into the scene (a few dozen a frame) and
leaves out up to 30 draws a frame while the camera is in Link.

Hardware: Windows 11 Pro (build 26300), RTX 5090, driver 621.24, Ryzen 7 9800X3D
Scene: Inside the Deku Tree, the top of the 1F vine wall; DLAA at 5120x2160, DLSS frame generation on (~55 fps base, ~165 shown)
Method: 4 runs interleaved (main, PR, main, PR), the same save and settings, the camera turned into Link; NVIDIA clips
reviewed frame by frame; the PR's runs with RX_VK_DLSS_FADED_LOG=1.
How to reproduce: a save in the Deku Tree (child Link); Upscaler DLAA or DLSS, any frame generation; climb the 1F vine
wall to its top and turn the camera into Link; RX_VK_DLSS_FADED_LOG=1 in longshot_env.txt for the vk: upscaler: faded: lines,
RX_VK_DLSS_FADED=0 for main's picture with this build.

Before: main @ 544229a2 After: this PR @ 6b3232b8 (the same change on 544229a2; rebased since)
smear with the camera in Link yes, both runs no, both runs
depth draws left out 0 at most 30 a frame, only while the camera is in Link
Link coming back normal the game's own fade-in, no missing frame at 60 fps
vk: upscaler: faded: frame 5437: 37 meshes with 42 depth draws into the scene; 7 of them got colour in the frame (0 colour draws on the scene's depth target, 12 on others), 30 got none, 30 of those hidden in the next frame; 0 more meshes had colour and no depth draw; 30 depth draws left out, 0 drawn for a query; 0 draws of more meshes than the table holds
vk: upscaler: faded: frames 5437 to 6037: 13920 depth draws of hidden meshes left out, in 464 frames, 30 in a frame at most, 0 of them with a stencil test; 30 times a mesh's colour came back in a frame with them left out
vk: upscaler: faded: frames 5044 to 5644: 18030 depth draws of hidden meshes left out, in 601 frames, 30 in a frame at most, 0 of them with a stencil test; 0 times a mesh's colour came back in a frame with them left out
vk: upscaler: faded: frame 2650: 1 meshes were hidden, and no depth draw of theirs was left out: 1 were drawn because the game asks about them with an occlusion query
vk: skips a frame by vk_draw.cpp line: 7969: 30.0

The same spot (the top of the 1F vine wall, the camera in Link), DLAA and frame generation on; frames from NVIDIA clips at 1920x810:

Before: main @ 544229a2 After: this PR @ 6b3232b8
Before: main @ 544229a2, run 1 After: this PR @ 6b3232b8, run 2
Before: main @ 544229a2, run 3 After: this PR @ 6b3232b8, run 4

Flags and settings

Two new switches, the rule shipping on; RX_VK_PARALLEL is read by it too.

Flag What it is Before this PR After this PR Effect Helps / doesn't help / untested Recommendation
RX_VK_DLSS_FADED kill, bool (none: the depth drawn) on =0 draws hidden meshes' depth again helps: no smear with the camera in Link on for everyone
RX_VK_DLSS_FADED_LOG diag, bool (none) off =1 logs the first frames' counts and why a hidden mesh's draws were drawn for testing off
RX_VK_PARALLEL attempt, int (unchanged) 0 0 now also read by the rule: with 2 or more (the parallel replay) the rule is off, as its one table is used by one thread at a time not tried with it unchanged

Testing

Tested: Windows 11 (build 26300), RTX 5090, driver 621.24: the A/B above (DLAA, frame generation on). Game-free:
tests/test_hidden_mesh_depth.py fails on main and passes here (the rule over frames modelled on the game's: the camera in
Link, blinks, short losses, the query, other targets, a full table, a skipped frame; and where draw() asks it); it fails
again with the wait set to 1 frame, the query check turned around, or the scene check taken out. tests/run_all.py (Windows, llvm-mingw): 628 passed,
48 failed, 47 skipped; the same 48 fail on a clean main @ 50170f81 (listed below).

Not tested: DLSS Quality and the other scales (the reporter's own run was DLSS 2560x1440 to 3840x2160 with their
patch); AMD FSR 4, FSR 3.1 and Intel XeSS; the first-person look (C-up); Linux; AMD and Intel GPUs. The parallel replay
(RX_VK_PARALLEL=2 and more) turns the rule off.

Must be tested:

  • Linux, any GPU: build, and at the same spot with DLSS, FSR 4 or FSR 3.1, expecting no smear (Test Farm: @Beanstalk linux, the Deku Tree vine wall top with the camera in Link).
  • Intel, Windows: the same spot with XeSS, expecting no smear and Link back with no blink (the colour pass is LEQUAL with a bias there) (Test Farm: @Beanstalk intel).

Risks

What could break: a mesh whose colour stops for 3 frames while it is still meant to be seen: its depth draws are left
out until its colour comes back, and it comes back one frame late (the logs count those). The game's own picture changes
too where it reads that depth (later depth-tested draws, effects made from the depth). Draws the game asks about with an
occlusion query are never left out, so its culling is unchanged.

Turning it off: RX_VK_DLSS_FADED=0.

Compatibility: Nothing changes.

Issues

Fixes #1370

The 48 checks that fail here and on main @ 50170f81 (Windows, llvm-mingw)

test_auto_handheld, test_bug_report, test_bug_report_defaults, test_cpu_report, test_crash_dialog, test_crash_groups, test_crt_options, test_damage_debug_menu, test_display_startup_failure, test_dlss_feature_size, test_failed_compile_keeps_objects, test_fastfp_fma, test_fpx_sticky, test_framegen_preset, test_fsr_uniform_ownership, test_guest_imported, test_hardware_report, test_hud_layout_row, test_import_reach, test_invalidate_vcore, test_job_queue, test_linux_preflight, test_linux_pressure, test_mirror_budget, test_missing_nup, test_pads_after_menu, test_parallel_init_order, test_pending_guest_import, test_perf_report, test_pipeline_play_cache, test_portable_builder_startup, test_present_thread, test_profiling_mode, test_readback_timeout_source, test_recorder_sync, test_replay_write_order, test_rumble_menu, test_run_all_changed, test_slow_frames, test_spawn_emit, test_staging_burst, test_target_image_pool, test_tested_configurations, test_upscaler_round_trip, test_upscaler_rows, test_vcore_escape, test_vk_occlusion_queries, test_walk_key

Checklist

Everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description) of the status line's type.
  • Why gives the reason plainly and links the issues that fit (the tracker searched).
  • Tested on my own PC where it runs (in the game, for a change the game runs), as Testing's Tested says; what
    can't be run by hand is in Testing's Not testable by hand, with why.
  • Measurements has a verdict, or one line saying why there is nothing to measure.
  • Nothing gets worse that I know of: any cost (speed, latency, memory, a setup that worked before) is measured and
    in Risks. Not ticked yet: Measurements adds a per-draw table lookup with no numbers, so that cost is unmeasured.
  • Testing names what was tested, what wasn't, and what must still be tested, where and how.
  • Rebased on current main.
  • python -I -B tests/run_all.py passes (any failure that also fails on main is named).
  • No game files, dumps, build output or generated files.
  • third_party/ untouched (a new folder with a PROVENANCE.md instead).
  • The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. (Our code is; the rule comes from the patch the reporter posted on #1370, and their agreement is asked there.)

When it applies

  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.
  • Switches documented (docs/development.md; the README for a menu row) and shipped at their recommended value.
  • Screenshots of the same spot, captioned like the Measurements columns, for a change that shows on screen.
  • A game-free test added for the fix, failing on main and passing here.
  • A check under tests/ that reads changed source updated in this PR, not weakened. (The new tests/test_hidden_mesh_depth.py reads them; no existing check needed a change.)
  • Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths. (Windows built and run; Linux: Test Farm, under Must be tested.)
  • Docs updated.

🤖 Generated with Claude Code

**Type:** fix · **Risk:** low · **Tested on:** Windows 11, RTX 5090 · **Needs:** Linux (build and a quick run), AMD and Intel (any GPU with a temporal upscaler) ## Why When the camera is pushed into Link (the top of a vine wall, a crawl tunnel), the game stops drawing his colour but goes on drawing his body into the scene's depth. DLSS, DLAA and frame generation take that depth and the actor motion drawn over it, so they follow an invisible body: the picture smears, with dark blotches and copies that move with the camera. The reporter of #1370 found the cause and posted a patch; this is that patch, made into a PR with their credit. ## How to reproduce **Seen on:** Windows 11 (build 26300), RTX 5090, driver 621.24 **Settings and switches:** Upscaler DLAA (5120x2160), DLSS frame generation on; no switches **Steps:** Inside the Deku Tree, climb the vine wall on 1F to its top and turn the camera so that it goes into Link. **Expected:** the room behind Link, sharp. **Actual:** on main, dark blotches, flat watercolour patches and a veil over the picture that move with the camera. ## What changed A skinned mesh (a vertex buffer) that had colour, and then for 3 frames in a row only depth draws into the scene and no colour anywhere, is hidden: its depth draws into the scene are left out until its colour comes back. Only the game's own draws are left out; nothing is added. - `gpu/vk/hidden_mesh.h` (new, no Vulkan calls): the rule, `hidden_mesh::Tracker`, and the reasons for each part of it. - `gpu/vk/vk_draw.cpp`: `hidden_depth_draw()` gives each draw to the rule right after `skin_check()`, before actor motion takes it and before its descriptors are built; `skin_check()` now fills a `SkinnedDraw` and `draw()` gives it to actor motion only if it was not left out. Never left out: a draw the game asks about with an occlusion query, a draw into another depth target (shadows, other views), a mesh that never had colour. - `gpu/vk/vk_temporal.cpp`: `temporal_hidden_mesh_mode()` (the switches, read once, off with the parallel replay) and `temporal_scene_depth_is()`. - Changes from the reporter's patch: it waits 3 frames instead of 1 (the colour pass tests depth EQUAL against these draws, so with 1 a mesh that blinks would be lost for good, and a colour lost for one frame would be lost for two); the decision comes before actor motion; one table for every drawing thread (the game submits from several); a stream-0 check on the key; logging. ## Measurements **Verdict:** the smear is gone at the spot in both runs with this PR, and present in both runs of main (interleaved). No numbers: this is a picture fix. The rule adds one table lookup to each skinned draw into the scene (a few dozen a frame) and leaves out up to 30 draws a frame while the camera is in Link. Hardware: Windows 11 Pro (build 26300), RTX 5090, driver 621.24, Ryzen 7 9800X3D Scene: Inside the Deku Tree, the top of the 1F vine wall; DLAA at 5120x2160, DLSS frame generation on (~55 fps base, ~165 shown) Method: 4 runs interleaved (main, PR, main, PR), the same save and settings, the camera turned into Link; NVIDIA clips reviewed frame by frame; the PR's runs with `RX_VK_DLSS_FADED_LOG=1`. How to reproduce: a save in the Deku Tree (child Link); Upscaler DLAA or DLSS, any frame generation; climb the 1F vine wall to its top and turn the camera into Link; `RX_VK_DLSS_FADED_LOG=1` in `longshot_env.txt` for the `vk: upscaler: faded:` lines, `RX_VK_DLSS_FADED=0` for main's picture with this build. | | Before: main @ 544229a2 | After: this PR @ 6b3232b8 (the same change on 544229a2; rebased since) | |---|---|---| | smear with the camera in Link | yes, both runs | no, both runs | | depth draws left out | 0 | at most 30 a frame, only while the camera is in Link | | Link coming back | normal | the game's own fade-in, no missing frame at 60 fps | ``` vk: upscaler: faded: frame 5437: 37 meshes with 42 depth draws into the scene; 7 of them got colour in the frame (0 colour draws on the scene's depth target, 12 on others), 30 got none, 30 of those hidden in the next frame; 0 more meshes had colour and no depth draw; 30 depth draws left out, 0 drawn for a query; 0 draws of more meshes than the table holds vk: upscaler: faded: frames 5437 to 6037: 13920 depth draws of hidden meshes left out, in 464 frames, 30 in a frame at most, 0 of them with a stencil test; 30 times a mesh's colour came back in a frame with them left out vk: upscaler: faded: frames 5044 to 5644: 18030 depth draws of hidden meshes left out, in 601 frames, 30 in a frame at most, 0 of them with a stencil test; 0 times a mesh's colour came back in a frame with them left out vk: upscaler: faded: frame 2650: 1 meshes were hidden, and no depth draw of theirs was left out: 1 were drawn because the game asks about them with an occlusion query vk: skips a frame by vk_draw.cpp line: 7969: 30.0 ``` The same spot (the top of the 1F vine wall, the camera in Link), DLAA and frame generation on; frames from NVIDIA clips at 1920x810: | Before: main @ 544229a2 | After: this PR @ 6b3232b8 | |---|---| | ![Before: main @ 544229a2, run 1](https://git.magicbean.dev/attachments/53b8b70f-463f-4d44-bed5-8529ed325eb3) | ![After: this PR @ 6b3232b8, run 2](https://git.magicbean.dev/attachments/df7a5158-8568-4144-a114-1ef57d57cc6f) | | ![Before: main @ 544229a2, run 3](https://git.magicbean.dev/attachments/26fe5697-ecb5-4022-89e1-808e31192b2a) | ![After: this PR @ 6b3232b8, run 4](https://git.magicbean.dev/attachments/4e664e28-e395-4e76-bc15-0f4ce20ba7e3) | ### Flags and settings Two new switches, the rule shipping on; `RX_VK_PARALLEL` is read by it too. | Flag | What it is | Before this PR | After this PR | Effect | Helps / doesn't help / untested | Recommendation | |---|---|---|---|---|---|---| | `RX_VK_DLSS_FADED` | kill, bool | (none: the depth drawn) | on | `=0` draws hidden meshes' depth again | helps: no smear with the camera in Link | on for everyone | | `RX_VK_DLSS_FADED_LOG` | diag, bool | (none) | off | `=1` logs the first frames' counts and why a hidden mesh's draws were drawn | for testing | off | | `RX_VK_PARALLEL` | attempt, int (unchanged) | 0 | 0 | now also read by the rule: with 2 or more (the parallel replay) the rule is off, as its one table is used by one thread at a time | not tried with it | unchanged | ## Testing **Tested:** Windows 11 (build 26300), RTX 5090, driver 621.24: the A/B above (DLAA, frame generation on). Game-free: `tests/test_hidden_mesh_depth.py` fails on main and passes here (the rule over frames modelled on the game's: the camera in Link, blinks, short losses, the query, other targets, a full table, a skipped frame; and where `draw()` asks it); it fails again with the wait set to 1 frame, the query check turned around, or the scene check taken out. `tests/run_all.py` (Windows, llvm-mingw): 628 passed, 48 failed, 47 skipped; the same 48 fail on a clean main @ 50170f81 (listed below). **Not tested:** DLSS Quality and the other scales (the reporter's own run was DLSS 2560x1440 to 3840x2160 with their patch); AMD FSR 4, FSR 3.1 and Intel XeSS; the first-person look (C-up); Linux; AMD and Intel GPUs. The parallel replay (`RX_VK_PARALLEL=2` and more) turns the rule off. **Must be tested:** - Linux, any GPU: build, and at the same spot with DLSS, FSR 4 or FSR 3.1, expecting no smear (Test Farm: `@Beanstalk linux`, the Deku Tree vine wall top with the camera in Link). - Intel, Windows: the same spot with XeSS, expecting no smear and Link back with no blink (the colour pass is LEQUAL with a bias there) (Test Farm: `@Beanstalk intel`). ## Risks **What could break:** a mesh whose colour stops for 3 frames while it is still meant to be seen: its depth draws are left out until its colour comes back, and it comes back one frame late (the logs count those). The game's own picture changes too where it reads that depth (later depth-tested draws, effects made from the depth). Draws the game asks about with an occlusion query are never left out, so its culling is unchanged. **Turning it off:** `RX_VK_DLSS_FADED=0`. **Compatibility:** Nothing changes. ## Issues Fixes #1370 <details><summary>The 48 checks that fail here and on main @ 50170f81 (Windows, llvm-mingw)</summary> test_auto_handheld, test_bug_report, test_bug_report_defaults, test_cpu_report, test_crash_dialog, test_crash_groups, test_crt_options, test_damage_debug_menu, test_display_startup_failure, test_dlss_feature_size, test_failed_compile_keeps_objects, test_fastfp_fma, test_fpx_sticky, test_framegen_preset, test_fsr_uniform_ownership, test_guest_imported, test_hardware_report, test_hud_layout_row, test_import_reach, test_invalidate_vcore, test_job_queue, test_linux_preflight, test_linux_pressure, test_mirror_budget, test_missing_nup, test_pads_after_menu, test_parallel_init_order, test_pending_guest_import, test_perf_report, test_pipeline_play_cache, test_portable_builder_startup, test_present_thread, test_profiling_mode, test_readback_timeout_source, test_recorder_sync, test_replay_write_order, test_rumble_menu, test_run_all_changed, test_slow_frames, test_spawn_emit, test_staging_burst, test_target_image_pool, test_tested_configurations, test_upscaler_round_trip, test_upscaler_rows, test_vcore_escape, test_vk_occlusion_queries, test_walk_key </details> ## Checklist ### Everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`) of the status line's type. - [x] Why gives the reason plainly and links the issues that fit (the tracker searched). - [x] Tested on my own PC where it runs (in the game, for a change the game runs), as Testing's Tested says; what can't be run by hand is in Testing's Not testable by hand, with why. - [x] Measurements has a verdict, or one line saying why there is nothing to measure. - [ ] Nothing gets worse that I know of: any cost (speed, latency, memory, a setup that worked before) is measured and in Risks. Not ticked yet: Measurements adds a per-draw table lookup with no numbers, so that cost is unmeasured. - [x] Testing names what was tested, what wasn't, and what must still be tested, where and how. - [x] Rebased on current `main`. - [x] `python -I -B tests/run_all.py` passes (any failure that also fails on `main` is named). - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [ ] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. (Our code is; the rule comes from the patch the reporter posted on #1370, and their agreement is asked there.) ### When it applies - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. - [x] Switches documented (docs/development.md; the README for a menu row) and shipped at their recommended value. - [x] Screenshots of the same spot, captioned like the Measurements columns, for a change that shows on screen. - [x] A game-free test added for the fix, failing on `main` and passing here. - [x] A check under `tests/` that reads changed source updated in this PR, not weakened. (The new `tests/test_hidden_mesh_depth.py` reads them; no existing check needed a change.) - [ ] Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths. (Windows built and run; Linux: Test Farm, under Must be tested.) - [x] Docs updated. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The game-free check for #1370: with the camera pushed into Link the game stops his colour draws but keeps his 30
depth-only draws, so the temporal upscalers and frame generation follow an invisible body. The check drives the rule
(gpu/vk/hidden_mesh.h) over frames as the game draws them and checks where draw() asks it and its switches. It fails
here: there is no such rule yet.

Assisted-by: Claude Opus 5.5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
fix(vk): leave out the depth draws of a mesh the game no longer shows: no ghosting with the camera inside Link (#1370)
Some checks failed
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval approved by llun (reviewed)
beanstalk/any 1/1 fail
PR description / Description follows the template (pull_request_target) Successful in 7s
02cc468224
When the camera is pushed into Link (the crawl tunnels, the top of a vine wall) the game stops his colour draws but goes on
with his 30 z-prepass draws, which write the scene's depth and no colour. The temporal upscalers (DLSS, FSR, XeSS) and
frame generation take that depth, and actor motion draws his motion over it, so they followed an invisible body in front
of the room: copies of the background and a drag over the picture, under DLSS and DLAA.

The rule (gpu/vk/hidden_mesh.h, plain code with the whole decision): a skinned mesh, followed by its vertex buffer, is
hidden after 3 frames in a row with depth-only draws into the scene and no colour from it into any target, following
colour; its depth-only draws into the scene are left out until its colour is back. 3 frames, not 1: the game's colour
pass tests depth EQUAL against these draws, so with 1 a mesh that blinks would never be shown again and a colour lost for
a frame would be lost for two. The frame a hidden mesh's colour comes back still has its depth left out, so it shows a
frame late (Link as the camera leaves him); the log counts those frames, and the draws left out that had a stencil test.
Never left out: a draw with an occlusion query (the game's culling), a draw into another depth target, a mesh that never
had colour. A mesh is a draw's stream 0 only where it reads a vertex from it (not a mesh-shader draw, which keeps the
buffer bound before). draw() asks the rule right after skin_check, so a draw left out is neither given to actor motion nor
given descriptors. One table for every drawing thread: the game submits from several threads and the replay draws one
submission at a time; with the parallel replay (RX_VK_PARALLEL>=2), whose workers draw at once, nothing runs.

Nothing runs without a temporal upscaler or frame generation's inputs, so the game's own upscale is unchanged. With them,
the game's own picture changes too where it reads that depth: later depth-tested draws, the occlusion counts of what is
behind the body, effects made from the depth no longer see the hidden body.

RX_VK_DLSS_FADED=0 draws them again; RX_VK_DLSS_FADED_LOG=1 adds the detailed log lines (by default: a start line and one
line for each stretch of frames with draws left out).

From the patch magicbeanenjoyerguyperson posted on #1370, who found the cause and measured it; reworked here (the 3-frame
rule, the place in draw(), one table for all threads, the stream 0 check, a plain header and its test, the logging, the
parallel replay).

Assisted-by: Claude Opus 5.5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Member

Tested in game: RTX 5090, driver 621.24, Windows 11 (build 26300): Inside the Deku Tree, the top of the 1F vine wall with the camera pushed into Link; DLAA at 5120x2160, DLSS frame generation on. Four runs interleaved with main 544229a2 (this change at 6b3232b8, before the rebase): main smeared both times (dark blotches, flat watercolour patches, a veil moving with the camera), this change neither time. Its log: at most 30 depth draws a frame left out, only while the camera is in Link, none with a stencil test; one draw kept for an occlusion query; Link comes back with the game's own fade-in and no missing frame in a 60 fps clip. No errors.

Tested in game: RTX 5090, driver 621.24, Windows 11 (build 26300): Inside the Deku Tree, the top of the 1F vine wall with the camera pushed into Link; DLAA at 5120x2160, DLSS frame generation on. Four runs interleaved with main 544229a2 (this change at 6b3232b8, before the rebase): main smeared both times (dark blotches, flat watercolour patches, a veil moving with the camera), this change neither time. Its log: at most 30 depth draws a frame left out, only while the camera is in Link, none with a stencil test; one draw kept for an occlusion query; Link comes back with the game's own fade-in and no missing frame in a 60 fps clip. No errors.
Author
Member

@Beanstalk please run this branch at 02cc4682 against main on Linux (any GPU: build it there too) and on Windows with an Intel GPU, with a temporal upscaler on (DLSS or DLAA on NVIDIA, FSR 4 or FSR 3.1 on AMD, XeSS on Intel) and frame generation where the GPU has it. The spot: inside the Deku Tree as child Link, climb the 1F vine wall to its top and turn the camera into Link for about 30 s, then let it come back out; after that a short walk with Link in view. What to look at: on main the picture smears there (dark blotches, flat patches and a veil that move with the camera); with this branch it should be sharp, Link should come back with no missing frame, and Link and his shadow should look as on main on the walk. Run the branch with RX_VK_DLSS_FADED_LOG=1: its vk: upscaler: faded: lines should show at most 30 depth draws a frame left out, only while the camera is in Link.

@Beanstalk please run this branch at 02cc4682 against main on Linux (any GPU: build it there too) and on Windows with an Intel GPU, with a temporal upscaler on (DLSS or DLAA on NVIDIA, FSR 4 or FSR 3.1 on AMD, XeSS on Intel) and frame generation where the GPU has it. The spot: inside the Deku Tree as child Link, climb the 1F vine wall to its top and turn the camera into Link for about 30 s, then let it come back out; after that a short walk with Link in view. What to look at: on main the picture smears there (dark blotches, flat patches and a veil that move with the camera); with this branch it should be sharp, Link should come back with no missing frame, and Link and his shadow should look as on main on the walk. Run the branch with `RX_VK_DLSS_FADED_LOG=1`: its `vk: upscaler: faded:` lines should show at most 30 depth draws a frame left out, only while the camera is in Link.
Member

@pmwork-personal only members of BigBeans can start the farm. One of them can approve this request by reacting 👍 to it or to this comment.

@pmwork-personal only members of `BigBeans` can start the farm. One of them can approve this request by reacting 👍 to it or to this comment.
Member

@Beanstalk

@Beanstalk
Member

Beanstalk test farm

Commit 02cc468 · tier reviewed · approved by llun · dashboard

What will be tested · AI plan (gpt-6.1-terra)

On any available PC, the plan compares main and the PR in the Deku Tree with FSR 3.1 enabled. It moves Link and the camera, captures images for visual regressions, and measures frame times over roughly 13 minutes. Crashes, substantial image differences, or a 20% p99 frame-time regression fail the plan; the scripted route does not guarantee reaching the vine-wall reproduction spot.

  • Where: any (any PC, 1-2 reports).
  • deku-camera: from a new save (settings dlss=3), then teleport to Inside the Deku Tree, take the picture link-visible to compare with main, move the stick, measure tree for 30 s (after 5 s warm-up), take the picture after-camera to compare with main; 1 run on each side.
  • Measured: crashes, frame times, stutters and hitches.
  • The PR fails if: it crashes; or a picture differs from main by more than 10%; or frame time (p99) is more than 20% above main.
  • Time: about 14 min of game runs per tester (2 game starts), plus the two builds.

Done (started 18:37 UTC, last report 20:13 UTC). Comment @Beanstalk to run it again.

Target Reports Crash Frame p99 (ms) vs main VRAM peak (MB) vs main Result
any · 1: linux+other unknown, unknown; 2: linux+nvidia+nvidia-proprietary+dgpu NVIDIA GeForce RTX 3080 Ti, 620.70.6 2/1 1 2 1 PR run — — fail

Measurements · any

Verdict: fail on any (2/1 report): deku-camera crash failed.

Hardware: 1: linux+other unknown, unknown AMD Ryzen 7 5700X3D 8-Core Processor, 128 GB RAM; 2: linux+nvidia+nvidia-proprietary+dgpu NVIDIA GeForce RTX 3080 Ti, 620.70.6 AMD Ryzen 9 3900X 12-Core Processor, 48 GB RAM
Scene: deku-camera, from a new save (dlss=3); each cell's settings and switches as the table names them
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); deku-camera: 1 game start a side, tree 30 s after 5 s warm-up; each number the median of the runs, then of 2 reports
How to reproduce: the farm's plan above (@Beanstalk on this PR runs it again)

Nothing was measured: no metric came back.

Flags and settings

None: the plan varied no setting, switch or build option.

Markdown for the PR description
## Measurements

**Verdict:** fail on any (2/1 report): `deku-camera crash` failed.

Hardware: 1: linux+other `unknown, unknown` `AMD Ryzen 7 5700X3D 8-Core Processor, 128 GB RAM`; 2: linux+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 3080 Ti, 620.70.6` `AMD Ryzen 9 3900X 12-Core Processor, 48 GB RAM`  
Scene: deku-camera, from a new save (dlss=3); each cell's settings and switches as the table names them  
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); deku-camera: 1 game start a side, tree 30 s after 5 s warm-up; each number the median of the runs, then of 2 reports  
How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again)

Nothing was measured: no metric came back.

### Flags and settings

None: the plan varied no setting, switch or build option.
<!-- beanstalk:sticky --> ### Beanstalk test farm Commit `02cc468` · tier **reviewed** · approved by llun · [dashboard](https://beanstalk.magicbean.dev/prs/1447) **What will be tested** · AI plan (`gpt-6.1-terra`) On any available PC, the plan compares main and the PR in the Deku Tree with FSR 3.1 enabled. It moves Link and the camera, captures images for visual regressions, and measures frame times over roughly 13 minutes. Crashes, substantial image differences, or a 20% p99 frame-time regression fail the plan; the scripted route does not guarantee reaching the vine-wall reproduction spot. - **Where:** any (any PC, 1-2 reports). - **deku-camera:** from a new save (settings dlss=3), then teleport to Inside the Deku Tree, take the picture link-visible to compare with main, move the stick, measure tree for 30 s (after 5 s warm-up), take the picture after-camera to compare with main; 1 run on each side. - **Measured:** crashes, frame times, stutters and hitches. - **The PR fails if:** it crashes; or a picture differs from main by more than 10%; or frame time (p99) is more than 20% above main. - **Time:** about 14 min of game runs per tester (2 game starts), plus the two builds. Done (started 18:37 UTC, last report 20:13 UTC). Comment `@Beanstalk` to run it again. | Target | Reports | Crash | Frame p99 (ms) vs main | VRAM peak (MB) vs main | Result | | --- | --- | --- | --- | --- | --- | | any · 1: linux+other `unknown, unknown`; 2: linux+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 3080 Ti, 620.70.6` | 2/1 [1](https://beanstalk.magicbean.dev/reports/rp_7e0d04d7d8d4ab15) [2](https://beanstalk.magicbean.dev/reports/rp_685e8a8b07a6e694) | 1 PR run | — | — | fail | #### Measurements · any **Verdict:** fail on any (2/1 report): `deku-camera crash` failed. Hardware: 1: linux+other `unknown, unknown` `AMD Ryzen 7 5700X3D 8-Core Processor, 128 GB RAM`; 2: linux+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 3080 Ti, 620.70.6` `AMD Ryzen 9 3900X 12-Core Processor, 48 GB RAM` Scene: deku-camera, from a new save (dlss=3); each cell's settings and switches as the table names them Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); deku-camera: 1 game start a side, tree 30 s after 5 s warm-up; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) Nothing was measured: no metric came back. ### Flags and settings None: the plan varied no setting, switch or build option. <details><summary>Markdown for the PR description</summary> ```markdown ## Measurements **Verdict:** fail on any (2/1 report): `deku-camera crash` failed. Hardware: 1: linux+other `unknown, unknown` `AMD Ryzen 7 5700X3D 8-Core Processor, 128 GB RAM`; 2: linux+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 3080 Ti, 620.70.6` `AMD Ryzen 9 3900X 12-Core Processor, 48 GB RAM` Scene: deku-camera, from a new save (dlss=3); each cell's settings and switches as the table names them Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); deku-camera: 1 game start a side, tree 30 s after 5 s warm-up; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) Nothing was measured: no metric came back. ### Flags and settings None: the plan varied no setting, switch or build option. ``` </details>
Owner

Brought up to the ready-for-review standard (#1454): the checklist's Everyone list has two new boxes, added here from what this PR's description and comments show (please check they match what you know).

  • Tested on my own PC: ticked: Testing's Tested: the author's own in-game A/B on Windows 11, RTX 5090, DLAA with frame generation.
  • Nothing gets worse that I know of: not ticked: Measurements adds a per-draw table lookup with no numbers, so that cost is unmeasured. Measure that cost and state it in Risks, then tick it.
Brought up to the [ready-for-review standard](https://git.magicbean.dev/MagicBeanDev/Longshot/src/branch/main/CONTRIBUTING.md#ready-for-review-out-of-wip) (#1454): the checklist's Everyone list has two new boxes, added here from what this PR's description and comments show (please check they match what you know). - *Tested on my own PC*: ticked: Testing's Tested: the author's own in-game A/B on Windows 11, RTX 5090, DLAA with frame generation. - *Nothing gets worse that I know of*: not ticked: Measurements adds a per-draw table lookup with no numbers, so that cost is unmeasured. Measure that cost and state it in Risks, then tick it.
Some checks failed
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval approved by llun (reviewed)
beanstalk/any 1/1 fail
PR description / Description follows the template (pull_request_target) Successful in 7s
This pull request is marked as a work in progress.
Some workflows are waiting to be reviewed.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'fix/hidden-mesh-depth:pmwork-personal-fix/hidden-mesh-depth'
git switch 'pmwork-personal-fix/hidden-mesh-depth'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!1447
No description provided.