Skip to content

GPU: no blending on integer render targets in host pipelines (port of upstream #806) - #51

Open
FrancescoGelosoEterea wants to merge 1 commit into
fxceless:mainfrom
FrancescoGelosoEterea:int-blend
Open

FrancescoGelosoEterea wants to merge 1 commit into
fxceless:mainfrom
FrancescoGelosoEterea:int-blend

Conversation

@FrancescoGelosoEterea

Copy link
Copy Markdown

Why

The title leaves blending enabled on an integer render target (R8_UINT) in one world mesh pipeline. The console ignores blending there; D3D12 does not allow it, so CreatePipelineState returns E_INVALIDARG and every draw of that pipeline is dropped:

host mesh pipeline refused error=0x80070057 shaders=[mesh f5e50eb2108c425b, pixel ce3f0432a08f1d35]

This is the refused mesh pipeline reported in #26 (RTX 4060 Ti). It is refused on native Windows/NVIDIA as well, not only on vkd3d-proton.

What

This is pablogonz12's fix from Marvisak/VIctory#806 (commit 169efcb, authorship kept), ported onto this fork. host_blend in pipeline/host.rs builds the blend description the host pipeline gets, on both the graphics and the mesh path. It turns blending off on every render target in use whose format is *_UINT or *_SINT. When IndependentBlendEnable is off, each target first gets a copy of target 0's state, so the other targets keep blending as before. A blend state without integer blending is passed through unchanged.

The only conflict was in pipeline/host.rs, around this fork's rectangle-list geometry shader and its mesh-library test. Both are kept.

Tested

RTX 5070 Ti, driver 621.24, Windows 11. Own 1.0.2.1 copy, Series X profile, diagnostics build on top of 90228a7 (rebased onto 4e17478 afterwards; that commit changes only comments, and the tests pass there).

Credit: the diagnosis and the fix are pablogonz12's (Marvisak/VIctory#806); I ported and tested them.

@adriaespii

Copy link
Copy Markdown

Independent test run on commit eb5061c (AMD RDNA4):

  • Hardware: AMD Radeon RX 9070 (driver 32.0.32015.7029), AMD Ryzen 5 7600, Windows 11 Pro, Rust 1.98.1 (x86_64-pc-windows-msvc)
  • cargo clippy --workspace --all-targets -- -D warnings: 0 warnings
  • cargo test --workspace: 498 passed, 0 failed, 7 ignored (victory-gpu: 112 passed, 0 failed, 1 ignored; victory-shader: 210 passed, 0 failed, 2 ignored)
  • Not tested: live game run (no game files on this machine)

AI use: Antigravity (Gemini 4 Neon) ran clippy/tests locally and wrote this report.

@rocobalt1

Copy link
Copy Markdown

Confirmed on the card in #26: the mesh pipeline this PR is about is created here, and its draws are no longer dropped.

Setup: RTX 4060 Ti 8 GB, driver 32.0.16.1656, Windows 11, Ryzen 9 5900X; 4e17478 + #32 + #86 + #77 + #81 + #9 + #40 + #83 + #38 + this PR (e05ea2a), diag build, --console series-x, VICTORY_DISPLAY_MODE=1920x1080, VICTORY_SHADER_LOOP_LIMIT=256, VICTORY_NO_WATCHDOG=1, fresh data dir. TdrDelay=60.

before with this PR
host pipeline refused ... shaders=[mesh ...] lines 1 0
shader refusals (does not translate) 4 4
copies, median 94.6 ms 67 ms
frame, median 1 036 ms 807 ms
device removal no no

The refused pair was shaders=[mesh f5e50eb2108c425b, pixel ce3f0432a08f1d35], i.e. the same one the description names, so the R8_UINT blend diagnosis holds on the 8 GB part too.

No game data; counts only.

@icecreammule277-dot

Copy link
Copy Markdown

Tested on an RX 9070 XT (Adrenalin 32.0.32029.2010), native Windows D3D12.

This port fixes a world mesh pipeline that CreatePipelineState refused with E_INVALIDARG: the title leaves blending enabled on an integer render target, and the described [upstream #806] path turns it off there. The refused pipeline's draws were the missing walls — with the port the pipeline builds and the walls render.

host_blend turning off only the integer slots (and, when IndependentBlendEnable is off, first copying RenderTarget[0] to every slot) is exactly right: it is a no-op for every non-integer target, since D3D12 already applied RenderTarget[0] to them.

@sagouindupm

Copy link
Copy Markdown

Confirmed on an 8 GB NVIDIA card in Series S mode: with this PR the refused mesh pipeline builds and the first gameplay room has its walls.

Setup

Before / after (two runs each)

without this PR with this PR
host mesh pipeline refused lines 1 per run ([mesh f5e50eb2108c425b, pixel ce3f0432a08f1d35], E_INVALIDARG) 0
host pipeline refused lines in all 6 5
walls of the first room at the window view missing in both runs (sky on both sides of the window frame) present in both runs (cinderblock wall around the window)
median frame time in the world 409 ms and 439 ms 446 ms and about 370 ms

The wall check is a screenshot of the window at the same moments of each run, plus the mean brightness of a strip at the left and right edges (about 100 on the left without the PR, 7 to 50 with it). The debug layer names the reason on this card too: CreateGraphicsPipelineState: The render target format at slot 2 is format (R8_UINT). This format does not support blending ... the Blend State indicates blending is enabled for this slot (id 676).

One caveat: the walls are not missing in every run without the PR. In four other baseline runs tonight they were there once, so there is a second, intermittent cause (the stale pages discussed in #62). Two runs with the PR and walls both times is consistent with this PR fixing the pipeline's part; it does not show the intermittent one is gone.

Not tested: Series X with this PR; more than two runs; anything past the first room.

No game data. AI-assisted: Claude Code (Claude Fable 5.2) applied the commit, made the runs, read the logs and wrote this comment.

zhaibingye added a commit to zhaibingye/VIctory that referenced this pull request Nov 25, 2026
Port the narrowly scoped graphics and mesh pipeline fix and its two
regression tests from fxceless/victory-fork#51 (eb5061c), adapted to
this fork's pipeline construction. That PR credits pablogonz12 for
Marvisak#806 (169efcb), and FrancescoGelosoEterea for the
secondary port and native NVIDIA verification.

Windows MSVC workspace test compilation passed for this adaptation;
no local native Windows execution.
DesignWithTommy added a commit to DesignWithTommy/i95 that referenced this pull request Nov 25, 2026
The console ignores blending on UINT/SINT targets and titles leave it on,
but D3D12 refuses such a pipeline with E_INVALIDARG and its draws are
lost. Desc and stream pipelines now turn BlendEnable off on integer
targets, splitting a shared description into one per target so the
others keep theirs; logged first 4 then powers of two.
TUXBOX_INTEGER_TARGET_BLEND=1 keeps the title's blend state.

Ported from VIctory-zhai 3716dd5 (from fxceless/victory-fork#51 and
Marvisak/VIctory#806; GPL-3.0), credit to pablogonz12,
FrancescoGelosoEterea and their authors.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Arvi23

Arvi23 commented Nov 25, 2026

Copy link
Copy Markdown

Tested on AMD RDNA4 (RX 9070 XT, Windows 10): the same mesh pipeline is refused there without this PR and created with it.

Setup: RX 9070 XT, driver 32.0.32029.2010, Windows 10 IoT Enterprise LTSC 21H2 (19044) with the Agility SDK runtime (#420), release build, Series X profile, no VICTORY_* switches.

AI use: Claude Code (Claude Opus 5.5) read the logs and wrote this; the runs are on my machine.

@FrancescoGelosoEterea

Copy link
Copy Markdown
Author

The "first room's walls are still missing in some launches" known issue in c96b4f2 looks like the problem this PR fixes. The walls are the draws of the refused mesh pipeline [mesh f5e50eb2108c425b, pixel ce3f0432a08f1d35] (blending left on an R8_UINT target).

It has now been confirmed independently on five cards:

Card Result
RTX 5070 Ti pipeline created, walls render
RTX 4060 Ti 8 GB same, refusal gone (rocobalt1)
RTX 3050 8 GB, Series S mode walls missing in both runs without the PR, present with it (sagouindupm)
RX 9070 tests and clippy pass (adriaespii)
RX 9070 XT the only refused pipeline in the run, created with the PR (Arvi23)

Since c96b4f2 (the depth bounds change) it conflicts in pipeline/host.rs. I'll rebase it onto current main.

The console ignores blending on integer render targets and the title
leaves it on (the world has a mesh pipeline blending into an R8_UINT
target). D3D12 does not allow it: vkd3d-proton refuses such a pipeline
with E_INVALIDARG and its draws are lost. The host pipeline now turns
blending off on integer targets; with one description for all targets,
each target gets its own copy so the others keep theirs.
@iGoldenNinja

iGoldenNinja commented Nov 25, 2026 •

Copy link
Copy Markdown

Independent RTX 5080 title check. Windows 11 Pro 26200, driver 617.14, Ryzen 9 5900X, 32 GB RAM, DRED and Series X profile. I applied PR 51 (d82acef) to diagnostic PR 688 (7e7bb18), keeping the archive reader, replay, relay and inline staging settings from the prior run. Both builds logged zero shader-cache hits during startup.

The earlier executable logged 0x80070057 for mesh f5e50eb2108c425b / pixel ce3f0432a08f1d35. The patched executable logged successful host acceptance of that exact pair and no refusal for it. The matched post-retreat interior capture still showed large wall and ceiling gaps. This verifies the pipeline acceptance on this GPU, with the remaining room geometry issue still open.

The five-minute controlled prison route averaged 4.565 presented FPS, 435.139 ms P99, and 711.421 ms worst. The previous staging-on run measured 4.579 FPS and 393.971 ms P99. The title responded to camera and movement input and ended deliberately, without a DRED device-removal report. Method and comparison. AI-assisted with OpenAI Codex.

coderanonymus pushed a commit to coderanonymus/victory-fork that referenced this pull request Nov 25, 2026
A refused XMemVirtualAlloc or XMemAllocDefault handed the title a null in
silence, and the title then writes at null plus an offset, which reads
like a title bug. In fxceless#289 the faulting write is at 0x217800, the
request's length 0x2173a0 rounded up to 2 KiB, so the base it built on
was most likely such a null.

At the commit limit, XMemVirtualAlloc now writes the same crashes.log
report the physical-page commit writes since fxceless#51 (the shared part is
`commit_refused`); other refusals, and a host heap out of memory, are
warnings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 65062e1)
e4glevlr pushed a commit to e4glevlr/victory-fork that referenced this pull request Nov 25, 2026
A refused XMemVirtualAlloc or XMemAllocDefault handed the title a null in
silence, and the title then writes at null plus an offset, which reads
like a title bug. In fxceless#289 the faulting write is at 0x217800, the
request's length 0x2173a0 rounded up to 2 KiB, so the base it built on
was most likely such a null.

At the commit limit, XMemVirtualAlloc now writes the same crashes.log
report the physical-page commit writes since fxceless#51 (the shared part is
`commit_refused`); other refusals, and a host heap out of memory, are
warnings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 65062e1)
(cherry picked from commit 52bb2e9)
Belobug pushed a commit to Belobug/VIctory-Belobug-AMD that referenced this pull request Nov 25, 2026
The console ignores blending on integer render targets and the title
leaves it on (the world has a mesh pipeline blending into an R8_UINT
target). D3D12 does not allow it: such a pipeline is refused with
E_INVALIDARG and its draws are lost. The host pipeline now turns
blending off on integer targets; with one description for all targets,
each target gets its own copy so the others keep theirs.

Ported by hand from fxceless/victory-fork#51 (d82acef) to this tree's
host.rs (one graphics and one mesh call site). On an RX 9070 XT this
tree refused [mesh f5e50eb2108c425b, pixel ce3f0432a08f1d35], the
first room's walls.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jailsonMMB added a commit to jailsonMMB/victory-fork- that referenced this pull request Nov 25, 2026
The console ignores blending on integer render targets, and the title
leaves it on: the world has a mesh pipeline that blends into an `R8_UINT`
target. D3D12 does not allow that, so the host refuses the pipeline with
`E_INVALIDARG` and every draw of it is lost — the first gameplay room's
walls among them (the sky seen through them).

`host_blend` takes the title's blend state as the host takes it: blending
off on integer targets only. The console blending there is ignored, so
the result is what the console drew. With one description for all
targets, each target gets its own copy, so the others keep theirs. The
state is left byte for byte as the title wrote it when no integer target
blends, so no other pipeline's description changes.

Used at both places a blend state goes into a host pipeline: the
descriptor path and the stream path.

Ported from Belobug/VIctory-Belobug-AMD#45, which is itself a port of
`fxceless/victory-fork`fxceless#51 (pgm1207's commit): the same pipeline was seen
failing on five cards, NVIDIA and AMD. Two tests taken with it.

Verified without a compiler: `git diff --check` and a tree-sitter parse.
Every `DXGI_FORMAT_*` name it asks about is already named in this tree,
from the same `windows` 0.62 crate, so the constants resolve.
IsNevis pushed a commit to IsNevis/VIctory-Belobug-AMD that referenced this pull request Nov 25, 2026
The console ignores blending on integer render targets and the title
leaves it on (the world has a mesh pipeline blending into an R8_UINT
target). D3D12 does not allow it: such a pipeline is refused with
E_INVALIDARG and its draws are lost. The host pipeline now turns
blending off on integer targets; with one description for all targets,
each target gets its own copy so the others keep theirs.

Ported by hand from fxceless/victory-fork#51 (d82acef) to this tree's
host.rs (one graphics and one mesh call site). On an RX 9070 XT this
tree refused [mesh f5e50eb2108c425b, pixel ce3f0432a08f1d35], the
first room's walls.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
wolfattack199 pushed a commit to wolfattack199/victory-fork that referenced this pull request Nov 25, 2026
A refused XMemVirtualAlloc or XMemAllocDefault handed the title a null in
silence, and the title then writes at null plus an offset, which reads
like a title bug. In fxceless#289 the faulting write is at 0x217800, the
request's length 0x2173a0 rounded up to 2 KiB, so the base it built on
was most likely such a null.

At the commit limit, XMemVirtualAlloc now writes the same crashes.log
report the physical-page commit writes since fxceless#51 (the shared part is
`commit_refused`); other refusals, and a host heap out of memory, are
warnings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 65062e1)
arnoudstorm added a commit to arnoudstorm/VIctory that referenced this pull request Nov 25, 2026
… mesh pipeline)

