GPU: reconstruct packed UNORM rectangle vertex colors #2243
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!2243
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2243/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?
@andrewpozdnakov7-jpg on GitHub · 2026-11-25 08:36 UTC · original
andrewpozdnakov7-jpg:codex2/packed-rect-vertex→main· +52 −6 · 1 files · 1 commits · closed without mergingRectangle expansion handles several unpacked vertex formats. For R10G10B10A2_UNORM, the generated fourth vertex currently keeps the color of the first vertex. This format is supported by the D3D12 input assembler. Format support.
Reconstruct each packed channel with the same fourth-corner formula used by the existing expansion, then clamp to its bit width. A packed element that crosses the vertex stride retains the first vertex's bytes.
The same synthetic vertex-buffer test failed before the change and passed after it. It checks all four channels and a packed element whose word crosses the stride.
Windows/WARP GPU library suite with the regression went from 145 passed, 2 failed, 2 ignored to 146 passed, 1 failed, 2 ignored. The placed-view texture-format test failed in both builds.
Clippy passed for victory-gpu all targets with warnings denied, with and without diagnostics.
Native D3D12 WARP control with the same synthetic vertex data on
940d32fandc53275b. It fed the expanded fourth vertex through the packed input assembler format, drew one point, and copied the float render target back. The pixel was [0.9384164, 0.21505377, 0.015640274, 0.33333334] before and [1.0, 0.2639296, 0.0, 1.0] after, matching the reconstructed channels.Coordination claim in #1633.
AI-assisted using Codex. Synthetic vertex data only.
@MamaLeVrai on GitHub · 2026-11-25 09:13 UTC · original
Test report on real hardware: AMD RX 6950 XT (RDNA2), Windows 11, Rust 1.98.1, with a GPU present, so the hardware-only shader checks run. I merged this PR's head
c53275b7intomain940d32fin a throwaway tree (no conflict).cargo clippy --workspace --all-targets --locked -- -D warnings: clean; the same with--all-features: clean.cargo test --workspace --locked: 702 passed, 0 failed, 10 ignored, two runs (mainalone on the same machine: 701 passed, 0 failed, 10 ignored). The title was not run, so this says nothing about in-game effect. No game data.AI-assisted (Claude Code); no game data.
@Marvisak on GitHub · 2026-11-25 13:31 UTC · original
Automated triage for the maintainers.
Merge candidate (worth a look).
expand_rectsincrates/victory-gpu/src/primitive.rsnow computes the fourth rectangle corner forR10G10B10A2_UNORMelements per channel (packed_unorm_corner: v0 + v2 - v1 in integer units, clamped to each field's range), where before such an element, unknown tocomponents, kept the first vertex's value; it requires the whole 4-byte word inside the vertex, like the existing per-component bound. I checked the corner formula and clamping against the float path used for the other UNORM kinds (Kind::write) and the test's expected values; CI (check) passes, and a tester reports the workspace tests passing on RDNA2. Minor: the rest of the file matches formats by number, so thewindowsimport could be the literal24for consistency.Generated by Claude Code
@Marvisak on GitHub · 2026-11-25 22:07 UTC · original
Automated triage for the maintainers, second look (a review against current
main, with builds and tests where they could change the verdict).Closing because it is inconsistent with
8ff79135, which it predates. Every other element now computesget(a) + get(b) - get(right)with the right angle found from the position, while the packed path here always takes the right angle at v1, so rectangles with it at v0 or v2 would get the wrong colour. The test has no position element, so it does not see this. The function is also the CPU fallback, which practically never runs now that rectangle lists get a geometry shader.If this is mistaken, reply here with what was missed and it will be looked at again. Thank you for the contribution.
Pull request closed