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

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

@⁠Deilach on GitHub · 2026-11-25 04:01 UTC · original
Deilach:linux-integer-blend → main · +80 −3 · 2 files · 1 commits · open

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

**@⁠Deilach** on GitHub · 2026-11-25 04:01 UTC · [original](https://github.com/Marvisak/VIctory/pull/2042) `Deilach:linux-integer-blend` → `main` · +80 −3 · 2 files · 1 commits · open ## 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)
One of the title's world mesh pipelines blends into an R8_UINT render
target. D3D12 leaves blending on integer formats undefined, and
vkd3d-proton (D3D12 under Wine/Proton) refuses such a pipeline when the
pixel shader writes the target ("Enabling blending on RT 2 with format
DXGI_FORMAT_R8_UINT, but using integer format is not supported",
E_INVALIDARG), so on Linux its draws were dropped: missing world
geometry in the distance.

The console's colour blocks bypass blending for integer formats, so the
host is now given blending off on integer targets, target 0's state
spread to each first when blending is not independent. Pipelines with
no integer target that blends keep the title's state as it is.

The pipeline pre-build on vkd3d-proton (RX 9070 XT, RADV): 1 pipeline
refused before, 0 after; the world mesh pipeline is made in a run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:52:37 +00:00
Author
Owner

@⁠jeremygold02 on GitHub · 2026-11-25 04:06 UTC · original

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.

**@⁠jeremygold02** on GitHub · 2026-11-25 04:06 UTC · [original](https://github.com/Marvisak/VIctory/pull/2042#issuecomment-7152530488) **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.
Author
Owner

@⁠upipibi on GitHub · 2026-11-25 04:41 UTC · original

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

**@⁠upipibi** on GitHub · 2026-11-25 04:41 UTC · [original](https://github.com/Marvisak/VIctory/pull/2042#issuecomment-7153079462) 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).
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 09:19 UTC · original

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

**@⁠Marvisak** on GitHub · 2026-11-25 09:19 UTC · [original](https://github.com/Marvisak/VIctory/pull/2042#issuecomment-7158171067) <!-- 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 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/2042/head:github-bot/gh-2042'
git switch 'github-bot/gh-2042'

Merge

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