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

Open
github-bot wants to merge 2 commits from github-bot/gh-1162 into main AGit
Owner

@⁠Dathinel on GitHub · 2026-11-25 22:10 UTC · original
Dathinel:gpu/blend-integer-targets → main · +86 −5 · 1 files · 2 commits · open

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

**@⁠Dathinel** on GitHub · 2026-11-25 22:10 UTC · [original](https://github.com/fxceless/victory-fork/pull/1162) `Dathinel:gpu/blend-integer-targets` → `main` · +86 −5 · 1 files · 2 commits · open **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)
D3D12 refuses a pipeline whose blend state is on for a slot with an integer
format (debug layer id 676); the console makes it. One mesh pipeline of the
first gameplay scene was refused this way on every run.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
With VICTORY_BLEND_INT_OFF=1 the description no longer matched the name of a
pipeline stored without it, so it was made again on every run.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:58:43 +00:00
Author
Owner

@⁠Dathinel on GitHub · 2026-11-25 22:12 UTC · original

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.

**@⁠Dathinel** on GitHub · 2026-11-25 22:12 UTC · [original](https://github.com/fxceless/victory-fork/pull/1162#issuecomment-7176063817) 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.
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-25 22:10 UTC · original · edited 2026-11-25 22:14 UTC

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.

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-25 22:10 UTC · [original](https://github.com/fxceless/victory-fork/pull/1162#issuecomment-7176028930) · edited 2026-11-25 22:14 UTC <!-- 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>
Author
Owner

@⁠Dathinel on GitHub · 2026-11-25 22:20 UTC · original

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

**@⁠Dathinel** on GitHub · 2026-11-25 22:20 UTC · [original](https://github.com/fxceless/victory-fork/pull/1162#issuecomment-7176245657) 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).
@ -635,3 +647,3 @@
}
}),
BlendState: g.blend,
BlendState: g.host_blend(),
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-25 22:14 UTC · original

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 👍 / 👎.

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-25 22:14 UTC · [original](https://github.com/fxceless/victory-fork/pull/1162#discussion_r4701494824) **<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 -->
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1162/head:github-bot/gh-1162'
git switch 'github-bot/gh-1162'

Merge

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