GPU: no blending on integer render targets #715
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!715
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-715"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@KyleS98 on GitHub · 2026-11-25 05:25 UTC · original
KyleS98:fix/integer-target-blend→main· +121 −5 · 1 files · 2 commits · openA pipeline whose blend description enables blending on an integer render target (UINT/SINT) is created as the title describes it. D3D12 treats that as an error, and what the driver writes to the target is undefined. On an RTX 3090 Ti the debug layer (
VICTORY_D3D12_DEBUG=1) reports it for a G-buffer pass of the prologue:The console's blender passes integer targets through, so this PR does the same on the host.
Change
GraphicsState::host_blendturns blending (and logic ops) off for every integer render-target slot.RenderTarget[0]to every slot. In that case the first slot's description is spread to all slots before the integer ones are switched off, so the other targets keep exactly the blend they had.VICTORY_FIX_INTBLEND=0restores the old behaviour, for comparisons.Testing
pipeline::host::blend_tests): shared and independent descriptions, a non-blending integer slot, and float-only targets. All pass.cargo clippy -p victory-gpu --all-targetsadds no new warnings. The existing ones inresource.rs,draw.rsandindirect.rsare unchanged.AI-assisted (Claude Code, Claude Opus 5.5). No game data attached.
🤖 Generated with Claude Code
@avt0m4t48 on GitHub · 2026-11-25 05:32 UTC · original
I independently checked the integer-target blend change at
c2eb4c4c0a3a5724ae9edd5cde0ded7d13de7f76against its parent and the listed base310c6eb6c16822ab95076aad61fce19bba86bb98.host_blendbody and the Windows bindings' descriptor fields and format constants. It varied 21 signed and unsigned integer formats across all eight slots with shared and independent blending. Base kept blending enabled in all 336 affected cases. The PR passed all 336, clearing the integer slot's blend flag and preserving the other active slots' effective blend factors, operations, and write masks.VICTORY_FIX_INTBLEND=0.cargo check --locked --offline -p victory-gpu --tests --features diagnostics,blake3/pure --target x86_64-pc-windows-msvcpassed at both revisions. WARP, physical GPU execution, and game data were outside these checks.One cache interaction showed up in source review. The pipeline name still hashes the raw blend description, so an affected descriptor can use the same library name before and after normalization, including across the opt-out toggle. If a previous run successfully stored that name with different blend state, D3D12's descriptor matching and no-overwrite rule suggest a persistent miss and recreate for the affected entry. That is a source-level finding. I did not measure it with a Windows pipeline library.
@KyleS98 on GitHub · 2026-11-25 05:37 UTC · original
Thanks @avt0m4t48, that's right: the library name was still built from the title's blend description. Fixed in
9478005("GPU: name pipelines by the host blend description").GraphicsState::describe, which feeds both the library name and the early-start key, now formatshost_blend()instead of the rawblend.VICTORY_FIX_INTBLENDtoggle changes the result) get different names, so a stored entry can't be matched against a mismatched description.the_name_follows_the_host_blendcovers both directions. The 5 blend tests pass.As in your note, I haven't measured the library behaviour on Windows. Entries stored under the old names simply stop being looked up.
AI-assisted (Claude Code, Claude Opus 5.5).
@avt0m4t48 on GitHub · 2026-11-25 05:47 UTC · original
I rechecked the pipeline-name follow-up at
9478005c00a8598daccf254441107788dc17e624against the previous head,c2eb4c4c0a3a5724ae9edd5cde0ded7d13de7f76.VICTORY_FIX_INTBLENDon and off. The new head separates all 336 pairs in both the graphics and mesh library names. The early-start hash, computed from the same state text and fixed synthetic shader IDs, showed the same result.cargo check --locked --offline -p victory-gpu --tests --features diagnostics,blake3/pure --target x86_64-pc-windows-msvcwith the existingdepth_writtenwarning. Live D3D12 pipeline-library load/store and GPU execution remain unverified.AI-assisted using Codex.
@KyleS98 on GitHub · 2026-11-25 05:52 UTC · original
Thanks for the re-check @avt0m4t48. Good to have the 336 pairs separated in both the graphics and mesh library names, and the early-start key too.
For the part that's still unverified (live pipeline-library store/load and GPU execution), I'll run the prologue on an RTX 3090 Ti with
VICTORY_D3D12_DEBUG=1and a warm library. I'll post whether message 676 still appears, and whether the affected pipelines load from the library on the second run instead of being made again ("the library did not load it").AI-assisted (Claude Code, Claude Opus 5.5).
@KyleS98 on GitHub · 2026-11-25 08:47 UTC · original
Note: I reworded this branch's commit messages (metadata line only, no code change), so the hashes changed:
c2eb4c4is nowe386512and9478005is now1bc4884. The diff against310c6ebis the same as before.@xunbreakablex on GitHub · 2026-11-25 15:20 UTC · original
Data point from an NVIDIA card (AI-assisted, Claude; run on my machine): RTX 4070 (undervolted, 100 W limit), Ryzen 5 5600 at 3.95 GHz (6 cores), Windows 11, driver 621.01, Series X profile.
I ported only the integer-render-target blend part of this PR onto
a253706by hand (pipeline/host.rs, +122/-5, with your tests; not pushed) and ran it once into the world (480 s).host mesh pipeline refused (0x80070057) shaders=[mesh f5e50eb2108c425b, pixel ce3f0432a08f1d35], first bound between world +76 and +218 frames, about one dropped draw per frame.host pipeline shaders=[mesh f5e50eb2…, pixel ce3f0432…]is created and bound. Translation cache stayed warm (the change is host-side), no device loss.So on a 32-lane NVIDIA card the refused pair is exactly this case and the fix makes it build.
@KyleS98 on GitHub · 2026-11-26 06:42 UTC · original
@xunbreakablex thanks, that is a useful confirmation: the same kind of refusal (
mesh f5e50eb2108c425b,pixel ce3f0432a08f1d35) on a second 32-lane card, and the pipeline builds once blending is left off for the integer target, with no device loss. Agreed that one run says nothing about frame time; what it buys is one fewer dropped draw a frame on your card.AI-assisted (Claude Code, Claude Fable 5.2).
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.Merge
Merge the changes and update on Forgejo.