Repository navigation
Conversation
|
Reviewed and tested 1. Branch hygiene & policy failures
2. D3D12
|
bb69da3 to
8aa35fb
Compare
8aa35fb to
f00d527
Compare
|
Re-verified
However, the
Minor nits: |
One graphics pipeline of the intro is refused on the card, and with the debug
layer on the refusal says why:
ID3D12Device::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.
ID3D12Device::CreateGraphicsPipelineState: Pixel Shader output 'SV_Target2'
has type that is NOT float, while the corresponding Output Merger
RenderTarget slot [2] has blending enabled.
and the pipeline - a mesh/pixel pair, `[mesh f5e50eb2108c425b, pixel
ce3f0432a08f1d35]` - comes back `E_INVALIDARG` ("参数错误") with every one of its
draws lost. The frame line's `dropped` counter is not where that shows: its
largest term is dispatches of the ray-tracing structure builder, dropped on
purpose (`VICTORY_BVH_BUILDER=1` gates the builder), 200 to 1,400 a frame. The
evidence here is the pipeline.
The state is the console's, where the renderer allows a blend on an integer
target; D3D12 does not. `GraphicsState::settle_integer_targets` turns the blend
off for those slots alone, before the state is described (so the library name
still says what is made) and before any pipeline is built. Where the title's
blend was a write - `ONE`/`ZERO`, its usual static state - the picture is the
same; where it was not, the slot is overwritten rather than blended. Only
`BlendEnable` changes: the blend factors are left as the title wrote them.
`IndependentBlendEnable` decides what "that slot" means. With it off - D3D12's
default - `RenderTarget[0]` applies to every bound slot and `RenderTarget[1..]`
is never read, so a slot cannot be settled by itself: slot 1 may say it does not
blend while slot 0's state blends it. Then slot 0's state is copied to every
slot and the slots are made independent, which leaves the float slots blending
exactly as the title asked while the integer slot is turned off on its own. When
every bound slot is integer, nothing has to become independent: slot 0's blend
goes off and the shared state goes with it.
Measured on an RTX 4080 SUPER. Three state tests pin the slots: the integer one
loses its blend, the float ones keep theirs, a slot past `NumRenderTargets` is
untouched, the factors survive, settling twice changes nothing; the shared case
takes the slots apart with slot 0's state on each, whichever slot is the integer
one; and a state that blends nothing is left exactly as it was. The device
agrees: built through the same code where the device tests live, a shared state
over an `R8_UINT` slot is refused by the device and made once the slots are
apart. A card run with the same keys 300 s either side went from 20 `host mesh
pipeline refused` lines to none, gaining one line naming `slots=[(2, 62)]` -
format 62 is `R8_UINT`.
`cargo test -p victory-gpu --lib --profile diag --features diagnostics`: 198
passed, 2 failed, 1 ignored - the two failures are the known Marvisak#1744 view-heap pair
on an NVIDIA host (FIND-9: this device caps shader-visible view heaps at
1,000,000, `HEAP_VIEWS` is 2^21), and they fail here without this change too.
`cargo clippy -p victory-gpu --all-features -- -D warnings` is clean.
f00d527 to
69d483f
Compare
|
@fuzeofficlal - you were right about both halves, and it is fixed in
On the device, not only in the state. I built your missed disable case through the same code on an RTX 4080 SUPER (a pixel shader writing
That device test lives where the device harness is; this PR's tree has no @kotekompotek - the +68k diff was the branch, not the change. It was cut from a tree that had a fork merge in it. State of the three tests now:
|
AwsAli05
left a comment
There was a problem hiding this comment.
Current main has the integer-target blend fix from #1152, including preserving the float target's blend state when independent blending has to be enabled. On 842b0cb the merge preview for this branch conflicts in pipeline/host.rs.
I compared the format lists. The remaining behavior this branch adds is treating R9G9B9E5_SHAREDEXP as non-blendable. Can the branch use main's existing helper and isolate that format, with a test for the actual graphics pipeline? The current replacement also omits main's R32G32B32_UINT and R32G32B32_SINT cases.
AI-assisted static review.
|
Automated triage for the maintainers. This PR no longer merges cleanly into current Generated by Claude Code |
|
The picture with the blend turned off: same screen, same pixels. Measured. You asked what happens to what those draws put in that
Frame 2048 is not a visual difference from the change: the two runs are on different screens there - one shows the Korean legal notices page ( So: on every screen both runs reached together, the frames are pixel-identical. Whatever that slot's blend was contributing, turning it off did not change the picture on the screens we could capture. What this does and does not say
Reproduce: |
|
Closing: main now does this itself, in What this thread did contribute, for the record:
The one thing |
|
One correction to what I wrote above: |
What this is
On the card, one graphics pipeline of the intro is refused and every one of its draws is lost. With the debug layer on (
VICTORY_D3D12_DEBUG=1), the refusal names itself:CreateGraphicsPipelineStateanswersE_INVALIDARG("参数错误"), so the pipeline - a mesh/pixel pair,[mesh f5e50eb2108c425b, pixel ce3f0432a08f1d35]- is refused whole.The state is the console's, where the renderer allows a blend on an integer target. D3D12 does not, and NVIDIA enforces it.
What the change does
GraphicsState::settle_integer_targetsturnsBlendEnableoff for render target slots whose format is an integer one, and only for those. It runs once, after the stream is read and before the state is described - so a pipeline's name in the library still says what is actually made - and before the graphics, mesh or depth-bounds pipeline is built.ONE/ZERO, its usual static state) the picture is the same.Evidence
The refused state, refused then made - on the card. Built through the same code on a tree that has the device tests: the device refuses an
R8_UINTtarget with blending enabled, and makes the same pipeline once that slot's blend is off. This PR carries the half of that which needs no device harness:The state test,
a_blend_on_an_integer_target_is_turned_off_for_that_slot_onlypins the slots: the integer target loses its blend, the two float targets keep theirs, a slot pastNumRenderTargetsis untouched, the factors survive, settling twice changes nothing, and a state the title wrote with the blend already off settles to the same description (so it shares the pipeline name, as it should - the pipelines are identical).On the title, same keys, same 300 s, old binary against new:
blend0(before)blend1(after)host mesh pipeline refusedlinesblending is off for those slots slots=[(2, 62)](62 isR8_UINT)One correction worth stating
The frame line's
dropped … without a host pipelinecounter is not the measure of this fix. Its largest term is dispatches of the ray-tracing structure builder, which are dropped on purpose (VICTORY_BVH_BUILDER=1gates the builder, andpipeline.rsdocuments why: a 32-lane host cannot build them whole, and #2311 measured a card hung in exactly that dispatch): 200 to 1,400 a frame, in both runs. So the counter barely moves; what moves is the refused pipeline, listed above.Checks
cargo test -p victory-gpu --lib --profile diag --features diagnosticsdynamic_slots_are_held_until_released,lists_share_a_table_and_copies_keep_their_views- the known#1744view-heap pair on an NVIDIA host (FIND-9: this card caps shader-visible view heaps at 1,000,000 andHEAP_VIEWSis 2^21); they fail without this change toocargo clippy -p victory-gpu --all-features -- -D warningsRTX 4080 SUPER, Rust 1.98.1, Windows 11.
What is not done
Where a blend was not a plain write, this changes what those draws put in that
R8_UINTtarget: it becomes an overwrite. If that turns out to matter, the emulation belongs in the shader (fetch, blend, store) rather than in the state, andsettle_integer_targetsis the place to hang it.