gpu: packed 16-bit render targets are R8G8B8A8 where the GPU cannot render to them #89

Open
github-bot wants to merge 2 commits from github-bot/gh-89 into main AGit
Owner

@⁠HenriqueSBueno on GitHub · 2026-11-24 00:22 UTC · original
HenriqueSBueno:nvidia-packed-targets → main · +895 −26 · 6 files · 2 commits · open

What

On a GPU that can't render to the console's packed 16-bit colour formats, or can't write them as typed UAVs, render-target and unordered-access textures in those formats are made as R8G8B8A8_UNORM. The formats are B5G5R5A1_UNORM (86) and B4G4R4A4_UNORM (115). Textures that are only sampled keep their format.

Why

On NVIDIA (RTX 3080, driver 616.92) the title asks for two 2560x1440 targets the driver refuses:

WARN victory_gpu::resource: no host texture error=E_INVALIDARG ... format: 86, ... flags: 5
WARN victory_gpu::resource: no host texture error=E_INVALIDARG ... format: 115, ... flags: 1

NVIDIA has no render-target support for B4G4R4A4 and no typed UAV for B5G5R5A1. AMD has both, so this doesn't show on an RX 6700 XT.

How

  • resource::target_format stands the R8G8B8A8_UNORM format in for 86/115. It applies only when CheckFeatureSupport(FORMAT_SUPPORT) lacks RENDER_TARGET or TYPED_UNORDERED_ACCESS_VIEW, asked once per format, so AMD keeps the native formats. Each channel keeps its value, with more precision.
  • Texture creation: a texture with render-target or unordered access uses target_format, and so does its optimized clear value.
  • Render-target views and pipeline RTV formats use target_format, so views, PSOs and resources agree.
  • fits: a shader-resource or unordered-access view naming 86/115 on such a texture takes the texture's format.

Tested

Windows 11, RTX 3080 (NVIDIA 616.92), i5-10400F:

  • cargo test -p victory-gpu: 39 pass. cargo clippy -p victory-gpu: clean. cargo xtask policy: ok.
  • Before: the two warnings above.
  • After: the log says packed 16-bit render targets are R8G8B8A8_UNORM on this GPU for format 86 and format 115, and there are no no host texture warnings.
  • The menus look the same with and without this change. I compared captured frames up to the account prompt and the legal screens, so the textures matter later. Untested on AMD; there the feature check keeps the old path.

AI-assisted (Claude Code)

