GPU: no blending on integer render targets in host pipelines #2040

Open
Deilach wants to merge 1 commit from upstream-pr/2042 into main
Deilach commented 2026-11-25 04:01:37 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Deilach on 2026-11-25T04:01:37Z.


What

Host pipelines no longer enable blending on integer render targets (_UINT/_SINT). Without independent blending, target 0's blend state is first copied to each target so that only the integer targets change. Pipelines without such a target are passed through unchanged.

Why

One of the world's mesh pipelines enables blending on an R8_UINT render target. D3D12 leaves blending on integer formats undefined. The Windows driver accepts it, but vkd3d-proton (D3D12 on Vulkan, used by Wine/Proton on Linux) follows the rule and refuses the whole pipeline:

err:vkd3d-proton:d3d12_pipeline_state_validate_blend_state: Enabling blending on RT 2 with format DXGI_FORMAT_R8_UINT, but using integer format is not supported.

So on Linux every draw using it was dropped, leaving world geometry missing in the distance. The console's colour blocks bypass blending for integer formats anyway, so turning it off on the host matches the console's behaviour.

Testing

On Linux (RX 9070 XT, RADV, Wine 11.22 + vkd3d-proton master):

  • translate --cache --pipelines: 1 pipeline refused before, 0 after.
  • In-game, the world mesh pipeline is now created and more of the distant world draws.
  • New unit test pipeline::host::tests::integer_targets_do_not_blend.
  • cargo clippy --workspace --all-targets [--all-features] -- -D warnings is clean.
  • victory-gpu and victory-shader tests under Wine: same results as main plus the new test. The 75 tests that need WARP or dxil.dll fail in Wine on main too.

I haven't tested this on Windows. It only changes pipelines that blend into integer targets, where the Windows result was already undefined.

