Publish written depth planes before later draws in the same list #1541
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!1541
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1541"
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?
@invismann on GitHub · 2026-11-28 21:25 UTC · original
invismann:fix/same-list-depth-plane-publication→main· +95 −112 · 3 files · 1 commits · merged 2026-11-29 08:16 UTCSupersedes #1018 and replaces the depth-plane portion of #1532.
A draw can depth-test against stale values when an earlier shader wrote the depth-plane twin and the copy waits until the list closes. Publish the written plane before later commands in the same list. Restore the render targets and invalidate cached state after the internal pass.
Validation
On upstream
77df871e, strict Clippy reports existing shader diagnostics and the full-tree asset policy flags the existing size ofemit/lower.rs. The test-module split for that file is in #1460.[pr-fix] [rendering] Publish written depth planes before later draws in the same listto Publish written depth planes before later draws in the same list@nick0451 on GitHub · 2026-11-28 22:35 UTC · original
Tested in play: RTX 3090 24 GB (driver 610.88), i9-14900K, Windows 11. A release build of this PR merged onto main
923e38c, run in turn with main and four other PR builds. Series S, DLSS Performance, frame generation off. The same frozen save, outdoors on a balcony, standing still. A warm-up start per build, then two rounds, each run 40 s to settle and 60 s measured, then a screenshot. Main: 25.4 and 24.8 fps, 10 compute programs refused (no wave32 lowering). I compare round 2 only, because round 1 was slow for every new build.ERRORline. The picture matches main, and the same 10 programs are refused as on main, so nothing in this scene visibly depends on this change.The first start of every new build in this session crashed while loading at
+0x23cf683(main and all five PRs alike; see #628), so that is not from this change.Tested with an AI assistant (Claude Code); results are from this PC.
@KyleS98 on GitHub · 2026-11-28 23:57 UTC · original
An in-game case for this, with a trace, in case it helps the review: mirrors.
The title draws what a mirror shows as a second view of its own (programs
*MirrorReflection*, into images of the picture's size rounded up to 16, in a centred rectangle the size of the mirror on screen). Right before those draws,PS_Prepass_StencilCulling(drawn withMS_VS_TransformD_PositionOnly) marks the mirror's pixels by writing that view's depth image through an unordered-access view (an R32_FLOAT view of an R32G8X24 image), in the same list. With the plane drawn from its twin only when the list closed, every draw of the mirror's view was tested against the plane as it had been: withVICTORY_DUMP_TARGETSall ten of the view's images held one colour each at the end of the frame, and the mirror showed the sky (first house, the bathroom).What the list does with that depth image, from a trace of
twin_usein my fork:late);behind [Some(false), Some(true)]: nothing owed bybehind[0]any more.So by the time the draws come the plane is owed through
latealone. Publishing right after the writer, as this does, is ahead of all that: the plane is up to date before step 3. (My own first attempt looked atbehind[0]before each draw and did nothing in this list, for that reason.)Tested:
d4b5d517+ this commit cherry-picked (clean) + #1762, RTX 3090 Ti (616.92), Series S, DLSS Quality, builder off, first house's bathroom: "times used before the pass" 0 at the end of a 200 s run (2,300 "not given back to a twin"), and the mirror's view is drawn. With this alone the mirror turns from sky to black, because the view's own lighting has only the sun's direct light without the rays; #1762 is the light for it, and with both the mirror shows the room.AI-assisted (Claude Code, Claude Fable 5.2).
@amazedturnip on GitHub · 2026-11-29 05:38 UTC · original
Tested alongside #1762 on 9800X3D + RTX 5070 Ti 16 GB (Series X 1440p DLSS, RT off). Same-list depth publish ran cleanly across 20+ min gameplay with zero depth glitches or stalls.