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

Open
marquezinii wants to merge 2 commits from upstream-pr/1868 into main
marquezinii commented 2026-11-24 23:51:31 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by marquezinii on 2026-11-24T23:51:31Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:issue:5482354886 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1868). Originally posted by [marquezinii](https://github.com/marquezinii) on 2026-11-24T23:51:31Z. --- `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.
catminou4 commented 2026-11-25 00:32:40 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T00:32:40Z.

Review: COMMENTED


Mixed PR: shader/formats parts are macOS-tested in the batch; GPU/HLE parts are Windows-only statics.

FidelityFX RGB9E5 output for NVIDIA (gpu+hle): third FidelityFX PR this wave after #1793 — check which one the maintainer intends to land.

<!-- greyfinch-sync:Marvisak/VIctory:review:6049696462 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1868#pullrequestreview-6049696462). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-25T00:32:40Z. **Review:** COMMENTED --- Mixed PR: shader/formats parts are macOS-tested in the batch; GPU/HLE parts are Windows-only statics. FidelityFX RGB9E5 output for NVIDIA (gpu+hle): third FidelityFX PR this wave after #1793 — check which one the maintainer intends to land.
upipibi commented 2026-11-25 01:07:34 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by upipibi on 2026-11-25T00:08:36Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7148193110 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1868#issuecomment-7148193110). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-25T00:08:36Z. --- 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.
marquezinii commented 2026-11-25 05:06:24 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by marquezinii on 2026-11-25T04:46:53Z.


@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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7153158107 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1868#issuecomment-7153158107). Originally posted by [marquezinii](https://github.com/marquezinii) on 2026-11-25T04:46:53Z. --- @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.
upipibi commented 2026-11-25 06:02:46 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by upipibi on 2026-11-25T05:20:38Z.


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).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7153679858 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1868#issuecomment-7153679858). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-25T05:20:38Z. --- 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).
Marvisak commented 2026-11-25 08:06:32 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 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 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

<!-- greyfinch-sync:Marvisak/VIctory:comment:7155723687 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1868#issuecomment-7155723687). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T07:18:53Z. --- <!-- 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)_
pickles976 commented 2026-11-25 19:37:29 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by pickles976 on 2026-11-25T19:37:29Z.


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.

Follow-through on the memory-tested Linux/Wine stack (2026-11-27)

Retested the bridge plus the published 85b26e892db80d35f48bf1497a667a2bbabc795c output/state-selection review fix. The PR head remains 7db1c078711da6a5085b018129cbdb7aa9259203; this is not an exact-head or stock-driver certification. Local base 3ed7d725f6895fe1a235eb6fa8ff2485261ca151 is a dirty memory/paging/shader integration; it retains #2101 texture creation, uses owning Arc bridge-cache entries, and adds first-dispatch resource-role/return-code logging. Wine 11, RTX 4060 Laptop 8 GiB, NVIDIA 590.48.1, 16 GiB RAM, diagnostic-relaxed vkd3d 2576c0b4adfae4a+.

  • Actual device query: RGB9E5 support1 0x8013f1 / support2 0x200, no typed UAV/store/RT; FP16 supports all three. No unsupported direct RGB9E5 dispatch was submitted.
  • Fail-closed native FidelityFX 3.1.6 fixture: 1/1 pass, 2.31 s, fresh 6.16 s compile. Two frames per FP16/RGB9E5 output, every RGB pixel within 0.05; non-writable RGBA8 and invalid-state cases refused; device healthy. SDK and host cannot silently skip. Optional Windows debug-layer execution is not certified. Log: verify-rgb9e5-bridge-20261127T054055Z.log.
  • Fresh 30.47 s diagnostics release, guarded 1080p-output/1280x720-render title run: bridge activates, native formats [10,19,34,10], first host dispatch returns 0. The actual game window remains black at 120/170 s. Logged colour-input resource matches a black FP16 target captured in the first scene frame. That is an end-of-frame snapshot, not an at-dispatch capture or late-frame history; it does not establish the missing producer.
  • 180 s wall stop/137, not resource failure: GPU peak 3636 MiB, minimum available RAM 4449.1 MiB, scope peak 8314 MiB, minimum user-available disk 10.956 GiB. Unchanged 6000 MiB GPU / 2048 MiB RAM / 10 GiB disk guards; scope 9 GiB/512 MiB swap. No kernel entries in the interval.

