Present: a single R11G11B10_FLOAT or R9G9B9E5 plane is drawn into the FP16 swap chain, not dropped #1837
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!1837
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1837"
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?
@upipibi on GitHub · 2026-11-29 00:43 UTC · original
upipibi:fix/present-packed-float→main· +359 −10 · 2 files · 3 commits · merged 2026-11-29 08:16 UTCDepends on #1709. The branch's first commit is #1709's (101Leafy), cherry-picked onto current main
f9dfb76so this applies; only the last two commits are this PR's.Fixes: no issue reports this (see below).
What it changes
swap_format(crates/victory-gpu/src/host.rs) has no swap chain family for DXGI_FORMAT_R11G11B10_FLOAT (26) orDXGI_FORMAT_R9G9B9E5_SHAREDEXP (67). #1709 lets two planes compose into an FP16 back buffer when the scene has no
family, but a plane presented on its own still stops at
"cannot present this format", and that frame is never shown.On top of #1709 this PR:
compose::viewaccepts it: 2D, one slice, onesample, no DENY_SHADER_RESOURCE);
compose.rs,ps_single, made byComposer::single): theplane is sampled, alpha is set to one, and nothing is clamped.
Composer::recordgets the plane twice and thesecond copy is unread. The Presenter keeps this composer in its own
singleslot, so the two-plane composer isuntouched;
Nonewith a warning if that composer cannot be made or recorded, as before, because the plane cannot becopied into the swap chain.
The
singlecomposer is made once, after the resize block (after itssettle_now), and only while its slot isempty. It is never replaced or cleared while the presenter lives, and
drop_presentersettles before dropping it.So the drop-before-settle point UwUCammie raised on #1709 (descriptor heaps freed while queued presents still use
them, and a second creation) does not apply to this slot.
If #1709 changes (for example to move its composer creation after the resize), I will rebase this on top.
The two-plane shader is not reused for this because its
clean/saturateclamps to [0, 1]. A copy into the FP16swap chain (formats 9..=14) keeps values above one, and so does this pass.
Linear-colour caveat: like the existing 9..=14 copy, the FP16 swap chain is linear and no transfer function is
applied. A plane that holds display-encoded values looks the same as it would through that copy.
Commit 1 also adds a test-only hook in
present_planes(present_seen,#[cfg(test)]only). It reads back the backbuffer before the panel, notice and menu are drawn. The tree had no present-path test harness. The hook does not
change non-test builds.
How it was tested
GPU and profile: RTX 3070, driver 616.56, Windows 11 (10.0.26100), rustc 1.98.1. Presenter unit test only, no
title run: no game files used.
Test
host::packed_present_tests::packed_float_single_planes_are_presented:format changes between them.
1.0. The RGBA8 control must be 255, 0, 0, 255.
Base: main
f9dfb76with #1709 (32dedce) on top. WARP runs useVICTORY_D3D12_WARP=1and--features diagnostics; the test prints which adapter it ran on.Before (
f9dfb76+ #1709 + the test commit only), on hardware and on WARP: frame 0 (R8G8B8A8_UNORM) presentedSome(false)and read back. Frame 1 (R11G11B10_FLOAT) presentedNone, nothing read back:frame 1 (R11G11B10_FLOAT) was not presented, FAILED.After (this branch): every frame presented
Some(false)and read back. All 5,120 pixels matched, 3/3 on hardwareand 3/3 on WARP.
For shader changes, the wave sizes tested: n/a (presenter)
cargo test -p victory-gpu --lib --locked:f9dfb76+ #1709)--features diagnosticsThe one extra test is the new one.
cargo clippy -p victory-gpu --all-targets --locked, with and without diagnostics: no findings on the changedlines. The only victory-gpu findings are the existing
drop(presenter)lines inpresent_planes(#1459/#1645address them).
-D warningsstops earlier, in victory-shader, on main.Checked for overlap
#1645, #1459, #1668, #1265, #1801, #605
present_planes. #1645 and #1459change the two-plane
drop(presenter)fallbacks next to it. Whichever merges second needs a small rebase there.Composer::format()): this PR builds on it and addsonly the single-plane case it leaves out.
compose.rs(shader source or composer setup). This PR adds one entry pointand does not change
ps.swap_formatchange for these formats. No issue reports it.Credit: the approach is TaynanGT/Vice-Tay#365's (pass a single sampleable plane through the compositor when DXGI
cannot present its format; its description measures R11G11B10_FLOAT frames presented by the title). This version
is adapted to this tree's compositor, with an unclamped pass instead of the SDR one. The upstream version is
Marvisak/VIctory#3784; the per-pixel test with values above one is andrewpozdnakov7-jpg's extension there,
credited as co-author on the test commit.
AI use: written with Claude Code (Claude Opus 5.5) and reviewed before submission. Tested as above.
🤖 Generated with Claude Code
An R11G11B10_FLOAT or R9G9B9E5_SHAREDEXP plane presented alone is never shown: swap_format has no swap chain for them. The test presents an RGBA8 control and both packed formats across swap chain format changes and checks every pixel the present put into the back buffer (5,120 of them), read back through a test-only hook in present_planes. On main the RGBA8 control is presented and R11G11B10_FLOAT is not ("frame 1 (R11G11B10_FLOAT) was not presented"). Ported from Marvisak/VIctory#3784; the per-pixel, per-quadrant checks with values above one are andrewpozdnakov7-jpg's extension there. Co-authored-by: andrewpozdnakov7-jpg <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>