Native host: R8G8_UINT and R8G8_SNORM were mapped to each other's formats #39
No reviewers
Labels
No labels
accessibility
bug
claimed
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
tester report
urgent
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LakshanSivakumar--Native-Victory-macOS!39
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/39/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?
@ShadyUnderLight on GitHub · 2026-11-26 10:56 UTC · original
ShadyUnderLight:fix/rg8-format-kinds→main· +20 −5 · 4 files · 3 commits · merged 2026-11-26 11:17 UTCSummary
Corrects the host mapping of the three R8G8 DXGI formats.
4a4d844collapsed DXGI 49 and 50 ontoRg8Unorm, and mapped DXGI 51 toRg8Uint.Problem
DXGI defines these as three distinct formats:
R8G8_UNORMRg8UnormRg8UnormR8G8_UINTRg8UnormRg8UintR8G8_SNORMRg8UintRg8SnormA uint view sampled through an
RG8Unormtexture returns normalized floats instead of integers; a snorm view sampled through anRG8Uinttexture returns raw integers instead of [-1, 1]. DXGI 50 also missedis_integer()'s no-blend rule for integer render targets.Fix
descriptors::format.Format::Rg8Snormwith its(1, 2)block size and its Metal mappingMTLPixelFormat::RG8Snorm. It is a normalized format, so it stays out ofis_integer().docs/native-host.md.Tests
r8g8_formats_keep_their_numeric_kindcovers all three formats and the integer/normalized distinction.On main the
Rg8Snormvariant does not exist yet, so the test does not compile (E0599). With that one line lifted out, it fails on the mapping:A temporary probe on main printed
49 -> Rg8Unorm,50 -> Rg8Unorm,51 -> Rg8Uint is_integer=true. The probe was deleted and is not part of this PR. The new test passes here, andhost_formats_have_the_title_formats_element_size(which walks 49, 50 and 51) still passes.Verification
Run on the native arm64 host, plus the Windows target CI uses:
Native-only lint (not part of CI) still reports two pre-existing
unnecessary_castlints incrates/victory-metal/src/present.rs:126and:144. They reproduce on unmodifiedmainand this PR does not touch that file.Risk
Low. DXGI 49 keeps its existing mapping; 50 and 51 now keep their numeric kind. No shader translation, pipeline state or draw-path code changes. Format 50 now takes the existing integer-target path, so integer render targets of that format no longer blend.
Notes
Found while auditing a 75 s native run; the title uses format 50 (64x64) and format 51 (1024x1024). No claim is made about visual output or frame rate.
@LakshanSivakumar on GitHub · 2026-11-26 11:07 UTC · original · approved these changes
Correct, thanks. 50/51 were swapped in our own
4a4d844, and the doc table now matches DXGI too. Tested merged with current main: gpu/hle/victory tests, Windows clippy and policy pass.