Repository navigation
Series S: the second present plane, and a plain stretch for the upscale dispatch - #188
sagouindupm wants to merge 9 commits into
Conversation
…resent plane, and a plain stretch for the upscale dispatch Part of #16
|
Works here: with this branch, Setup
From the log (about 3.5 minutes)
On the same machine, Series X runs out of RAM after about 7 minutes, so Series S is the useful mode for 16 GB / 8 GB machines. No game data. (AI-assisted: Claude Code built the branch, read the log and wrote this comment.) |
No PC GPU renders to R9G9B9E5, so CreateRenderTargetView on such a target removes the device. Add it to the existing stand-in table, next to the 16-bit colour formats. (cherry picked from commit 7dc19f2)
(cherry picked from commit 9ba864a)
… for the upscaler's output Two passes of ours for the title's Series S mode, in a new module `over`. A present there has two planes: the game image at 1920x1080 and the interface at 3840x2160, empty texels zero with alpha zero. Only the first plane's first resource was shown, so the window was black through the menus and loading screens. The second plane (its description 0x48 bytes after the first, laid out the same) is now drawn over the back buffer after the copy of the first: one triangle, the plane sampled across the whole buffer, blended by its alpha, taken as premultiplied. `list::upscale_stretch` records, on a title list, a compute pass that writes a texture from the bilinear samples of the top-left part of another, then replays the list's state. It is what the upscale dispatch is given in place of the console upscaler (next commit). Measured on an RTX 3050 8 GB, Windows 11: with `--console series-s` the menus and loading screens are visible at 30 fps where the window was black. One plane behaves as before. No test yet; planes after the second and a plane's placement parameters are not read.
In its Series S mode the title renders at 1280x720 and calls the console's
FidelityFX upscaler (`ffxDispatch` of amd_fidelityfx_loader_xbox.dll) to make
the 1920x1080 output. The loader and upscaler are the title's own DLLs and
run, but the upscaler's passes are compute pipelines in a container that is
not translated ("falling back to NewBE" in the title's log), so the output
was never written: the world was black behind the interface.
The executable's import of `ffxDispatch` is now bound to ours. An upscale
dispatch (type 0x10001, the public FidelityFX API's layout) is recorded as
`victory_gpu::list::upscale_stretch` of its colour input into its output;
any other dispatch, and an upscale that could not be stretched, goes to the
title's DLL. The DLL is not registered as an HLE module: that kept the
title's own from loading and left its other three entry points missing.
Measured on an RTX 3050 8 GB, Windows 11, release build, on top of the
R9G9B9E5 stand-in (fxceless#32): the Series S world renders (opening cutscene), 0.4
to 1.2 s a frame with peaks of 3 s, the card about a quarter busy, 7 GB of
video memory, no host error in a five-minute run. Series X is not affected
in the run made (it does not dispatch the upscaler).
Not done: temporal accumulation, sharpening, use of the depth and motion
inputs. No test yet. Only the opening cutscene was looked at.
66804e3 to
19a0240
Compare
|
Tested on Windows, works for menus in Series S mode. Setup: NVIDIA GeForce RTX 3070 Laptop GPU, AMD Ryzen 7 5800H, 32 GB RAM, Windows 11 IoT Enterprise LTSC (build 26100), rustc 1.99.0. Diag build ( Before (fork With this PR:
Remaining warnings (same as without the PR): unimplemented pipeline creation methods at device slots Thanks, this fixes the black Series S menus here. |
ErRusso
left a comment
There was a problem hiding this comment.
Reviewed at 19a0240 against 2119b0e. The first two commits are #32's and unmodified; the review below covers the last two.
Verification:
cargo xwin check --release -p victory-gpu -p victory-hlepasses.victory-gpu --libunder Wine: 110 passed, 0 failed, 1 ignored.victory-hle --libunder Wine: 94 passed, 1 failed (net::tests::only_loopback_is_reachable, Wine lacksWSAConnectByList; unrelated).
Requesting changes for three concrete items:
-
over.rs:245-247writes out of bounds for non-multiple-of-8 sizes.Dispatch(width.div_ceil(8), height.div_ceil(8), 1)launches threads pasttarget's width/height, and the shader writestarget[id.xy]unconditionally. The tested 1920x1080 and 1280x720 happen to divide by 8, but the pass is generic. Addif (id.x >= width || id.y >= height) return;(pass the dimensions in the constants or useGetDimensions) instead of relying on typed-UAV out-of-bounds writes being discarded. -
ffx.rs:108-111returns success when there is no real dispatch. IfREAL == 0andupscale_stretchreturns false,dispatchreturns0(FFX success) without writing the output or calling the title's DLL. That is the silent-black case this PR is meant to remove, and it also masks a missing loader/export. Return a non-zero FFX error, or log once and make the interception conditional onREAL != 0inrun.rsso the original import is not replaced when no fallback exists. -
No tests for the new logic. The compile-time
offset_of!(Upscale, output)assert is good, but the PR adds 671 lines of unsafe ABI/descriptor code with no test. Please add at least unit tests for the pure pieces:typed()mappings,Upscaleoffsets forrender/upscale(not justoutput), and the plane-selection predicate. A GPU test for the stretch/over passes would be better, but the pure checks are the minimum.
Process: #32 is still open and its two commits are carried here. Please state the merge order explicitly (or rebase this onto #32) so reviewers do not merge #32 twice or merge this without #32's review.
Non-blocking:
record_stretchcaches a failedmake_stretchasNoneforever (over.rs:334), unlikeover::record, which retries. A transient first-call failure leaves the output black for the session.RING = 16andSTRETCH_RING = 64are fixed in-flight assumptions; document or derive them from the maximum presents/dispatches sent ahead.- On Wine, both new shaders go through
host::compile; without #20's root-signature fallback they will failCreateRootSignature. Worth noting as a dependency for Proton/Series S.
|
Confirmed a lit 3D scene on a desktop RTX 5070, Windows, NVIDIA 610.88. I applied the four commits from With The last Series S interval was 424 ms/frame at 4,481 draws. All nine timing intervals late in the Series S capture were still compiling pipelines from its fresh cache. A warm-cache comparison would be needed to establish a speed difference. The run reached its target frame without device removal. AI-assisted build, capture, and review. |
… is an error; tests What the review of fxceless#188 asked for. - over.rs: the stretch's groups are 8 by 8 and reach past a target whose size is not a multiple of 8; the shader now reads the target's size and returns for texels outside it, instead of leaving them to out-of-bounds writes being dropped. - ffx.rs: a dispatch that was neither stretched nor passed to the title's own DLL (none found) returned success with the output unwritten. It now returns FFX_API_RETURN_ERROR and says so once in the log. - queue.rs: the choice of a present's second plane is a function of its own (`second_plane`), so it can be tested. - over.rs: a stretch pass that could not be made is tried again at the next dispatch, as the pass over a present is; the two view rings say what their fixed sizes rest on. Tests: the typed-format mapping and the stretch's bounds guard (`over::tests`), the second plane's choice over seven cases (`queue::plane_tests`), the upscale description's offsets and the unanswered dispatch (`ffx::tests`). `cargo test --release -p victory-gpu -p victory-hle`: 113 passed, 0 failed, 1 ignored; 97 passed, 0 failed; `no_dll_planting` 1 passed. One release run with `--console series-s` on an RTX 3050 8 GB, about 3.5 minutes: both passes fire, the world renders, no host error.
|
Thanks for the review; all three items are addressed in
Process: the description now states the merge order (#32 first; I rebase once it lands so only this PR's commits remain). Non-blocking:
Verification on AI-assisted: Claude Code (Claude Fable 5.2) wrote the changes and this reply and made the run. |
|
On An asset-free test isolated the failure. Wine’s compiler returned success for both shaders but emitted no OpenAI Codex assisted with the patch, testing and report. |
… is an error; tests What the review of fxceless#188 asked for. - over.rs: the stretch's groups are 8 by 8 and reach past a target whose size is not a multiple of 8; the shader now reads the target's size and returns for texels outside it, instead of leaving them to out-of-bounds writes being dropped. - ffx.rs: a dispatch that was neither stretched nor passed to the title's own DLL (none found) returned success with the output unwritten. It now returns FFX_API_RETURN_ERROR and says so once in the log. - queue.rs: the choice of a present's second plane is a function of its own (`second_plane`), so it can be tested. - over.rs: a stretch pass that could not be made is tried again at the next dispatch, as the pass over a present is; the two view rings say what their fixed sizes rest on. Tests: the typed-format mapping and the stretch's bounds guard (`over::tests`), the second plane's choice over seven cases (`queue::plane_tests`), the upscale description's offsets and the unanswered dispatch (`ffx::tests`). `cargo test --release -p victory-gpu -p victory-hle`: 113 passed, 0 failed, 1 ignored; 97 passed, 0 failed; `no_dll_planting` 1 passed. One release run with `--console series-s` on an RTX 3050 8 GB, about 3.5 minutes: both passes fire, the world renders, no host error.
Under Wine / Proton the system compiler compiles a [RootSignature] attribute without writing the signature into the shader, so CreateRootSignature on the shader failed and both passes of over.rs were never made: Series S stayed black there (reported on fxceless#188, Bazzite, RTX 5060 Laptop, vkd3d-proton). The signatures are now built from descriptions and serialized with D3D12SerializeRootSignature: a table of the plane and a bilinear sampler for the pass over a present; four constants, a table of the source and the target, and the sampler for the stretch. The sources no longer name one. cargo test --release -p victory-gpu --lib: 114 passed, 0 failed, 1 ignored (three runs; an earlier run of the whole test binary ended in an access violation once and did not again). One release run with --console series-s on an RTX 3050 8 GB, Windows 11, about 3 minutes: both passes fire, menus and the world render, no host error. Not run under Wine here.
|
@Filip722 thank you, that was precise enough to act on. On Windows it behaves as before: Your read-back test (the stretched blue scene with the transparent, premultiplied green and opaque red overlay regions) is exactly the GPU test the review asked for and that this PR still lacks. If you are willing to push it somewhere, I will take it into this branch with your authorship. AI-assisted: Claude Code (Claude Fable 5.2) wrote the change and this reply and made the run. |
|
Confirmed on the RTX 5060 Laptop (8 GB), Bazzite 44, NVIDIA 615.78.08, Proton Experimental 11.0-20261112 and vkd3d-proton 3.2.0 ( The test-only commit is ready to cherry-pick onto this branch. It runs the stretch and overlay, reads all 15 output texels, and checks the transparent, half-green and opaque-red regions. The fixture failed at I also ran the full Windows-target OpenAI Codex (GPT-6.2-Sol) assisted with the fixture, builds, testing and report. |
Run the real stretch and overlay passes on a 3 by 2 blue scene and a 5 by 3 synthetic overlay. Read back the output and check every texel for transparent, half-alpha and opaque regions. On the RTX 5060 Laptop under Proton the previous revision fails to record the stretch and the serialized-root revision passes. Assisted-by: OpenAI Codex (GPT-6.2-Sol) (cherry picked from commit 76687ee3b125e7b94bd9db12549fd36705e91023)
|
@Filip722 taken as @ErRusso this is the GPU test of the two passes your review said would be better than the pure checks: it runs the stretch and the pass over a present and reads the output texels back. With AI-assisted: Claude Code (Claude Fable 5.2) made the cherry-pick and the run and wrote this comment. |
…t time) Hardware-verified on RTX 5070 Laptop GPU (8 GB) in 95s 3D gameplay (0 crashes). Includes upstream PRs (#1677, fxceless#987, fxceless#188, fxceless#610) plus Phase 1-3 changes: - descriptor/host.rs: lock-free AtomicU64 + 64-striped slot_locks/kept in HostHeap::mirror - host.rs & queue.rs: victory-reaper background thread for COM/late-wait drops; Held::Present 2nd MPO plane support for VICTORY_ASYNC_PRESENT=1 - xmem.rs: XMemMapPhysicalPagesScatter single-lock hoisting, no-op skipping, exact 64 KiB placeholder fast path (preserving 64 KiB page independence) - shadow.rs: move D3D12 buffer allocations (shared_buffer, card_for, window_card_for, place_for) outside BUFFERS/LOOSE write locks - draw.rs, host.rs, indirect.rs, list.rs: 2-slot isolated indirect_window_scratch ring synced with draw::State::windows, remove post-clamp global UAV(None) barrier, use targeted uav_barrier_for(src/count) via UAV cleanliness tracking, default VICTORY_TEXTURE_STAGE_MB=48 Measured 1000 Hz profile (baseline -> Phase 3): - usual frame: 183.2 ms -> 102 ms (-45%) - GPU all other lists: 70.3 ms -> 36.4 ms (-48%) - GPU card busy: 47% -> 68% - shadow RwLock wait: 93.46 ms (P1+2) -> 0.00 ms (-100%) - execute_indirect: 167.05 ms (P1+2) -> 78.10 ms (-53%)
… is an error; tests What the review of fxceless#188 asked for. - over.rs: the stretch's groups are 8 by 8 and reach past a target whose size is not a multiple of 8; the shader now reads the target's size and returns for texels outside it, instead of leaving them to out-of-bounds writes being dropped. - ffx.rs: a dispatch that was neither stretched nor passed to the title's own DLL (none found) returned success with the output unwritten. It now returns FFX_API_RETURN_ERROR and says so once in the log. - queue.rs: the choice of a present's second plane is a function of its own (`second_plane`), so it can be tested. - over.rs: a stretch pass that could not be made is tried again at the next dispatch, as the pass over a present is; the two view rings say what their fixed sizes rest on. Tests: the typed-format mapping and the stretch's bounds guard (`over::tests`), the second plane's choice over seven cases (`queue::plane_tests`), the upscale description's offsets and the unanswered dispatch (`ffx::tests`). `cargo test --release -p victory-gpu -p victory-hle`: 113 passed, 0 failed, 1 ignored; 97 passed, 0 failed; `no_dll_planting` 1 passed. One release run with `--console series-s` on an RTX 3050 8 GB, about 3.5 minutes: both passes fire, the world renders, no host error. (cherry picked from commit 82231c3)
Under Wine / Proton the system compiler compiles a [RootSignature] attribute without writing the signature into the shader, so CreateRootSignature on the shader failed and both passes of over.rs were never made: Series S stayed black there (reported on fxceless#188, Bazzite, RTX 5060 Laptop, vkd3d-proton). The signatures are now built from descriptions and serialized with D3D12SerializeRootSignature: a table of the plane and a bilinear sampler for the pass over a present; four constants, a table of the source and the target, and the sampler for the stretch. The sources no longer name one. cargo test --release -p victory-gpu --lib: 114 passed, 0 failed, 1 ignored (three runs; an earlier run of the whole test binary ended in an access violation once and did not again). One release run with --console series-s on an RTX 3050 8 GB, Windows 11, about 3 minutes: both passes fire, menus and the world render, no host error. Not run under Wine here. (cherry picked from commit c022e4d)
…to the right and bottom edges The title's colour can be the top left of a larger texture. The sampler clamps at the texture's edge, not at the rendered size's, so the last column and row took in texels beside it. The coordinate now stays half a texel inside the rendered size. Reported with the fix and the measurement by ArturoWolff on fxceless#188; the readback test gets a padded source for it (red beside a blue 3 by 2 scene in a 4 by 3 texture: top right was (51,0,204), now blue). (cherry picked from commit 3ed3b19)
Our presents held behind a queue's line (VICTORY_ASYNC_PRESENT=1, off by default; from the fork's 3973179) carry one texture and are shown later with no second plane. With fxceless#188 the second plane (the interface, in the title's Series S mode) is drawn by the present made at once, so such a present now goes that way instead of being held. Without the switch nothing changes: presents are never held. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…till wrong with the 3D picture - What the fork adds: fxceless#188, the second present plane and the plain stretch, with its limit (the size of a plane's description is not from Microsoft's documentation). - Status: on Series S the selector and the loading pictures show and the session goes on into the game (Codex, build 3f07a38, 606 s to the time limit, no crash). Measured here: two planes on Series S, one on Series X. The 3D picture is nearly black; no frame-rate change is claimed. - What's next: the three separate reasons the 3D picture is poor (ray tracing off by default, no room for textures on 8 GB, the plain stretch) and then the frame rate. English and Spanish. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…sent plane, a plain stretch for the upscale dispatch) Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Tested on RTX 5060 Ti 8 GB (Windows 11) on top of fork 🤖 Generated with Claude Code |
|
How this merges on current The conflict is in One more call site. Main's held present ( Run. RTX 3070 8 GB, 16 GB RAM, Windows 11, AI-assisted (Claude Code). No game data attached. |
|
I rebased the six presentation and stretch commits onto The benchmark initially captured black PNGs because it read the first plane before composition. Reading the composed buffer produced visible content in 26 of 28 captures. The same 28 frame numbers were black with the original readback. Both asynchronous switches were enabled. Captured frames use the synchronous readback path. The latest captured frame showed illustrated loading. Readback commit Both GPU readback tests ran on RADV and passed. The plane parser test passed too. Tested-on: Radeon RX 6800, Fedora Linux 45, Wine and RADV |
|
A follow-up to my earlier note here: with AI-assisted (Claude Code, with Gemini). No game data attached. |
Gets the Series S mode (
--console series-s) from a black window to a rendered world on an 8 GB NVIDIA card. Stacked on #32 (its two commits are the first two here, unchanged, by their author); the commits after them are this PR's.Merge order: #32 first, then this. Once #32 is merged I rebase this branch onto
main, which leaves only this PR's own commits; if this is merged first instead, #32's two commits come in with it and #32 can be closed as merged. Please do not merge both as they stand.What is in it
crates/victory-gpu/src/over.rs(new),host.rs,queue.rs: a present's second plane is drawn over the first. In Series S mode the title presents two planes (game image 1920x1080, interface 3840x2160 with alpha 0 where empty) and only the first was shown, so menus and loading screens were black. The second plane is drawn after the copy of the first, stretched to the back buffer and blended by its alpha (taken as premultiplied). Its views are kept in a ring, so presents sent ahead keep theirs.crates/victory-hle/src/modules/ffx.rs(new),apps/victory/src/run.rs,crates/victory-gpu/src/list.rs: the executable's import offfxDispatchis bound to ours. An upscale dispatch (type0x10001, the public FidelityFX API layout; the title renders 1280x720 and asks for 1920x1080) becomes a compute pass that writes the output from bilinear samples of the colour input, then replays the list's state. Any other dispatch, and an upscale that cannot be stretched, goes to the title's own DLL. The console upscaler's passes are not translated ("falling back to NewBE" in the title's log), so its output was never written and the world was black behind the interface.Tested
NVIDIA GeForce RTX 3050 8 GB, Intel Core i5-12400F, 32 GB RAM, Windows 11 Pro 26200, Rust 1.98.1.
Runs were made on
8f3f488(these commits before the rebase onto currentmain; the rebase brought in only the two lane-mask commits):--console series-s, about five minutes: menus and loading at 30 fps; the opening cutscene renders at 0.4 to 1.2 s a frame with peaks of 3 s; the card about a quarter busy; 7 GB of video memory; no host error.VICTORY_D3D12_DEBUG=1 VICTORY_D3D12_DRED=1, same mode, about five minutes: no debug-layer message, no device removal.After the rebase (
66804e3, now19a0240: the same tree, commit messages rewritten):cargo check --release -p victorypasses;cargo test --release -p victory-gpu -p victory-hle: 110 passed, 0 failed, 1 ignored and 95 passed, 0 failed, plusno_dll_planting1 passed.After the review (
82231c3):cargo test --release -p victory-gpu -p victory-hle: 113 passed, 0 failed, 1 ignored and 97 passed, 0 failed, plusno_dll_planting1 passed. One release run with--console series-s, about 3.5 minutes: both passes fire, the world renders, no host error.After
c022e4d(explicit root signatures):cargo test --release -p victory-gpu --lib: 114 passed, 0 failed, 1 ignored, three times; an earlier run of the whole test binary ended in an access violation once and did not again. One release run with--console series-s, about 3 minutes: both passes fire, menus and the world render, no host error.03d1791(by Filip722) adds a GPU read-back test of both passes; with itcargo test --release -p victory-gpu --lib: 115 passed, 0 failed, 1 ignored. Filip722 confirmedc022e4dunder Proton (thread below).Not tested
c022e4d(the compiler there writes none into the shader, reported in the thread below); the HLSL itself still goes throughhost::compile.Related
AI use
🤖 Generated with Claude Code