The console ignores blending on integer render targets and the title
leaves it on (a mesh pipeline blending into an R8_UINT target); D3D12
refuses such a pipeline with E_INVALIDARG and its draws are lost. On the
780M every run logged "host mesh pipeline refused" for [mesh
f5e50eb2108c425b, pixel ce3f0432a08f1d35], the first room's walls (10 of
10 stability runs). With this change: 0 refusals (run ambient-blend).

From fxceless/victory-fork#51 (d82acef), as ported by pgm1207 in
Belobug/VIctory-Belobug-AMD 8629211 (GPL-3.0-or-later); applied to both
mesh stream paths of this tree, tests included.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dwojtun287-lang pushed a commit to dwojtun287-lang/VIctory that referenced this pull request Nov 25, 2026
The console ignores blending on integer render targets and the title
leaves it on (the world has a mesh pipeline blending into an R8_UINT
target). D3D12 does not allow it: such a pipeline is refused with
E_INVALIDARG and its draws are lost. The host pipeline now turns
blending off on integer targets; with one description for all targets,
each target gets its own copy so the others keep theirs.

Ported by hand from fxceless/victory-fork#51 (d82acef) to this tree's
host.rs (one graphics and one mesh call site). On an RX 9070 XT this
tree refused [mesh f5e50eb2108c425b, pixel ce3f0432a08f1d35], the
first room's walls.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Andry018

