Skip to content

GPU: composite multiple PresentX planes (fixes Series S black UI/menus) - #211

Closed
Yaekai wants to merge 10 commits into
Marvisak:mainfrom
Yaekai:feat/gpu-presentx-multiplane
Closed

Yaekai wants to merge 10 commits into
Marvisak:mainfrom
Yaekai:feat/gpu-presentx-multiplane

Conversation

@Yaekai

@Yaekai Yaekai commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Problem

When running with --console series-s, GTA VI calls PresentX with 2 planes:

  • Plane 0: 1920×1080 3D scene buffer (black during menus)
  • Plane 1: 3840×2160 UI/HUD overlay plane

Previously, queue::present only read plane_parameters[0] and ignored planes 1..planes, causing --console series-s to display a solid black screen on menus and lose the UI/HUD overlay in gameplay.

Changes

  • crates/victory-gpu/src/queue.rs:
    Pad Plane to the observed 72-byte (0x48) array stride (const _: () = assert!(size_of::<Plane>() == 0x48);) so plane_parameters[1..] indexes cleanly.
    • Collect all active plane resources (up to 8) and pass them to Host::present, restoring each plane's resource state afterward.
  • crates/victory-gpu/src/host.rs:
    • Keep the existing zero-overhead CopyResource fast path when planes.len() == 1.
    • When planes.len() >= 2, size the swap chain to the maximum (width, height) across planes and lazily compile a small built-in fullscreen-triangle compositor (Compositor, via D3DCompile):
      • Plane 0 is drawn opaque (linear-scaled to the swap chain).
      • Planes 1.. are composited on top with premultiplied alpha (ONE, INV_SRC_ALPHA).
      • Diagnostics captures (VICTORY_CAPTURE) and black-frame probes read back the composited backbuffer.

Verification

  • Built --profile diag -p victory --features diagnostics cleanly with 0 warnings in modified code.
  • Tested live with --console series-s + VICTORY_D3D12_DEBUG=1 + VICTORY_CAPTURE:
    • Before: frame-150.png and frame-256.png were 100% solid black ((0, 0, 0)), while VICTORY_DUMP_TARGETS showed the menu rendered onto the 3840×2160 Plane 1 texture.
    • After: presenting to a window width=3840 height=2160 format=28, 0 D3D12 debug layer errors from the compositor, and frame-150.png / frame-256.png render the crisp 4K menu UI cleanly.

@kykifox1337-source

Copy link
Copy Markdown

Tested on NVIDIA and Windows 10, without the debug layer: it fixes the black screen here too.

Setup: Windows 10 22H2 (19045), i7-8700K, RTX 2070 SUPER 8 GB (driver 610.88), diag build of main d2a4bae + #175 (Windows 10 needs the Agility runtime to draw at all) + this PR at 24a387d, --console series-s, VICTORY_CAPTURE. Counts only.

without this PR with it
captured frames 1 to 1650 all solid black (identical 1.5 KB PNGs) while 1,500 to 2,900 draws/frame ran intro video and loading screen render; frames from 750 on are full images
presentation 1920x1080 presenting to a window width=3840 height=2160
menus 30 fps 25 to 30 fps

The device was removed (0x887A0004, no DRED) about 45 s after the world loaded. Series X mode on the same build was removed the same way, so it is not from this PR; it looks like the NVIDIA world hang in #71.

AI-assisted (Claude Code); I ran everything above myself.

@cdomergue

Copy link
Copy Markdown

Tested 24a387d on Windows with an RTX 4070 SUPER in Series S mode. On main (d2a4bae), the window stayed black. With this PR alone, I could see the profile selector, choose Player, and use the first-run settings. The navigation options and button prompts were readable in French.

The last screen I saw was purple. The log ended with a memory allocation failure before I reached the world.

I recommend merging this PR. It fixes the black menus on my setup and lets me get through the settings.

@Castyan

Castyan commented Nov 24, 2026

Copy link
Copy Markdown

Independent A/B test on main at 8e79c80, with only PR #211 at 24a387d applied to the second build.

Setup — Windows 11 Pro x64 build 26300, Ryzen 5 9600X, 16 GB RAM, RTX 5060 installed. Both builds used Rust 1.98.1, the diag profile, Series S, and the WARP software adapter. Both were observed for 60 seconds with fresh, separate cache and data directories and no scripted input.

Observation main Same base + #211
Swap chain at creation 1920 × 1080 3840 × 2160
Black samples 73 / 73 13 / 46
Non-black samples 0 / 73 33 / 46
First non-black sample — Frame 180, 8.78 s
Window FPS counter at the end 30 15
Minimum Windows commit headroom 6,488 MiB 6,305 MiB

