native: tell signed from unsigned BC6H #129
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/129"
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 Olima34 on 2026-11-26T18:00:05Z.
BC6H textures on the native host decoded with the wrong signedness, and the signed format was missing.
Evidence. Tester log #123 (M4 Air, Series S):
a title texture format the host does not represent format=96 w=512 h=512(DXGI 96 = BC6H_SF16). Anddescriptors.rsmapped DXGI 95 (BC6H_UF16, unsigned) toMTLPixelFormat::BC6H_RGBFloat(150), which is Metal's signed BC6H. Unsigned isBC6H_RGBUfloat(151). Both values are checked in objc2-metal 0.3.2MTLPixelFormat.rs.What.
Format::Bc6his now documented as unsigned (UF16), and a newBc6hSigned(SF16) is added. Both are 16-byte 4×4 blocks.Bc6h→BC6H_RGBUfloatandBc6hSigned→BC6H_RGBFloat.native/descriptors.rsmaps 95 →Bc6hand 96 →Bc6hSigned.Tests.
sample_bc6h_unsigned_and_signed: one mode-11 block per format (one region, 10-bit endpoints, untransformed; endpoint 0 = (0x100, 0x300, 0), every index 0), sampled on the GPU.Unquantize,FinishUnquantize), cited in the test: UF16 gives (1807/2^18, 323.75, 0), and SF16 gives (1567/1024, −1567/1024, 0), since 0x300 is −256 in 10-bit two's complement.Bc6hdecodes to [1.5302734, −1.5302734, 0] instead of [0.0068932, 323.75, 0].sample_bc1_and_create_every_bc_formatnow also createsBc6hSigned.descriptors::tests::bc6h_keeps_its_signednesschecks the 95 and 96 mapping and the element size.victory-gpu and victory-metal tests (arm64), Windows clippy and
cargo xtask policypass. Not checked in game.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-26T18:10:02Z.
Merged, thanks. Unsigned BC6H now decodes correctly, and DXGI 96 maps to the signed format.