fix(formats): reject multisampled block-compressed textures #386
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!386
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@Damokles2 on GitHub · 2026-11-27 21:46 UTC · original
Damokles2:fix-texture-bc-msaa-validation→main· +75 −1 · 1 files · 1 commits · openProblem 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.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.