GPU: expand packed rectangle colors from the selected corner #3646
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3646"
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 andrewpozdnakov7-jpg on 2026-11-28T01:50:58Z.
The CPU rectangle fallback leaves
R10G10B10A2_UNORMat the copied corner’s value. Reconstruct the fourth color from the two adjacent vertices and the right-angle vertex already selected from the position. Clamp RGB to 10 bits and alpha to 2 bits.This replaces the closed #2243. Its review identified that the packed calculation assumed the second vertex was the right angle. The new regression supplies a
float2position and packed color in the same vertex and exercises all six orders. The fourth position and all four color channels match the expected values for every order.The same regression fails on
63bcca43. All ten primitive tests passed with the fix when compiling the exact module and its unchanged right-angle helper withrustc --test. The local test exercises CPU expansion. DXGI input-assembler format support.AI-assisted with OpenAI Codex.
Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T01:51:19Z.
Verified
187d1c29a5789d923f028312fb37904927dccf56against63bcca43c6a00a758510398fa43096ce7e4f7df0. The new rectangle test fails on main and passes for all six orders with the fix. The fourth vertex has position(2, 1)and packed color(1023, 270, 0, 3), including saturation in the red, blue, and alpha channels.All ten primitive tests passed using the exact source and unchanged right-angle helper. Git merged this head cleanly with #2729 at
857f394ebe5a7f8d1b4100979cd801eb4ac4deb8. The same ten tests passed from the merged primitive source. Asset policy passed for 191 files. These runs used generated CPU vertex data.Please preserve the Git author if cherry-picking or rebasing, or include this trailer if folding the change into another commit.
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-28T02:45:57Z.
Review: APPROVED
LGTM — verified on Windows:
cargo test -p victory-gpu --lib primitive::passed (10/10, includingpacked_unorm_uses_the_position_corner_in_each_vertex_order)cargo clippy -p victory-gpu --all-targets -- -D warningspassed with 0 warningscargo xtask policypassed (191 files ok)Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T03:18:02Z.
I checked #3653 with the current
187d1c29head. Combined commit89e04d8preserves both PR heads.All ten existing rectangle tests, including the packed-color test for every vertex order, passed on both revisions. I also expanded 4,096 generated rectangles with float positions and packed R10G10B10A2, UNORM8, SNORM8 and UNORM16 in one vertex. The full output buffers matched byte for byte. A second fixture compared 51,511,296 reconstructed normalized codes. These checks ran the exact rectangle expansion source on CPU and the asset policy passed.
Please retain the Git authors on cherry-pick or rebase, or add
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>if folding the normalized arithmetic into another commit.AI-assisted with OpenAI Codex.
Imported from Marvisak/VIctory. Originally posted by futurepro62 on 2026-11-29T21:53:46Z.
Full-suite run on NVIDIA, since this PR has no test report yet. Tested exact head
187d1c2(on its base63bcca4).Tested
dxil.dllfrom Windows SDK 10.0.26100 (the loader's default), debug.cargo build --workspace --locked, thencargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware: 867 passed, 0 failed, 10 ignored.packed_unorm_uses_the_position_corner_in_each_vertex_order.--skipleaves out tests that fail on main63bcca4on this card too, not because of this PR:heap_direct_texture_reads_mark_their_heap_indexends thevictory-shadertest process with0xc0000005(#2571), so without the skip the rest of that crate never reports;dynamic_slots_are_held_until_released,lists_share_a_table_and_copies_keep_their_viewsand the twostride_testshit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317);gathers_at_a_level_match_the_hardwarefails on lane 0 (#1744).Not tested
AI use
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.