GPU: a pipeline that blends an integer target is made instead of refused #2790

Closed
github-bot wants to merge 1 commit from gh-pr/2790/head into gh-pr/2790/base
Owner

@⁠HoLa-Lee on GitHub · 2026-11-25 20:35 UTC · original
HoLa-Lee:gpu/integer-target-blend → main · +199 −3 · 1 files · 1 commits · closed without merging

What this is

On the card, one graphics pipeline of the intro is refused and every one of its draws is lost. With the debug layer on (VICTORY_D3D12_DEBUG=1), the refusal names itself:

ID3D12Device::CreateGraphicsPipelineState: The render target format at slot 2 is format (R8_UINT).
  This format does not support blending. The Pixel Shader output signature indicates this output
  could be written, and the Blend State indicates blending is enabled for this slot.
ID3D12Device::CreateGraphicsPipelineState: Pixel Shader output 'SV_Target2' has type that is NOT
  float, while the corresponding Output Merger RenderTarget slot [2] has blending enabled.

CreateGraphicsPipelineState answers E_INVALIDARG ("参数错误"), so the pipeline - a mesh/pixel pair, [mesh f5e50eb2108c425b, pixel ce3f0432a08f1d35] - is refused whole.

The state is the console's, where the renderer allows a blend on an integer target. D3D12 does not, and NVIDIA enforces it.

What the change does

GraphicsState::settle_integer_targets turns BlendEnable off for render target slots whose format is an integer one, and only for those. It runs once, after the stream is read and before the state is described - so a pipeline's name in the library still says what is actually made - and before the graphics, mesh or depth-bounds pipeline is built.

  • Where the title's blend was a write (ONE/ZERO, its usual static state) the picture is the same.
  • Where it was not, that slot is overwritten instead of blended.
  • Only the enable flag changes; the blend factors, write masks and every other slot keep the values the title wrote.

Evidence

The refused state, refused then made - on the card. Built through the same code on a tree that has the device tests: the device refuses an R8_UINT target with blending enabled, and makes the same pipeline once that slot's blend is off. This PR carries the half of that which needs no device harness:

The state test, a_blend_on_an_integer_target_is_turned_off_for_that_slot_only pins the slots: the integer target loses its blend, the two float targets keep theirs, a slot past NumRenderTargets is untouched, the factors survive, settling twice changes nothing, and a state the title wrote with the blend already off settles to the same description (so it shares the pipeline name, as it should - the pipelines are identical).

On the title, same keys, same 300 s, old binary against new:

blend0 (before) blend1 (after)
host mesh pipeline refused lines 20 0
settle line 0 1 - blending is off for those slots slots=[(2, 62)] (62 is R8_UINT)
story frames logged (draws ≥ 500) 24 23
most draws in a frame 5,012 9,393

One correction worth stating

The frame line's dropped … without a host pipeline counter is not the measure of this fix. Its largest term is dispatches of the ray-tracing structure builder, which are dropped on purpose (VICTORY_BVH_BUILDER=1 gates the builder, and pipeline.rs documents why: a 32-lane host cannot build them whole, and #2311 measured a card hung in exactly that dispatch): 200 to 1,400 a frame, in both runs. So the counter barely moves; what moves is the refused pipeline, listed above.

Checks

cargo test -p victory-gpu --lib --profile diag --features diagnostics 197 passed, 2 failed, 1 ignored
the 2 failures dynamic_slots_are_held_until_released, lists_share_a_table_and_copies_keep_their_views - the known #1744 view-heap pair on an NVIDIA host (FIND-9: this card caps shader-visible view heaps at 1,000,000 and HEAP_VIEWS is 2^21); they fail without this change too
cargo clippy -p victory-gpu --all-features -- -D warnings clean

RTX 4080 SUPER, Rust 1.98.1, Windows 11.

What is not done

Where a blend was not a plain write, this changes what those draws put in that R8_UINT target: it becomes an overwrite. If that turns out to matter, the emulation belongs in the shader (fetch, blend, store) rather than in the state, and settle_integer_targets is the place to hang it.

