Blending into an integer render target turned off for the host (VICTORY_BLEND_INT_OFF=1): one refused mesh pipeline is made #1159

Closed
Dathinel wants to merge 2 commits from upstream-pr/1162 into main
Dathinel commented 2026-11-25 22:10:12 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by Dathinel on 2026-11-25T22:10:12Z.


What. One mesh pipeline of the first gameplay scene is refused by the host on every run here (0x80070057): mesh f5e50eb2108c425b + pixel ce3f0432a08f1d35. Both shaders translate. #1141 lists the same pair as refused on an RTX 5070, so it is not specific to this card.

Why it is refused. With a diagnostics build and VICTORY_D3D12_DEBUG=1 the debug layer names it:

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. (id 676, error)

The title's blend state is on for a slot whose target is an integer format. The console makes that pipeline; D3D12 does not.

The change. GraphicsState::host_blend(): with VICTORY_BLEND_INT_OFF=1, blending is turned off for the integer render targets and left as it was for the others. If the state is shared by every slot (no independent blending), it is spread to the eight slots first, so only the integer ones change. Used at the four places that hand the blend state to the host (vertex and mesh pipelines, with and without depth bounds). Off by default: nothing changes without the switch. One file, +85/−4, a unit test for the function.

Measured (RTX 3050 Laptop 4 GB, 32-lane waves, Ryzen 7 7435HS, --console series-s, tree main 9c184b3 + #1081 + #798, run 253 switch set + VICTORY_TEXTURE_BUDGET_MB=1024, diagnostics build, debug layer on):

switch off (8 runs of the world) VICTORY_BLEND_INT_OFF=1 (1 run, 160 s)
this pipeline refused, every run created (host mesh pipeline shaders=[mesh f5e50eb2108c425b, pixel ce3f0432a08f1d35])
draws dropped for it 5 to 6 a frame while it is in view none logged
pipelines refused in the run 7 6 (the six 64-lane compute programs)
debug layer id 676 1 0
device loss none none

Not tested / not known.

  • What those 5 to 6 draws show: I did not compare pictures, so I cannot say the result is right, only that the pipeline is made and nothing new is reported by the debug layer.
  • What the console does with blending on an integer target. I assumed the write goes through unblended; that is why this is behind a switch.
  • Frame time: not compared (the run with the switch was short and still loading).
  • Only the Series S profile, one card.
  • On this branch alone (clean main): the unit test and cargo xtask policy pass; the game runs were on the tree above.

AI-assisted (Claude Code); built, run and read on the machine above.

🤖 Generated with Claude Code

<!-- greyfinch-sync:fxceless/victory-fork:issue:5500035745 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1162). Originally posted by [Dathinel](https://github.com/Dathinel) on 2026-11-25T22:10:12Z. --- **What.** One mesh pipeline of the first gameplay scene is refused by the host on every run here (`0x80070057`): mesh `f5e50eb2108c425b` + pixel `ce3f0432a08f1d35`. Both shaders translate. #1141 lists the same pair as refused on an RTX 5070, so it is not specific to this card. **Why it is refused.** With a diagnostics build and `VICTORY_D3D12_DEBUG=1` the debug layer names it: > 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. (id 676, error) The title's blend state is on for a slot whose target is an integer format. The console makes that pipeline; D3D12 does not. **The change.** `GraphicsState::host_blend()`: with `VICTORY_BLEND_INT_OFF=1`, blending is turned off for the integer render targets and left as it was for the others. If the state is shared by every slot (no independent blending), it is spread to the eight slots first, so only the integer ones change. Used at the four places that hand the blend state to the host (vertex and mesh pipelines, with and without depth bounds). Off by default: nothing changes without the switch. One file, +85/−4, a unit test for the function. **Measured** (RTX 3050 Laptop 4 GB, 32-lane waves, Ryzen 7 7435HS, `--console series-s`, tree `main` 9c184b3 + #1081 + #798, run 253 switch set + `VICTORY_TEXTURE_BUDGET_MB=1024`, diagnostics build, debug layer on): | | switch off (8 runs of the world) | `VICTORY_BLEND_INT_OFF=1` (1 run, 160 s) | |---|---|---| | this pipeline | refused, every run | created (`host mesh pipeline shaders=[mesh f5e50eb2108c425b, pixel ce3f0432a08f1d35]`) | | draws dropped for it | 5 to 6 a frame while it is in view | none logged | | pipelines refused in the run | 7 | 6 (the six 64-lane compute programs) | | debug layer id 676 | 1 | 0 | | device loss | none | none | **Not tested / not known.** - What those 5 to 6 draws show: I did not compare pictures, so I cannot say the result is right, only that the pipeline is made and nothing new is reported by the debug layer. - What the console does with blending on an integer target. I assumed the write goes through unblended; that is why this is behind a switch. - Frame time: not compared (the run with the switch was short and still loading). - Only the Series S profile, one card. - On this branch alone (clean `main`): the unit test and `cargo xtask policy` pass; the game runs were on the tree above. AI-assisted (Claude Code); built, run and read on the machine above. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
chatgpt-codex-connector[bot] commented 2026-11-25 22:14:17 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T22:14:17Z.

Review: COMMENTED


💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 927163f0ae

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

<!-- greyfinch-sync:fxceless/victory-fork:review:6065722734 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1162#pullrequestreview-6065722734). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/apps/chatgpt-codex-connector) on 2026-11-25T22:14:17Z. **Review:** COMMENTED --- <!-- codex-review-receipt:v1 --> ### 💡 Codex Review Here are some automated review suggestions for this pull request. **Reviewed commit:** `927163f0ae` <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". </details>
Dathinel commented 2026-11-25 23:09:54 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by Dathinel on 2026-11-25T22:12:04Z.


Prior art: #51 already fixes the same mesh/pixel pair (f5e50eb2108c425b / ce3f0432a08f1d35) in the same three pipeline creation paths. Its author credits pablogonz12 and reports successful creation on an RTX 5070 Ti in Series X, with unchanged FPS. The contribution here is the independent RTX 3050 Laptop / Series S measurement, D3D12 debug message 676 and an opt-in switch. The core blend fix overlaps, so one implementation should suffice. AI-assisted comparison of both diffs.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7176063817 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1162#issuecomment-7176063817). Originally posted by [Dathinel](https://github.com/Dathinel) on 2026-11-25T22:12:04Z. --- Prior art: #51 already fixes the same mesh/pixel pair (f5e50eb2108c425b / ce3f0432a08f1d35) in the same three pipeline creation paths. Its author credits pablogonz12 and reports successful creation on an RTX 5070 Ti in Series X, with unchanged FPS. The contribution here is the independent RTX 3050 Laptop / Series S measurement, D3D12 debug message 676 and an opt-in switch. The core blend fix overlaps, so one implementation should suffice. AI-assisted comparison of both diffs.
chatgpt-codex-connector[bot commented 2026-11-25 23:09:54 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T22:10:26Z.


Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-25T22:14:19.567520Z 927163f PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7176028930 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1162#issuecomment-7176028930). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-25T22:10:26Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"927163f0aee51774570e586a47997012506b198b","has_any_findings":true,"has_unresolved_findings":true,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} --> <details> <summary><strong>Codex Review Summary</strong>: ✅ Completed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ✅ **Completed** <relative-time datetime="2026-11-25T22:14:19.567520Z">2026-11-25T22:14:19.567520Z</relative-time> | `927163f` | PR opened | <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review" or "@codex security review". Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. </details> </details>
Dathinel commented 2026-11-25 23:09:55 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by Dathinel on 2026-11-25T22:20:44Z.


The review's point holds: the library name came from describe(), which printed the title's blend state, so with the switch on a pipeline stored earlier under that name could not be replaced and was made again each run. Fixed in 3abd812: describe() prints the state the host is given. With the switch off the name is the same as before. The pipeline::host unit tests pass; I have not measured a second run with a warm library after this change.

On #51: agreed, the core is the same fix and one implementation is enough. If #51 is the one carried, what this PR adds is the debug-layer message (id 676), the RTX 3050 Laptop / Series S measurement and the library-name point above, which applies to any version that changes the blend state after the name is taken.

AI-assisted (Claude Code).

<!-- greyfinch-sync:fxceless/victory-fork:comment:7176245657 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1162#issuecomment-7176245657). Originally posted by [Dathinel](https://github.com/Dathinel) on 2026-11-25T22:20:44Z. --- The review's point holds: the library name came from `describe()`, which printed the title's blend state, so with the switch on a pipeline stored earlier under that name could not be replaced and was made again each run. Fixed in `3abd812`: `describe()` prints the state the host is given. With the switch off the name is the same as before. The `pipeline::host` unit tests pass; I have not measured a second run with a warm library after this change. On #51: agreed, the core is the same fix and one implementation is enough. If #51 is the one carried, what this PR adds is the debug-layer message (id 676), the RTX 3050 Laptop / Series S measurement and the library-name point above, which applies to any version that changes the blend state after the name is taken. AI-assisted (Claude Code).
chatgpt-codex-connector[bot commented 2026-11-25 23:10:01 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T22:14:17Z.

Code review location: crates/victory-gpu/src/pipeline/host.rs; line 649

@@ -634,7 +646,7 @@ impl HostPipeline {
                     BytecodeLength: gs.len(),
                 }
             }),
-            BlendState: g.blend,
+            BlendState: g.host_blend(),

P2 Badge Include the effective blend state in the pipeline cache key

When a persistent library already contains a valid unmodified PSO—for example, one whose pixel shader leaves an integer MRT unwritten—enabling VICTORY_BLEND_INT_OFF changes its descriptor but retains its library name. The name still uses g.describe() at line 589, which serializes the original self.blend. Loading the existing entry then fails description matching, and library::pipeline cannot replace the occupied name (library.rs:583–585), so the adjusted PSO must be recompiled on every subsequent enabled run. Include the effective host blend state, or a flag-dependent discriminator, in the library key.

Useful? React with 👍 / 👎.

<!-- greyfinch-sync:fxceless/victory-fork:review-comment:4701494824 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1162#discussion_r4701494824). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-25T22:14:17Z. **Code review location:** `crates/victory-gpu/src/pipeline/host.rs`; line 649 ~~~~diff @@ -634,7 +646,7 @@ impl HostPipeline { BytecodeLength: gs.len(), } }), - BlendState: g.blend, + BlendState: g.host_blend(), ~~~~ --- **<sub><sub>![P2 Badge](https://img.shields.io/badge/P2-yellow?style=flat)</sub></sub> Include the effective blend state in the pipeline cache key** When a persistent library already contains a valid unmodified PSO—for example, one whose pixel shader leaves an integer MRT unwritten—enabling `VICTORY_BLEND_INT_OFF` changes its descriptor but retains its library name. The name still uses `g.describe()` at line 589, which serializes the original `self.blend`. Loading the existing entry then fails description matching, and `library::pipeline` cannot replace the occupied name (`library.rs:583–585`), so the adjusted PSO must be recompiled on every subsequent enabled run. Include the effective host blend state, or a flag-dependent discriminator, in the library key. Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
Dathinel commented 2026-11-28 01:08:01 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by Dathinel on 2026-11-28T01:08:01Z.


Closing as superseded: main already turns blending off on integer render targets for the host (pipeline/host.rs, with the tests integer_targets_do_not_blend and blend_states_without_integer_blending_are_kept), which is what this did behind a switch. The independent measurement that motivated it (RTX 3050 Laptop 4 GB, Series S, the D3D12 debug message for the mesh/pixel pair) is kept with the rest of that card's results at https://github.com/Dathinel/victory-4gb . Written with AI assistance (Claude Code).

<!-- greyfinch-sync:fxceless/victory-fork:comment:7231444716 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1162#issuecomment-7231444716). Originally posted by [Dathinel](https://github.com/Dathinel) on 2026-11-28T01:08:01Z. --- Closing as superseded: `main` already turns blending off on integer render targets for the host (`pipeline/host.rs`, with the tests `integer_targets_do_not_blend` and `blend_states_without_integer_blending_are_kept`), which is what this did behind a switch. The independent measurement that motivated it (RTX 3050 Laptop 4 GB, Series S, the D3D12 debug message for the mesh/pixel pair) is kept with the rest of that card's results at https://github.com/Dathinel/victory-4gb . Written with AI assistance (Claude Code).

Pull request closed

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
fxceless/victory-fork!1159
No description provided.