fix(formats): reject multisampled block-compressed textures #386
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/386"
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 trustno1-coder/VIctory-NVIDIA. Originally posted by Damokles2 on 2026-11-27T21:46:12Z.
Problem and fix
Layout::new()accepts multisampled block-compressed textures if the dimension, mip count, and swizzle pass validation. In a standalone CPU reproduction, a 4×4BC1_UNORMtexture with one mip, four samples, andSW_64KB_R_Xreturned a 65,536-byte allocation. With the guard it returnsError::Invalid.The change adds
d.block == 1to the multisample branch. That keeps the existing dimension, mip, and swizzle rules and leaves footprint calculations and GPU fallback behavior untouched. The current format table usesblock == 4only for BC1–BC7.Microsoft limits multisampled textures to render-target or depth-stencil resources, and the BC format tables give them neither capability. AMD PAL also validates format and tiling support for MSAA during image creation. D3D12 resource description · Microsoft BC1 format support · AMD PAL image validation · AMD GFX10 AddrLib swizzle validation
Regression coverage
SW_64KB_R_X.R10G10B10A2_UNORM, andD32_FLOAT. The existing rejection of linear 4× RGBA8 is also covered.Validation
cargo check, library-only strict Clippy, andgit diff --checkpassed.victory-loadertransmute annotation failures. All-features Clippy also reproduced the existingvictory-formatsprecedence diagnostic.rustfmt --checkstill reports upstream formatting drift, with 3,522 baseline hunks and 3,521 candidate hunks.0f0ada19095979e2192d1b5a98bb5297cf4d53ea095065e9753f69ae84fa9bdb7481445e5144f5b431db25eb94da78ca245d92ae89167ca7aa0879dc806b0fba6c2c5addcfdf0b5c7df32375684aef80Fixes #356.
AI-assisted with OpenAI Codex.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-11-28T02:49:50Z.
Merged into main (
8fc2254) and shipped in v2026.11.27.10. The commit keeps you as its author, so it counts toward the contributors list. GitHub shows this as closed rather than merged only because the commits were applied on top of the newest main (new commit IDs). Thank you!Pull request closed