fix: align appended vertex inputs for rectangle expansion #324
No reviewers
Labels
No labels
accessibility
bloqué : binaire console
bug
chargeur
console-dll
cpu
documentation
duplicate
enhancement
good first issue
gpu
help wanted
invalid
performance
question
runtime-gdk
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LooperSalty--AnyXboxX!324
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-324"
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?
@mauroalvare on GitHub · 2026-11-26 03:05 UTC · original
mauroalvare:codex/victory-rectangle-input-alignment→main· +210 −4 · 3 files · 1 commits · openChange
Neptune's CPU fallback for rectangle draws uses
GraphicsState::elementsto locate the attributes for the synthesized fourth vertex. WithR8G8_UINTfollowed by an appendedR32G32_FLOAT, the fallback read the float pair at byte 2. D3D12's native input layout fetches that pair at byte 4, so the vertex shader saw the wrong attributes.Use the input assembler's 1-, 2-, or 4-byte alignment for appended elements, with a cursor per slot and saturating offset arithmetic. This affects the CPU rectangle path in the D3D12 backend built by
tools/lancer_victory.ps1. D3D12 input element documentation · Direct3D element alignmentThe implementation adapts JFIREonFIRE's VIctory change and adds a GPU readback regression. The source and licence are recorded in
THIRD_PARTY.mdand the commit trailers. VIctory source commitVerification
Base
c4c93bdc413191a9dc909998d2d53080a3f0c880and fix7727e3f3ee7b5e3812c82e6d9a3299a730548e9c. On the base revision, apply justrectangle_input_tests.rsand its#[cfg(test)]module declaration from this PR. Run fromthird_party/victory. LeaveVICTORY_D3D12_WARPunset for NVIDIA or set it to1for WARP.(0.5, 0.75), failed(0.75, 1.0), passed(0.5, 0.75), failed(0.75, 1.0), passedThe exact dwords were
[3f000000, 3f400000, 00000011]on the base and[3f400000, 3f800000, 00000011]on the fix. Both targeted runs on the fix reported1 passed; 0 failed; 0 ignoredand executed readback.cargo test --locked --offline -p victory-gpu --lib --features diagnostics pipeline::host::rectangle_input_tests::appended_offsets_follow_their_own_input_slots -- --exact --test-threads=1failed on the base with[0, 6, 1, 3, 8, 4]instead of[0, 6, 2, 4, 8, 8]. It passed with the fix and also covers theu32limit on the CPU.cargo test --locked --offline -p victory-gpu --lib --features diagnostics -- --test-threads=1reported 198 passed, 3 failed, 3 ignored. The matching main baseline had 196 passed, 3 failed, 3 ignored. The same assertions failed inspans_say_the_next_start_and_the_lowest_level_viewed,warp_card_fetch_copies_flagged_pieces_to_their_slots, andwarp_card_patch_writes_the_masked_bytes_and_no_others.cargo test --locked --offline -p victory-loader --test load_probereported 2 passed.cargo build --locked --offline --release -p victorypassed.cargo xtask policyreportedasset policy: 200 files ok.cargo test --release --locked --offline --manifest-path rust/Cargo.tomlreported 12 passed in total.python -m ruff check --select W605,F,E9 PrototypeScarlett tests toolsreportedAll checks passed!.python -m pytest -rswithANYXBOXX_REQUIRE_RUNTIME=1on Python 3.13.15 reported1665 passed in 100.29s (0:01:40).Oracle and test data
The fixture creates three padded vertices of one tilted rectangle. It passes the production input offsets to
primitive::expand_rects, then draws a point with the synthesized corner using the native append-aligned input layout. The vertex shader writes the fetched coordinates and a control tag to a UAV for readback. The expected corner followsv0 + v2 - v1. The vertex data and shader are generated by the test.Checklist
AI assistance was used for investigation, implementation, and verification with OpenAI Codex.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.