fix(vk): the tree-shadow mask blend off by default (a GPU hang / device lost near Hyrule Castle) #2374
No reviewers
Labels
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
No milestone
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Hookshot!2374
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/mask-blend-off-by-default"
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?
Release blocker for 2.1.1. The owner's test of main crashed near Hyrule Castle: device lost after a ~2.5 s GPU hang on the mesh draw
b0b3b40244c71ec7. In the checkpoints, the draw that follows it is OoT's tree-shadow pass3427a1dbefd5e02c, the one #1581's mask blend (mask_stabilize) runs after.49f75dc8RX_VK_MASK_BLEND=0Two of last night's route runs (
sun_nodefer,c8_on) died the same way, on the same program.This makes the blend opt-in (
RX_VK_MASK_BLEND=<weight>; the default was 0.85). Without the TAAU network, the tree-shadow streaks it evened out come back until the hang is found.tests/test_tree_shadow_mask.pyis updated (passes).cc the author of #1581: the hang is on the draw before your pass, so it may be the mask image's history or barrier rather than the blend itself. Logs are available.
🤖 Generated with Claude Code
Right call for 2.1.1: with the default at 0 the
MaskGuardindraw()is never armed, somask_stabilize(its history images, barriers and dispatches) never runs, and the frame is what v2.1.0 drew.RX_VK_MASK_BLEND=0.85still brings it back for testing, and the updated check pins the 0.0f default and the 0 to 0.95 clamp.On the hang itself, #2171 (mikaba-eu) looks like the likely cause and fits your checkpoints.
mask_guard = {cmd, at.color[0], ...}builds a temporaryMaskGuardand copies it in; the temporary's destructor runs at the end of that statement, somask_stabilizefires once before the tree-shadow draw (right afterb0b3b40244c71ec7in GPU order, on the mask before it is drawn), and again when the real guard leaves scope. That first call can also record the history images' UNDEFINED->GENERAL barriers beforeend_pass, i.e. inside an open dynamic-rendering pass. #2171 arms the guard field by field and movesend_passto the top. Worth running the castle save with #2171 andRX_VK_MASK_BLEND=0.85before turning the default back on. The two PRs touch neighbouring lines invk_draw.cppand should merge cleanly in either order (this one changes only the default and the doc comment).CI: the Linux Python checks part 2/2 and appimage failures are runner DNS/apt errors (
Temporary failure resolving 'azure.archive.ubuntu.com'), not this change; Windows source checks and the Windows Vulkan build pass. A re-run should clear them.@ -5984,2 +5986,3 @@/// RX_VK_MASK_BLEND=0 ran 14 minutes there clean, as v2.1.0 (before this pass) did. Opt-in until the hang is foundfloat mask_weight() {static const float w = std::clamp(getenv("RX_VK_MASK_BLEND") ? (float)atof(getenv("RX_VK_MASK_BLEND")) : 0.85f, 0.0f, 0.95f);static const float w = std::clamp(getenv("RX_VK_MASK_BLEND") ? (float)atof(getenv("RX_VK_MASK_BLEND")) : 0.0f, 0.0f, 0.95f);Nit: when this goes back on, the comment could name the likely cause (the temporary guard's early dispatch, #2171) rather than only "until the hang is found". Also missing a final period.
github-sync referenced this pull request2026-11-12 06:22:54 +00:00