**@⁠HoLa-Lee** on GitHub · 2026-11-25 20:35 UTC · [original](https://github.com/Marvisak/VIctory/pull/2790) `HoLa-Lee:gpu/integer-target-blend` → `main` · +199 −3 · 1 files · 1 commits · closed without merging ## What this is On the card, one graphics pipeline of the intro is refused and every one of its draws is lost. With the debug layer on (`VICTORY_D3D12_DEBUG=1`), the refusal names itself: ``` ID3D12Device::CreateGraphicsPipelineState: The render target format at slot 2 is format (R8_UINT). This format does not support blending. The Pixel Shader output signature indicates this output could be written, and the Blend State indicates blending is enabled for this slot. ID3D12Device::CreateGraphicsPipelineState: Pixel Shader output 'SV_Target2' has type that is NOT float, while the corresponding Output Merger RenderTarget slot [2] has blending enabled. ``` `CreateGraphicsPipelineState` answers `E_INVALIDARG` ("参数错误"), so the pipeline - a mesh/pixel pair, `[mesh f5e50eb2108c425b, pixel ce3f0432a08f1d35]` - is refused whole. The state is the console's, where the renderer allows a blend on an integer target. D3D12 does not, and NVIDIA enforces it. ## What the change does `GraphicsState::settle_integer_targets` turns `BlendEnable` off for render target slots whose format is an integer one, and only for those. It runs once, after the stream is read and **before the state is described** - so a pipeline's name in the library still says what is actually made - and before the graphics, mesh or depth-bounds pipeline is built. - Where the title's blend was a write (`ONE`/`ZERO`, its usual static state) the picture is the same. - Where it was not, that slot is overwritten instead of blended. - Only the enable flag changes; the blend factors, write masks and every other slot keep the values the title wrote. ## Evidence **The refused state, refused then made - on the card.** Built through the same code on a tree that has the device tests: the device refuses an `R8_UINT` target with blending enabled, and makes the same pipeline once that slot's blend is off. This PR carries the half of that which needs no device harness: **The state test, `a_blend_on_an_integer_target_is_turned_off_for_that_slot_only`** pins the slots: the integer target loses its blend, the two float targets keep theirs, a slot past `NumRenderTargets` is untouched, the factors survive, settling twice changes nothing, and a state the title wrote with the blend already off settles to the same description (so it shares the pipeline name, as it should - the pipelines are identical). **On the title, same keys, same 300 s, old binary against new:** | | `blend0` (before) | `blend1` (after) | |---|---|---| | `host mesh pipeline refused` lines | **20** | **0** | | settle line | 0 | 1 - `blending is off for those slots slots=[(2, 62)]` (62 is `R8_UINT`) | | story frames logged (draws ≥ 500) | 24 | 23 | | most draws in a frame | 5,012 | **9,393** | ## One correction worth stating The frame line's `dropped … without a host pipeline` counter is **not** the measure of this fix. Its largest term is dispatches of the ray-tracing structure builder, which are dropped on purpose (`VICTORY_BVH_BUILDER=1` gates the builder, and `pipeline.rs` documents why: a 32-lane host cannot build them whole, and #2311 measured a card hung in exactly that dispatch): **200 to 1,400 a frame**, in both runs. So the counter barely moves; what moves is the refused pipeline, listed above. ## Checks | | | |---|---| | `cargo test -p victory-gpu --lib --profile diag --features diagnostics` | **197 passed, 2 failed, 1 ignored** | | the 2 failures | `dynamic_slots_are_held_until_released`, `lists_share_a_table_and_copies_keep_their_views` - the known `#1744` view-heap pair on an NVIDIA host (**FIND-9**: this card caps shader-visible view heaps at 1,000,000 and `HEAP_VIEWS` is 2^21); they fail without this change too | | `cargo clippy -p victory-gpu --all-features -- -D warnings` | clean | RTX 4080 SUPER, Rust 1.98.1, Windows 11. ## What is not done Where a blend was *not* a plain write, this changes what those draws put in that `R8_UINT` target: it becomes an overwrite. If that turns out to matter, the emulation belongs in the shader (fetch, blend, store) rather than in the state, and `settle_integer_targets` is the place to hang it.
One graphics pipeline of the intro is refused on the card, and with the debug
layer on the refusal says why:

    ID3D12Device::CreateGraphicsPipelineState: The render target format at slot
    2 is format (R8_UINT). This format does not support blending. The Pixel
    Shader output signature indicates this output could be written, and the
    Blend State indicates blending is enabled for this slot.

    ID3D12Device::CreateGraphicsPipelineState: Pixel Shader output 'SV_Target2'
    has type that is NOT float, while the corresponding Output Merger
    RenderTarget slot [2] has blending enabled.

and the pipeline - a mesh/pixel pair, `[mesh f5e50eb2108c425b, pixel
ce3f0432a08f1d35]` - comes back `E_INVALIDARG` ("参数错误") with every one of its
draws lost. The frame line's `dropped` counter is not where that shows: its
largest term is dispatches of the ray-tracing structure builder, dropped on
purpose (`VICTORY_BVH_BUILDER=1` gates the builder), 200 to 1,400 a frame. The
evidence here is the pipeline.

The state is the console's, where the renderer allows a blend on an integer
target; D3D12 does not. `GraphicsState::settle_integer_targets` turns the blend
off for those slots alone, before the state is described (so the library name
still says what is made) and before any pipeline is built. Where the title's
blend was a write - `ONE`/`ZERO`, its usual static state - the picture is the
same; where it was not, the slot is overwritten rather than blended. Only
`BlendEnable` changes: the blend factors are left as the title wrote them.

`IndependentBlendEnable` decides what "that slot" means. With it off - D3D12's
default - `RenderTarget[0]` applies to every bound slot and `RenderTarget[1..]`
is never read, so a slot cannot be settled by itself: slot 1 may say it does not
blend while slot 0's state blends it. Then slot 0's state is copied to every
slot and the slots are made independent, which leaves the float slots blending
exactly as the title asked while the integer slot is turned off on its own. When
every bound slot is integer, nothing has to become independent: slot 0's blend
goes off and the shared state goes with it.

Measured on an RTX 4080 SUPER. Three state tests pin the slots: the integer one
loses its blend, the float ones keep theirs, a slot past `NumRenderTargets` is
untouched, the factors survive, settling twice changes nothing; the shared case
takes the slots apart with slot 0's state on each, whichever slot is the integer
one; and a state that blends nothing is left exactly as it was. The device
agrees: built through the same code where the device tests live, a shared state
over an `R8_UINT` slot is refused by the device and made once the slots are
apart. A card run with the same keys 300 s either side went from 20 `host mesh
pipeline refused` lines to none, gaining one line naming `slots=[(2, 62)]` -
format 62 is `R8_UINT`.

`cargo test -p victory-gpu --lib --profile diag --features diagnostics`: 198
passed, 2 failed, 1 ignored - the two failures are the known #1744 view-heap pair
on an NVIDIA host (FIND-9: this device caps shader-visible view heaps at
1,000,000, `HEAP_VIEWS` is 2^21), and they fail here without this change too.
`cargo clippy -p victory-gpu --all-features -- -D warnings` is clean.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:14:17 +00:00
github-bot closed this pull request 2026-11-26 05:14:17 +00:00
Author
Owner

@⁠kotekompotek on GitHub · 2026-11-25 20:38 UTC · original

+68k across 583 files is a whole-fork diff, not a reviewable change - third of this shape after #2643 and #2758. The integer-blend fix in the title may be real, but nobody can verify what else is in here; please split it into focused PRs.

**@⁠kotekompotek** on GitHub · 2026-11-25 20:38 UTC · [original](https://github.com/Marvisak/VIctory/pull/2790#issuecomment-7173980136) +68k across 583 files is a whole-fork diff, not a reviewable change - third of this shape after #2643 and #2758. The integer-blend fix in the title may be real, but nobody can verify what else is in here; please split it into focused PRs.
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-25 20:46 UTC · original

Reviewed and tested bb69da3b on Windows 11 (RTX 5090 + WARP). Two blockers before merge:

1. Branch hygiene & policy failures

  • The branch is based on an older fork (ffe310eb, 583 files changed, +67,983/-1,808), conflicts with main (13f91ca), bundles build artifacts under target-merge/diag/ and tools/disasm_rva.py, fails cargo xtask policy (548 violations), and fails cargo clippy --all-targets -- -D warnings. This needs to be rebased onto 13f91ca as a clean commit containing only the pipeline/host.rs change and tests.

2. D3D12 IndependentBlendEnable == FALSE spec bug in settle_integer_targets

In D3D12, when self.blend.IndependentBlendEnable is false (the default), the runtime applies RenderTarget[0]'s blend state to every bound render target 0..NumRenderTargets and ignores RenderTarget[1..7]:

  • Missed integer RT: if RT0 is float with RenderTarget[0].BlendEnable = true, RT2 is R8_UINT with RenderTarget[2].BlendEnable = false, and IndependentBlendEnable = false, settle_integer_targets inspects RenderTarget[2].BlendEnable (false), makes no change, and D3D12 still rejects the PSO because RT0's blend applies to RT2.
  • Clobbered float RT: if RT0 is integer with BlendEnable = true, RT1 is float, and IndependentBlendEnable = false, clearing RenderTarget[0].BlendEnable without first setting IndependentBlendEnable = true and copying RenderTarget[0] into the other active slots silently disables blending on float RT1 as well.

Handling IndependentBlendEnable == false by expanding RenderTarget[0] across 0..rt_count and setting IndependentBlendEnable = true whenever any non-zero slot is an integer target (while RT0 blends) or RT0 is integer (while any other slot is float) will cover both MRT cases cleanly.

(On bb69da3b, the two new tests a_blend_on_an_integer_target_is_turned_off_for_that_slot_only and a_pipeline_that_blends_an_integer_target_is_refused_until_the_blend_is_off pass on RTX 5090 and WARP.)

**@⁠fuzeofficlal** on GitHub · 2026-11-25 20:46 UTC · [original](https://github.com/Marvisak/VIctory/pull/2790#issuecomment-7174178701) Reviewed and tested `bb69da3b` on Windows 11 (RTX 5090 + WARP). Two blockers before merge: ### 1. Branch hygiene & policy failures - The branch is based on an older fork (`ffe310eb`, 583 files changed, `+67,983/-1,808`), conflicts with `main` (`13f91ca`), bundles build artifacts under `target-merge/diag/` and `tools/disasm_rva.py`, fails `cargo xtask policy` (**548 violations**), and fails `cargo clippy --all-targets -- -D warnings`. This needs to be rebased onto `13f91ca` as a clean commit containing only the `pipeline/host.rs` change and tests. ### 2. D3D12 `IndependentBlendEnable == FALSE` spec bug in `settle_integer_targets` In D3D12, when `self.blend.IndependentBlendEnable` is `false` (the default), the runtime applies `RenderTarget[0]`'s blend state to **every** bound render target `0..NumRenderTargets` and ignores `RenderTarget[1..7]`: - **Missed integer RT**: if RT0 is float with `RenderTarget[0].BlendEnable = true`, RT2 is `R8_UINT` with `RenderTarget[2].BlendEnable = false`, and `IndependentBlendEnable = false`, `settle_integer_targets` inspects `RenderTarget[2].BlendEnable` (`false`), makes no change, and D3D12 still rejects the PSO because RT0's blend applies to RT2. - **Clobbered float RT**: if RT0 is integer with `BlendEnable = true`, RT1 is float, and `IndependentBlendEnable = false`, clearing `RenderTarget[0].BlendEnable` without first setting `IndependentBlendEnable = true` and copying `RenderTarget[0]` into the other active slots silently disables blending on float RT1 as well. Handling `IndependentBlendEnable == false` by expanding `RenderTarget[0]` across `0..rt_count` and setting `IndependentBlendEnable = true` whenever any non-zero slot is an integer target (while RT0 blends) or RT0 is integer (while any other slot is float) will cover both MRT cases cleanly. *(On `bb69da3b`, the two new tests `a_blend_on_an_integer_target_is_turned_off_for_that_slot_only` and `a_pipeline_that_blends_an_integer_target_is_refused_until_the_blend_is_off` pass on RTX 5090 and WARP.)*
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-25 21:31 UTC · original

Re-verified f00d527f on Windows 11 (RTX 5090 + WARP, --features diagnostics):

  • Branch hygiene is now clean (+107/-3 in crates/victory-gpu/src/pipeline/host.rs, clean git merge-tree against origin/main 13f91ca).
  • cargo xtask policy: 184 files ok; cargo clippy (default & --features diagnostics): 0 warnings; RTX 5090 pipeline::host::tests 3/3 passed; WARP full suite 199/199 passed (1 ignored).

However, the IndependentBlendEnable == FALSE bug from the previous review is still unaddressed in settle_integer_targets:

  1. Missed disable: when IndependentBlendEnable == false, RT0 is a float target with RenderTarget[0].BlendEnable = true, and RT2 is R8_UINT with RenderTarget[2].BlendEnable = false, D3D12 applies RenderTarget[0] to all active slots 0..NumRenderTargets and still rejects the PSO with E_INVALIDARG, while settle_integer_targets sees RenderTarget[2].BlendEnable == false and returns 0 without changing anything.
  2. Over-broad disable: when IndependentBlendEnable == false, RT0 is an integer target with BlendEnable = true, and RT1 is a float target, clearing RenderTarget[0].BlendEnable without setting IndependentBlendEnable = true and copying the original RenderTarget[0] to the other active slots also turns off blending on float RT1.

Minor nits: takes_blending includes DXGI_FORMAT_R9G9B9E5_SHAREDEXP (which is not an integer format and not a valid RTV format), line 769 removes indentation on mesh_pipeline's doc comment, and the test only exercises IndependentBlendEnable == true on CPU without creating a host PSO. (For reference, #2801 handles IndependentBlendEnable == false expansion, reuses twin::integer, preserves GraphicsState::blend/describe(), and tests real PSO creation on D3D12.)

**@⁠fuzeofficlal** on GitHub · 2026-11-25 21:31 UTC · [original](https://github.com/Marvisak/VIctory/pull/2790#issuecomment-7175190254) Re-verified `f00d527f` on Windows 11 (RTX 5090 + WARP, `--features diagnostics`): - Branch hygiene is now clean (`+107/-3` in `crates/victory-gpu/src/pipeline/host.rs`, clean `git merge-tree` against `origin/main` `13f91ca`). - `cargo xtask policy`: 184 files ok; `cargo clippy` (default & `--features diagnostics`): 0 warnings; RTX 5090 `pipeline::host::tests` 3/3 passed; WARP full suite 199/199 passed (1 ignored). However, the **`IndependentBlendEnable == FALSE`** bug from the previous review is still unaddressed in `settle_integer_targets`: 1. **Missed disable**: when `IndependentBlendEnable == false`, RT0 is a float target with `RenderTarget[0].BlendEnable = true`, and RT2 is `R8_UINT` with `RenderTarget[2].BlendEnable = false`, D3D12 applies `RenderTarget[0]` to all active slots `0..NumRenderTargets` and still rejects the PSO with `E_INVALIDARG`, while `settle_integer_targets` sees `RenderTarget[2].BlendEnable == false` and returns `0` without changing anything. 2. **Over-broad disable**: when `IndependentBlendEnable == false`, RT0 is an integer target with `BlendEnable = true`, and RT1 is a float target, clearing `RenderTarget[0].BlendEnable` without setting `IndependentBlendEnable = true` and copying the original `RenderTarget[0]` to the other active slots also turns off blending on float RT1. Minor nits: `takes_blending` includes `DXGI_FORMAT_R9G9B9E5_SHAREDEXP` (which is not an integer format and not a valid RTV format), line 769 removes indentation on `mesh_pipeline`'s doc comment, and the test only exercises `IndependentBlendEnable == true` on CPU without creating a host PSO. (For reference, #2801 handles `IndependentBlendEnable == false` expansion, reuses `twin::integer`, preserves `GraphicsState::blend`/`describe()`, and tests real PSO creation on D3D12.)
Author
Owner

@⁠HoLa-Lee on GitHub · 2026-11-25 22:24 UTC · original

@⁠fuzeofficlal - you were right about both halves, and it is fixed in 69d483f.

settle_integer_targets now reads IndependentBlendEnable first:

  • Off (D3D12's default, and what the title's stream usually leaves): RenderTarget[0] applies to every bound slot and RenderTarget[1..] is never read, so a slot cannot be settled by itself. If any bound slot is integer and slot 0 blends, slot 0's state is copied to every slot and IndependentBlendEnable is set - which fixes your two cases at once:
    • missed disable: float slot 0 blending + R8_UINT slot 2 with its own BlendEnable false now settles (before: returns 0 and the PSO is still refused);
    • over-broad disable: integer slot 0 + float slot 1 now keeps slot 1 blending (before: clearing slot 0 also cleared the float slot's blend).
  • Every bound slot integer: nothing becomes independent - slot 0's blend goes off and the shared state goes with it, as before.
  • Slot 0 not blending: returned 0 and untouched, exactly as before.

On the device, not only in the state. I built your missed disable case through the same code on an RTX 4080 SUPER (a pixel shader writing SV_Target0 float and SV_Target1 uint, NumRenderTargets = 2, R8G8B8A8_UNORM + R8_UINT, IndependentBlendEnable = false, slot 0 blending, slot 1 not):

device
the state the title hands us refused, E_INVALIDARG
the same state after settle_integer_targets() made - and it asserts slot 0 still blends, slot 1 does not, IndependentBlendEnable true

That device test lives where the device harness is; this PR's tree has no dxc/host() test helpers, so the PR carries the three state tests and the device result is above.

@⁠kotekompotek - the +68k diff was the branch, not the change. It was cut from a tree that had a fork merge in it. f00d527 and now 69d483f are cut from 13f91ca and touch one file: +199/-3 in crates/victory-gpu/src/pipeline/host.rs.

State of the three tests now: a_blend_on_an_integer_target_is_turned_off_for_that_slot_only (per-slot, independent case), a_shared_blend_state_stops_sharing_so_an_integer_slot_can_be_settled (your four cases: mixed with slot 0 float, mixed with slot 0 integer, all integer, slot 0 quiet), and the device test above.

cargo test -p victory-gpu --lib --profile diag --features diagnostics on this tree: 198 passed, 2 failed, 1 ignored - the 2 are the #1744 view-heap pair (FIND-9: this card caps shader-visible view heaps at 1,000,000, HEAP_VIEWS is 2^21) and fail without the change too. cargo clippy -p victory-gpu --all-features -- -D warnings: clean.

**@⁠HoLa-Lee** on GitHub · 2026-11-25 22:24 UTC · [original](https://github.com/Marvisak/VIctory/pull/2790#issuecomment-7176318635) **@⁠fuzeofficlal - you were right about both halves, and it is fixed in `69d483f`.** `settle_integer_targets` now reads `IndependentBlendEnable` first: - **Off (D3D12's default, and what the title's stream usually leaves):** `RenderTarget[0]` applies to every bound slot and `RenderTarget[1..]` is never read, so a slot cannot be settled by itself. If any bound slot is integer and slot 0 blends, slot 0's state is copied to every slot and `IndependentBlendEnable` is set - which fixes your two cases at once: - *missed disable*: float slot 0 blending + `R8_UINT` slot 2 with its own `BlendEnable` false now settles (before: returns 0 and the PSO is still refused); - *over-broad disable*: integer slot 0 + float slot 1 now keeps slot 1 blending (before: clearing slot 0 also cleared the float slot's blend). - **Every bound slot integer:** nothing becomes independent - slot 0's blend goes off and the shared state goes with it, as before. - **Slot 0 not blending:** returned 0 and untouched, exactly as before. **On the device, not only in the state.** I built your *missed disable* case through the same code on an RTX 4080 SUPER (a pixel shader writing `SV_Target0` float and `SV_Target1` uint, `NumRenderTargets = 2`, `R8G8B8A8_UNORM` + `R8_UINT`, `IndependentBlendEnable = false`, slot 0 blending, slot 1 not): | | device | |---|---| | the state the title hands us | **refused**, `E_INVALIDARG` | | the same state after `settle_integer_targets()` | **made** - and it asserts slot 0 still blends, slot 1 does not, `IndependentBlendEnable` true | That device test lives where the device harness is; this PR's tree has no `dxc`/`host()` test helpers, so the PR carries the three state tests and the device result is above. **@⁠kotekompotek - the +68k diff was the branch, not the change.** It was cut from a tree that had a fork merge in it. `f00d527` and now `69d483f` are cut from `13f91ca` and touch one file: **+199/-3 in `crates/victory-gpu/src/pipeline/host.rs`**. State of the three tests now: `a_blend_on_an_integer_target_is_turned_off_for_that_slot_only` (per-slot, independent case), `a_shared_blend_state_stops_sharing_so_an_integer_slot_can_be_settled` (your four cases: mixed with slot 0 float, mixed with slot 0 integer, all integer, slot 0 quiet), and the device test above. `cargo test -p victory-gpu --lib --profile diag --features diagnostics` on this tree: **198 passed, 2 failed, 1 ignored** - the 2 are the `#1744` view-heap pair (`FIND-9`: this card caps shader-visible view heaps at 1,000,000, `HEAP_VIEWS` is 2^21) and fail without the change too. `cargo clippy -p victory-gpu --all-features -- -D warnings`: clean.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 23:14 UTC · original

Automated triage for the maintainers.

This PR no longer merges cleanly into current main (it was cut from 13f91ca; main has moved since): it conflicts in crates/victory-gpu/src/pipeline/host.rs. Its content will be reviewed once it is rebased. When you rebase, note that #2801 also changes integer render targets' blending in the same area.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 23:14 UTC · [original](https://github.com/Marvisak/VIctory/pull/2790#issuecomment-7177298643) <!-- victory-triage v1 head=69d483fd8d731080b36fb70aa98f0f5067efac12 verdict=needs-rebase at=2026-11-25T23:13:52Z --> Automated triage for the maintainers. This PR no longer merges cleanly into current `main` (it was cut from `13f91ca`; `main` has moved since): it conflicts in `crates/victory-gpu/src/pipeline/host.rs`. Its content will be reviewed once it is rebased. When you rebase, note that #2801 also changes integer render targets' blending in the same area. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠HoLa-Lee on GitHub · 2026-11-25 23:28 UTC · original

The picture with the blend turned off: same screen, same pixels. Measured.

You asked what happens to what those draws put in that R8_UINT target. Two 300 s runs of the intro, same keys, same seed, VICTORY_FAST=1 + STAGE_MB=64 + GATHER=1, VICTORY_CAPTURE on so every power-of-two frame is written to half-resolution PNG, RTX 4080 SUPER:

frame differing pixels mean abs difference
1-1024 (11 captures) 0 of 2,073,600 each 0.0000
2048 40,833 (1.97%) 1.3992
4096 228 (0.011%) 0.0022

Frame 2048 is not a visual difference from the change: the two runs are on different screens there - one shows the Korean legal notices page (법적 공지), the other the English one (LEGAL NOTICES) - so the scripted keys landed one page apart. The captures make that plain. Frame 4096 differs in 228 pixels (0.011%, a few glyph edges).

So: on every screen both runs reached together, the frames are pixel-identical. Whatever that slot's blend was contributing, turning it off did not change the picture on the screens we could capture.

What this does and does not say

  • It says the change is not visibly harmful on these screens, which was the open question.
  • It does not say the slot is visible here at all: the R8_UINT target may be a mask or a coverage buffer that no captured screen reads back. A world frame with something the target feeds would be the stronger test, and that needs getting past the intro, which this machine does not yet do.
  • The mechanism itself is proven where it can be: the device test builds the refused state and asserts it is refused before, and made after (RTX 4080 SUPER, E_INVALIDARG → Ok), and the two runs' logs go from 20 host mesh pipeline refused lines to none.

Reproduce: cargo test -p victory-gpu --lib --profile diag --features diagnostics pipeline::host::tests and a run with VICTORY_CAPTURE=<folder>; the comparison script is 30 lines of Pillow, and the numbers above are its output.

**@⁠HoLa-Lee** on GitHub · 2026-11-25 23:28 UTC · [original](https://github.com/Marvisak/VIctory/pull/2790#issuecomment-7177608229) **The picture with the blend turned off: same screen, same pixels. Measured.** You asked what happens to what those draws put in that `R8_UINT` target. Two 300 s runs of the intro, same keys, same seed, `VICTORY_FAST=1` + `STAGE_MB=64` + `GATHER=1`, `VICTORY_CAPTURE` on so every power-of-two frame is written to half-resolution PNG, RTX 4080 SUPER: | frame | differing pixels | mean abs difference | |---|---|---| | 1-1024 (11 captures) | **0 of 2,073,600** each | 0.0000 | | 2048 | 40,833 (1.97%) | 1.3992 | | 4096 | 228 (0.011%) | 0.0022 | Frame 2048 is not a visual difference from the change: the two runs are on **different screens** there - one shows the Korean legal notices page (`법적 공지`), the other the English one (`LEGAL NOTICES`) - so the scripted keys landed one page apart. The captures make that plain. Frame 4096 differs in 228 pixels (0.011%, a few glyph edges). So: **on every screen both runs reached together, the frames are pixel-identical.** Whatever that slot's blend was contributing, turning it off did not change the picture on the screens we could capture. ## What this does and does not say - It says the change is not visibly harmful on these screens, which was the open question. - It does not say the slot is *visible* here at all: the `R8_UINT` target may be a mask or a coverage buffer that no captured screen reads back. A world frame with something the target feeds would be the stronger test, and that needs getting past the intro, which this machine does not yet do. - The mechanism itself is proven where it can be: the device test builds the refused state and asserts it is refused before, and made after (RTX 4080 SUPER, `E_INVALIDARG` → `Ok`), and the two runs' logs go from 20 `host mesh pipeline refused` lines to none. Reproduce: `cargo test -p victory-gpu --lib --profile diag --features diagnostics pipeline::host::tests` and a run with `VICTORY_CAPTURE=<folder>`; the comparison script is 30 lines of Pillow, and the numbers above are its output.
Author
Owner

@⁠HoLa-Lee on GitHub · 2026-11-25 23:32 UTC · original

Closing: main now does this itself, in a7cb47c (GPU: no blending on integer render targets in host pipelines (#1152), Pablo González, 2026-11-25 22:49 UTC). host_blend in pipeline/host.rs turns blending off on integer targets and, "with one description for all targets, each target gets its own copy so the others keep theirs" - the same two halves this PR had: the per-slot disable, and the IndependentBlendEnable handling @⁠fuzeofficlal asked for in review. There is nothing left here worth merging.

What this thread did contribute, for the record:

  • the card's own words for the refusal (R8_UINT at slot 2, E_INVALIDARG from CreateGraphicsPipelineState) and the counts of draws it cost;
  • the measurement that the picture does not change when that slot's blend is off (two 300 s runs, every VICTORY_CAPTURE frame: 12 of 13 pixel-identical, the one that differed was a different screen);
  • @⁠fuzeofficlal's IndependentBlendEnable == FALSE case, which host_blend also has to get right and does (blends(i) reads slot 0 when the slots share, then the shared state is copied out and the integer slots are turned off).

The one thing a7cb47c has no test for is host_blend itself. That is worth a small PR of its own and I will send it rather than leave the function unguarded: the six cases are pure function in, function out, no GPU needed.

**@⁠HoLa-Lee** on GitHub · 2026-11-25 23:32 UTC · [original](https://github.com/Marvisak/VIctory/pull/2790#issuecomment-7177698887) **Closing: main now does this itself, in `a7cb47c`** (`GPU: no blending on integer render targets in host pipelines (#1152)`, Pablo González, 2026-11-25 22:49 UTC). `host_blend` in `pipeline/host.rs` turns blending off on integer targets and, "with one description for all targets, each target gets its own copy so the others keep theirs" - the same two halves this PR had: the per-slot disable, and the `IndependentBlendEnable` handling @⁠fuzeofficlal asked for in review. There is nothing left here worth merging. What this thread did contribute, for the record: - the card's own words for the refusal (`R8_UINT` at slot 2, `E_INVALIDARG` from `CreateGraphicsPipelineState`) and the counts of draws it cost; - the measurement that the picture does not change when that slot's blend is off (two 300 s runs, every `VICTORY_CAPTURE` frame: 12 of 13 pixel-identical, the one that differed was a different screen); - @⁠fuzeofficlal's `IndependentBlendEnable == FALSE` case, which `host_blend` also has to get right and does (`blends(i)` reads slot 0 when the slots share, then the shared state is copied out and the integer slots are turned off). The one thing `a7cb47c` has no test for is `host_blend` itself. That is worth a small PR of its own and I will send it rather than leave the function unguarded: the six cases are pure function in, function out, no GPU needed.
Author
Owner

@⁠HoLa-Lee on GitHub · 2026-11-25 23:39 UTC · original

One correction to what I wrote above: a7cb47c does ship tests for host_blend - integer_targets_do_not_blend (both IndependentBlendEnable values, slot 0 and 1 keeping theirs, slot 2 off, the title's factors kept) and blend_states_without_integer_blending_are_kept (no integer target, an integer target that does not blend, integer formats past NumRenderTargets). So there is nothing for me to add there either; I looked at the merged file after posting. The closing stands for the right reason.

**@⁠HoLa-Lee** on GitHub · 2026-11-25 23:39 UTC · [original](https://github.com/Marvisak/VIctory/pull/2790#issuecomment-7177869958) One correction to what I wrote above: `a7cb47c` does ship tests for `host_blend` - `integer_targets_do_not_blend` (both `IndependentBlendEnable` values, slot 0 and 1 keeping theirs, slot 2 off, the title's factors kept) and `blend_states_without_integer_blending_are_kept` (no integer target, an integer target that does not blend, integer formats past `NumRenderTargets`). So there is nothing for me to add there either; I looked at the merged file after posting. The closing stands for the right reason.

Pull request closed

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!2790
No description provided.