Reject multisampled block-compressed texture layouts #410

Closed
github-bot wants to merge 660 commits from github-bot/gh-410 into main AGit
Owner

@⁠safesearch77 on GitHub · 2026-11-28 13:25 UTC · original
safesearch77:fix/formats-reject-msaa-bc → main · +60088 −5430 · 206 files · 660 commits · closed without merging

Layout::new allowed samples > 1 for any 2D, single-mip, non-linear layout without checking block == 1, which accepted multisampled block-compressed (BC1–BC7) texture descriptions even though block-compressed formats only support single-sample layouts.

Require d.block == 1 whenever d.samples > 1 in Layout::new.

Ported from trustno1-coder/VIctory-NVIDIA@5b6955c8 (by Damokles2).

Verification

  • cargo +1.98.1 test --locked --target x86_64-pc-windows-msvc -p victory-formats --lib (Wine): 52 passed; 0 failed; 8 ignored (pure CPU tests), including bc_formats_accept_single_sample_layouts, bc_formats_reject_multisampled_layouts (BC1–BC7 at 2x/4x/8x), and uncompressed_formats_keep_multisample_layout_rules (R8G8B8A8_UNORM, R10G10B10A2_UNORM, D32_FLOAT at 4x tiled vs LINEAR).
  • cargo +1.98.1 test --locked -p victory-formats --lib (native Linux): 52 passed; 0 failed; 8 ignored.
  • cargo +1.98.1 clippy --locked --target x86_64-pc-windows-msvc -p victory-formats --all-targets -- -D warnings: clean (0 warnings).
  • cargo +1.98.1 xtask policy: asset policy: 322 files ok.
**@⁠safesearch77** on GitHub · 2026-11-28 13:25 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/410) `safesearch77:fix/formats-reject-msaa-bc` → `main` · +60088 −5430 · 206 files · 660 commits · closed without merging `Layout::new` allowed `samples > 1` for any 2D, single-mip, non-linear layout without checking `block == 1`, which accepted multisampled block-compressed (BC1–BC7) texture descriptions even though block-compressed formats only support single-sample layouts. Require `d.block == 1` whenever `d.samples > 1` in `Layout::new`. Ported from `trustno1-coder/VIctory-NVIDIA@5b6955c8` (by `Damokles2`). ### Verification - `cargo +1.98.1 test --locked --target x86_64-pc-windows-msvc -p victory-formats --lib` (Wine): `52 passed; 0 failed; 8 ignored` (pure CPU tests), including `bc_formats_accept_single_sample_layouts`, `bc_formats_reject_multisampled_layouts` (BC1–BC7 at `2x`/`4x`/`8x`), and `uncompressed_formats_keep_multisample_layout_rules` (`R8G8B8A8_UNORM`, `R10G10B10A2_UNORM`, `D32_FLOAT` at `4x` tiled vs `LINEAR`). - `cargo +1.98.1 test --locked -p victory-formats --lib` (native Linux): `52 passed; 0 failed; 8 ignored`. - `cargo +1.98.1 clippy --locked --target x86_64-pc-windows-msvc -p victory-formats --all-targets -- -D warnings`: clean (`0` warnings). - `cargo +1.98.1 xtask policy`: `asset policy: 322 files ok`.
Require d.block == 1 when d.samples > 1 in Layout::new so BC1-BC7
formats only accept single-sample layouts.

Ported from trustno1-coder/VIctory-NVIDIA 5b6955c (Damokles2).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 13:36:46 +00:00
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-29 11:35 UTC · original

Thanks for isolating the invalid multisampled BC layout. Please retain a positive uncompressed multisample case and a normal single-sample BC case alongside the rejection test.

**@⁠TaynanGT** on GitHub · 2026-11-29 11:35 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/410#issuecomment-7255220125) Thanks for isolating the invalid multisampled BC layout. Please retain a positive uncompressed multisample case and a normal single-sample BC case alongside the rejection test.
Author
Owner

@⁠safesearch77 on GitHub · 2026-11-29 13:17 UTC · original

Thanks. The three tests in this PR already cover what you asked for:

  • uncompressed_formats_keep_multisample_layout_rules is the positive uncompressed case. It checks that 4x R8G8B8A8_UNORM, R10G10B10A2_UNORM and D32_FLOAT with a 64 KiB swizzle still give a valid layout, and that a LINEAR multisampled layout is still refused, as before.
  • bc_formats_accept_single_sample_layouts is the normal single-sample case: every BC1–BC5, BC6H and BC7 DXGI format (70–84, 94–99) at one sample.
  • bc_formats_reject_multisampled_layouts is the rejection: the same formats at 2, 4 and 8 samples return Error::Invalid.

I see #439 already has this fix (d.block == 1 in Layout::new) and these three tests, unchanged, in 42c0244. I'm happy to close this PR as included once #439 lands, unless you'd rather merge it on its own first.

Re-run today under Wine: victory-formats --lib passes 52/52 (8 ignored), including all three.

AI-assisted: yes (Claude), reviewed locally before posting.

**@⁠safesearch77** on GitHub · 2026-11-29 13:17 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/410#issuecomment-7256430451) Thanks. The three tests in this PR already cover what you asked for: - `uncompressed_formats_keep_multisample_layout_rules` is the positive uncompressed case. It checks that 4x R8G8B8A8_UNORM, R10G10B10A2_UNORM and D32_FLOAT with a 64 KiB swizzle still give a valid layout, and that a LINEAR multisampled layout is still refused, as before. - `bc_formats_accept_single_sample_layouts` is the normal single-sample case: every BC1–BC5, BC6H and BC7 DXGI format (70–84, 94–99) at one sample. - `bc_formats_reject_multisampled_layouts` is the rejection: the same formats at 2, 4 and 8 samples return `Error::Invalid`. I see #439 already has this fix (`d.block == 1` in `Layout::new`) and these three tests, unchanged, in 42c0244. I'm happy to close this PR as included once #439 lands, unless you'd rather merge it on its own first. Re-run today under Wine: `victory-formats --lib` passes 52/52 (8 ignored), including all three. AI-assisted: yes (Claude), reviewed locally before posting.
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-29 14:39 UTC · original

Thanks for the positive and negative layout cases. I confirmed the BC rejection test is present in my current local tree. I will keep the normal single-sample BC and uncompressed MSAA tests as well. No need to close this separately until the integration is verified and published.

**@⁠TaynanGT** on GitHub · 2026-11-29 14:39 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/410#issuecomment-7257468874) Thanks for the positive and negative layout cases. I confirmed the BC rejection test is present in my current local tree. I will keep the normal single-sample BC and uncompressed MSAA tests as well. No need to close this separately until the integration is verified and published.
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-30 17:08 UTC · original

main has moved to a new line of the code and everything is now named Vice-Tay, so this PR no longer applies as it is (details in #468). If you'd like this change in, please rebuild it on the current main and open a new PR; I'll review it there.

**@⁠TaynanGT** on GitHub · 2026-11-30 17:08 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/410#issuecomment-7285790880) `main` has moved to a new line of the code and everything is now named Vice-Tay, so this PR no longer applies as it is (details in #468). If you'd like this change in, please rebuild it on the current `main` and open a new PR; I'll review it there.
github-bot closed this pull request 2026-11-30 17:14:28 +00:00

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.