FidelityFX: write an RGB9E5 output NVIDIA cannot store to through an FP16 texture (fixes a device removal) #1868

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

@⁠marquezinii on GitHub · 2026-11-24 23:51 UTC · original
marquezinii:gpu/fsr-rgb9e5-output → main · +679 −57 · 7 files · 2 commits · open

main's host FidelityFX path (0b35b7f) removes the device on NVIDIA when the title's output is RGB9E5. This fixes it.

What's wrong

Grand Theft Auto VI upscales into an RGB9E5 texture (#1793's log: host formats [10, 19, 34, 67]), made with render-target and unordered-access uses. NVIDIA creates that texture, so its host copy takes UNORDERED_ACCESS and ffxDispatch hands it to the upscaler. But NVIDIA cannot store to RGB9E5 through a typed unordered access view. When the upscaler writes it, the device is removed: 0x887A0005 in the test below, on an RTX 5070.

AMD's RX 9070 XT and WARP store RGB9E5 (#1793), so this only shows on NVIDIA.

What the fix does

  • victory_gpu::rgb9e5::stores(texture): whether the host stores to the texture's format through a typed UAV. It asks format support for both TYPED_UNORDERED_ACCESS_VIEW (support 1) and UAV_TYPED_STORE (support 2), once per format. The state alone is not enough, as above.

  • Where it does not, ffxDispatch moves the output to COPY_DEST, and the upscaler writes an FP16 texture of ours instead (victory_gpu::rgb9e5::Bridge, one per output size, kept). After the upscaler:

    1. The FP16 rows are copied to a buffer.
    2. A compute shader packs each pixel into RGB9E5 by D3D's rule (9-bit mantissas, shared exponent of bias 15).
    3. A buffer-to-texture copy writes the title's texture, since a copy writes any format.

    The bridge's resources end in the states they started in. The title's texture is left in COPY_DEST, where the list was told it is.

  • The packer is a 5.1 shader with its root signature inside, compiled by the system's compiler, as indirect.rs does. It needs no descriptor heap: root constants, a root SRV and a root UAV.

  • Hosts that store RGB9E5 write it directly, as before.

  • Some hosts refuse to make the title's texture at all. An RTX 3070 refuses an RGB9E5 texture with either use (reported in the comments). An RTX 5070 refuses it, and a B4G4R4A4 one, when a clear value comes with the render target use, and the title passes one. When make_texture fails, it now retries without the render target and unordered access uses that D3D12_FEATURE_FORMAT_SUPPORT doesn't list for the format, and without the clear value. The texture then exists in COPY_DEST, and the bridge writes it. Render target views are not made on such a texture, because one would remove the device: set_targets leaves it unbound and a clear skips it.

Tested

Windows 11 26300, RTX 5070 (driver 621.40), FidelityFX SDK 2.4.0 signedbin (provider 3.1.6):

  • tests/fidelityfx.rs now also upscales into an RGB9E5 output made with the title's uses (render target and unordered access). It checks every pixel of both outputs within 0.05 after two upscalings each, with the debug layer on and no errors from it, and logs which way the RGB9E5 output went. Here: RGB9E5 output written through an FP16 texture. It passes.

  • With the output's way decided by its state only, which is what main does, the same test removed the device while copying back.

  • cargo test -p victory-gpu (76 passed, plus the two NVIDIA heap-cap failures main has, #1744) and cargo test -p victory-hle pass.

  • Clippy with -D warnings, with and without diagnostics, cargo doc and cargo xtask policy pass.

  • textures_are_made_without_uses_their_format_does_not_support: B4G4R4A4, RGB9E5, B5G5R5A1 and R8G8B8A8 textures asked for with both uses and a clear value are made, and keep the uses their format supports. Without the retry it fails on the RTX 5070 (no host texture of format 115).

In the title (RTX 5070, main at 940d32f plus #1775 and #1751, without which main removes the device at boot on NVIDIA (#1753); Series S, since only that profile takes the FidelityFX path):

  • The retry fires for the output: a host texture without the uses its format does not support ... format=67 asked=5 made=0. Without it the upscaling never runs. In a run of #1704 before it was stacked here: FidelityFX: a resource has no host texture in its state; the upscaling did not run state=2.
  • FidelityFX: upscaler context on the host provider="3.1.6" render=[1280, 720] output=[1920, 1080], then the output is written through an FP16 texture and first upscaling, host formats of its textures formats=[10, 19, 34, 10].
  • In one run with VICTORY_SKIP_PIPELINES=f607780aa8e502d0, the world ran about 4½ minutes past the first upscaling, and no device removal came from it. Without that skip, the GPU hangs within a minute on an indirect dispatch of that compute pipeline, with or without FidelityFX (DRED names it), which is unrelated to this PR. The world's frames are still dark on this machine, so the picture couldn't be judged.

Not tested: AMD, where the direct path is unchanged; Ampere (the retry is meant for it, from the comments' report).

#1704 (DLSS on the same module) is now stacked on this PR and uses this module, so there's one copy of the bridge.

**@⁠marquezinii** on GitHub · 2026-11-24 23:51 UTC · [original](https://github.com/Marvisak/VIctory/pull/1868) `marquezinii:gpu/fsr-rgb9e5-output` → `main` · +679 −57 · 7 files · 2 commits · open `main`'s host FidelityFX path (0b35b7f) removes the device on NVIDIA when the title's output is RGB9E5. This fixes it. ## What's wrong Grand Theft Auto VI upscales into an RGB9E5 texture (#1793's log: host formats `[10, 19, 34, 67]`), made with render-target and unordered-access uses. NVIDIA creates that texture, so its host copy takes `UNORDERED_ACCESS` and `ffxDispatch` hands it to the upscaler. But NVIDIA cannot store to RGB9E5 through a typed unordered access view. When the upscaler writes it, the device is removed: `0x887A0005` in the test below, on an RTX 5070. AMD's RX 9070 XT and WARP store RGB9E5 (#1793), so this only shows on NVIDIA. ## What the fix does - `victory_gpu::rgb9e5::stores(texture)`: whether the host stores to the texture's format through a typed UAV. It asks format support for both `TYPED_UNORDERED_ACCESS_VIEW` (support 1) and `UAV_TYPED_STORE` (support 2), once per format. The state alone is not enough, as above. - Where it does not, `ffxDispatch` moves the output to `COPY_DEST`, and the upscaler writes an FP16 texture of ours instead (`victory_gpu::rgb9e5::Bridge`, one per output size, kept). After the upscaler: 1. The FP16 rows are copied to a buffer. 2. A compute shader packs each pixel into RGB9E5 by D3D's rule (9-bit mantissas, shared exponent of bias 15). 3. A buffer-to-texture copy writes the title's texture, since a copy writes any format. The bridge's resources end in the states they started in. The title's texture is left in `COPY_DEST`, where the list was told it is. - The packer is a 5.1 shader with its root signature inside, compiled by the system's compiler, as `indirect.rs` does. It needs no descriptor heap: root constants, a root SRV and a root UAV. - Hosts that store RGB9E5 write it directly, as before. - Some hosts refuse to make the title's texture at all. An RTX 3070 refuses an RGB9E5 texture with either use (reported in the comments). An RTX 5070 refuses it, and a B4G4R4A4 one, when a clear value comes with the render target use, and the title passes one. When `make_texture` fails, it now retries without the render target and unordered access uses that `D3D12_FEATURE_FORMAT_SUPPORT` doesn't list for the format, and without the clear value. The texture then exists in `COPY_DEST`, and the bridge writes it. Render target views are not made on such a texture, because one would remove the device: `set_targets` leaves it unbound and a clear skips it. ## Tested Windows 11 26300, RTX 5070 (driver 621.40), FidelityFX SDK 2.4.0 `signedbin` (provider 3.1.6): - `tests/fidelityfx.rs` now also upscales into an RGB9E5 output made with the title's uses (render target and unordered access). It checks every pixel of both outputs within 0.05 after two upscalings each, with the debug layer on and no errors from it, and logs which way the RGB9E5 output went. Here: `RGB9E5 output written through an FP16 texture`. It passes. - With the output's way decided by its state only, which is what `main` does, the same test removed the device while copying back. - `cargo test -p victory-gpu` (76 passed, plus the two NVIDIA heap-cap failures `main` has, #1744) and `cargo test -p victory-hle` pass. - Clippy with `-D warnings`, with and without `diagnostics`, `cargo doc` and `cargo xtask policy` pass. - `textures_are_made_without_uses_their_format_does_not_support`: B4G4R4A4, RGB9E5, B5G5R5A1 and R8G8B8A8 textures asked for with both uses and a clear value are made, and keep the uses their format supports. Without the retry it fails on the RTX 5070 (`no host texture of format 115`). **In the title** (RTX 5070, `main` at `940d32f` plus #1775 and #1751, without which `main` removes the device at boot on NVIDIA (#1753); Series S, since only that profile takes the FidelityFX path): - The retry fires for the output: `a host texture without the uses its format does not support ... format=67 asked=5 made=0`. Without it the upscaling never runs. In a run of #1704 before it was stacked here: `FidelityFX: a resource has no host texture in its state; the upscaling did not run state=2`. - `FidelityFX: upscaler context on the host provider="3.1.6" render=[1280, 720] output=[1920, 1080]`, then `the output is written through an FP16 texture` and `first upscaling, host formats of its textures formats=[10, 19, 34, 10]`. - In one run with `VICTORY_SKIP_PIPELINES=f607780aa8e502d0`, the world ran about 4½ minutes past the first upscaling, and no device removal came from it. Without that skip, the GPU hangs within a minute on an indirect dispatch of that compute pipeline, with or without FidelityFX (DRED names it), which is unrelated to this PR. The world's frames are still dark on this machine, so the picture couldn't be judged. **Not tested:** AMD, where the direct path is unchanged; Ampere (the retry is meant for it, from the comments' report). #1704 (DLSS on the same module) is now stacked on this PR and uses this module, so there's one copy of the bridge.
The title upscales into an RGB9E5 texture with render-target and
unordered-access uses. NVIDIA creates such a texture, so its host copy
takes UNORDERED_ACCESS, but it cannot store to RGB9E5 through a typed
unordered access view: the host upscaler writing it removes the device
(0x887A0005 in the test below).

Where the host does not store to the output's format (format support:
typed UAV and UAV typed store), the output is moved to COPY_DEST and the
upscaler writes an FP16 texture of ours instead. Its rows are copied to
a buffer, a compute shader packs them into RGB9E5 by D3D's rule, and a
buffer-to-texture copy writes the title's texture. The packer is a 5.1
shader with its root signature inside, as indirect.rs does, and needs no
descriptor heap. Hosts that store RGB9E5 write it directly, as before.

tests/fidelityfx.rs upscales into an RGB9E5 output too, made with the
title's uses, and checks every pixel of both outputs.
Formats such as RGB9E5 and B4G4R4A4 support neither render targets nor
typed unordered views on NVIDIA. An RTX 5070 still makes such a texture
with those flags, unless a clear value comes with it, and the title
passes one: 2560x1440 B4G4R4A4 and RGB9E5 targets got no host texture.
An RTX 3070 refuses them with either flag.

When creation fails, make_texture retries without the render target and
unordered access flags that D3D12_FEATURE_FORMAT_SUPPORT doesn't list
for the format, and without the clear value. The texture then exists and
is written by copies. An RGB9E5 upscaler output goes through the FP16
bridge. Render target views are not made on such a texture, because one
would remove the device: set_targets leaves it unbound and a clear
skips it.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:47:06 +00:00
Author
Owner

@⁠upipibi on GitHub · 2026-11-25 00:08 UTC · original

Checked on an RTX 3070 (Ampere, driver 616.56, Windows 11) at 3d579a7. I don't have the FidelityFX SDK, so tests/fidelityfx.rs skips here. Instead I drove the bridge directly with a local test (not pushed).

The packer is exact. I uploaded a 256×256 FP16 texture: R takes every one of the 65 536 half patterns, including NaN, ±Inf, negatives and denormals, and G and B take other patterns. That went through Bridge::write into an RGB9E5 texture, then copied back. All 65 536 pixels match float3_to_rgb9e5 from EXT_texture_shared_exponent computed exactly on the CPU, so the fix-up at 512 and the clamp to 65408 both hold.

On Ampere the title's texture is never made, so the bridge is never reached. This driver reports RGB9E5 as Support1 0x8013f0 (sample, load, gather, mip; no render target, no typed UAV) and Support2 0x200 (tiled only). CreateCommittedResource of an RGB9E5 2D texture fails with E_INVALIDARG when it has ALLOW_RENDER_TARGET | ALLOW_UNORDERED_ACCESS (the title's uses). It also fails with either flag alone. So resource::make_texture logs no host texture, external::host_texture returns None, and ffxDispatch takes the unwritable branch. There, in_state(COPY_DEST) is None as well, so the output is left unwritten. The device isn't removed, but no picture comes out either.

Your RTX 5070 on 621.40 does create the texture, so this looks like a difference between drivers or generations. One way to cover both: when make_texture fails, retry once without ALLOW_RENDER_TARGET / ALLOW_UNORDERED_ACCESS, dropping only the ones D3D12_FEATURE_FORMAT_SUPPORT doesn't list for the format. The texture then exists in COPY_DEST, stores() returns false, and this PR's bridge writes it.

Batch on the same machine: victory-shader (206 passed, with the three #1744 failures main has) and victory-gpu (76 passed, with the two NVIDIA heap-cap failures) are the same as main.

AI-assisted (Claude Code). Synthetic tests only.

**@⁠upipibi** on GitHub · 2026-11-25 00:08 UTC · [original](https://github.com/Marvisak/VIctory/pull/1868#issuecomment-7148193110) Checked on an RTX 3070 (Ampere, driver 616.56, Windows 11) at `3d579a7`. I don't have the FidelityFX SDK, so `tests/fidelityfx.rs` skips here. Instead I drove the bridge directly with a local test (not pushed). **The packer is exact.** I uploaded a 256×256 FP16 texture: R takes every one of the 65 536 half patterns, including NaN, ±Inf, negatives and denormals, and G and B take other patterns. That went through `Bridge::write` into an RGB9E5 texture, then copied back. All 65 536 pixels match `float3_to_rgb9e5` from EXT_texture_shared_exponent computed exactly on the CPU, so the fix-up at 512 and the clamp to 65408 both hold. **On Ampere the title's texture is never made, so the bridge is never reached.** This driver reports RGB9E5 as `Support1 0x8013f0` (sample, load, gather, mip; no render target, no typed UAV) and `Support2 0x200` (tiled only). `CreateCommittedResource` of an RGB9E5 2D texture fails with `E_INVALIDARG` when it has `ALLOW_RENDER_TARGET | ALLOW_UNORDERED_ACCESS` (the title's uses). It also fails with either flag alone. So `resource::make_texture` logs `no host texture`, `external::host_texture` returns `None`, and `ffxDispatch` takes the `unwritable` branch. There, `in_state(COPY_DEST)` is `None` as well, so the output is left unwritten. The device isn't removed, but no picture comes out either. Your RTX 5070 on 621.40 does create the texture, so this looks like a difference between drivers or generations. One way to cover both: when `make_texture` fails, retry once without `ALLOW_RENDER_TARGET` / `ALLOW_UNORDERED_ACCESS`, dropping only the ones `D3D12_FEATURE_FORMAT_SUPPORT` doesn't list for the format. The texture then exists in `COPY_DEST`, `stores()` returns `false`, and this PR's bridge writes it. Batch on the same machine: `victory-shader` (206 passed, with the three #1744 failures `main` has) and `victory-gpu` (76 passed, with the two NVIDIA heap-cap failures) are the same as `main`. AI-assisted (Claude Code). Synthetic tests only.
Author
Owner

@⁠marquezinii on GitHub · 2026-11-25 04:46 UTC · original

@⁠upipibi thanks for the exhaustive packer check and the Ampere report. I took your suggestion in 7db1c07 (rebased on 940d32f):

  • When make_texture fails, it retries without the render target and unordered access uses that D3D12_FEATURE_FORMAT_SUPPORT doesn't list for the format, and without the clear value. The texture then exists, stores() is false, and the bridge writes it from COPY_DEST.
  • Render target views are never made on such a texture: set_targets leaves it unbound and a clear skips it. One would remove the device, like the B5G5R5A1 UAV in #1753.

It turned out to matter on the RTX 5070 as well. This card makes RGB9E5 or B4G4R4A4 render targets without a clear value, but refuses them with one, and the title passes one. In the title (Series S profile) the log now shows ... format=67 asked=5 made=0, then the FSR 3.1.6 context, the output is written through an FP16 texture, and the upscaling running. Without the retry it never ran. Details are in the description. I couldn't check Ampere myself, so a run of textures_are_made_without_uses_their_format_does_not_support on your 3070 would be welcome.

On the overlap question in the review above: #1704 (DLSS) is now stacked on this PR and uses its victory_gpu::rgb9e5, so only one copy of the bridge remains. #1793 (Series X switching to the host upscaler) is about which upscaler the title picks, not how its output is written. It patches the title's picker in apps/victory/src/title_patch.rs, doesn't touch fidelityfx.rs, and merges cleanly with this PR.

**@⁠marquezinii** on GitHub · 2026-11-25 04:46 UTC · [original](https://github.com/Marvisak/VIctory/pull/1868#issuecomment-7153158107) @⁠upipibi thanks for the exhaustive packer check and the Ampere report. I took your suggestion in 7db1c07 (rebased on `940d32f`): - When `make_texture` fails, it retries without the render target and unordered access uses that `D3D12_FEATURE_FORMAT_SUPPORT` doesn't list for the format, and without the clear value. The texture then exists, `stores()` is false, and the bridge writes it from `COPY_DEST`. - Render target views are never made on such a texture: `set_targets` leaves it unbound and a clear skips it. One would remove the device, like the B5G5R5A1 UAV in #1753. It turned out to matter on the RTX 5070 as well. This card makes RGB9E5 or B4G4R4A4 render targets without a clear value, but refuses them with one, and the title passes one. In the title (Series S profile) the log now shows `... format=67 asked=5 made=0`, then the FSR 3.1.6 context, `the output is written through an FP16 texture`, and the upscaling running. Without the retry it never ran. Details are in the description. I couldn't check Ampere myself, so a run of `textures_are_made_without_uses_their_format_does_not_support` on your 3070 would be welcome. On the overlap question in the review above: #1704 (DLSS) is now stacked on this PR and uses its `victory_gpu::rgb9e5`, so only one copy of the bridge remains. #1793 (Series X switching to the host upscaler) is about which upscaler the title picks, not how its output is written. It patches the title's picker in `apps/victory/src/title_patch.rs`, doesn't touch `fidelityfx.rs`, and merges cleanly with this PR.
Author
Owner

@⁠upipibi on GitHub · 2026-11-25 05:20 UTC · original

Ran the test you asked for on the RTX 3070 (Ampere, driver 616.56), Windows 11, debug build, at 7db1c07: textures_are_made_without_uses_their_format_does_not_support passes. The whole victory-gpu suite gives 142 passed, 2 failed, 2 ignored; the 2 are #1744's heap-cap failures on main. Same as main on this hardware.

AI-assisted (Claude Code).

**@⁠upipibi** on GitHub · 2026-11-25 05:20 UTC · [original](https://github.com/Marvisak/VIctory/pull/1868#issuecomment-7153679858) Ran the test you asked for on the RTX 3070 (Ampere, driver 616.56), Windows 11, debug build, at `7db1c07`: `textures_are_made_without_uses_their_format_does_not_support` passes. The whole `victory-gpu` suite gives 142 passed, 2 failed, 2 ignored; the 2 are #1744's heap-cap failures on `main`. Same as `main` on this hardware. AI-assisted (Claude Code).
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 07:18 UTC · original

Automated triage for the maintainers.

This is a useful fix with hardware evidence (RTX 5070, with the debug layer on). victory_gpu::rgb9e5::stores asks the host for both typed-UAV support and UAV_TYPED_STORE. Bridge has the upscaler write an FP16 texture of ours, which is then packed into RGB9E5 by a compute pass (the packing matches D3D's shared-exponent rule: bias 15, max 65408, rounding carried into the exponent) and copied into the title's texture. make_texture retries without render-target/UAV uses the format lacks, and set_targets/clear_rtv skip such textures.

One correctness problem in ffxDispatch (crates/victory-hle/src/modules/fidelityfx.rs):

  • unwritable is true whenever the output has no host texture in the wanted state (is_none_or) or any format the host cannot store to. In both cases the output is sent through the bridge, which always packs RGB9E5 and CopyTextureRegions that into the title's texture. If the output is any other format (for example an RGBA8 output that failed in_state for an unrelated reason), this records a copy whose formats do not match, instead of the current "did not run" warning. Please take the bridge path only when the output's host texture format is DXGI_FORMAT_R9G9B9E5_SHAREDEXP, and keep the existing warning otherwise.

Minor:

  • The shader comment says "as DLSS wrote them" but this path is FidelityFX.
  • renders() calls GetDesc for every bound target on every set_targets. Fine for now, but it is a per-draw call.

CI: passing.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 07:18 UTC · [original](https://github.com/Marvisak/VIctory/pull/1868#issuecomment-7155723687) <!-- victory-triage v1 head=7db1c078711da6a5085b018129cbdb7aa9259203 verdict=needs-work at=2026-11-25T07:18:53Z --> Automated triage for the maintainers. This is a useful fix with hardware evidence (RTX 5070, with the debug layer on). `victory_gpu::rgb9e5::stores` asks the host for both typed-UAV support and `UAV_TYPED_STORE`. `Bridge` has the upscaler write an FP16 texture of ours, which is then packed into RGB9E5 by a compute pass (the packing matches D3D's shared-exponent rule: bias 15, max 65408, rounding carried into the exponent) and copied into the title's texture. `make_texture` retries without render-target/UAV uses the format lacks, and `set_targets`/`clear_rtv` skip such textures. One correctness problem in `ffxDispatch` (`crates/victory-hle/src/modules/fidelityfx.rs`): - `unwritable` is true whenever the output has no host texture in the wanted state (`is_none_or`) or any format the host cannot store to. In both cases the output is sent through the bridge, which always packs **RGB9E5** and `CopyTextureRegion`s that into the title's texture. If the output is any other format (for example an RGBA8 output that failed `in_state` for an unrelated reason), this records a copy whose formats do not match, instead of the current "did not run" warning. Please take the bridge path only when the output's host texture format is `DXGI_FORMAT_R9G9B9E5_SHAREDEXP`, and keep the existing warning otherwise. Minor: - The shader comment says "as DLSS wrote them" but this path is FidelityFX. - `renders()` calls `GetDesc` for every bound target on every `set_targets`. Fine for now, but it is a per-draw call. CI: passing. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠pickles976 on GitHub · 2026-11-25 19:37 UTC · original · edited 2026-11-25 19:47 UTC

Additional Linux/Wine NVIDIA capability evidence relevant to the allocation retry in this PR. This is not a full PR/fallback verification.

Host: RTX 4060 Laptop 8 GB, NVIDIA 590.48.01, Linux 6.17.0-40; vkd3d-proton 3.2.0 (2576c0b4adfae4a), DXVK v3.1.1-209-g1039f682058fa71, Rust 1.98.1 Windows MSVC target. A temporary headless Rust integration probe used the Windows D3D12 API directly; no game, FidelityFX SDK, shaders, command queue submissions, or asset copies.

For DXGI_FORMAT_R9G9B9E5_SHAREDEXP (67):

adapter=NVIDIA GeForce RTX 4060 Laptop GPU
support1=0x8013f1 support2=0x200
render_target=false typed_uav=false typed_store=false
requested RT|UAV clear=false: HRESULT(0x80070057)
requested RT|UAV clear=true:  HRESULT(0x80070057)
COPY_DEST/no-flags allocation succeeded; device healthy

Allocation parameters: DEFAULT heap, 16x16 TEXTURE2D, one mip/array slice/sample, UNKNOWN layout. The first two calls requested ALLOW_RENDER_TARGET | ALLOW_UNORDERED_ACCESS, initial COMMON state, with and without a matching-format zero clear value. The successful call used no resource flags, COPY_DEST, and no clear value. GetDeviceRemovedReason() remained successful.

This host needs the texture-creation retry, not just the dispatch-time FP16 bridge: unlike the NVIDIA case where allocation succeeds despite missing typed stores, vkd3d rejects the original combined uses outright.

Probe detail: the first attempt selected by PCI vendor ID and stopped before device creation because DXVK's default NVIDIA-hiding behavior reported AMD's ID. For the measurement above only, DXVK_CONFIG='dxgi.hideNvidiaGpu = False' exposed the real vendor; NVIDIA's Vulkan ICD was explicitly selected, and there was no WARP fallback. This did not change the title-launch configuration.

Not tested: your PR's implementation, FP16 packing/readback, PC FSR context/dispatch, output image, gameplay, or long-run stability. Reporting against the existing PR rather than proposing a duplicate NVIDIA-specific patch. The temporary probe is being removed after this check.

AI assistance: OpenAI coding assistant wrote and ran the probe and drafted this report from its output.

Follow-up: allocation and pixel tests now pass locally

Integrated the diff at 7db1c078711da6a5085b018129cbdb7aa9259203 into the existing local integration tree and ran:

victory-gpu --lib resource::tests::textures_are_made_without_uses_their_format_does_not_support
1 passed (0.60 s)

victory-hle --test fidelityfx
provider 0xf5a5ca1e00c01006 "3.1.6"
RGB9E5 output written through an FP16 texture
1 passed (2.24 s)

The latter ran both frames per format and checked the readback pixels in both FP16 and RGB9E5 with the PR's existing assertions. It did not skip for a missing SDK/GPU. Same headless Wine/NVIDIA environment as above; fetched only SDK v2.4.0's official signedbin/amd_fidelityfx_upscaler_dx12.dll (57,664,272 bytes), SHA256 aad4fccccb29084a655f9a4f9f613bd22c8c03fb4a0f8840148cc6543b4ccace.

Integration qualifications: this is not an unmodified checkout of the PR. Existing deferred-texture work adds an on_demand parameter, so the allocation test passes false. The local bridge cache uses Arc<Bridge> owned by the map instead of Box::leak/&'static Bridge, and LazyLock initialization; the dispatch takes its texture reference before moving that Arc into packed. These ownership adaptations do not alter the packing shader/copy commands, but must be disclosed when interpreting the result. Other pre-existing local integration changes remain. The debug layer is optional in this test, so a pass does not establish that Microsoft's debug-layer validation ran under Wine.

No title gameplay or long-run stability claim. No competing PR proposed.

**@⁠pickles976** on GitHub · 2026-11-25 19:37 UTC · [original](https://github.com/Marvisak/VIctory/pull/1868#issuecomment-7172551533) · edited 2026-11-25 19:47 UTC Additional **Linux/Wine NVIDIA capability evidence** relevant to the allocation retry in this PR. This is not a full PR/fallback verification. Host: RTX 4060 Laptop 8 GB, NVIDIA 590.48.01, Linux 6.17.0-40; vkd3d-proton 3.2.0 (`2576c0b4adfae4a`), DXVK `v3.1.1-209-g1039f682058fa71`, Rust 1.98.1 Windows MSVC target. A temporary headless Rust integration probe used the Windows D3D12 API directly; no game, FidelityFX SDK, shaders, command queue submissions, or asset copies. For `DXGI_FORMAT_R9G9B9E5_SHAREDEXP` (67): ```text adapter=NVIDIA GeForce RTX 4060 Laptop GPU support1=0x8013f1 support2=0x200 render_target=false typed_uav=false typed_store=false requested RT|UAV clear=false: HRESULT(0x80070057) requested RT|UAV clear=true: HRESULT(0x80070057) COPY_DEST/no-flags allocation succeeded; device healthy ``` Allocation parameters: DEFAULT heap, 16x16 TEXTURE2D, one mip/array slice/sample, UNKNOWN layout. The first two calls requested `ALLOW_RENDER_TARGET | ALLOW_UNORDERED_ACCESS`, initial COMMON state, with and without a matching-format zero clear value. The successful call used no resource flags, COPY_DEST, and no clear value. `GetDeviceRemovedReason()` remained successful. This host needs the **texture-creation retry**, not just the dispatch-time FP16 bridge: unlike the NVIDIA case where allocation succeeds despite missing typed stores, vkd3d rejects the original combined uses outright. Probe detail: the first attempt selected by PCI vendor ID and stopped before device creation because DXVK's default NVIDIA-hiding behavior reported AMD's ID. For the measurement above only, `DXVK_CONFIG='dxgi.hideNvidiaGpu = False'` exposed the real vendor; NVIDIA's Vulkan ICD was explicitly selected, and there was no WARP fallback. This did not change the title-launch configuration. **Not tested:** your PR's implementation, FP16 packing/readback, PC FSR context/dispatch, output image, gameplay, or long-run stability. Reporting against the existing PR rather than proposing a duplicate NVIDIA-specific patch. The temporary probe is being removed after this check. AI assistance: OpenAI coding assistant wrote and ran the probe and drafted this report from its output. ### Follow-up: allocation and pixel tests now pass locally Integrated the diff at `7db1c078711da6a5085b018129cbdb7aa9259203` into the existing local integration tree and ran: ```text victory-gpu --lib resource::tests::textures_are_made_without_uses_their_format_does_not_support 1 passed (0.60 s) victory-hle --test fidelityfx provider 0xf5a5ca1e00c01006 "3.1.6" RGB9E5 output written through an FP16 texture 1 passed (2.24 s) ``` The latter ran both frames per format and checked the readback pixels in both FP16 and RGB9E5 with the PR's existing assertions. It did not skip for a missing SDK/GPU. Same headless Wine/NVIDIA environment as above; fetched only SDK v2.4.0's official `signedbin/amd_fidelityfx_upscaler_dx12.dll` (57,664,272 bytes), SHA256 `aad4fccccb29084a655f9a4f9f613bd22c8c03fb4a0f8840148cc6543b4ccace`. **Integration qualifications:** this is not an unmodified checkout of the PR. Existing deferred-texture work adds an `on_demand` parameter, so the allocation test passes `false`. The local bridge cache uses `Arc<Bridge>` owned by the map instead of `Box::leak`/`&'static Bridge`, and `LazyLock` initialization; the dispatch takes its texture reference before moving that Arc into `packed`. These ownership adaptations do not alter the packing shader/copy commands, but must be disclosed when interpreting the result. Other pre-existing local integration changes remain. The debug layer is optional in this test, so a pass does not establish that Microsoft's debug-layer validation ran under Wine. No title gameplay or long-run stability claim. No competing PR proposed.
Author
Owner

@⁠steven-seagull27 on GitHub · 2026-11-26 01:55 UTC · original · edited 2026-11-26 02:02 UTC

@⁠marquezinii I put the requested bridge-format correction in one commit on top of 7db1c07. It checks the actual host texture before choosing the RGB9E5 packer. A direct output must support a typed store and have the UAV flag. The existing refusal path handles other unwritable formats and unsupported starting states. When the bridge is used, the provider receives the FP16 scratch texture's actual initial state.

Output in the regression Original head, both adapters With the patch, both adapters
Read-only RGBA8, unordered-access starting state Selected the RGB9E5 bridge Returned PARAMETER (6)
Same RGBA8, common starting state Selected direct dispatch Returned 6
RGB9E5, unsupported starting state 0x40 Selected the bridge Returned 6

The original-head comparison stopped immediately after selection, before submitting the invalid combinations. The new cases exercise the real ffxDispatch entry point.

  • RTX 5080, driver 621.40. The full integration test passed with AMD's signed SDK 2.1.1 provider 3.1.5 and the D3D12 debug layer. It ran two frames into each valid output. All 2,073,600 pixels per format matched the fixture's RGB tolerance (0.05 per channel), FP16 directly and RGB9E5 through the bridge. No debug-layer errors.
  • Windows built-in WARP. All three refusals passed. A separate selection-only run confirmed direct FP16 and direct RGB9E5. The full SDK process exited with 0xc0000005 after the refusal checks, before reporting pixel results. The cause is undetermined. WARP's positive pixel readback remains unverified here.

The three existing FidelityFX module tests, strict all-feature Clippy for the HLE and GPU crates, and the asset-policy check passed. From the PR branch:

git fetch https://github.com/steven-seagull27/VIctory.git codex/pr1868-rgb9e5-selection
git cherry-pick 85b26e892db80d35f48bf1497a667a2bbabc795c

Current-main integration. Git merged the PR into 63bcca43 without a text conflict, but the Windows build failed in both draw.rs and list.rs: host_resource now returns an owned resource and renders takes a reference. I fixed both callers in the fast-forwardable current-main branch. It includes the review fix above and passes strict GPU/HLE Clippy, asset policy and the full two-format RTX FidelityFX readback.

I also checked compatibility with the newly adopted #2626 head c8cc83e. On the combined tree the real FidelityFX readback passed on the RTX. The #1868 allocation test passed on RTX and built-in WARP, and both of #2626's packed-format footprint checks passed three times per adapter. To take the review fix and main update together, use git fetch https://github.com/steven-seagull27/VIctory.git codex/pr1868-current-main and git merge --ff-only FETCH_HEAD on your PR branch.

AI-assisted with Codex. Synthetic textures only.

**@⁠steven-seagull27** on GitHub · 2026-11-26 01:55 UTC · [original](https://github.com/Marvisak/VIctory/pull/1868#issuecomment-7180289939) · edited 2026-11-26 02:02 UTC @⁠marquezinii I put the requested bridge-format correction in [one commit on top of `7db1c07`](https://github.com/steven-seagull27/VIctory/commit/85b26e892db80d35f48bf1497a667a2bbabc795c). It checks the **actual host texture** before choosing the RGB9E5 packer. A direct output must support a typed store and have the UAV flag. The existing refusal path handles other unwritable formats and unsupported starting states. When the bridge is used, the provider receives the FP16 scratch texture's actual initial state. | Output in the regression | Original head, both adapters | With the patch, both adapters | |---|---|---| | Read-only RGBA8, unordered-access starting state | Selected the RGB9E5 bridge | Returned `PARAMETER` (6) | | Same RGBA8, common starting state | Selected direct dispatch | Returned 6 | | RGB9E5, unsupported starting state `0x40` | Selected the bridge | Returned 6 | The original-head comparison stopped immediately after selection, before submitting the invalid combinations. The new cases exercise the real `ffxDispatch` entry point. - **RTX 5080, driver 621.40.** The full integration test passed with AMD's signed SDK 2.1.1 provider **3.1.5** and the D3D12 debug layer. It ran two frames into each valid output. All **2,073,600 pixels per format** matched the fixture's RGB tolerance (0.05 per channel), FP16 directly and RGB9E5 through the bridge. No debug-layer errors. - **Windows built-in WARP.** All three refusals passed. A separate selection-only run confirmed direct FP16 and direct RGB9E5. The full SDK process exited with `0xc0000005` after the refusal checks, before reporting pixel results. The cause is undetermined. WARP's positive pixel readback remains unverified here. The three existing FidelityFX module tests, strict all-feature Clippy for the HLE and GPU crates, and the asset-policy check passed. From the PR branch: ```sh git fetch https://github.com/steven-seagull27/VIctory.git codex/pr1868-rgb9e5-selection git cherry-pick 85b26e892db80d35f48bf1497a667a2bbabc795c ``` **Current-main integration.** Git merged the PR into `63bcca43` without a text conflict, but the Windows build failed in both `draw.rs` and `list.rs`: `host_resource` now returns an owned resource and `renders` takes a reference. I fixed both callers in the [fast-forwardable current-main branch](https://github.com/steven-seagull27/VIctory/commit/2a66f2c2b15bbf60de312286000bef05e561914a). It includes the review fix above and passes strict GPU/HLE Clippy, asset policy and the full two-format RTX FidelityFX readback. I also checked compatibility with the newly adopted #2626 head `c8cc83e`. On the combined tree the real FidelityFX readback passed on the RTX. The #1868 allocation test passed on RTX and built-in WARP, and both of #2626's packed-format footprint checks passed three times per adapter. To take the review fix and main update together, use `git fetch https://github.com/steven-seagull27/VIctory.git codex/pr1868-current-main` and `git merge --ff-only FETCH_HEAD` on your PR branch. AI-assisted with Codex. Synthetic textures only.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

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

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1868'
git switch 'github-bot/gh-1868'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1868'
git switch 'github-bot/gh-1868'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1868'
git switch 'main'
git merge --squash 'github-bot/gh-1868'
git switch 'main'
git merge --ff-only 'github-bot/gh-1868'
git switch 'main'
git merge 'github-bot/gh-1868'
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!1868
No description provided.