Native host: R8G8_UINT and R8G8_SNORM were mapped to each other's formats #39
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/39"
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 LakshanSivakumar/Native-Victory-macOS. Originally posted by ShadyUnderLight on 2026-11-26T10:56:50Z.
Summary
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.
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-26T11:07:14Z.
Review: APPROVED
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.