Evidence: rgb9e5-bridge-trial-20261127T054433Z/ and matching guard logs. No gameplay or frame-rate claim; native/shader caches retained, not a matched performance comparison. The safe native output bridge is verified, but it is not sufficient to restore this title's image. Next check is the black HDR input's requested writer, including unavailable pipelines, and a later scene-frame capture. Images/assets remain local.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7172551533 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1868#issuecomment-7172551533). Originally posted by [pickles976](https://github.com/pickles976) on 2026-11-25T19:37:29Z. --- 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. ### Follow-through on the memory-tested Linux/Wine stack (2026-11-27) Retested the bridge plus the published `85b26e892db80d35f48bf1497a667a2bbabc795c` output/state-selection review fix. The PR head remains `7db1c078711da6a5085b018129cbdb7aa9259203`; this is **not an exact-head or stock-driver certification**. Local base `3ed7d725f6895fe1a235eb6fa8ff2485261ca151` is a dirty memory/paging/shader integration; it retains #2101 texture creation, uses owning Arc bridge-cache entries, and adds first-dispatch resource-role/return-code logging. Wine 11, RTX 4060 Laptop 8 GiB, NVIDIA 590.48.1, 16 GiB RAM, diagnostic-relaxed vkd3d `2576c0b4adfae4a+`. * Actual device query: RGB9E5 support1 `0x8013f1` / support2 `0x200`, no typed UAV/store/RT; FP16 supports all three. No unsupported direct RGB9E5 dispatch was submitted. * Fail-closed native FidelityFX 3.1.6 fixture: **1/1 pass, 2.31 s**, fresh 6.16 s compile. Two frames per FP16/RGB9E5 output, every RGB pixel within 0.05; non-writable RGBA8 and invalid-state cases refused; device healthy. SDK and host cannot silently skip. Optional Windows debug-layer execution is not certified. Log: `verify-rgb9e5-bridge-20261127T054055Z.log`. * Fresh 30.47 s diagnostics release, guarded 1080p-output/1280x720-render title run: bridge activates, native formats `[10,19,34,10]`, first host dispatch returns **0**. **The actual game window remains black at 120/170 s.** Logged colour-input resource matches a black FP16 target captured in the first scene frame. That is an end-of-frame snapshot, not an at-dispatch capture or late-frame history; it does not establish the missing producer. * 180 s wall stop/137, not resource failure: GPU peak 3636 MiB, minimum available RAM 4449.1 MiB, scope peak 8314 MiB, minimum user-available disk 10.956 GiB. Unchanged 6000 MiB GPU / 2048 MiB RAM / 10 GiB disk guards; scope 9 GiB/512 MiB swap. No kernel entries in the interval. Evidence: `rgb9e5-bridge-trial-20261127T054433Z/` and matching guard logs. No gameplay or frame-rate claim; native/shader caches retained, not a matched performance comparison. **The safe native output bridge is verified, but it is not sufficient to restore this title's image.** Next check is the black HDR input's requested writer, including unavailable pipelines, and a later scene-frame capture. Images/assets remain local.
steven-seagull27 commented 2026-11-26 02:07:17 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by steven-seagull27 on 2026-11-26T01:55:46Z.


@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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7180289939 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1868#issuecomment-7180289939). Originally posted by [steven-seagull27](https://github.com/steven-seagull27) on 2026-11-26T01:55:46Z. --- @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 cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/1868:upstream-pr/1868'
git switch 'upstream-pr/1868'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/1868'
git switch 'upstream-pr/1868'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1868'
git switch 'upstream-pr/1868'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1868'
git switch 'main'
git merge --squash 'upstream-pr/1868'
git switch 'main'
git merge --ff-only 'upstream-pr/1868'
git switch 'main'
git merge 'upstream-pr/1868'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
Marvisak/VIctory!1866
No description provided.