**@⁠HenriqueSBueno** on GitHub · 2026-11-24 00:22 UTC · [original](https://github.com/Marvisak/VIctory/pull/89) `HenriqueSBueno:nvidia-packed-targets` → `main` · +895 −26 · 6 files · 2 commits · open ## What On a GPU that can't render to the console's packed 16-bit colour formats, or can't write them as typed UAVs, render-target and unordered-access textures in those formats are made as R8G8B8A8_UNORM. The formats are B5G5R5A1_UNORM (86) and B4G4R4A4_UNORM (115). Textures that are only sampled keep their format. ## Why On NVIDIA (RTX 3080, driver 616.92) the title asks for two 2560x1440 targets the driver refuses: ``` WARN victory_gpu::resource: no host texture error=E_INVALIDARG ... format: 86, ... flags: 5 WARN victory_gpu::resource: no host texture error=E_INVALIDARG ... format: 115, ... flags: 1 ``` NVIDIA has no render-target support for B4G4R4A4 and no typed UAV for B5G5R5A1. AMD has both, so this doesn't show on an RX 6700 XT. ## How - `resource::target_format` stands the R8G8B8A8_UNORM format in for 86/115. It applies only when `CheckFeatureSupport(FORMAT_SUPPORT)` lacks `RENDER_TARGET` or `TYPED_UNORDERED_ACCESS_VIEW`, asked once per format, so AMD keeps the native formats. Each channel keeps its value, with more precision. - **Texture creation:** a texture with render-target or unordered access uses `target_format`, and so does its optimized clear value. - **Render-target views and pipeline RTV formats** use `target_format`, so views, PSOs and resources agree. - **`fits`:** a shader-resource or unordered-access view naming 86/115 on such a texture takes the texture's format. ## Tested Windows 11, RTX 3080 (NVIDIA 616.92), i5-10400F: - `cargo test -p victory-gpu`: 39 pass. `cargo clippy -p victory-gpu`: clean. `cargo xtask policy`: ok. - **Before:** the two warnings above. - **After:** the log says `packed 16-bit render targets are R8G8B8A8_UNORM on this GPU` for format 86 and format 115, and there are no `no host texture` warnings. - The menus look the same with and without this change. I compared captured frames up to the account prompt and the legal screens, so the textures matter later. Untested on AMD; there the feature check keeps the old path. AI-assisted (Claude Code)
AI-assisted (Claude Code)
- Buffer-to-texture CopyTextureRegion: widen packed 16-bit (86/115) placed footprints to R8G8B8A8_UNORM and expand texels on the CPU at submission (packed <-> RGBA8 helpers and unit tests added for uploads and readbacks).
- texture::upload: detile widened packed 16-bit textures into a tight 2-byte buffer before expanding rows into the 4-byte host staging footprint.
- GPU-to-GPU CopyResource, CopyTextureRegion, and ResolveSubresource: skip mixed native-packed <-> widened copies once per format before barriers or host_written, and map resolve formats through target_format.
- view_format: return None for typed widened targets so null view descriptions inherit the host resource dimension.

AI-assisted (Claude Code)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:49:54 +00:00
Author
Owner

@⁠ifBars on GitHub · 2026-11-24 00:34 UTC · original

Confirmed the two allocation cases on an RTX 3060 Ti, Windows 10 22H2, NVIDIA 610.88. A synthetic hardware test of the patch created both 2560×1440 resources with the original flags and optimized clear values. Guest format 86 (flags 5) and 115 (flags 1) both became host format 28. Sampled-only textures retained their packed formats.

One integration detail for transfers: a guest buffer footprint in either packed format still describes two bytes per pixel. Directly forwarding that footprint to a widened RGBA8 texture, or copying between a sampled-only packed texture and a widened render target, can record incompatible host copies. Resolves between widened targets also need the effective host format. In the downstream test we allowed transfers with matching representations and declined unsupported mixed transfers before recording barriers or marking the destination written.

This was a native resource test. It did not run the title or establish an effect on the world hang. AI-assisted with Codex.

**@⁠ifBars** on GitHub · 2026-11-24 00:34 UTC · [original](https://github.com/Marvisak/VIctory/pull/89#issuecomment-7118203156) Confirmed the two allocation cases on an RTX 3060 Ti, Windows 10 22H2, NVIDIA 610.88. A synthetic hardware test of the patch created both 2560×1440 resources with the original flags and optimized clear values. Guest format 86 (flags 5) and 115 (flags 1) both became host format 28. Sampled-only textures retained their packed formats. One integration detail for transfers: a guest buffer footprint in either packed format still describes two bytes per pixel. Directly forwarding that footprint to a widened RGBA8 texture, or copying between a sampled-only packed texture and a widened render target, can record incompatible host copies. Resolves between widened targets also need the effective host format. In the downstream test we allowed transfers with matching representations and declined unsupported mixed transfers before recording barriers or marking the destination written. This was a native resource test. It did not run the title or establish an effect on the world hang. AI-assisted with Codex.
Author
Owner

@⁠lordon1a on GitHub · 2026-11-24 00:40 UTC · original

Verified 85ea36da5 on Windows 11 (x86_64-pc-windows-gnullvm, rustc 1.100.0, applied cleanly to main@35b054ec0): pass (no regression on host D3D12).

  • cargo xtask policy: 150 files ok
  • cargo test -p victory-gpu: 39 passed, 0 failed.

AI-assisted.

**@⁠lordon1a** on GitHub · 2026-11-24 00:40 UTC · [original](https://github.com/Marvisak/VIctory/pull/89#issuecomment-7118310812) Verified `85ea36da5` on Windows 11 (`x86_64-pc-windows-gnullvm`, `rustc 1.100.0`, applied cleanly to `main@35b054ec0`): **pass** (no regression on host D3D12). - `cargo xtask policy`: 150 files ok - `cargo test -p victory-gpu`: **39 passed, 0 failed**. AI-assisted.
Author
Owner

@⁠DaviTostes on GitHub · 2026-11-24 00:50 UTC · original

Tested da580e4 under Wine 11.22 + vkd3d-proton 3.1 on Arch Linux x86_64 (AMD RX 9060 XT, RADV 26.3.1), Windows build with cargo xwin ... --target x86_64-pc-windows-msvc: pass, no regression.

  • victory_gpu: 36 passed, 3 failed — the same three environment-only failures as main (argument_clamp_builds, a_rejected_blob_gives_an_empty_library, #128's VirtualQuery upload skip).
  • The diff adds no test, so this only shows nothing else broke. vkd3d-proton does honour the feature-level check this PR relies on for the fallback, so a synthetic case that creates a packed 16-bit target and queries the fallback format would be worth adding.

No game data used. AI-assisted (DeepSeek V4.1 Flash coding agent).

**@⁠DaviTostes** on GitHub · 2026-11-24 00:50 UTC · [original](https://github.com/Marvisak/VIctory/pull/89#issuecomment-7118490142) Tested `da580e4` under **Wine 11.22 + vkd3d-proton 3.1** on Arch Linux x86_64 (AMD RX 9060 XT, RADV 26.3.1), Windows build with `cargo xwin ... --target x86_64-pc-windows-msvc`: **pass, no regression**. - `victory_gpu`: **36 passed, 3 failed** — the same three environment-only failures as `main` (`argument_clamp_builds`, `a_rejected_blob_gives_an_empty_library`, #128's `VirtualQuery` upload skip). - The diff adds no test, so this only shows nothing else broke. vkd3d-proton does honour the feature-level check this PR relies on for the fallback, so a synthetic case that creates a packed 16-bit target and queries the fallback format would be worth adding. No game data used. AI-assisted (DeepSeek V4.1 Flash coding agent).
Author
Owner

@⁠HenriqueSBueno on GitHub · 2026-11-24 01:09 UTC · original

Thanks for the reviews and the numbers on three more cards. 081afbd covers the transfer paths @⁠ifBars and @⁠martingouv pointed out:

  • Buffer-to-texture CopyTextureRegion into a widened target: the 2-byte footprint becomes an R8G8B8A8 footprint (row pitch rounded to 256). The texels are expanded on the CPU at submission.
  • texture::upload: a widened texture is detiled into a tight 2-byte buffer, then expanded row by row into the 4-byte staging footprint.
  • GPU copies and resolves: CopyResource, texture-to-texture CopyTextureRegion and resolves between a native packed texture and a widened one are skipped. Each format logs one warning, and the skip happens before any barrier or host_written, so no invalid host command is recorded. Resolves between two widened targets use target_format.
  • Conversion: B5G5R5A1 is B in bits 0–4, G 5–9, R 10–14, A bit 15. B4G4R4A4 is 4 bits each, B to A from the low bits. Channels are expanded by bit replication.
  • Tests:
    • an exhaustive round trip over all 65,536 values of both formats;
    • bit layouts and pitched rows;
    • target_format is the identity for other formats;
    • detiling a widened texture into RGBA8 staging;
    • a host-GPU test that the copies run, or are skipped where the formats are mixed.
  • Not wired: the readback direction (RGBA8 to packed, for texture-to-buffer copies) is implemented and tested but not used yet. It's for when #67 lands; until then texture-to-buffer copies return early on main as before.

Checks on Windows 11, RTX 3080 (616.92): cargo test -p victory-gpu 43 passed, cargo clippy -p victory-gpu --all-targets clean, cargo xtask policy ok.

AI-assisted (Claude Code)

**@⁠HenriqueSBueno** on GitHub · 2026-11-24 01:09 UTC · [original](https://github.com/Marvisak/VIctory/pull/89#issuecomment-7118821532) Thanks for the reviews and the numbers on three more cards. `081afbd` covers the transfer paths @⁠ifBars and @⁠martingouv pointed out: - **Buffer-to-texture `CopyTextureRegion`** into a widened target: the 2-byte footprint becomes an R8G8B8A8 footprint (row pitch rounded to 256). The texels are expanded on the CPU at submission. - **`texture::upload`:** a widened texture is detiled into a tight 2-byte buffer, then expanded row by row into the 4-byte staging footprint. - **GPU copies and resolves:** `CopyResource`, texture-to-texture `CopyTextureRegion` and resolves between a native packed texture and a widened one are skipped. Each format logs one warning, and the skip happens before any barrier or `host_written`, so no invalid host command is recorded. Resolves between two widened targets use `target_format`. - **Conversion:** B5G5R5A1 is B in bits 0–4, G 5–9, R 10–14, A bit 15. B4G4R4A4 is 4 bits each, B to A from the low bits. Channels are expanded by bit replication. - **Tests:** - an exhaustive round trip over all 65,536 values of both formats; - bit layouts and pitched rows; - `target_format` is the identity for other formats; - detiling a widened texture into RGBA8 staging; - a host-GPU test that the copies run, or are skipped where the formats are mixed. - **Not wired:** the readback direction (RGBA8 to packed, for texture-to-buffer copies) is implemented and tested but not used yet. It's for when #67 lands; until then texture-to-buffer copies return early on `main` as before. Checks on Windows 11, RTX 3080 (616.92): `cargo test -p victory-gpu` 43 passed, `cargo clippy -p victory-gpu --all-targets` clean, `cargo xtask policy` ok. AI-assisted (Claude Code)
Author
Owner

@⁠yuniskh on GitHub · 2026-11-24 02:37 UTC · original · edited 2026-11-24 02:45 UTC

I tested the packed texture fallback on a desktop RTX 5090 (621.24) and the integrated AMD Radeon GPU in the same PC. This builds on martingouv's note about one-bit alpha.

The 5090 can't write formats 86 and 115 as typed UAVs, but the AMD GPU can. I compared the actual AMD writes against a widened RGBA8 shader running on the 5090. Rounding at each store and using the nearest expanded byte on the dependent read matched all 262,144 packed results across both formats. A different rule matched native format 86 render-target draws on the 5090. Overlapping triangles showed why converting only after a draw can still give wrong colors.

For format 115 unblended draws, two inputs could become the same RTX byte but different native AMD packed values. I tried correcting the original shader output before storing it to RGBA8. That matched all 196,608 pixels across two random input sets and a rounding-boundary test.

The ZIP has the shaders, a standalone GPU-to-packed-buffer readback prototype, raw logs and separate texture-layout patches. The patches apply to main at d2a4bae and PR #89 at 081afbd. All 17 standalone test programs passed locally. I haven't compiled the patched VIctory crate or tested gameplay.

AI-assisted with Codex.

VIctory-RTX5090-graphics-tests.zip

Complete outputs folder — includes the DirectX test report, the project test results, and the graphics-test package linked above.

VIctory-complete-outputs.zip

**@⁠yuniskh** on GitHub · 2026-11-24 02:37 UTC · [original](https://github.com/Marvisak/VIctory/pull/89#issuecomment-7120322973) · edited 2026-11-24 02:45 UTC I tested the packed texture fallback on a desktop RTX 5090 (621.24) and the integrated AMD Radeon GPU in the same PC. This builds on martingouv's note about one-bit alpha. The 5090 can't write formats 86 and 115 as typed UAVs, but the AMD GPU can. I compared the actual AMD writes against a widened RGBA8 shader running on the 5090. Rounding at each store and using the nearest expanded byte on the dependent read matched all 262,144 packed results across both formats. A different rule matched native format 86 render-target draws on the 5090. Overlapping triangles showed why converting only after a draw can still give wrong colors. For format 115 unblended draws, two inputs could become the same RTX byte but different native AMD packed values. I tried correcting the original shader output before storing it to RGBA8. That matched all 196,608 pixels across two random input sets and a rounding-boundary test. The ZIP has the shaders, a standalone GPU-to-packed-buffer readback prototype, raw logs and separate texture-layout patches. The patches apply to main at d2a4bae and PR #89 at 081afbd. All 17 standalone test programs passed locally. I haven't compiled the patched VIctory crate or tested gameplay. AI-assisted with Codex. [VIctory-RTX5090-graphics-tests.zip](https://github.com/user-attachments/files/35308400/VIctory-RTX5090-graphics-tests.zip) **Complete outputs folder** — includes the DirectX test report, the project test results, and the graphics-test package linked above. [VIctory-complete-outputs.zip](https://github.com/user-attachments/files/35308595/VIctory-complete-outputs.zip)
Author
Owner

@⁠miniongk on GitHub · 2026-11-24 04:15 UTC · original

Tested 081afbd applied onto #320 (a5ba4a4) plus #483 (65a161d) on an RTX 5080, driver 621.24, Windows 11 26300, with a local Xbox Series 1.0.2.1 copy.

  • cargo test --workspace: 286 passed, 0 failed, 4 ignored.
  • The two packed-format host-texture creation failures present before this patch became zero; the expected compatibility substitutions were logged for both formats.
  • The world still ends in DXGI_ERROR_DEVICE_HUNG. In this run DRED implicated mesh dispatch, with no indirect-execution stop recorded.

This confirms the texture compatibility work on the real title path, but not a fix for #97. Only aggregate counts and error classes shared. AI-assisted (Kimi Code).

**@⁠miniongk** on GitHub · 2026-11-24 04:15 UTC · [original](https://github.com/Marvisak/VIctory/pull/89#issuecomment-7121845989) Tested `081afbd` applied onto #320 (`a5ba4a4`) plus #483 (`65a161d`) on an RTX 5080, driver 621.24, Windows 11 26300, with a local Xbox Series 1.0.2.1 copy. - `cargo test --workspace`: 286 passed, 0 failed, 4 ignored. - The two packed-format host-texture creation failures present before this patch became zero; the expected compatibility substitutions were logged for both formats. - The world still ends in `DXGI_ERROR_DEVICE_HUNG`. In this run DRED implicated mesh dispatch, with no indirect-execution stop recorded. This confirms the texture compatibility work on the real title path, but not a fix for #97. Only aggregate counts and error classes shared. AI-assisted (Kimi Code).
Author
Owner

@⁠walterwallaceson on GitHub · 2026-11-24 05:54 UTC · original

Tested #55 (56f1d41) and #89 (081afbd) together on an AMD CPU, so the Intel start-up blocker above doesn't apply: Windows 10 22H2 (19045.6466), RTX 3070, NVIDIA 621.14, Ryzen 5 5600X, release build. Both merged cleanly on top of #233 (3098672) + #175 (19aec59), so this is the four together, not either PR alone.

#175 + #233 + #55 + #89
no host texture (2560x1440, formats 86 and 115, 0x80070057) 2 0
what renders intro only, then nothing during the world load intro, loading screens, the first mission's title card
device removed (0x887A0006, no breadcrumbs) ~60 s into the world load, 27 lists ~40 s into the world load, 32 lists
  • cargo test --workspace: victory-gpu 48 passed (43 without these PRs); the only failures are the known Windows 10 ones (#118/#152, #362).
  • No title exceptions. The two host pipeline refused lines in the run come after the removal (0x887A0005), so they're a consequence of it.
  • New in this run: no free dynamic descriptor slots: a table is not made about 34 s before the removal, the signature #304 and #336 describe. It didn't appear in the #175 + #233 run. Adding #336 on top makes the world last about 2 min instead of 40 s (details on #336).

No game data in this report.

AI-assisted (Claude Code); everything above was run on my machine.

**@⁠walterwallaceson** on GitHub · 2026-11-24 05:54 UTC · [original](https://github.com/Marvisak/VIctory/pull/89#issuecomment-7123390058) Tested #55 (56f1d41) and #89 (081afbd) together on an AMD CPU, so the Intel start-up blocker above doesn't apply: Windows 10 22H2 (19045.6466), RTX 3070, NVIDIA 621.14, Ryzen 5 5600X, release build. Both merged cleanly on top of #233 (3098672) + #175 (19aec59), so this is the four together, not either PR alone. | | #175 + #233 | + #55 + #89 | |---|---|---| | `no host texture` (2560x1440, formats 86 and 115, `0x80070057`) | 2 | 0 | | what renders | intro only, then nothing during the world load | intro, loading screens, the first mission's title card | | device removed (`0x887A0006`, no breadcrumbs) | ~60 s into the world load, 27 lists | ~40 s into the world load, 32 lists | - `cargo test --workspace`: `victory-gpu` 48 passed (43 without these PRs); the only failures are the known Windows 10 ones (#118/#152, #362). - No title exceptions. The two `host pipeline refused` lines in the run come after the removal (`0x887A0005`), so they're a consequence of it. - New in this run: `no free dynamic descriptor slots: a table is not made` about 34 s before the removal, the signature #304 and #336 describe. It didn't appear in the #175 + #233 run. Adding #336 on top makes the world last about 2 min instead of 40 s (details on #336). No game data in this report. AI-assisted (Claude Code); everything above was run on my machine.
Author
Owner

@⁠erLCoder on GitHub · 2026-11-24 06:26 UTC · original · edited 2026-11-24 06:48 UTC

Tested 081afbd538 on Windows 10 22H2, GTX 1660 Ti, NVIDIA 581.42, Rust 1.98.1.

cargo test --offline --locked -p victory-gpu --features diagnostics --lib packed -- --nocapture --test-threads=1: 4 passed. I repeated the GPU copy/readback test with a local test-only assertion requiring a D3D12 device and RGBA8 fallback: formats 86 and 115 both selected host format 28; sampled-only textures retained their original formats. The test passed.

Earlier independent D3D12 probes on this GPU showed format 86 with UAV flags and format 115 with render-target flags returning E_INVALIDARG. The checks above were synthetic.

Follow-up, game run on the same PC. Series X, fresh cache, Agility SDK 1.620.2. The build combined #89 (081afbd), #152 (18b2716), #334 (af2aecf) and #439 (e6936e3, including #233/#320) with local diagnostic logging. The game logged the RGBA8 fallback for both formats 86 and 115, with zero no host texture messages in this run. After about eight minutes the intro HUD began rendering on a black background. The run ended with DXGI_ERROR_DEVICE_HUNG; DRED stopped at a DispatchMesh breadcrumb. This was one combined run, so the world outcome cannot be attributed to one PR.

AI-assisted report.

**@⁠erLCoder** on GitHub · 2026-11-24 06:26 UTC · [original](https://github.com/Marvisak/VIctory/pull/89#issuecomment-7123929960) · edited 2026-11-24 06:48 UTC Tested 081afbd5382bb6aabaec5b28864c11cf00a15725 on Windows 10 22H2, GTX 1660 Ti, NVIDIA 581.42, Rust 1.98.1. `cargo test --offline --locked -p victory-gpu --features diagnostics --lib packed -- --nocapture --test-threads=1`: 4 passed. I repeated the GPU copy/readback test with a local test-only assertion requiring a D3D12 device and RGBA8 fallback: formats 86 and 115 both selected host format 28; sampled-only textures retained their original formats. The test passed. Earlier independent D3D12 probes on this GPU showed format 86 with UAV flags and format 115 with render-target flags returning E_INVALIDARG. The checks above were synthetic. **Follow-up, game run on the same PC.** Series X, fresh cache, Agility SDK 1.620.2. The build combined #89 (`081afbd`), #152 (`18b2716`), #334 (`af2aecf`) and #439 (`e6936e3`, including #233/#320) with local diagnostic logging. The game logged the RGBA8 fallback for both formats 86 and 115, with zero `no host texture` messages in this run. After about eight minutes the intro HUD began rendering on a black background. The run ended with `DXGI_ERROR_DEVICE_HUNG`; DRED stopped at a `DispatchMesh` breadcrumb. This was one combined run, so the world outcome cannot be attributed to one PR. AI-assisted report.
Author
Owner

@⁠LooperSalty on GitHub · 2026-11-24 08:32 UTC · original

Tested on Intel i7-13700KF + NVIDIA RTX 4070 SUPER, Windows 11, diag build of main dd54de2 + this PR:

  • the two no host texture warnings (formats 86 and 115) are gone;
  • the title goes through the profile screen, intro art, first-run settings, legal screens and the first mission's title card, and the pause menu (Esc) opens and is navigable, at 30 fps in the menus;
  • after that the world is dark at 1-2 fps, as described in the README.

Without this PR the same machine also reaches those screens, but logs both warnings.

🤖 Generated with Claude Code

**@⁠LooperSalty** on GitHub · 2026-11-24 08:32 UTC · [original](https://github.com/Marvisak/VIctory/pull/89#issuecomment-7126268177) Tested on Intel i7-13700KF + NVIDIA RTX 4070 SUPER, Windows 11, diag build of main dd54de2 + this PR: - the two `no host texture` warnings (formats 86 and 115) are gone; - the title goes through the profile screen, intro art, first-run settings, legal screens and the first mission's title card, and the pause menu (Esc) opens and is navigable, at 30 fps in the menus; - after that the world is dark at 1-2 fps, as described in the README. Without this PR the same machine also reaches those screens, but logs both warnings. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Author
Owner

@⁠Sil3ntGam3r on GitHub · 2026-11-24 08:40 UTC · original

Tested on Windows 11, RTX 3070 8 GB (driver 621.14), i5-11600K, merged onto main d2a4bae.

  • main: the first screen stays black; the log has both no host texture … E_INVALIDARG warnings (2560×1440, format 86 flags 5 and format 115 flags 1).
  • with this PR: both warnings are gone. First-boot screens, start screen and loading run at 30 fps and reach the first mission (which then hits the NVIDIA world hang, #619).

cargo test -p victory-gpu passes on the merge. (AI-assisted test run.)

**@⁠Sil3ntGam3r** on GitHub · 2026-11-24 08:40 UTC · [original](https://github.com/Marvisak/VIctory/pull/89#issuecomment-7126432749) Tested on Windows 11, RTX 3070 8 GB (driver 621.14), i5-11600K, merged onto main `d2a4bae`. - main: the first screen stays black; the log has both `no host texture … E_INVALIDARG` warnings (2560×1440, format 86 flags 5 and format 115 flags 1). - with this PR: both warnings are gone. First-boot screens, start screen and loading run at 30 fps and reach the first mission (which then hits the NVIDIA world hang, #619). `cargo test -p victory-gpu` passes on the merge. (AI-assisted test run.)
Author
Owner

@⁠steppergg on GitHub · 2026-11-24 09:14 UTC · original

Tested 081afbd merged onto main 8e79c80 on Windows 10 22H2 (19045.6036), RTX 4060 Ti, driver 621.24, Rust 1.98.1. No game data used.

  • cargo test -p victory-gpu --features diagnostics: 57 passed, 0 failed, 1 ignored, including packed_16_targets_copy_and_skip_mixed_transfers.
  • It now conflicts with main in list.rs (three hunks):
    • In copy_resource and copy_texture_region I kept both sides: the skip_mixed_packed_copy check, then main's title_written upload.
    • In the buffer-to-texture path I took this PR's prepare_footprint_upload. Its non-packed path still calls defer_copy, while main changed that call to defer_fill (the Wine MEM_FREE upload fix). Taking this PR's side as is undoes that fix without any conflict showing inside the new function, so it needs defer_fill there.

The tests pass with defer_fill; I did not test under Wine.

AI-assisted (Claude Code); run on my machine.

**@⁠steppergg** on GitHub · 2026-11-24 09:14 UTC · [original](https://github.com/Marvisak/VIctory/pull/89#issuecomment-7127143973) Tested `081afbd` merged onto main `8e79c80` on Windows 10 22H2 (19045.6036), RTX 4060 Ti, driver 621.24, Rust 1.98.1. No game data used. - `cargo test -p victory-gpu --features diagnostics`: 57 passed, 0 failed, 1 ignored, including `packed_16_targets_copy_and_skip_mixed_transfers`. - It now conflicts with main in `list.rs` (three hunks): - In `copy_resource` and `copy_texture_region` I kept both sides: the `skip_mixed_packed_copy` check, then main's `title_written` upload. - In the buffer-to-texture path I took this PR's `prepare_footprint_upload`. **Its non-packed path still calls `defer_copy`, while main changed that call to `defer_fill`** (the Wine `MEM_FREE` upload fix). Taking this PR's side as is undoes that fix without any conflict showing inside the new function, so it needs `defer_fill` there. The tests pass with `defer_fill`; I did not test under Wine. AI-assisted (Claude Code); run on my machine.
Author
Owner

@⁠Hiiva on GitHub · 2026-11-24 11:03 UTC · original

Verified da580e4 + 081afbd on an ffe310e-based integration branch with Windows 11, RTX 4080, Rust 1.98.1 MSVC, and diagnostics.

The packed copy/readback fixture passes with both the D3D12 debug layer and GPU validation enabled. The RTX uses host format 28 for target formats 86/115 while sampled textures retain 86/115. WARP retains the native packed formats and passes the same fixture. Exhaustive conversion round trips and pitched detile tests also pass.

I added a callback-based debug error collector to this fixture. Host::execute drains the normal info queue, and checking GetDeviceRemovedReason alone does not detect every invalid command. The callback retains errors through submission; it remained empty on both runs. The effective formats are now printed so a skipped device or unexercised fallback is visible.

Integration preserves the mixed-copy checks before main's title_written uploads and uses defer_fill in the non-packed prepare_footprint_upload path, as steppergg identified.

Source: github.com/Hiiva/VIctory@4eada4adea
Test follow-up: github.com/Hiiva/VIctory@4eada4adea

These checks cover synthetic transfers. Widened targets still use 8-bit store precision, and mixed native/widened GPU transfers are skipped.

**@⁠Hiiva** on GitHub · 2026-11-24 11:03 UTC · [original](https://github.com/Marvisak/VIctory/pull/89#issuecomment-7129604376) Verified da580e4 + 081afbd on an ffe310e-based integration branch with Windows 11, RTX 4080, Rust 1.98.1 MSVC, and diagnostics. The packed copy/readback fixture passes with both the D3D12 debug layer and GPU validation enabled. The RTX uses host format 28 for target formats 86/115 while sampled textures retain 86/115. WARP retains the native packed formats and passes the same fixture. Exhaustive conversion round trips and pitched detile tests also pass. I added a callback-based debug error collector to this fixture. Host::execute drains the normal info queue, and checking GetDeviceRemovedReason alone does not detect every invalid command. The callback retains errors through submission; it remained empty on both runs. The effective formats are now printed so a skipped device or unexercised fallback is visible. Integration preserves the mixed-copy checks before main's title_written uploads and uses defer_fill in the non-packed prepare_footprint_upload path, as steppergg identified. Source: https://github.com/Hiiva/VIctory/tree/4eada4adeabeb85c872e5f219984cd7de8ba5113 Test follow-up: https://github.com/Hiiva/VIctory/commit/4eada4adeabeb85c872e5f219984cd7de8ba5113 These checks cover synthetic transfers. Widened targets still use 8-bit store precision, and mixed native/widened GPU transfers are skipped.
Author
Owner

@⁠bittertea0323 on GitHub · 2026-11-24 12:00 UTC · original

PR #89 measured on a second host: packed 16-bit textures stop failing and the title reaches the scene

Independent verification of #89 (nvidia-packed-targets) on Windows 10 + RTX 4070 SUPER, against a
baseline on the same machine one minute earlier. This is a net positive and worth landing, with
one caveat about the remaining translation count.

A/B, same host, same title (Xbox Series X mode, 120 s, 8 GB guard)

                        baseline (main @ ffe310e)    with #89
texture creation failures          2                    0     ← the 86/115 video textures now build
peak draws/frame                  11                  819     ← the title advances into the scene
translation failures              63                  135     ← higher only because more stages run
peak RAM                        8.3 GB             10.05 GB
crash                            none                none

texture failures is no host texture ... E_INVALIDARG (the B5G5R5A1_UNORM / B4G4R4A4_UNORM
cases from #797): the core commit turns them into R8G8B8A8_UNORM and they allocate. The draw count
going from 11 to 819 is the observable consequence — before this, the title never got past the menu
frame.

The higher failure count is not a regression: 63 was the menu-stage count, 135 is measured after
the scene starts submitting, so different shader sets are exercised. It is still well below the 538
seen on older main.

What I could not verify

Only the first of the two commits applied cleanly onto current main (packed 16-bit render targets are R8G8B8A8); the second (convert and guard packed 16-bit transfers) conflicts in
crates/victory-gpu/src/list.rs because it was written against an older base. So the texture
counters and draw count above are from the core widening only — the CPU-side texel expansion is
missing in my build, which means the video frames may allocate correctly but show wrong colours.

If the author or a maintainer rebases the pair onto ffe310e, re-running this bench would tell us
whether the expansion commit also fixes the appearance (my build cannot answer that).

Reproduce

The bench script from #819 with -Console series-x -MaxRamGB 8, 120 s, on a host with a real copy of
the title. Nothing game-specific is quoted here.

**@⁠bittertea0323** on GitHub · 2026-11-24 12:00 UTC · [original](https://github.com/Marvisak/VIctory/pull/89#issuecomment-7130842920) # PR #89 measured on a second host: packed 16-bit textures stop failing and the title reaches the scene Independent verification of #89 (`nvidia-packed-targets`) on Windows 10 + RTX 4070 SUPER, against a baseline on the same machine one minute earlier. This is a **net positive and worth landing**, with one caveat about the remaining translation count. ## A/B, same host, same title (Xbox Series X mode, 120 s, 8 GB guard) ``` baseline (main @ ffe310e) with #89 texture creation failures 2 0 ← the 86/115 video textures now build peak draws/frame 11 819 ← the title advances into the scene translation failures 63 135 ← higher only because more stages run peak RAM 8.3 GB 10.05 GB crash none none ``` `texture failures` is `no host texture ... E_INVALIDARG` (the `B5G5R5A1_UNORM` / `B4G4R4A4_UNORM` cases from #797): the core commit turns them into `R8G8B8A8_UNORM` and they allocate. The draw count going from 11 to 819 is the observable consequence — before this, the title never got past the menu frame. The higher failure count is **not** a regression: 63 was the menu-stage count, 135 is measured after the scene starts submitting, so different shader sets are exercised. It is still well below the 538 seen on older `main`. ## What I could not verify Only the first of the two commits applied cleanly onto current `main` (`packed 16-bit render targets are R8G8B8A8`); the second (`convert and guard packed 16-bit transfers`) conflicts in `crates/victory-gpu/src/list.rs` because it was written against an older base. So the texture counters and draw count above are from the **core widening only** — the CPU-side texel expansion is missing in my build, which means the video frames may allocate correctly but show wrong colours. If the author or a maintainer rebases the pair onto `ffe310e`, re-running this bench would tell us whether the expansion commit also fixes the *appearance* (my build cannot answer that). ## Reproduce The bench script from #819 with `-Console series-x -MaxRamGB 8`, 120 s, on a host with a real copy of the title. Nothing game-specific is quoted here.
Author
Owner

@⁠NuraadGit on GitHub · 2026-11-24 14:56 UTC · original

A world measurement for this from an RTX 2080: GTA VI uses both packed formats as full-screen targets every frame, and on NVIDIA their writes are lost without a substitution like this one.

I tested on a stack that has #55's "drop the use the host refuses" fallback (JMAN730's fork + #493 + #189 + #206 + #667 + #704 + #489 + #747's 2^18 slots). In the world, the fallback fires on exactly two textures:

host texture without a use the host refuses  2560x1440 format 115 (B4G4R4A4_UNORM)  flags RT          dropped=RT
host texture without a use the host refuses  2560x1440 format 86  (B5G5R5A1_UNORM)  flags RT|UAV      dropped=UAV

So without a substitution, the B4G4R4A4 target's draws and the B5G5R5A1 target's compute writes are lost. Before I guarded the RTV path (my comment on #55), the first one also removed the device.

I tried the substitution in the fork's target_format: 86 and 115 become R8G8B8A8_UNORM for render-target or UAV textures, and their views, pipeline RTV formats and clear values follow. With that, the fallback doesn't fire at all, the world runs ~2,840 draws per frame, and the device stays up for 12 minutes.

Two suggestions for this PR:

  1. Include the UAV case. The B5G5R5A1 texture needs unordered access, not only a render target. NVIDIA has neither for 86.
  2. The console's 10-bit float colours, 116 (R10G10B10_7E3_A2_FLOAT) and 117 (R10G10B10_6E4_A2_FLOAT), have no PC format at all. R16G16B16A16_FLOAT is the natural stand-in for targets. I haven't seen GTA VI create one yet, so this is a heads-up, not a measured case.

AI-assisted (Claude Code): the runs and log analysis were automated. The hardware, title copy and runs are the user's.

**@⁠NuraadGit** on GitHub · 2026-11-24 14:56 UTC · [original](https://github.com/Marvisak/VIctory/pull/89#issuecomment-7135201747) **A world measurement for this from an RTX 2080: GTA VI uses both packed formats as full-screen targets every frame, and on NVIDIA their writes are lost without a substitution like this one.** I tested on a stack that has #55's "drop the use the host refuses" fallback (JMAN730's fork + #493 + #189 + #206 + #667 + #704 + #489 + #747's 2^18 slots). In the world, the fallback fires on exactly two textures: ``` host texture without a use the host refuses 2560x1440 format 115 (B4G4R4A4_UNORM) flags RT dropped=RT host texture without a use the host refuses 2560x1440 format 86 (B5G5R5A1_UNORM) flags RT|UAV dropped=UAV ``` So without a substitution, the B4G4R4A4 target's draws and the B5G5R5A1 target's compute writes are lost. Before I guarded the RTV path (my comment on #55), the first one also removed the device. I tried the substitution in the fork's `target_format`: 86 and 115 become `R8G8B8A8_UNORM` for render-target or UAV textures, and their views, pipeline RTV formats and clear values follow. With that, the fallback doesn't fire at all, the world runs ~2,840 draws per frame, and the device stays up for 12 minutes. Two suggestions for this PR: 1. **Include the UAV case.** The B5G5R5A1 texture needs unordered access, not only a render target. NVIDIA has neither for 86. 2. **The console's 10-bit float colours, 116 (`R10G10B10_7E3_A2_FLOAT`) and 117 (`R10G10B10_6E4_A2_FLOAT`), have no PC format at all.** `R16G16B16A16_FLOAT` is the natural stand-in for targets. I haven't seen GTA VI create one yet, so this is a heads-up, not a measured case. *AI-assisted (Claude Code): the runs and log analysis were automated. The hardware, title copy and runs are the user's.*
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-24 14:47 UTC · original · edited 2026-11-24 15:03 UTC

I reproduced a pixel-level difference for a same-format copy on an RTX 5090. The device reports RTV and shader sampling support for B5G5R5A1_UNORM (86), with typed UAV support absent.

The synthetic case uses two 1×1 format-86 textures. The source has ALLOW_RENDER_TARGET only and is cleared to opaque red. The destination has flags 0 and starts with packed green 0x03e0. I recorded the same guest CopyResource(destination, source) on both revisions and read back both resources.

Revision Source after clear Destination after copy
Pre-PR parent 35b054e Format 86, 0xfc00 Format 86, 0xfc00
PR head 081afbd RGBA8, [255, 0, 0, 255] Format 86, 0x03e0

I also ran a local control on 081afbd retaining native format 86 for this test and got 0xfc00 again. The same logical-format copy is reaching the mixed-format skip because the missing typed-UAV capability also widens an RTV-only resource. Selecting the fallback by use would need to account for the physical RTV formats when choosing the graphics PSO, since both native 86 and RGBA8 attachments could then represent the same guest format.

Follow-up on usage-based selection. A local prototype with RTV-specific PSO variants restored the RTV-only → sampled copy on the RTX 5090. A single logical format-86 graphics pipeline also drew opaque red to both a native format-86 RTV and a widened RGBA8 RTV on the same command list, in both binding orders. I checked explicit and default RTV descriptions.

There is a second copy to preserve. With a format-86 RTV|UAV source cleared to red and an RTV-only destination initialized to green, 081afbd backed both resources with RGBA8 and the destination read back red. In the usage-split prototype the source was RGBA8 and the destination was native format 86. The destination still read its original packed green 0x03e0 after CopyResource.

That leaves two pixel-level cases for a complete change to pass. Usage-based allocation and RTV-compatible PSO selection restore the first copy. The second also needs a transfer between the two physical formats.

**@⁠fuzeofficlal** on GitHub · 2026-11-24 14:47 UTC · [original](https://github.com/Marvisak/VIctory/pull/89#issuecomment-7134949311) · edited 2026-11-24 15:03 UTC I reproduced a pixel-level difference for a same-format copy on an RTX 5090. The device reports RTV and shader sampling support for `B5G5R5A1_UNORM` (86), with typed UAV support absent. The synthetic case uses two 1×1 format-86 textures. The source has `ALLOW_RENDER_TARGET` only and is cleared to opaque red. The destination has flags `0` and starts with packed green `0x03e0`. I recorded the same guest `CopyResource(destination, source)` on both revisions and read back both resources. | Revision | Source after clear | Destination after copy | | --- | --- | --- | | Pre-PR parent `35b054e` | Format 86, `0xfc00` | Format 86, `0xfc00` | | PR head `081afbd` | RGBA8, `[255, 0, 0, 255]` | Format 86, `0x03e0` | I also ran a local control on `081afbd` retaining native format 86 for this test and got `0xfc00` again. The same logical-format copy is reaching the mixed-format skip because the missing typed-UAV capability also widens an RTV-only resource. Selecting the fallback by use would need to account for the physical RTV formats when choosing the graphics PSO, since both native 86 and RGBA8 attachments could then represent the same guest format. Follow-up on usage-based selection. A local prototype with RTV-specific PSO variants restored the RTV-only → sampled copy on the RTX 5090. A single logical format-86 graphics pipeline also drew opaque red to both a native format-86 RTV and a widened RGBA8 RTV on the same command list, in both binding orders. I checked explicit and default RTV descriptions. There is a second copy to preserve. With a format-86 `RTV|UAV` source cleared to red and an `RTV`-only destination initialized to green, `081afbd` backed both resources with RGBA8 and the destination read back red. In the usage-split prototype the source was RGBA8 and the destination was native format 86. The destination still read its original packed green `0x03e0` after `CopyResource`. That leaves two pixel-level cases for a complete change to pass. Usage-based allocation and RTV-compatible PSO selection restore the first copy. The second also needs a transfer between the two physical formats.
Author
Owner

@⁠NuraadGit on GitHub · 2026-11-24 16:08 UTC · original

Two corrections to my comment above.

  1. "NVIDIA has neither for 86" is wrong. My own log says so: the fallback dropped only the UAV use of the B5G5R5A1 texture (flags: 5, dropped=4) and kept the render target. That matches @⁠martingouv's and @⁠fuzeofficlal's CheckFeatureSupport results for 86 (render target yes, typed UAV no).
  2. The UAV case I asked for is already in this PR: target_format covers a format whose typed UAV is missing.

What the measurement does say about @⁠fuzeofficlal's case (an RTV-only 86 is widened without need): these are the only two textures the host refuses in my RTX 2080 world run.

format size flags refused use
115 B4G4R4A4_UNORM 2560x1440 RT RT
86 B5G5R5A1_UNORM 2560x1440 RT + UAV UAV

So choosing by use (widen 86 only when it also needs the UAV, and 115 when it needs the RT) covers both refused textures. My log only names refused textures, so it can't say whether the title also makes an RTV-only 86.

AI-assisted (Claude Code): the runs and log analysis were automated. The hardware, title copy and runs are the user's.

**@⁠NuraadGit** on GitHub · 2026-11-24 16:08 UTC · [original](https://github.com/Marvisak/VIctory/pull/89#issuecomment-7137194865) **Two corrections to my comment above.** 1. **"NVIDIA has neither for 86" is wrong.** My own log says so: the fallback dropped only the UAV use of the B5G5R5A1 texture (`flags: 5`, `dropped=4`) and kept the render target. That matches @⁠martingouv's and @⁠fuzeofficlal's `CheckFeatureSupport` results for 86 (render target yes, typed UAV no). 2. **The UAV case I asked for is already in this PR:** `target_format` covers a format whose typed UAV is missing. What the measurement does say about @⁠fuzeofficlal's case (an RTV-only 86 is widened without need): these are the only two textures the host refuses in my RTX 2080 world run. | format | size | flags | refused use | |---|---|---|---| | 115 `B4G4R4A4_UNORM` | 2560x1440 | RT | RT | | 86 `B5G5R5A1_UNORM` | 2560x1440 | RT + UAV | UAV | So choosing by use (widen 86 only when it also needs the UAV, and 115 when it needs the RT) covers both refused textures. My log only names refused textures, so it can't say whether the title also makes an RTV-only 86. *AI-assisted (Claude Code): the runs and log analysis were automated. The hardware, title copy and runs are the user's.*
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-24 16:52 UTC · original

Rebased and extended this work on top of current main (ffe310e) in fuzeofficlal/VIctory (fix/packed-16-targets) (head 15124e9).

Summary of Changes

  1. Usage- & MSAA-aware format selection + lazy PSO variants:
    • Query D3D12_FEATURE_FORMAT_SUPPORT (RENDER_TARGET, TYPED_UNORDERED_ACCESS_VIEW, UAV_TYPED_STORE) and D3D12_FEATURE_MULTISAMPLE_QUALITY_LEVELS so DXGI_FORMAT_B5G5R5A1_UNORM (86) and DXGI_FORMAT_B4G4R4A4_UNORM (115) remain native where supported (e.g., 86 RTV-only/MSAA on RTX 5090, and native 86/115 on AMD/WARP) and widen to RGBA8_UNORM (28) only when required by the requested usage or sample count.
    • Track widened render targets per graphics state and lazily cache per-physical-format RTV PSO variants while preserving is_skipped and bind() -> bool.
  2. Same-command-list GPU compute pack/unpack & MSAA resolve (packed_copy.rs, list.rs):
    • Added packed_copy.rs (cs_5_1 with an inline root signature and odd-width 4-byte alignment) for bidirectional 86/115 <-> RGBA8_UNORM conversion on the same command list across CopyResource, CopyTextureRegion (including source_box, offsets, mips, arrays, and 3D slices), and mixed-format ResolveSubresource / ResolveSubresourceRegion (1-mip/1-slice RESOLVE_DEST temporary target -> COPY_SOURCE barrier -> packed_copy::record_region, with no redundant destination barrier).
    • Resolved the list.rs rebase conflicts against main, preserving defer_fill in prepare_footprint_upload, title_written uploads before packed_transfer, and host_written tracking.
  3. Synthetic verification:
    • Added synthetic pixel-readback tests covering bidirectional CopyResource roundtrips, CopyTextureRegion with source_box and neighbor preservation, RTV PSO variant switching, and mixed-format MSAA resolves (capability-gated on native vs widened adapters).

Verification Results

  • cargo xtask policy: pass (155 files ok)
  • cargo clippy --workspace --all-targets --locked -- -D warnings (default & --all-features): 0 warnings
  • cargo test --workspace --locked: 351 passed, 0 failed, 6 ignored
  • Synthetic packed/resolve suite with VICTORY_D3D12_DEBUG=1 (--features diagnostics, 0 debug-layer errors):
    • NVIDIA GeForce RTX 5090: 9 passed, 0 failed (86 native RTV/MSAA + 86 UAV/115 widened)
    • AMD Radeon integrated graphics: 9 passed, 0 failed (native 86/115 + MSAA)
    • D3D12 WARP (VICTORY_D3D12_WARP=1): 9 passed, 0 failed

Branch compare link for review / cherry-pick:
https://github.com/Marvisak/VIctory/compare/main...fuzeofficlal:VIctory:fix/packed-16-targets

**@⁠fuzeofficlal** on GitHub · 2026-11-24 16:52 UTC · [original](https://github.com/Marvisak/VIctory/pull/89#issuecomment-7138336832) Rebased and extended this work on top of current `main` (`ffe310e`) in [`fuzeofficlal/VIctory` (`fix/packed-16-targets`)](https://github.com/fuzeofficlal/VIctory/tree/fix/packed-16-targets) (head `15124e9`). ### Summary of Changes 1. **Usage- & MSAA-aware format selection + lazy PSO variants**: - Query `D3D12_FEATURE_FORMAT_SUPPORT` (`RENDER_TARGET`, `TYPED_UNORDERED_ACCESS_VIEW`, `UAV_TYPED_STORE`) and `D3D12_FEATURE_MULTISAMPLE_QUALITY_LEVELS` so `DXGI_FORMAT_B5G5R5A1_UNORM` (`86`) and `DXGI_FORMAT_B4G4R4A4_UNORM` (`115`) remain native where supported (e.g., `86` RTV-only/MSAA on RTX 5090, and native `86`/`115` on AMD/WARP) and widen to `RGBA8_UNORM` (`28`) only when required by the requested usage or sample count. - Track widened render targets per graphics state and lazily cache per-physical-format RTV PSO variants while preserving `is_skipped` and `bind() -> bool`. 2. **Same-command-list GPU compute pack/unpack & MSAA resolve (`packed_copy.rs`, `list.rs`)**: - Added `packed_copy.rs` (`cs_5_1` with an inline root signature and odd-width 4-byte alignment) for bidirectional `86`/`115` <-> `RGBA8_UNORM` conversion on the same command list across `CopyResource`, `CopyTextureRegion` (including `source_box`, offsets, mips, arrays, and 3D slices), and mixed-format `ResolveSubresource` / `ResolveSubresourceRegion` (`1`-mip/`1`-slice `RESOLVE_DEST` temporary target -> `COPY_SOURCE` barrier -> `packed_copy::record_region`, with no redundant destination barrier). - Resolved the `list.rs` rebase conflicts against `main`, preserving `defer_fill` in `prepare_footprint_upload`, `title_written` uploads before `packed_transfer`, and `host_written` tracking. 3. **Synthetic verification**: - Added synthetic pixel-readback tests covering bidirectional `CopyResource` roundtrips, `CopyTextureRegion` with `source_box` and neighbor preservation, RTV PSO variant switching, and mixed-format MSAA resolves (capability-gated on native vs widened adapters). ### Verification Results - `cargo xtask policy`: pass (`155 files ok`) - `cargo clippy --workspace --all-targets --locked -- -D warnings` (default & `--all-features`): 0 warnings - `cargo test --workspace --locked`: `351 passed, 0 failed, 6 ignored` - Synthetic packed/resolve suite with `VICTORY_D3D12_DEBUG=1` (`--features diagnostics`, 0 debug-layer errors): - NVIDIA GeForce RTX 5090: `9 passed, 0 failed` (`86` native RTV/MSAA + `86` UAV/115 widened) - AMD Radeon integrated graphics: `9 passed, 0 failed` (native `86`/`115` + MSAA) - D3D12 WARP (`VICTORY_D3D12_WARP=1`): `9 passed, 0 failed` Branch compare link for review / cherry-pick: https://github.com/Marvisak/VIctory/compare/main...fuzeofficlal:VIctory:fix/packed-16-targets
Author
Owner

@⁠jeremygold02 on GitHub · 2026-11-24 17:22 UTC · original

I verified the guest texture-to-buffer case raised above on a physical RTX 5070. The local integration uses this PR at 081afbd5 with #67 and #137. Both guest formats (86 and 115) had actual RGBA8 host textures on this adapter.

I uploaded a nonuniform 4×4 array of 16-bit texels and copied it back through the guest CopyTextureRegion entry point. For each format, a whole-surface copy matched all 16 original texels. An interior 2×2 box copied to (2, 1) in a larger footprint with a 32-byte offset and 16-byte row pitch also matched. I compared the complete destination buffer, including the sentinel in its padding and untouched pixels.

The integration checks the guest source format against the packed destination and reads the actual host texture format. D3D12 gets an RGBA8 staging footprint. After the queue completes, the existing pack_rgba8_to_16 helper packs only the copied texels in each row, retaining the guest pitch and write notifications. The existing unconverted readback test passed alongside the new coverage. This was a synthetic round trip using the open PR head, with no mission test of this change.

**@⁠jeremygold02** on GitHub · 2026-11-24 17:22 UTC · [original](https://github.com/Marvisak/VIctory/pull/89#issuecomment-7139097719) I verified the guest texture-to-buffer case raised above on a physical RTX 5070. The local integration uses this PR at `081afbd5` with #67 and #137. Both guest formats (86 and 115) had actual RGBA8 host textures on this adapter. I uploaded a nonuniform 4×4 array of 16-bit texels and copied it back through the guest `CopyTextureRegion` entry point. For each format, a whole-surface copy matched all 16 original texels. An interior 2×2 box copied to (2, 1) in a larger footprint with a 32-byte offset and 16-byte row pitch also matched. I compared the complete destination buffer, including the sentinel in its padding and untouched pixels. The integration checks the guest source format against the packed destination and reads the actual host texture format. D3D12 gets an RGBA8 staging footprint. After the queue completes, the existing `pack_rgba8_to_16` helper packs only the copied texels in each row, retaining the guest pitch and write notifications. The existing unconverted readback test passed alongside the new coverage. This was a synthetic round trip using the open PR head, with no mission test of this change.
Author
Owner

@⁠omeyasawant on GitHub · 2026-11-24 20:59 UTC · original · edited 2026-11-24 21:09 UTC

Independent integration test of both packed-target commits through 081afbd5382bb6aabaec5b28864c11cf00a15725 on an RTX 5090.

Why this was tested
On this host, dropping unsupported resource flags alone lets video render but later world submissions hit D3D12 messages 36 (B4G4R4A4 cannot be an RTV on this driver) and 42 (resource lacks RENDER_TARGET), followed by DXGI_ERROR_INVALID_CALL. This reproduces the need to keep resource, view and pipeline formats consistent rather than only dropping flags.

Integration and tests

  • Public reproduction branch: https://github.com/omeyasawant/VIctory/tree/experiments/rtx5090-wave64-packed-targets at 67e3304.
  • Base main ffe310e, #189 wave64 compute emulation, #967 hardware selection, texture-fallback commit 964cdbd from #1630, #334 buffer-state transitions, then both commits of this PR. Original authors retained; this is not a duplicate PR.
  • Conflicts in list.rs retained title-memory upload before texture copies as well as the packed copy guards/new staged conversion helper. The test-module insertion conflict retained both groups of tests.
  • Windows 11 Pro 10.0.26200; i7-14700K; 192 GiB RAM; RTX 5090 driver 32.0.16.1088; Rust 1.98.1 MSVC; DXC validator 1.9.2609.5 through VICTORY_DXIL.
  • cargo build --profile diag -p victory --features diagnostics --locked: passes.
  • cargo test --workspace --locked -- --test-threads=1: 381 passed, 0 failed, 7 ignored. Optional tests may return early without their inputs; totals are not a claim of every GPU path being exercised.
  • Runtime log explicitly selects RTX 5090 and reports both formats 86/115 promoted to R8G8B8A8_UNORM. Local presented-frame inspection confirms visible intro video. No screenshots or game-derived dumps are attached.

Limits
This tests a combination of pending fixes, not a clean A/B of this PR alone. No working world or controllable gameplay is verified; further runtime testing is ongoing. AMD/Intel execution was not tested. This is evidence of build/test compatibility and observed promotion, not a claim that all rendering problems are fixed.

AI assistance: OpenAI Codex resolved the integration conflicts, ran checks and drafted this report at the account owner's request. Exact runtime model identifier unavailable.

Runtime-measurement correction: A subsequent idle-GPU check, after the title exited, found a competing local CUDA workload with GPU utilization near 98% and about 31 GB of the 32 GB VRAM occupied. The game runs above were not performed with GPU resources isolated. Their FPS, presentation counts and memory/latency observations must not be treated as clean performance benchmarks or evidence of a project-specific stall. The reported test pass/fail counts are the actual observed results; the explicit texture-format/debug-layer errors and local frame-content observations are still observations, but causality of remaining slowdowns/crashes is not established. A clean rerun is needed. No details of the unrelated workload are included.

**@⁠omeyasawant** on GitHub · 2026-11-24 20:59 UTC · [original](https://github.com/Marvisak/VIctory/pull/89#issuecomment-7144321373) · edited 2026-11-24 21:09 UTC Independent integration test of both packed-target commits through `081afbd5382bb6aabaec5b28864c11cf00a15725` on an RTX 5090. **Why this was tested** On this host, dropping unsupported resource flags alone lets video render but later world submissions hit D3D12 messages 36 (B4G4R4A4 cannot be an RTV on this driver) and 42 (resource lacks RENDER_TARGET), followed by DXGI_ERROR_INVALID_CALL. This reproduces the need to keep resource, view and pipeline formats consistent rather than only dropping flags. **Integration and tests** - Public reproduction branch: https://github.com/omeyasawant/VIctory/tree/experiments/rtx5090-wave64-packed-targets at `67e3304`. - Base main `ffe310e`, #189 wave64 compute emulation, #967 hardware selection, texture-fallback commit `964cdbd` from #1630, #334 buffer-state transitions, then both commits of this PR. Original authors retained; this is not a duplicate PR. - Conflicts in `list.rs` retained title-memory upload before texture copies as well as the packed copy guards/new staged conversion helper. The test-module insertion conflict retained both groups of tests. - Windows 11 Pro 10.0.26200; i7-14700K; 192 GiB RAM; RTX 5090 driver 32.0.16.1088; Rust 1.98.1 MSVC; DXC validator 1.9.2609.5 through `VICTORY_DXIL`. - `cargo build --profile diag -p victory --features diagnostics --locked`: passes. - `cargo test --workspace --locked -- --test-threads=1`: **381 passed, 0 failed, 7 ignored**. Optional tests may return early without their inputs; totals are not a claim of every GPU path being exercised. - Runtime log explicitly selects RTX 5090 and reports both formats 86/115 promoted to R8G8B8A8_UNORM. Local presented-frame inspection confirms visible intro video. No screenshots or game-derived dumps are attached. **Limits** This tests a combination of pending fixes, not a clean A/B of this PR alone. No working world or controllable gameplay is verified; further runtime testing is ongoing. AMD/Intel execution was not tested. This is evidence of build/test compatibility and observed promotion, not a claim that all rendering problems are fixed. AI assistance: OpenAI Codex resolved the integration conflicts, ran checks and drafted this report at the account owner's request. Exact runtime model identifier unavailable. **Runtime-measurement correction:** A subsequent idle-GPU check, after the title exited, found a competing local CUDA workload with GPU utilization near 98% and about 31 GB of the 32 GB VRAM occupied. The game runs above were not performed with GPU resources isolated. Their FPS, presentation counts and memory/latency observations must not be treated as clean performance benchmarks or evidence of a project-specific stall. The reported test pass/fail counts are the actual observed results; the explicit texture-format/debug-layer errors and local frame-content observations are still observations, but causality of remaining slowdowns/crashes is not established. A clean rerun is needed. No details of the unrelated workload are included.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 00:16 UTC · original

Automated triage for the maintainers.

Needs rebase. This PR does not merge cleanly into current main (ac2525d). Conflicting files: crates/victory-gpu/src/descriptor/host.rs, crates/victory-gpu/src/list.rs, crates/victory-gpu/src/texture.rs.

The content has not been reviewed yet; it will be once the branch is rebased onto main.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 00:16 UTC · [original](https://github.com/Marvisak/VIctory/pull/89#issuecomment-7148333801) <!-- victory-triage v1 head=081afbd5382bb6aabaec5b28864c11cf00a15725 verdict=needs-rebase at=2026-11-25T00:13:20Z --> Automated triage for the maintainers. **Needs rebase.** This PR does not merge cleanly into current `main` (ac2525d). Conflicting files: `crates/victory-gpu/src/descriptor/host.rs`, `crates/victory-gpu/src/list.rs`, `crates/victory-gpu/src/texture.rs`. The content has not been reviewed yet; it will be once the branch is rebased onto `main`. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠JurajSimicevic on GitHub · 2026-11-25 01:41 UTC · original

@⁠HenriqueSBueno, both commits of this PR on today's main (ccfb029), you as the author, in case it saves you the rebase: https://github.com/JurajSimicevic/VIctory/tree/port/packed-16-targets-89 (use it or ignore it). It follows the porting notes in mercuryVM's review above point for point; the second commit's message lists them.

Checks on an RTX 5080 (driver 32.0.16.1742): both clippy configurations clean; cargo test -p victory-gpu 143 passed, 2 failed (the HEAP_VIEWS tests that fail on main too, #1751); the four new tests pass on the hardware device.

In the game (diag, DRED; one run without and one with the debug layer), main + this PR only, no typed-UAV fix:

  • both targets are widened on this GPU (the info line for 86 and 115), and there is no no host texture (main has one, the 2560x1440 format-115 target);
  • the boot gets past the B5G5R5A1_UNORM typed-UAV removal (#1753) and reaches the world, so for the title's targets this PR covers that crash by itself;
  • the debug layer shows no new kind of message compared with main + #1775;
  • the world hang (#71) still comes (38 s into the world, and 1 min 13 s with the debug layer), at the same indirect dispatch as without this PR. So on this card the missing format-115 target is not what causes the later hang suspected in #1754.

AI-assisted.

**@⁠JurajSimicevic** on GitHub · 2026-11-25 01:41 UTC · [original](https://github.com/Marvisak/VIctory/pull/89#issuecomment-7149842782) @⁠HenriqueSBueno, both commits of this PR on today's `main` (`ccfb029`), you as the author, in case it saves you the rebase: https://github.com/JurajSimicevic/VIctory/tree/port/packed-16-targets-89 (use it or ignore it). It follows the porting notes in mercuryVM's review above point for point; the second commit's message lists them. Checks on an RTX 5080 (driver 32.0.16.1742): both clippy configurations clean; `cargo test -p victory-gpu` 143 passed, 2 failed (the `HEAP_VIEWS` tests that fail on `main` too, #1751); the four new tests pass on the hardware device. In the game (diag, DRED; one run without and one with the debug layer), `main` + this PR only, no typed-UAV fix: - both targets are widened on this GPU (the info line for 86 and 115), and there is no `no host texture` (`main` has one, the 2560x1440 format-115 target); - the boot gets past the `B5G5R5A1_UNORM` typed-UAV removal (#1753) and reaches the world, so for the title's targets this PR covers that crash by itself; - the debug layer shows no new kind of message compared with `main` + #1775; - the world hang (#71) still comes (38 s into the world, and 1 min 13 s with the debug layer), at the same indirect dispatch as without this PR. So on this card the missing format-115 target is not what causes the later hang suspected in #1754. AI-assisted.
Author
Owner

@⁠Venom2054 on GitHub · 2026-11-25 09:18 UTC · original

Tested a locally adapted version of 081afbd5382bb6aabaec5b28864c11cf00a15725 on RTX 5070 Ti 16 GB, NVIDIA 621.01, Windows 11 Pro 26200, i7-14700, 32 GB RAM.

Base: main 940d32f69b22265690a0b5a15d6ded572ba33baf, with these pre-existing changes:

  • #2177 at 1a3261fe2e2c054c7f93060958f7888316370703 plus a local minimum-size correction for its smaller heap fallback.
  • Only GPU commit 93c4e1819607e512f1727c9599367a2235c039c7 from #1926.
  • #1762 at 19c801300b882df48e9a7d586a4767142a7b0ca3.
  • #1906 at bcd0d3d679e1a55a0d07fd3d83d04875d8f65834.
  • #2098 at 619b694a5d60da682671d39eb5b5b474661d1350.

Before #89, format 115 still failed to create its 2560x1440 host render target. After #89, both 86 and 115 logged RGBA8 widening, with zero no host texture messages. No mixed packed-copy skip messages appeared in this run.

With D3D12 debug enabled, the title reached ongoing 3D intro rendering and was manually stopped after 300.4 seconds, without reported device removal. No pipeline skips or reduced loop limit; GPU timing off. The preceding integration already survived a 321.1-second run, so I am not attributing improved stability to #89.

Rendering remains badly malformed/dark/overexposed at roughly 0.5–0.65 seconds per frame. There were 171 distinct refused host pipeline records; remaining D3D12 errors include Wave64 requested on a 32-lane device (ID 622), blending on R8_UINT (676), and resource-state mismatches (527/538). This is not a validation-clean or playable run.

Validation:

  • GPU suite with D3D12 debug: 157 passed, 0 failed, 3 ignored, including conversion, detile/upload and GPU readback tests.
  • Explicit ignored UAV hardware test: 1 passed.
  • Full workspace: 719 passed, 0 failed, 11 ignored (nested subprocess result excluded).
  • Build, all-target/all-feature Clippy with -D warnings, and asset policy: passed.

Adapting to newer main preserved castable-format and typed-UAV checks, tracked texture uploads, staging bounds and defer_fill. The render-target flag constant was moved to shared scope for host_desc/make_texture, and the old ignored UAV test now checks the effective host format. These results concern that adapted integration, not the unmodified PR head.

No game assets or raw dumps attached. Integration and testing were assisted by OpenAI Codex; credit for the upstream changes remains with their authors.

Venom

**@⁠Venom2054** on GitHub · 2026-11-25 09:18 UTC · [original](https://github.com/Marvisak/VIctory/pull/89#issuecomment-7158144119) Tested a locally adapted version of `081afbd5382bb6aabaec5b28864c11cf00a15725` on **RTX 5070 Ti 16 GB, NVIDIA 621.01, Windows 11 Pro 26200, i7-14700, 32 GB RAM**. Base: main `940d32f69b22265690a0b5a15d6ded572ba33baf`, with these pre-existing changes: - #2177 at `1a3261fe2e2c054c7f93060958f7888316370703` plus a local minimum-size correction for its smaller heap fallback. - Only GPU commit `93c4e1819607e512f1727c9599367a2235c039c7` from #1926. - #1762 at `19c801300b882df48e9a7d586a4767142a7b0ca3`. - #1906 at `bcd0d3d679e1a55a0d07fd3d83d04875d8f65834`. - #2098 at `619b694a5d60da682671d39eb5b5b474661d1350`. Before #89, format 115 still failed to create its 2560x1440 host render target. After #89, both 86 and 115 logged RGBA8 widening, with **zero `no host texture` messages**. No mixed packed-copy skip messages appeared in this run. With D3D12 debug enabled, the title reached ongoing 3D intro rendering and was manually stopped after **300.4 seconds**, without reported device removal. No pipeline skips or reduced loop limit; GPU timing off. The preceding integration already survived a 321.1-second run, so I am not attributing improved stability to #89. Rendering remains badly malformed/dark/overexposed at roughly 0.5–0.65 seconds per frame. There were 171 distinct refused host pipeline records; remaining D3D12 errors include Wave64 requested on a 32-lane device (ID 622), blending on R8_UINT (676), and resource-state mismatches (527/538). This is not a validation-clean or playable run. Validation: - GPU suite with D3D12 debug: **157 passed, 0 failed, 3 ignored**, including conversion, detile/upload and GPU readback tests. - Explicit ignored UAV hardware test: 1 passed. - Full workspace: **719 passed, 0 failed, 11 ignored** (nested subprocess result excluded). - Build, all-target/all-feature Clippy with `-D warnings`, and asset policy: passed. Adapting to newer main preserved castable-format and typed-UAV checks, tracked texture uploads, staging bounds and `defer_fill`. The render-target flag constant was moved to shared scope for `host_desc`/`make_texture`, and the old ignored UAV test now checks the effective host format. These results concern that adapted integration, not the unmodified PR head. No game assets or raw dumps attached. Integration and testing were assisted by OpenAI Codex; credit for the upstream changes remains with their authors. Venom
Author
Owner

@⁠artor410 on GitHub · 2026-11-25 21:53 UTC · original

Tested on RTX 3070 Ti, driver 610.88, Windows 11 26300, rustc 1.98.1. main 13f91ca. Does not merge into main (conflicts), so only the head 081afbd was tested.

  • cargo test -p victory-gpu on the head (old base): 43 passed, 0 failed.
  • Not probed on hardware because of the conflict. #2767 is a rebase of this PR onto 13f91ca. There, every probe case (UAV and RTV of 86 and 115) is safe and the views are made as R8G8B8A8.
  • The same change is also in Belobug/VIctory-Belobug-AMD as da580e4.

(Claude Code, Claude Opus 5.5.)

**@⁠artor410** on GitHub · 2026-11-25 21:53 UTC · [original](https://github.com/Marvisak/VIctory/pull/89#issuecomment-7175669157) Tested on RTX 3070 Ti, driver 610.88, Windows 11 26300, rustc 1.98.1. main 13f91ca. Does not merge into main (conflicts), so only the head 081afbd was tested. - `cargo test -p victory-gpu` on the head (old base): 43 passed, 0 failed. - Not probed on hardware because of the conflict. #2767 is a rebase of this PR onto 13f91ca. There, every probe case (UAV and RTV of 86 and 115) is safe and the views are made as R8G8B8A8. - The same change is also in Belobug/VIctory-Belobug-AMD as da580e4. (Claude Code, Claude Opus 5.5.)
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/descriptor/host.rs
  • crates/victory-gpu/src/list.rs
  • crates/victory-gpu/src/texture.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/89/head:github-bot/gh-89'
git switch 'github-bot/gh-89'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-89'
git switch 'github-bot/gh-89'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-89'
git switch 'github-bot/gh-89'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-89'
git switch 'main'
git merge --squash 'github-bot/gh-89'
git switch 'main'
git merge --ff-only 'github-bot/gh-89'
git switch 'main'
git merge 'github-bot/gh-89'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!89
No description provided.