Copy link
Copy Markdown

Confirmed on RDNA2: AMD Radeon RX 6600 (8 GB) with a Ryzen 7 9700X, Windows 11, release build, Series X profile, no VICTORY_* switches.

d82acef cherry-picks cleanly onto current main (0b0074e). On main alone, the world mesh pipeline this PR is about was refused with E_INVALIDARG in every run today (12 of 12). With the PR, it is created in both runs (2 of 2) and nothing else is refused. Frame time is unchanged, about 280-290 ms/frame in the prologue cell, and there was no device loss.

One thing this does not change on this card: the player's face in the world (black skin, eyes and earrings drawn) stays black with the PR, so that is a separate problem (see #264).

ljm-233 pushed a commit to ljm-233/VIctory that referenced this pull request Nov 25, 2026
…reads through quad reads

Two fixes ported from Belobug/VIctory-Belobug-AMD (GPL-3.0-or-later):

1. `host_blend` in the host pipeline path (`8629211`, pull request Marvisak#45 by
   pgm1207, itself from fxceless/victory-fork#51): the console ignores
   blending on integer render targets and the title leaves it on (the world
   sets it on an R8_UINT target), but D3D12 refuses such a pipeline with
   E_INVALIDARG and its draws are lost. Blending is now off on those targets
   only, each target with its own copy of the description.

   Measured here: the mesh pipeline the log had refused at every launch
   (`mesh f5e50eb2108c425b, pixel ce3f0432a08f1d35`, the first room's walls)
   is made now: `host mesh pipeline refused: 0` over a launch.

2. `helpers_read` in the pixel shader lowering (`03629f3`): a read of another
   lane of this lane's quad goes through quad reads in pixel shaders, helper
   lanes included. At a triangle's edge the quad's other pixels are helpers,
   and a wave read gives 0 from them, so a derivative taken by hand came out
   as the whole value, the texture read that used it took its smallest level,
   and edges showed as lines on car paint, glass and skin.
ai2n-dev pushed a commit to ai2n-dev/VIctory-NVIDIA that referenced this pull request Nov 25, 2026
The console ignores blending on integer render targets and the title
leaves it on (the world has a mesh pipeline blending into an R8_UINT
target). D3D12 does not allow it: such a pipeline is refused with
E_INVALIDARG and its draws are lost. The host pipeline now turns
blending off on integer targets; with one description for all targets,
each target gets its own copy so the others keep theirs.

Ported by hand from fxceless/victory-fork#51 (d82acef) to this tree's
host.rs (one graphics and one mesh call site). On an RX 9070 XT this
tree refused [mesh f5e50eb2108c425b, pixel ce3f0432a08f1d35], the
first room's walls.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 8629211)
akus-elinius pushed a commit to akus-elinius/victory-fork that referenced this pull request Nov 25, 2026
PR: fxceless#715
Head: 1bc4884

Chosen over fxceless#501 and fxceless#51 (the same fix): it also keys the pipeline's name in the library on the host's blend. Note: it also turns LogicOpEnable off on integer slots.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
rcioletti added a commit to rcioletti/victory-gta6 that referenced this pull request Nov 25, 2026
…MD GPUVM fix, mwaitx WaitOnAddress, bounded texture queue, int-target blend)
PiloteCode pushed a commit to PiloteCode/victory-fork that referenced this pull request Nov 25, 2026
A refused XMemVirtualAlloc or XMemAllocDefault handed the title a null in
silence, and the title then writes at null plus an offset, which reads
like a title bug. In fxceless#289 the faulting write is at 0x217800, the
request's length 0x2173a0 rounded up to 2 KiB, so the base it built on
was most likely such a null.

At the commit limit, XMemVirtualAlloc now writes the same crashes.log
report the physical-page commit writes since fxceless#51 (the shared part is
`commit_refused`); other refusals, and a host heap out of memory, are
warnings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 65062e1)
us3r40456 added a commit to us3r40456/VIctory-macOS that referenced this pull request Nov 25, 2026
Adapt the behavior demonstrated by pgm1207 and Arvi23 in Belobug/VIctory-Belobug-AMD@86292110 and fxceless/victory-fork#51. Reuse the existing format classifier and key both host pipeline paths on their effective blend state.
tuffn3ss pushed a commit to tuffn3ss/victory-plus that referenced this pull request Nov 26, 2026
A refused XMemVirtualAlloc or XMemAllocDefault handed the title a null in
silence, and the title then writes at null plus an offset, which reads
like a title bug. In fxceless#289 the faulting write is at 0x217800, the
request's length 0x2173a0 rounded up to 2 KiB, so the base it built on
was most likely such a null.

At the commit limit, XMemVirtualAlloc now writes the same crashes.log
report the physical-page commit writes since fxceless#51 (the shared part is
`commit_refused`); other refusals, and a host heap out of memory, are
warnings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 65062e1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants