GPU: no blending on integer render targets in host pipelines (fixes #806) #1152
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!1152
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1152/head"
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?
@pablogonz12 on GitHub · 2026-11-24 16:16 UTC · original
pablogonz12:up/gpu-no-blend→main· +116 −2 · 1 files · 3 commits · merged 2026-11-25 21:50 UTCFixes #806, where the patch was first posted as an issue.
What
host_blendinpipeline/host.rsbuilds the blend description both host pipeline paths get (graphics and mesh): blending off on every render target in use whose format is*_UINT/*_SINT. When the title's description hasIndependentBlendEnableoff, each target first gets a copy of target 0's state, so the other targets keep blending as before. A state without integer blending is passed through unchanged.Why
The title leaves blending enabled on integer render targets. The console ignores it there, but D3D12 does not allow it, so vkd3d-proton refuses the whole pipeline:
That is a world mesh pipeline, so its draws were lost on Linux.
How tested
30b0eb9), diagnostics build, into the world: before, the pipeline above was refused (1 refusal, the error above); after, the same pipeline is created, with no refusal and no integer-blend error in the run.cargo xwin clippy --workspace --all-targets --locked --target x86_64-pc-windows-msvc -- -D warningsand the same with--all-features: clean.integer_targets_do_not_blendandblend_states_without_integer_blending_are_kept(both paths build the description throughhost_blend). They are in a Windows-only module, so CI runs them; I could not run them here.Not tested
Written with an AI assistant.
@shortselow-byte on GitHub · 2026-11-24 17:23 UTC · original
This PR has no CI run yet, so I ran the CI's checks at head
e8fd20f(onmainffe310e) natively on Windows: Windows 11, Rust 1.98.1 MSVC, AMD Radeon RX 6900 XT (RDNA2).cargo test --workspace --locked -- --test-threads=1: 344 passed, 0 failed, includinginteger_targets_do_not_blendandblend_states_without_integer_blending_are_kept.cargo clippy --workspace --all-targets --locked -- -D warnings, and with--all-features: clean.cargo xtask policy: ok.The new tests check the blend description; I did not create a pipeline with an integer target on the AMD device.
@Zipettte on GitHub · 2026-11-24 18:01 UTC · original
Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at
e8fd20f:cargo test -p victory-gpupasses, 52 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).Tested with AI assistance (Claude).
@Marvisak on GitHub · 2026-11-25 01:17 UTC · original · edited 2026-11-25 02:23 UTC
Automated triage for the maintainers.
Recommended for a maintainer's look.
host_blendincrates/victory-gpu/src/pipeline/host.rsturns blending off on*_UINT/*_SINTrender targets in use. WhenIndependentBlendEnableis off, it first copies target 0's state to every target, so the other targets blend as before. A blend state without integer blending is passed through unchanged. D3D12 does not allow blending into integer formats, and the vkd3d-proton log in the description shows a world mesh pipeline being refused for that reason. Both the graphics and mesh pipeline paths now use it, and the format list covers every integer render-target format. The same fix also appears inside the larger bundle #1330; this is the focused version. CI is passing.Generated by Claude Code
@desplmfao on GitHub · 2026-11-25 13:54 UTC · original
In-title result for this PR on Linux.
Setup: Grand Theft Auto VI Series X, the first mission's prison yard. RTX 5080 on Linux, Proton with vkd3d-proton 3.2.0. Our working branch is
mainplus our open GPU fixes, and I merged this PR into it.Without this PR, every run (6 of 6) has one refused mesh pipeline:
Its draws are dropped at 2 to 4 per frame. In the runs where they were dropped, the room's walls around the window went missing (the scene showed straight through to the yard), and they came back later in the same run. The pipeline's pixel shader writes an integer target with blending on, which vkd3d-proton refuses here just as the Windows runtime does.
With this PR,
host mesh pipeline shaders=[mesh f5e50eb2108c425b, pixel ce3f0432a08f1d35]is made at first bind, there are no refusals and no drops from it, and the scene ran at 4,956 draws per frame. The user saw no difference in the rest of the picture.How it was found: the walls went missing intermittently, so the picture alone couldn't settle it. The frame lines' dropped counts for this one refused pipeline matched the runs where the walls went missing (4 per frame there, 0 to 2 in runs where they stayed). The ztrx fork's notes pointed at the integer-target blend refusal.
@lucaseddd on GitHub · 2026-11-25 14:24 UTC · original · edited 2026-11-25 14:28 UTC
Native Windows follow-up for the integer-target blend fix from #806 and Xeltax/VIcky#9. I compared two diagnostics builds of fxceless/victory-fork at
0b0074e0on Windows 10 22H2 with an RTX 3060 Laptop 6 GB (NVIDIA 591.59, Agility SDK 1.620.2). On the base build, the driver rejected mesh f5e50eb2108c425b + pixel ce3f0432a08f1d35 with E_INVALIDARG (0x80070057). The combined build created that exact mesh pipeline.Reproduction for the combined build:
0b0074e0, keep the self-copy check after mapping the source and destination mip indices. Compare the indices of the host subresources, so two aliases of the same host subresource never record a self-copy.Observed in the cutscene: the player reported clearer principal-character models, more of the street and buildings drawn, and more visible lighting. The supplied frames show faces, clothing, the car interior and street lighting, with some surfaces still nearly black and some daytime terrain/background still missing. Parts of the background appeared as the passage continued. The player ended the run during the cutscene, before checking gameplay.
This is visual evidence from a combined build, so it does not isolate the contribution of the blend change versus mip reduction. As a performance check, the medians of the first 18 reported intervals with at least 500 draws were 280 ms for the base and 359 ms for the combined run. The workloads/caches were not matched by scene or frame, and the combined run still had zero-pipeline-queue intervals at around 2?4 FPS late in the cutscene. The exact pipeline's successful creation is the targeted result relevant to #1152.
The source-only integration PR contains the tested diff, the mip-copy conflict resolution and the validation details.
@Calvix2k on GitHub · 2026-11-25 14:35 UTC · original
This is the better of the three (mine is #2346, the other is #2042), for two reasons I ran into while writing mine:
R16G16wrong — 37/39 instead of 36/38 (39 isR32_TYPELESS, perdxgiformat.h), so anR16G16_UINTtarget kept blending on (the refusal this fix exists to prevent) and anR16G16_SNORMlost it. Writing the formats by name, as you do, makes that class of mistake impossible; my follow-up commit fixed the table but the names are the real fix.IndependentBlendEnable. With it clear, D3D12 appliesRenderTarget[0]to every target, so clearing one entry either does nothing (integer target at slot ≥ 1 → still refused) or turns blending off everywhere (integer target at slot 0). Copying target 0 into each slot and setting the flag is the only way to have both, and your test covers bothindependentvalues.Two things worth carrying over from mine before this lands:
describe()must see the same state the pipeline is made from. The library name is computed from the state's text (GraphicsState::describe), andLoadPipelinecompares the stored description with the one passed in: if the name is made from the raw blend and the pipeline from the sanitized one, the entry is stored under a name whose description does not match (the failure mode of #1683, message 972). Applyinghost_blendinsidedescribe()as well fixes it; mine did that, and it is the one part I would keep.R8_UINTslot is a mask the title writes every frame, and the refused pipeline meant it was never written.So: closing #2346 in favour of this one. If the
describe()line goes in and this is what merges, the whole class is covered on one implementation rather than three.0x80070057/ D3D12id=676):BlendOp=MAXenabled onDXGI_FORMAT_R8_UINTRT slot 2 ([mesh f5e50eb2108c425b, pixel ce3f0432a08f1d35]) #2775