🤖 Generated with Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:issue:6596919179 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2042). Originally posted by [Deilach](https://github.com/Deilach) on 2026-11-25T04:01:37Z. --- ## What Host pipelines no longer enable blending on integer render targets (`_UINT`/`_SINT`). Without independent blending, target 0's blend state is first copied to each target so that only the integer targets change. Pipelines without such a target are passed through unchanged. ## Why One of the world's mesh pipelines enables blending on an `R8_UINT` render target. D3D12 leaves blending on integer formats undefined. The Windows driver accepts it, but vkd3d-proton (D3D12 on Vulkan, used by Wine/Proton on Linux) follows the rule and refuses the whole pipeline: ``` err:vkd3d-proton:d3d12_pipeline_state_validate_blend_state: Enabling blending on RT 2 with format DXGI_FORMAT_R8_UINT, but using integer format is not supported. ``` So on Linux every draw using it was dropped, leaving world geometry missing in the distance. The console's colour blocks bypass blending for integer formats anyway, so turning it off on the host matches the console's behaviour. ## Testing On Linux (RX 9070 XT, RADV, Wine 11.22 + vkd3d-proton master): - `translate --cache --pipelines`: 1 pipeline refused before, 0 after. - In-game, the world mesh pipeline is now created and more of the distant world draws. - New unit test `pipeline::host::tests::integer_targets_do_not_blend`. - `cargo clippy --workspace --all-targets [--all-features] -- -D warnings` is clean. - `victory-gpu` and `victory-shader` tests under Wine: same results as `main` plus the new test. The 75 tests that need WARP or `dxil.dll` fail in Wine on `main` too. I haven't tested this on Windows. It only changes pipelines that blend into integer targets, where the Windows result was already undefined. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
jeremygold02 commented 2026-11-25 04:07:14 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by jeremygold02 on 2026-11-25T04:06:10Z.


Triage verdict — Confirmed duplicate of #1152 (605e1af)

Evidence

  • @Deilach and @pablogonz12 independently apply the same repair to the graphics and mesh PSO paths. The 21 integer formats match. Both copy target 0’s state when blending is shared, disable blending on active integer targets, and preserve untouched states. #1152 is the earlier focused change tied to #806 and adds controls for nontrivial blend factors, already-disabled integer blending, and inactive integer slots. This implementation · #1152 implementation and tests

Checks and limits

  • The focused Windows blend-descriptor test passed independently on this head. It checks the descriptor values. It does not create a PSO or exercise a persisted pipeline library.
  • Both patches keep the library name based on the original title blend state while passing a changed descriptor to D3D12. If an affected older PSO already occupies that name, the new description can miss on load, and the old entry can prevent storing its replacement. Library load and store · D3D12 store behavior

Next step

  • Maintainers could keep #1152 and close this PR after preserving @Deilach’s independent evidence, shared integer-format classifier, and mixed independent-blend control as useful. On the retained change, key affected host PSOs by the effective blend state or version their library names, and verify a reload against a library containing an older entry.

This verification was AI-assisted.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7152530488 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2042#issuecomment-7152530488). Originally posted by [jeremygold02](https://github.com/jeremygold02) on 2026-11-25T04:06:10Z. --- **Triage verdict — Confirmed duplicate of #1152** (`605e1af`) **Evidence** - @Deilach and @pablogonz12 independently apply the same repair to the graphics and mesh PSO paths. The 21 integer formats match. Both copy target 0’s state when blending is shared, disable blending on active integer targets, and preserve untouched states. #1152 is the earlier focused change tied to #806 and adds controls for nontrivial blend factors, already-disabled integer blending, and inactive integer slots. [This implementation](https://github.com/Marvisak/VIctory/blob/605e1affa02f79d1901c5a81c460f3bcb1464881/crates/victory-gpu/src/pipeline/host.rs#L180) · [#1152 implementation and tests](https://github.com/Marvisak/VIctory/blob/7c4b952fd87c114d11daf9f7de0eb52bdaae7cb8/crates/victory-gpu/src/pipeline/host.rs#L864-L910) **Checks and limits** - The focused Windows blend-descriptor test passed independently on this head. It checks the descriptor values. It does not create a PSO or exercise a persisted pipeline library. - Both patches keep the library name based on the original title blend state while passing a changed descriptor to D3D12. If an affected older PSO already occupies that name, the new description can miss on load, and the old entry can prevent storing its replacement. [Library load and store](https://github.com/Marvisak/VIctory/blob/605e1affa02f79d1901c5a81c460f3bcb1464881/crates/victory-gpu/src/pipeline/library.rs#L242-L281) · [D3D12 store behavior](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/nf-d3d12-id3d12pipelinelibrary-storepipeline) **Next step** - Maintainers could keep #1152 and close this PR after preserving @Deilach’s independent evidence, shared integer-format classifier, and mixed independent-blend control as useful. On the retained change, key affected host PSOs by the effective blend state or version their library names, and verify a reload against a library containing an older entry. This verification was AI-assisted.
DenRakEiw commented 2026-11-25 05:05:43 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-25T04:06:51Z.

Review: APPROVED


Verified locally merged onto origin/main (940d32f, Windows 11 x64, NVIDIA GeForce RTX 5090 + WARP, Rust 1.98.1 MSVC):

  • cargo test -p victory-gpu --lib pipeline:: — 16 passed, 0 failed on both RTX 5090 hardware and VICTORY_D3D12_WARP=1 (including integer_targets_do_not_blend)
  • cargo clippy -p victory-gpu --all-targets — 0 warnings
  • cargo xtask policy — ok (183 files ok)

Clean host_blend() disabling blending on integer render targets per D3D12 requirements, with targeted unit test coverage. Looks good.

AI-assisted (Gemini 4 Neon).

<!-- greyfinch-sync:Marvisak/VIctory:review:6051715347 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2042#pullrequestreview-6051715347). Originally posted by [DenRakEiw](https://github.com/DenRakEiw) on 2026-11-25T04:06:51Z. **Review:** APPROVED --- Verified locally merged onto `origin/main` (`940d32f`, Windows 11 x64, NVIDIA GeForce RTX 5090 + WARP, Rust 1.98.1 MSVC): - `cargo test -p victory-gpu --lib pipeline::` — 16 passed, 0 failed on both RTX 5090 hardware and `VICTORY_D3D12_WARP=1` (including `integer_targets_do_not_blend`) - `cargo clippy -p victory-gpu --all-targets` — 0 warnings - `cargo xtask policy` — ok (`183 files ok`) Clean `host_blend()` disabling blending on integer render targets per D3D12 requirements, with targeted unit test coverage. Looks good. AI-assisted (Gemini 4 Neon).
catminou4 commented 2026-11-25 05:05:43 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T04:17:27Z.

Review: COMMENTED


Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff.

No blending on integer render targets in host pipelines — D3D12-correct (integer formats don't blend); good conformance fix.

<!-- greyfinch-sync:Marvisak/VIctory:review:6051788813 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2042#pullrequestreview-6051788813). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-25T04:17:27Z. **Review:** COMMENTED --- Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff. No blending on integer render targets in host pipelines — D3D12-correct (integer formats don't blend); good conformance fix.
upipibi commented 2026-11-25 05:06:23 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by upipibi on 2026-11-25T04:41:43Z.


Ran on Windows 11 with an RTX 3070 (Ampere, driver 616.56), debug build, at 605e1af. victory-gpu: 142 passed, 2 failed, 2 ignored; the new integer_targets_do_not_blend passes. The 2 failures are #1744's heap-cap failures on main. Same as main on this hardware.

Overlap, from reading: #1152 (open, MERGEABLE, triaged as a merge candidate) makes the same change in pipeline/host.rs. It turns blending off on _UINT / _SINT targets, and when IndependentBlendEnable is off it first copies target 0's state to each target. The difference: this PR reuses twin::integer for the format check, while #1152 adds its own list of 25 formats. Only one of the two needs to merge.

AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7153079462 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2042#issuecomment-7153079462). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-25T04:41:43Z. --- Ran on Windows 11 with an RTX 3070 (Ampere, driver 616.56), debug build, at `605e1af`. `victory-gpu`: 142 passed, 2 failed, 2 ignored; the new `integer_targets_do_not_blend` passes. The 2 failures are #1744's heap-cap failures on `main`. Same as `main` on this hardware. Overlap, from reading: #1152 (open, MERGEABLE, triaged as a merge candidate) makes the same change in `pipeline/host.rs`. It turns blending off on `_UINT` / `_SINT` targets, and when `IndependentBlendEnable` is off it first copies target 0's state to each target. The difference: this PR reuses `twin::integer` for the format check, while #1152 adds its own list of 25 formats. Only one of the two needs to merge. AI-assisted (Claude Code).
Marvisak commented 2026-11-25 10:07:38 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T09:19:12Z.


Automated triage for the maintainers.

Proposed close. This duplicates #1152, an earlier open PR for #806 that merges cleanly into current main. #1152 makes the same change in crates/victory-gpu/src/pipeline/host.rs: a host_blend that turns blending off on _UINT/_SINT render targets and first copies target 0's state to every target when IndependentBlendEnable is off. It applies it to both the graphics and mesh pipeline paths, and its tests cover more cases (blend states that need no change are kept as they are).

The independent Linux evidence here confirms the problem and the fix, thank you. One idea worth carrying over to #1152 is reusing twin::integer (made pub(crate) here) instead of a second format list.

Smaller issue in this version: host_blend was inserted between describe's doc comment and describe. That gives host_blend both doc comments and leaves describe with none.

This PR will be closed in 48 hours unless the author pushes a change or a maintainer removes the label.

CI: not run on this head (no check runs reported).


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7158171067 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2042#issuecomment-7158171067). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T09:19:12Z. --- <!-- victory-triage v1 head=605e1affa02f79d1901c5a81c460f3bcb1464881 verdict=proposed-close at=2026-11-25T09:19:04Z --> Automated triage for the maintainers. **Proposed close.** This duplicates #1152, an earlier open PR for #806 that merges cleanly into current `main`. #1152 makes the same change in `crates/victory-gpu/src/pipeline/host.rs`: a `host_blend` that turns blending off on `_UINT`/`_SINT` render targets and first copies target 0's state to every target when `IndependentBlendEnable` is off. It applies it to both the graphics and mesh pipeline paths, and its tests cover more cases (blend states that need no change are kept as they are). The independent Linux evidence here confirms the problem and the fix, thank you. One idea worth carrying over to #1152 is reusing `twin::integer` (made `pub(crate)` here) instead of a second format list. Smaller issue in this version: `host_blend` was inserted between `describe`'s doc comment and `describe`. That gives `host_blend` both doc comments and leaves `describe` with none. This PR will be closed in 48 hours unless the author pushes a change or a maintainer removes the label. CI: not run on this head (no check runs reported). --- _Generated by [Claude Code](https://claude.ai/code)_
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/2042:upstream-pr/2042'
git switch 'upstream-pr/2042'

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/2042'
git switch 'upstream-pr/2042'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2042'
git switch 'upstream-pr/2042'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2042'
git switch 'main'
git merge --squash 'upstream-pr/2042'
git switch 'main'
git merge --ff-only 'upstream-pr/2042'
git switch 'main'
git merge 'upstream-pr/2042'
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!2040
No description provided.