GPU: rectangle corners in normalized vertex formats, NaN in half conversion #1311

Closed
github-bot wants to merge 1 commit from gh-pr/1311/head into gh-pr/1311/base
Owner

@⁠SamuelReeder on GitHub · 2026-11-24 17:19 UTC · original
fix/rect-normalized-corners → main · +74 −2 · 1 files · 1 commits · closed without merging

expand_rects computes a rectangle's fourth corner only for the vertex formats components knows; others keep the first vertex's value. This adds the remaining 8- and 16-bit normalized formats:

  • SNORM: R16G16B16A16 (13), R8G8B8A8 (31), R16G16 (37), R8G8 (51), R16 (58), R8 (63)
  • UNORM: R8G8 (49), R16 (56), R8 (61)

The lowest SNORM integer reads as -1, as in D3D. f32_to_half also turned NaN into infinity; it now stays NaN.

The NaN change covers half of #843, reported there with a fix; #1069 (closed) fixed both halves. #1220 covers the rounding half.

Half rounding of exact ties is left to #1220. #1158 and #1204 also touch expand_rects.

Tests (synthetic, CPU only), each failing before and passing after:

  • signed_normalized_corners_complete_the_rectangle
  • small_normalized_formats_get_their_fourth_corner
  • halves_keep_nan

cargo test --workspace --locked --features victory-gpu/diagnostics with VICTORY_WARP=1 VICTORY_D3D12_WARP=1: 348 passed, 0 failed, 6 ignored. Clippy on victory-gpu is clean. Not tested with a title or on a hardware adapter.

🤖 Generated with Claude Code

**@⁠SamuelReeder** on GitHub · 2026-11-24 17:19 UTC · [original](https://github.com/Marvisak/VIctory/pull/1311) `fix/rect-normalized-corners` → `main` · +74 −2 · 1 files · 1 commits · closed without merging `expand_rects` computes a rectangle's fourth corner only for the vertex formats `components` knows; others keep the first vertex's value. This adds the remaining 8- and 16-bit normalized formats: - SNORM: R16G16B16A16 (13), R8G8B8A8 (31), R16G16 (37), R8G8 (51), R16 (58), R8 (63) - UNORM: R8G8 (49), R16 (56), R8 (61) The lowest SNORM integer reads as -1, as in D3D. `f32_to_half` also turned NaN into infinity; it now stays NaN. The NaN change covers half of #843, reported there with a fix; #1069 (closed) fixed both halves. #1220 covers the rounding half. Half rounding of exact ties is left to #1220. #1158 and #1204 also touch `expand_rects`. Tests (synthetic, CPU only), each failing before and passing after: - `signed_normalized_corners_complete_the_rectangle` - `small_normalized_formats_get_their_fourth_corner` - `halves_keep_nan` `cargo test --workspace --locked --features victory-gpu/diagnostics` with `VICTORY_WARP=1 VICTORY_D3D12_WARP=1`: 348 passed, 0 failed, 6 ignored. Clippy on `victory-gpu` is clean. Not tested with a title or on a hardware adapter. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The fourth corner of a rectangle kept the first vertex's value for 8- and
16-bit SNORM inputs and the one- and two-component UNORM formats. A NaN
converted to a half became infinity.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:27:11 +00:00
github-bot closed this pull request 2026-11-26 04:27:11 +00:00
Author
Owner

@⁠muhammed-aksoy on GitHub · 2026-11-24 17:54 UTC · original

Windows integration results for 075c4ba on ffe310e. The GPU diagnostics suite passed 56 tests with one ignored. In a separate local merge with the branch from #843, both touch primitive.rs. Keeping this PR's normalized rectangle changes and #843's payload-preserving, ties-to-even half conversion passed 56 GPU diagnostics tests with one ignored on WARP, including both regression cases. The tested merge is 8c799dc. These were synthetic fixtures. AI-assisted.

**@⁠muhammed-aksoy** on GitHub · 2026-11-24 17:54 UTC · [original](https://github.com/Marvisak/VIctory/pull/1311#issuecomment-7139872792) Windows integration results for `075c4ba` on `ffe310e`. The GPU diagnostics suite passed 56 tests with one ignored. In a separate local merge with the branch from #843, both touch `primitive.rs`. Keeping this PR's normalized rectangle changes and #843's payload-preserving, ties-to-even half conversion passed 56 GPU diagnostics tests with one ignored on WARP, including both regression cases. The tested merge is `8c799dc`. These were synthetic fixtures. AI-assisted.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!1311
No description provided.