GPU: no blending on integer render targets in host pipelines (port of upstream #806) #51

Open
github-bot wants to merge 1 commit from github-bot/gh-51 into main AGit
Owner

@⁠FrancescoGelosoEterea on GitHub · 2026-11-24 20:57 UTC · original
FrancescoGelosoEterea:int-blend → main · +118 −3 · 1 files · 1 commits · open

Why

The title leaves blending enabled on an integer render target (R8_UINT) in one world mesh pipeline. The console ignores blending there; D3D12 does not allow it, so CreatePipelineState returns E_INVALIDARG and every draw of that pipeline is dropped:

host mesh pipeline refused error=0x80070057 shaders=[mesh f5e50eb2108c425b, pixel ce3f0432a08f1d35]

This is the refused mesh pipeline reported in #26 (RTX 4060 Ti). It is refused on native Windows/NVIDIA as well, not only on vkd3d-proton.

What

This is pablogonz12's fix from Marvisak/VIctory#806 (commit 169efcb, authorship kept), ported onto this fork. host_blend in pipeline/host.rs builds the blend description the host pipeline gets, on both the graphics and the mesh path. It turns blending off on every render target in use whose format is *_UINT or *_SINT. When IndependentBlendEnable is off, each target first gets a copy of target 0's state, so the other targets keep blending as before. A blend state without integer blending is passed through unchanged.

The only conflict was in pipeline/host.rs, around this fork's rectangle-list geometry shader and its mesh-library test. Both are kept.

Tested

RTX 5070 Ti, driver 621.24, Windows 11. Own 1.0.2.1 copy, Series X profile, diagnostics build on top of 90228a7 (rebased onto 4e17478 afterwards; that commit changes only comments, and the tests pass there).

  • cargo test -p victory-gpu --lib -- pipeline::host: 3 passed (the two new blend tests and a_mesh_pipeline_loads_from_the_library).
  • In game (prologue, same run script before and after):
    • before: the mesh pipeline is refused and its draws are dropped every frame;
    • after: host mesh pipeline shaders=[mesh f5e50eb2108c425b, pixel ce3f0432a08f1d35] is created, with no refused [mesh f5e50…] drop lines. There is no device removal, and fps is unchanged (~4.1–4.2 with VICTORY_LATE_WAIT=1 VICTORY_WIDE_BACK=1 VICTORY_CARD_BUFFERS_MIN_MB=1 VICTORY_CARD_BUFFERS_MB=1024).
  • The compute pipelines still refused on this card (02384a60…, 2da4beb3…, 2cc4c197…, 369cbe90…, 6b82bc7d…) are the 64-lane ones from #7 and #11; this change does not touch them.

Credit: the diagnosis and the fix are pablogonz12's (Marvisak/VIctory#806); I ported and tested them.

**@⁠FrancescoGelosoEterea** on GitHub · 2026-11-24 20:57 UTC · [original](https://github.com/fxceless/victory-fork/pull/51) `FrancescoGelosoEterea:int-blend` → `main` · +118 −3 · 1 files · 1 commits · open ## Why The title leaves blending enabled on an integer render target (`R8_UINT`) in one world mesh pipeline. The console ignores blending there; D3D12 does not allow it, so `CreatePipelineState` returns `E_INVALIDARG` and every draw of that pipeline is dropped: ``` host mesh pipeline refused error=0x80070057 shaders=[mesh f5e50eb2108c425b, pixel ce3f0432a08f1d35] ``` This is the refused mesh pipeline reported in #26 (RTX 4060 Ti). It is refused on native Windows/NVIDIA as well, not only on vkd3d-proton. ## What This is pablogonz12's fix from Marvisak/VIctory#806 (commit `169efcb`, authorship kept), ported onto this fork. `host_blend` in `pipeline/host.rs` builds the blend description the host pipeline gets, on both the graphics and the mesh path. It turns blending off on every render target in use whose format is `*_UINT` or `*_SINT`. When `IndependentBlendEnable` is off, each target first gets a copy of target 0's state, so the other targets keep blending as before. A blend state without integer blending is passed through unchanged. The only conflict was in `pipeline/host.rs`, around this fork's rectangle-list geometry shader and its mesh-library test. Both are kept. ## Tested RTX 5070 Ti, driver 621.24, Windows 11. Own 1.0.2.1 copy, Series X profile, diagnostics build on top of `90228a7` (rebased onto `4e17478` afterwards; that commit changes only comments, and the tests pass there). - `cargo test -p victory-gpu --lib -- pipeline::host`: 3 passed (the two new blend tests and `a_mesh_pipeline_loads_from_the_library`). - In game (prologue, same run script before and after): - **before:** the mesh pipeline is refused and its draws are dropped every frame; - **after:** `host mesh pipeline shaders=[mesh f5e50eb2108c425b, pixel ce3f0432a08f1d35]` is created, with no `refused [mesh f5e50…]` drop lines. There is no device removal, and fps is unchanged (~4.1–4.2 with `VICTORY_LATE_WAIT=1 VICTORY_WIDE_BACK=1 VICTORY_CARD_BUFFERS_MIN_MB=1 VICTORY_CARD_BUFFERS_MB=1024`). - The compute pipelines still refused on this card (`02384a60…`, `2da4beb3…`, `2cc4c197…`, `369cbe90…`, `6b82bc7d…`) are the 64-lane ones from #7 and #11; this change does not touch them. Credit: the diagnosis and the fix are pablogonz12's (Marvisak/VIctory#806); I ported and tested them.
The console ignores blending on integer render targets and the title
leaves it on (the world has a mesh pipeline blending into an R8_UINT
target). D3D12 does not allow it: vkd3d-proton refuses such a pipeline
with E_INVALIDARG and its draws are lost. The host pipeline now turns
blending off on integer targets; with one description for all targets,
each target gets its own copy so the others keep theirs.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:35:16 +00:00
Author
Owner

@⁠adriaespii on GitHub · 2026-11-24 21:14 UTC · original

Independent test run on commit eb5061c (AMD RDNA4):

  • Hardware: AMD Radeon RX 9070 (driver 32.0.32015.7029), AMD Ryzen 5 7600, Windows 11 Pro, Rust 1.98.1 (x86_64-pc-windows-msvc)
  • cargo clippy --workspace --all-targets -- -D warnings: 0 warnings
  • cargo test --workspace: 498 passed, 0 failed, 7 ignored (victory-gpu: 112 passed, 0 failed, 1 ignored; victory-shader: 210 passed, 0 failed, 2 ignored)
  • Not tested: live game run (no game files on this machine)

AI use: Antigravity (Gemini 4 Neon) ran clippy/tests locally and wrote this report.

**@⁠adriaespii** on GitHub · 2026-11-24 21:14 UTC · [original](https://github.com/fxceless/victory-fork/pull/51#issuecomment-7144667588) Independent test run on commit `eb5061c` (AMD RDNA4): - **Hardware:** AMD Radeon RX 9070 (driver 32.0.32015.7029), AMD Ryzen 5 7600, Windows 11 Pro, Rust 1.98.1 (`x86_64-pc-windows-msvc`) - `cargo clippy --workspace --all-targets -- -D warnings`: 0 warnings - `cargo test --workspace`: 498 passed, 0 failed, 7 ignored (`victory-gpu`: 112 passed, 0 failed, 1 ignored; `victory-shader`: 210 passed, 0 failed, 2 ignored) - **Not tested:** live game run (no game files on this machine) *AI use: Antigravity (Gemini 4 Neon) ran clippy/tests locally and wrote this report.*
Author
Owner

@⁠rocobalt1 on GitHub · 2026-11-24 22:44 UTC · original

Confirmed on the card in #26: the mesh pipeline this PR is about is created here, and its draws are no longer dropped.

Setup: RTX 4060 Ti 8 GB, driver 32.0.16.1656, Windows 11, Ryzen 9 5900X; 4e17478 + #32 + #86 + #77 + #81 + #9 + #40 + #83 + #38 + this PR (e05ea2a), diag build, --console series-x, VICTORY_DISPLAY_MODE=1920x1080, VICTORY_SHADER_LOOP_LIMIT=256, VICTORY_NO_WATCHDOG=1, fresh data dir. TdrDelay=60.

before with this PR
host pipeline refused ... shaders=[mesh ...] lines 1 0
shader refusals (does not translate) 4 4
copies, median 94.6 ms 67 ms
frame, median 1 036 ms 807 ms
device removal no no

The refused pair was shaders=[mesh f5e50eb2108c425b, pixel ce3f0432a08f1d35], i.e. the same one the description names, so the R8_UINT blend diagnosis holds on the 8 GB part too.

No game data; counts only.

**@⁠rocobalt1** on GitHub · 2026-11-24 22:44 UTC · [original](https://github.com/fxceless/victory-fork/pull/51#issuecomment-7146587802) Confirmed on the card in #26: the mesh pipeline this PR is about is created here, and its draws are no longer dropped. **Setup:** RTX 4060 Ti **8 GB**, driver 32.0.16.1656, Windows 11, Ryzen 9 5900X; `4e17478` + #32 + #86 + #77 + #81 + #9 + #40 + #83 + #38 + **this PR** (`e05ea2a`), diag build, `--console series-x`, `VICTORY_DISPLAY_MODE=1920x1080`, `VICTORY_SHADER_LOOP_LIMIT=256`, `VICTORY_NO_WATCHDOG=1`, fresh data dir. `TdrDelay=60`. | | before | **with this PR** | |---|---:|---:| | `host pipeline refused ... shaders=[mesh ...]` lines | 1 | **0** | | shader refusals (`does not translate`) | 4 | 4 | | copies, median | 94.6 ms | 67 ms | | frame, median | 1 036 ms | 807 ms | | device removal | no | no | The refused pair was `shaders=[mesh f5e50eb2108c425b, pixel ce3f0432a08f1d35]`, i.e. the same one the description names, so the `R8_UINT` blend diagnosis holds on the 8 GB part too. No game data; counts only.
Author
Owner

@⁠icecreammule277-dot on GitHub · 2026-11-24 23:02 UTC · original

Tested on an RX 9070 XT (Adrenalin 32.0.32029.2010), native Windows D3D12.

This port fixes a world mesh pipeline that CreatePipelineState refused with E_INVALIDARG: the title leaves blending enabled on an integer render target, and the described [upstream #806] path turns it off there. The refused pipeline's draws were the missing walls — with the port the pipeline builds and the walls render.

host_blend turning off only the integer slots (and, when IndependentBlendEnable is off, first copying RenderTarget[0] to every slot) is exactly right: it is a no-op for every non-integer target, since D3D12 already applied RenderTarget[0] to them.

**@⁠icecreammule277-dot** on GitHub · 2026-11-24 23:02 UTC · [original](https://github.com/fxceless/victory-fork/pull/51#issuecomment-7146941618) Tested on an RX 9070 XT (Adrenalin 32.0.32029.2010), native Windows D3D12. This port fixes a world mesh pipeline that `CreatePipelineState` refused with `E_INVALIDARG`: the title leaves blending enabled on an integer render target, and the described [upstream #806] path turns it off there. The refused pipeline's draws were the missing walls — with the port the pipeline builds and the walls render. `host_blend` turning off only the integer slots (and, when `IndependentBlendEnable` is off, first copying `RenderTarget[0]` to every slot) is exactly right: it is a no-op for every non-integer target, since D3D12 already applied `RenderTarget[0]` to them.
Author
Owner

@⁠sagouindupm on GitHub · 2026-11-25 00:29 UTC · original

Confirmed on an 8 GB NVIDIA card in Series S mode: with this PR the refused mesh pipeline builds and the first gameplay room has its walls.

Setup

  • NVIDIA GeForce RTX 3050 8 GB, Intel Core i5-12400F, 32 GB RAM, Windows 11 Pro 26200. Release build, --console series-s, no other switch.
  • Tree: main at 2119b0e + #32 + #188 + #86 (not enabled in these runs), then eb5061c from this PR cherry-picked on top (no conflict).
  • Same checkpoint in every run (the opening cutscene, then the player at the window of the first room), warm shader cache, about 5 minutes each.

Before / after (two runs each)

without this PR with this PR
host mesh pipeline refused lines 1 per run ([mesh f5e50eb2108c425b, pixel ce3f0432a08f1d35], E_INVALIDARG) 0
host pipeline refused lines in all 6 5
walls of the first room at the window view missing in both runs (sky on both sides of the window frame) present in both runs (cinderblock wall around the window)
median frame time in the world 409 ms and 439 ms 446 ms and about 370 ms

The wall check is a screenshot of the window at the same moments of each run, plus the mean brightness of a strip at the left and right edges (about 100 on the left without the PR, 7 to 50 with it). The debug layer names the reason on this card too: CreateGraphicsPipelineState: The render target format at slot 2 is format (R8_UINT). This format does not support blending ... the Blend State indicates blending is enabled for this slot (id 676).

One caveat: the walls are not missing in every run without the PR. In four other baseline runs tonight they were there once, so there is a second, intermittent cause (the stale pages discussed in #62). Two runs with the PR and walls both times is consistent with this PR fixing the pipeline's part; it does not show the intermittent one is gone.

Not tested: Series X with this PR; more than two runs; anything past the first room.

No game data. AI-assisted: Claude Code (Claude Fable 5.2) applied the commit, made the runs, read the logs and wrote this comment.

**@⁠sagouindupm** on GitHub · 2026-11-25 00:29 UTC · [original](https://github.com/fxceless/victory-fork/pull/51#issuecomment-7148560921) Confirmed on an 8 GB NVIDIA card in Series S mode: with this PR the refused mesh pipeline builds and the first gameplay room has its walls. **Setup** - NVIDIA GeForce RTX 3050 8 GB, Intel Core i5-12400F, 32 GB RAM, Windows 11 Pro 26200. Release build, `--console series-s`, no other switch. - Tree: `main` at `2119b0e` + #32 + #188 + #86 (not enabled in these runs), then `eb5061c` from this PR cherry-picked on top (no conflict). - Same checkpoint in every run (the opening cutscene, then the player at the window of the first room), warm shader cache, about 5 minutes each. **Before / after (two runs each)** | | without this PR | with this PR | |---|---|---| | `host mesh pipeline refused` lines | 1 per run (`[mesh f5e50eb2108c425b, pixel ce3f0432a08f1d35]`, `E_INVALIDARG`) | 0 | | `host pipeline refused` lines in all | 6 | 5 | | walls of the first room at the window view | missing in both runs (sky on both sides of the window frame) | present in both runs (cinderblock wall around the window) | | median frame time in the world | 409 ms and 439 ms | 446 ms and about 370 ms | The wall check is a screenshot of the window at the same moments of each run, plus the mean brightness of a strip at the left and right edges (about 100 on the left without the PR, 7 to 50 with it). The debug layer names the reason on this card too: `CreateGraphicsPipelineState: The render target format at slot 2 is format (R8_UINT). This format does not support blending ... the Blend State indicates blending is enabled for this slot` (id 676). One caveat: the walls are not missing in every run without the PR. In four other baseline runs tonight they were there once, so there is a second, intermittent cause (the stale pages discussed in #62). Two runs with the PR and walls both times is consistent with this PR fixing the pipeline's part; it does not show the intermittent one is gone. **Not tested:** Series X with this PR; more than two runs; anything past the first room. No game data. AI-assisted: Claude Code (Claude Fable 5.2) applied the commit, made the runs, read the logs and wrote this comment.
Author
Owner

@⁠Arvi23 on GitHub · 2026-11-25 01:10 UTC · original

Tested on AMD RDNA4 (RX 9070 XT, Windows 10): the same mesh pipeline is refused there without this PR and created with it.

Setup: RX 9070 XT, driver 32.0.32029.2010, Windows 10 IoT Enterprise LTSC 21H2 (19044) with the Agility SDK runtime (#420), release build, Series X profile, no VICTORY_* switches.

  • Without this PR (31714de + #420's first commit + the #120 patch + #58): host mesh pipeline refused error=0x80070057 shaders=[mesh f5e50eb2108c425b, pixel ce3f0432a08f1d35], first bound at frame 1113 as gameplay starts. It was the only refused pipeline in the run.
  • With this PR and #203 on the same tree: 0 refused pipelines. The same with this PR on a803c87 + #420.
  • The picture: before, the main character's torso and jacket were black in the first gameplay room. After, they are drawn. #203 changed in the same step, so it is not separated which of the two did it. One run each.
  • No device removal and no compiler crash in either run.

AI use: Claude Code (Claude Opus 5.5) read the logs and wrote this; the runs are on my machine.

**@⁠Arvi23** on GitHub · 2026-11-25 01:10 UTC · [original](https://github.com/fxceless/victory-fork/pull/51#issuecomment-7149282749) **Tested on AMD RDNA4 (RX 9070 XT, Windows 10): the same mesh pipeline is refused there without this PR and created with it.** Setup: RX 9070 XT, driver 32.0.32029.2010, Windows 10 IoT Enterprise LTSC 21H2 (19044) with the Agility SDK runtime (#420), release build, Series X profile, no `VICTORY_*` switches. - Without this PR (`31714de` + #420's first commit + the #120 patch + #58): `host mesh pipeline refused error=0x80070057 shaders=[mesh f5e50eb2108c425b, pixel ce3f0432a08f1d35]`, first bound at frame 1113 as gameplay starts. It was the only refused pipeline in the run. - With this PR and #203 on the same tree: 0 refused pipelines. The same with this PR on `a803c87` + #420. - The picture: before, the main character's torso and jacket were black in the first gameplay room. After, they are drawn. #203 changed in the same step, so it is not separated which of the two did it. One run each. - No device removal and no compiler crash in either run. AI use: Claude Code (Claude Opus 5.5) read the logs and wrote this; the runs are on my machine.
Author
Owner

@⁠FrancescoGelosoEterea on GitHub · 2026-11-25 01:46 UTC · original

The "first room's walls are still missing in some launches" known issue in c96b4f2 looks like the problem this PR fixes. The walls are the draws of the refused mesh pipeline [mesh f5e50eb2108c425b, pixel ce3f0432a08f1d35] (blending left on an R8_UINT target).

It has now been confirmed independently on five cards:

Card Result
RTX 5070 Ti pipeline created, walls render
RTX 4060 Ti 8 GB same, refusal gone (rocobalt1)
RTX 3050 8 GB, Series S mode walls missing in both runs without the PR, present with it (sagouindupm)
RX 9070 tests and clippy pass (adriaespii)
RX 9070 XT the only refused pipeline in the run, created with the PR (Arvi23)

Since c96b4f2 (the depth bounds change) it conflicts in pipeline/host.rs. I'll rebase it onto current main.

**@⁠FrancescoGelosoEterea** on GitHub · 2026-11-25 01:46 UTC · [original](https://github.com/fxceless/victory-fork/pull/51#issuecomment-7149931300) The "first room's walls are still missing in some launches" known issue in `c96b4f2` looks like the problem this PR fixes. The walls are the draws of the refused mesh pipeline `[mesh f5e50eb2108c425b, pixel ce3f0432a08f1d35]` (blending left on an `R8_UINT` target). It has now been confirmed independently on five cards: | Card | Result | |---|---| | RTX 5070 Ti | pipeline created, walls render | | RTX 4060 Ti 8 GB | same, refusal gone (rocobalt1) | | RTX 3050 8 GB, Series S mode | walls missing in both runs without the PR, present with it (sagouindupm) | | RX 9070 | tests and clippy pass (adriaespii) | | RX 9070 XT | the only refused pipeline in the run, created with the PR (Arvi23) | Since `c96b4f2` (the depth bounds change) it conflicts in `pipeline/host.rs`. I'll rebase it onto current `main`.
Author
Owner

@⁠iGoldenNinja on GitHub · 2026-11-25 05:31 UTC · original · edited 2026-11-25 06:08 UTC

Independent RTX 5080 title check. Windows 11 Pro 26200, driver 617.14, Ryzen 9 5900X, 32 GB RAM, DRED and Series X profile. I applied PR 51 (d82acef) to diagnostic PR 688 (7e7bb18), keeping the archive reader, replay, relay and inline staging settings from the prior run. Both builds logged zero shader-cache hits during startup.

The earlier executable logged 0x80070057 for mesh f5e50eb2108c425b / pixel ce3f0432a08f1d35. The patched executable logged successful host acceptance of that exact pair and no refusal for it. The matched post-retreat interior capture still showed large wall and ceiling gaps. This verifies the pipeline acceptance on this GPU, with the remaining room geometry issue still open.

The five-minute controlled prison route averaged 4.565 presented FPS, 435.139 ms P99, and 711.421 ms worst. The previous staging-on run measured 4.579 FPS and 393.971 ms P99. The title responded to camera and movement input and ended deliberately, without a DRED device-removal report. Method and comparison. AI-assisted with OpenAI Codex.

**@⁠iGoldenNinja** on GitHub · 2026-11-25 05:31 UTC · [original](https://github.com/fxceless/victory-fork/pull/51#issuecomment-7153860320) · edited 2026-11-25 06:08 UTC Independent RTX 5080 title check. Windows 11 Pro 26200, driver 617.14, Ryzen 9 5900X, 32 GB RAM, DRED and Series X profile. I applied PR 51 (`d82acef`) to diagnostic PR 688 (`7e7bb18`), keeping the archive reader, replay, relay and inline staging settings from the prior run. Both builds logged zero shader-cache hits during startup. The earlier executable logged `0x80070057` for `mesh f5e50eb2108c425b / pixel ce3f0432a08f1d35`. The patched executable logged successful host acceptance of that exact pair and no refusal for it. The matched post-retreat interior capture still showed large wall and ceiling gaps. This verifies the pipeline acceptance on this GPU, with the remaining room geometry issue still open. The five-minute controlled prison route averaged **4.565 presented FPS**, **435.139 ms P99**, and **711.421 ms worst**. The previous staging-on run measured 4.579 FPS and 393.971 ms P99. The title responded to camera and movement input and ended deliberately, without a DRED device-removal report. [Method and comparison](https://github.com/iGoldenNinja/victory-fork/blob/menu-replay/docs/ssd-blend-pr51-5080.md). AI-assisted with OpenAI Codex.
Author
Owner

@⁠Andry018 on GitHub · 2026-11-25 16:20 UTC · original

Confirmed on RDNA2: AMD Radeon RX 6600 (8 GB) with a Ryzen 7 9700X, Windows 11, release build, Series X profile, no VICTORY_* switches.

d82acef cherry-picks cleanly onto current main (0b0074e). On main alone, the world mesh pipeline this PR is about was refused with E_INVALIDARG in every run today (12 of 12). With the PR, it is created in both runs (2 of 2) and nothing else is refused. Frame time is unchanged, about 280-290 ms/frame in the prologue cell, and there was no device loss.

One thing this does not change on this card: the player's face in the world (black skin, eyes and earrings drawn) stays black with the PR, so that is a separate problem (see #264).

**@⁠Andry018** on GitHub · 2026-11-25 16:20 UTC · [original](https://github.com/fxceless/victory-fork/pull/51#issuecomment-7167815734) Confirmed on RDNA2: AMD Radeon RX 6600 (8 GB) with a Ryzen 7 9700X, Windows 11, release build, Series X profile, no `VICTORY_*` switches. `d82acef` cherry-picks cleanly onto current `main` (`0b0074e`). On `main` alone, the world mesh pipeline this PR is about was refused with `E_INVALIDARG` in every run today (12 of 12). With the PR, it is created in both runs (2 of 2) and nothing else is refused. Frame time is unchanged, about 280-290 ms/frame in the prologue cell, and there was no device loss. One thing this does not change on this card: the player's face in the world (black skin, eyes and earrings drawn) stays black with the PR, so that is a separate problem (see #264).
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/pipeline/host.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/51/head:github-bot/gh-51'
git switch 'github-bot/gh-51'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-51'
git switch 'github-bot/gh-51'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-51'
git switch 'github-bot/gh-51'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-51'
git switch 'main'
git merge --squash 'github-bot/gh-51'
git switch 'main'
git merge --ff-only 'github-bot/gh-51'
git switch 'main'
git merge 'github-bot/gh-51'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.