Both processes were still running at the end of the observation. The monitored logs showed no commit-limit error, device removal, or unhandled exception. The same temporary measurement in both builds logged only the black/non-black result of VIctory's existing grid probe at every 30th frame and at powers of two. No frame captures were saved. The automated observation establishes that the sampled output became non-black with the PR. Menu readability and gameplay were outside this measurement.

AI-assisted test automation and report.

@Alex-Devxx

Copy link
Copy Markdown

Tested this PR locally on top of c7a5f49 with --console series-s on an AMD Radeon RX 7600 (RDNA 3):

  • System: Windows 11 Home (10.0.26300), Ryzen 5 5500X3D, 16 GB RAM, RX 7600 (Driver 32.0.32029.2010)
  • Build: diag (VICTORY_D3D12_DEBUG=1, VICTORY_D3D12_DRED=1, VICTORY_LOG=info)
  • Executable BLAKE3: b99f876b74d4a77f03af5f878223b27bd647b5c35a79d5decd9f716504239e93

Before vs. After (Series S)

  • Before (vanilla c7a5f49): presenting to a window width=1920 height=1080 format=28; completely black screen during boot/menus (audio and controller worked in the background).
  • After (with PR GPU: composite multiple PresentX planes (fixes Series S black UI/menus) #211): presenting to a window width=3840 height=2160 format=28; menus/UI render cleanly at 30.0 fps (~1.6–3.3 ms GPU time, 0 dropped draws).
  • World / Cutscenes: Loaded all the way into the first cutscene and skipped into the second cutscene (frame 2706) with zero crashes and no GPU device removal (unlike Series X mode on the same machine, which hits DXGI_ERROR_DEVICE_HUNG with a view heap page fault at slot 1402368). Scene itself remains dark as expected (304 untranslated shaders, 1160–4804 draws/frame dropped), and cleanly saved the pipeline library on exit (made=615, loaded=362).
  • Additional Series S WARN lines noted in world load: victory_gpu::resource: a GPU address above 40 bits address=0x130d8920000, pipeline state slot=0x58, command list slot=0x1a8.

@rubcov666

Copy link
Copy Markdown

Confirmed the Series S profile-screen fix on Windows 11 WARP. I tested upstream ffe310eb2098 and the same revision with only the compositor change from 24a387d700bc. Both used the diagnostic build, the same 1.0.2.1 title, fresh cache and save directories, and no input. I closed each run after frame 512.

Series S menu check Main Main + this PR
Swap chain 1920×1080 3840×2160
Whole-image check All 10 captures through frame 512 were solid black Frames 256 and 512 showed the profile menu. Frame 512 matched the verified Series X profile capture byte for byte locally.
Window sample at the end 30 fps, 14 draws/frame 30 fps, 14 draws/frame

Regression test. The attached patch adds a Windows WARP test that calls the production PresentX path with generated solid-color RGBA8 textures. The base is 32×32 and the overlay is 64×64. The existing readback returns the brightest RGB channel, which can be checked exactly for each uniform image.

Input Main Main + this PR Expected
Red base alone 192 192 192
Green overlay alone 32 32 32
Overlay over black 0 32 32
Overlay over red 192 96 96 ± 1

The same test failed on main and passed with the PR. The ordinary diagnostic victory-gpu library suite on the patched build also passed (53 passed, 2 ignored). Extract the patch in the checkout and run these commands in a Windows desktop PowerShell session.

git apply presentx-two-planes.patch
$env:VICTORY_D3D12_WARP = '1'
cargo test --locked -p victory-gpu --lib --features diagnostics queue::present_tests::presentx_blends_two_solid_planes -- --ignored --exact --nocapture --test-threads=1

Ryzen 7 9800X3D, Windows 11 Pro 26300.9974, WARP 10.0.26100.9818, Rust 1.98.1. The title comparison covers the profile screen. Baseline title runs.

Test execution and reporting were assisted by Codex on this PC.

presentx-two-planes.zip

@Castyan

Castyan commented Nov 24, 2026

Copy link
Copy Markdown

Follow-up A/B on main at ffe310e, with only PR #211 at 24a387d applied to the second build.

Both builds used Rust 1.98.1, the diag profile, Windows 11 x64, Series S, and WARP, with separate fresh VIctory caches and profiles. There was no scripted input. Counts below use only samples within the first 60 seconds.

Observation main Same base + #211
Swap chain at creation 1920 × 1080 3840 × 2160
Black samples 68 / 68 13 / 41
Non-black samples 0 / 68 28 / 41
First non-black sample — Frame 180, 9.53 s

I kept the candidate running for 155 seconds. It was still running at the cutoff, and all 69 sampled frames from the first non-black sample through the cutoff were non-black. The monitored logs showed no device removal or Win32 commit-limit error. The probe recorded only black/non-black values from VIctory's existing grid. No frame captures were saved.

For context, a separate earlier manual run with #211 on 8e79c80 ended after about 133 seconds with DXGI codes 0x887A0004 and 0x887A0005 following a submission of 24 lists. The extended run above covers unattended startup and does not replay that manual input sequence.

AI-assisted test automation and report.

Xeltax pushed a commit to Xeltax/VIcky that referenced this pull request Nov 24, 2026
Xeltax pushed a commit to Xeltax/VIcky that referenced this pull request Nov 24, 2026
…Marvisak#358 Marvisak#89 Marvisak#331 Marvisak#86 Marvisak#83 Marvisak#211 Marvisak#260 Marvisak#275)

Conflict in crates/victory-gpu/src/descriptor/host.rs: gpu-state (Marvisak#251)
moved the dynamic-slot search into free_table(); gpu-draw (Marvisak#86) bounds
the search by the heap's spare slots instead of DYNAMIC. free_table() works
over taken.len(), which is the spare count, so the helper is kept with
gpu-draw's spare-based cursor wrap. Both sides' tests kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1984742628 added a commit to 1984742628/VIctory that referenced this pull request Nov 24, 2026
… PresentX planes

Merges https://github.com/fxceless/victory-fork (main, 4e17478) into this
fork. The two rewrote the same GPU and shader code (20 files, 80 conflicts),
so the merged tree is fxceless's tree, with two additions it does not have,
re-applied on top:

- The FidelityFX upscaler answered by AMD's PC FidelityFX SDK when
  VICTORY_FFX_DIR is set (the pc-fsr branch, f96ad82): applied unchanged.
- PR Marvisak#211's multi-plane PresentX compositing (Series S menus): several
  planes are composited in a list of their own; a single plane keeps
  fxceless's present path, including presents sent ahead.

Dropped in favour of fxceless's own implementations: this fork's lazy host
textures and VRAM report, bounds root constants, rectangle geometry shader,
mesh index/position changes, the diagnostics switches added with them, and
PRs Marvisak#89, Marvisak#492 and Marvisak#578 (fxceless has its own target formats and wave64
handling; Marvisak#578 refused every wave64 compute program on 32-lane GPUs). That
work stays reachable on the try/pr-211-578 branch at 575a4ee.

Builds with and without the diagnostics feature; the workspace tests pass.
Not run in the game yet.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@Capi360

Capi360 commented Nov 24, 2026

Copy link
Copy Markdown

Independent Series S test on Windows 11 Pro build 26200, Ryzen 7 5700X3D, 32 GiB RAM, RTX 3060 Ti 8 GiB, NVIDIA driver 616.56.

I ran the #1638 NVIDIA stack with #242, then repeated with #211 integrated using the same profile and cache starting point. The Series S output before #211 was black in the sampled frames, including frames 600 and 1400. With composition, the intro and loading image came back. The center sample went from 0% colored pixels to 99.7% at frame 600 and 87.3% at frame 1400. Both compositor tests passed on this system.

I stopped at low Windows commit headroom during loading, so this verifies the display change through the intro and loading screen. Gameplay and its HUD remain unverified in this run.

Exact source revision. AI-assisted.

KainanP added a commit to KainanP/VIctory that referenced this pull request Nov 24, 2026
…us) onto Marvisak#1024 + Marvisak#346 + Marvisak#334 + integ/next

One conflict, crates/victory-gpu/src/host.rs tests: the stack adds
`adapter_filter_parses_index_and_name` and the capability tests, Marvisak#211 adds
`present_compositor_builds_both_pipeline_states`, at the same place. The
shared text holds the `#[test]` before and the closing brace after, so the
stack's last test is closed in the hunk and Marvisak#211's follows as its own test
(not nested). `Host::present` (single plane fast path, compositor for 2+)
and `queue::present` merged without conflict; the stack does not change
either. No non-textual fix needed (cargo check --all-targets --all-features).

No negative report on Marvisak#211: the Series S menus render on RTX 2070 SUPER,
RTX 4070 SUPER, RTX 3060 Laptop, RTX 4080, RX 7600 and WARP, and the device
removals seen later in the world also happen in Series X mode without it.
KainanP added a commit to KainanP/VIctory that referenced this pull request Nov 24, 2026
…6B16A16_FLOAT) onto Marvisak#211 + Marvisak#1024 + Marvisak#346 + Marvisak#334 + integ/next

Conflicts, both in tests:
1. crates/victory-gpu/src/descriptor/host.rs: the stack's tests
   (`raw_views_start_on_16_bytes` and the raw/structured view tests after
   it, from Marvisak#1426/Marvisak#704) and Marvisak#492's four `rgb9e5_srv_*` tests at the same
   place; git interleaved them over shared lines (a resource description's
   `SampleDesc`, a closing brace), so the two hunks are not separable
   texts. Resolved by keeping the stack's tests exactly as they were and
   adding Marvisak#492's four tests whole, as Marvisak#492 has them, before
   `dynamic_slots_are_held_until_released` (where Marvisak#492 put them). The
   resulting diff of the file against the previous head equals Marvisak#492's own
   (+235/-5 against main).
2. crates/victory-gpu/src/resource.rs: the stack's
   `get_desc_reports_the_allocated_mip_chain` and Marvisak#492's
   `r9g9b9e5_target_format_substitutes_rgba16f` /
   `r9g9b9e5_render_target_and_uav_textures_create_on_host` at the end of
   the module. The shared text holds the `#[test]` before and the closing
   braces after: the stack's test is closed in the hunk and Marvisak#492's follow
   as separate tests (not nested).

The non-test changes (`target_format`, `fits` taking a resource
description, `fits_texture_srv`, RTV and pipeline formats) merged without
conflict. `fits` has no other caller in the stack. Uploads from title
memory still skip render-target/UAV textures (`texture::title_written`),
so no 4-byte RGB9E5 rows are detiled into a substituted 8-byte texture.
Known open point from the review, not fixed by Marvisak#492: a copy between a
substituted target and a sampled-only RGB9E5 texture would mismatch
formats on the host; no report shows the title doing that.
No non-textual fix needed (cargo check --all-targets --all-features).
KainanP added a commit to KainanP/VIctory that referenced this pull request Nov 24, 2026
…sak#98, Marvisak#334 to Marvisak#492, validation)

The line rebuilt on the bundles' current heads (Marvisak#1402 119b763, Marvisak#1492 5bbc098
without Marvisak#98, Marvisak#1504 1d41891, Marvisak#1511 ca601f0) with every merge replayed, and the
merges after this file's first version (Marvisak#334, Marvisak#346, Marvisak#1024, Marvisak#211, Marvisak#492): merge
order, the runner's numbers on 967d3ae (RTX 571, WARP 570 + the known Marvisak#1084
failure, all features 580; Marvisak#98's one test leaves), what is not included (Marvisak#98,
Marvisak#282 for Marvisak#346, Marvisak#693 for Marvisak#1024, Marvisak#306's latest commit), and the open pull
requests whose head is contained here (109, from the 18:24 collection).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
github-actions Bot added a commit to KevinPratap/VIctory that referenced this pull request Nov 24, 2026
@giacbiologicbomb

Copy link
Copy Markdown

Tested a local adaptation of this PR on Windows with an RTX 5070 and about 15 GB RAM, using --console series-s. Before this adaptation the window was black; with the local adaptation I could see the loading screen reach its end. I did not see the world.

This was not an unmodified PR build: it was adapted on top of an fxceless-based local stack, with the fork's asynchronous presentation path replaced by synchronous presentation. The compositor initialization test passed, but the game result is not isolated to this PR.

In a later run without a free-RAM cutoff, the process ended after roughly 121 seconds. Its log reported no host list for a state prelude; device removed with an invalid-call/state message. Available RAM had been around 0.3 GB shortly before exit. I cannot tell whether memory pressure, the local adaptation, or something else caused the GPU failure.

GPU tests: check blended pixels after compositor initialization recovers
@giacbiologicbomb

Copy link
Copy Markdown

Follow-up to my earlier report: I tried Series S again on a cleaner local baseline: stack8 at 25b72e6 plus my adapted #211 compositor (a5a7a34), without the later stack9/JMAN fixes. The build passed and the title started, but it ended after approximately 84 seconds, before I saw the world.

The log reports host GPU device removed after a submission of 1 lists, with no DRED breadcrumbs and an invalid-call/state removal reason. Available physical RAM briefly reached approximately 0.30 GB; I did not use an automatic RAM cutoff on this run. I cannot determine from these logs whether memory pressure, my adaptation, another change in the combined baseline, or something else caused the removal. This is not an unmodified PR-head test.

1984742628 added a commit to 1984742628/VIctory that referenced this pull request Nov 24, 2026
…l at the world)

In Series S mode the title asks for its FidelityFX upscale output as a
1920x1080 R9G9B9E5_SHAREDEXP texture with render target and unordered
access. PC D3D12 never allows either use in that format: the texture was
refused, and the render target view made for it in that format removed
the device ("CreateRenderTargetView: The format (0x43, R9G9B9E5_SHAREDEXP)
cannot be used with a RenderTarget view", then DXGI_ERROR_INVALID_CALL),
the moment the world began. Series X does not hit it: its title does not
upscale by default.

target_format now gives R16G16B16A16_FLOAT for R9G9B9E5_SHAREDEXP on every
host (PR Marvisak#492's rule, lost when this fork's tree replaced the one that had
it). Texture creation, clear values, render target views, pipeline formats
and the view checks all go through target_format, so they agree.
shortcut: a view of the stand-in reads the alpha written there, where
RGB9E5 reads 1.

Tests: the mapping, and the title's exact texture made on the host GPU.
Also fixes PR Marvisak#211's PresentX test for this fork's rtv() (an Option), which
did not compile with the diagnostics feature.

Verified in the game: Series S no longer loses the device; FSR upscales
(first upscale result=0) and the world runs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@EgoRaInevitable

Copy link
Copy Markdown

I tested #211 on Linux/Proton, merged onto latest main.

PR head 8cd5cc6, merged onto main 70564ae (merge commit f4581aa) in a local worktree. Diagnostics build: --profile diag -p victory --features diagnostics, cargo-xwin 0.24.1, Rust 1.98.1.

System: CachyOS 7.3.5, Ryzen 5 5600X, RTX 3060 Ti 8 GB, driver 620.73.04. Runtime: Proton Experimental experimental-11.0-20261112, vkd3d-proton 3.2.0, DXVK from Proton Experimental. Run: --console series-s, VICTORY_CAPTURE.

An earlier Series S run on main was a black screen on my machine. With #211:

  • presentation changed to presenting to a window width=3840 height=2160 format=28;
  • frames 1/2/4/8/16/32/64: 0.0% non-black;
  • frames 128/150/256/512: 99.9% non-black;
  • frame 1024: 100.0% non-black;
  • I saw the menu and the loading screen.

The run later ended after ~78 s with NVRM NV_ERR_NO_MEMORY while host textures reached ~6152 MB. That is the 8 GB card limit, not this PR; no XMem mapping failures were logged. Recommend merge.

AI-assisted: build/run/capture analysis; I verified the display was actually not black and rendered the menu and intro.

@Marvisak

Copy link
Copy Markdown
Owner

Automated triage for the maintainers. Closing because it breaks a repository rule (see docs/asset-policy.md and the project rules): nothing taken from the console SDK or the game, no weakening of the asset policy, and the title stays offline.

If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

@Marvisak Marvisak closed this Nov 25, 2026
@Yaekai

Yaekai commented Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

This looks like a false positive from automated triage — this PR only modifies crates/victory-gpu/src/host.rs and crates/victory-gpu/src/queue.rs, contains no game assets, binaries, or console SDK code/headers, uses only synthetic 32×32 render-target tests and a standard 10-line fullscreen-triangle HLSL shader, keeps everything offline, and passes cargo xtask policy.

In case the SDK struct name in the Plane doc comment / PR description tripped the check, I've replaced it with a neutral description of the observed 0x48-byte stride. Could this be re-checked and reopened?

@Calvix2k

Copy link
Copy Markdown
Contributor

Independent confirmation on Windows 10 22H2 + RX 7800 XT (RDNA3), rebasing this PR's head onto main 4118f33 with only our Agility opt-in (#175) added:

  • Without the compositor: --console series-s presents a black window; the title is at 30 fps with 50+ draws/frame.
  • With it: the first-boot UI is visible at 30 fps (the "UI-TEXTGRÖSSE" screen and the calibration logo), and controller input advances it. The swap chain is sized 3840x2160 across the two planes, as the PR describes.

The next blocker here is unrelated to presentation: descriptor::create_placed_srv hands descriptor::record a handle in memory that VirtualQuery reports as not committed/writable (�x336f0f60); guarding the write lets the title continue and it then hits the null write at �ictory-image+0x23cf683 (#1118), so the placed view is needed. That is the Series S descriptor-heap case, not this PR.

The triage closure (asset policy) is a false positive from where I sit: this changes only crates/victory-gpu/src/host.rs and queue.rs, adds a ~10-line HLSL compositor compiled at runtime, and cargo xtask policy passes on the rebased tree. Please re-check/reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.