GPU: leave rectangle vertex components past the stride alone #66
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/66"
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?
Imported from Marvisak/VIctory. Originally posted by AndyLatimer on 2026-11-24T00:07:02Z.
expand_rects(crates/victory-gpu/src/primitive.rs) turns each console rectangle into two host triangles and makes the fourth corner asv0 + v2 - v1, element by element. Each vertex is astride-byte slice, but nothing checked that an element's components fit inside it. An input layout may place an element so that it reaches past the stride (into the next vertex's bytes), and the bound stride is only known at draw time. Then&v(i)[at..]or the component index went past the slice and the expansion panicked at submission (in the deferred host work of a rect-list draw).Examples that panicked:
R32G32B32A32_FLOATat offset 4 with an 8-byte stride (component 1 starts at byte 8).R8G8B8A8_UNORMat offset 8 with an 8-byte stride (the element starts at the stride).Now only the components fully inside the vertex are computed. The rest keep the first vertex's bytes, as inputs in formats
componentsdoes not know already do (documented with the existing shortcut note).draw.rsis unchanged.Testing
cargo test --workspace: 225 passed, 3 ignored (need external files). Includes 1 new regression test,elements_past_the_stride_are_left_alone, which panics on the old code.cargo clippy --workspace --all-targets: 0 warnings.cargo xtask policy: pass (148 files).rustfmt --checkon the changed file: clean.🤖 Generated with Claude Code
Imported from Marvisak/VIctory. Originally posted by lordon1a on 2026-11-24T00:19:55Z.
Verified
f3c7f0f2aon Windows 11 (x86_64-pc-windows-gnullvm,rustc 1.100.0, applied cleanly tomain@35b054ec0): pass.cargo xtask policy: 150 files okcargo test -p victory-gpu: 40 passed, 0 failed (including the new rectangle vertex stride test inprimitive.rs+ host D3D12 tests on Intel Iris Xe).AI-assisted.
Imported from Marvisak/VIctory. Originally posted by DaviTostes on 2026-11-24T00:57:38Z.
Tested
f3c7f0funder Wine 11.22 + vkd3d-proton 3.1 on Arch Linux x86_64 (AMD RX 9060 XT, RADV 26.3.1), Windows build withcargo xwin ... --target x86_64-pc-windows-msvc: pass, no regression.victory_gpu: 35 passed, 2 failed — the two environment-only failures on this base (argument_clamp_builds, and #128'sbuffer_data_reaches_the_host_texture).stride < vertex sizewould cover the "leave components alone" path.No game data used. AI-assisted (DeepSeek V4.1 Flash coding agent).