GPU: leave rectangle vertex components past the stride alone #66
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!66
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/66/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?
@AndyLatimer on GitHub · 2026-11-24 00:07 UTC · original
AndyLatimer:fix/gpu-rect-element-past-stride→main· +21 −2 · 1 files · 1 commits · merged 2026-11-24 00:40 UTCexpand_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
@lordon1a on GitHub · 2026-11-24 00:19 UTC · original
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.
@DaviTostes on GitHub · 2026-11-24 00:57 UTC · original
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).