fix(formats): reject unsupported MSAA swizzles #3385
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3385"
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 Marvisak/VIctory. Originally posted by oddmaniv on 2026-11-26T21:16:44Z.
Summary
Reject multisampled texture descriptors using GFX10 standard, display, and 256-byte swizzles. Preserve valid multisampled Z-order/render swizzles and single-sample controls.
Verification
Added a synthetic regression for 2/4/8 samples across the restricted modes and valid Z/render controls. Native Windows RED failed on the regression before the validation change; GREEN passed 1 test. Package tests, both workspace Clippy configurations, and asset policy passed. The changed-file rustfmt gate reported pre-existing formatting differences elsewhere in this file; no broad formatting churn was applied.
Defensive descriptor validation only. No game files or GPU runtime.
Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T21:28:42Z.
Review: APPROVED
LGTM — verified on Windows against
origin/main(63bcca4)._S), Display (_D), and 256B swizzle modes while keeping_Z_Xand_R_XMSAA valid matches GFX10 tiling constraints cleanly.cargo test -p victory-formats --lib texture:: -- --test-threads=1: 17 passed, 0 failed (includingstandard_and_display_swizzles_reject_multisampling).cargo clippy -p victory-formats --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T21:30:42Z.
Review: APPROVED
LGTM — verified against
origin/main(63bcca43) on Windows x64.samples > 1onstandard(),display(), and 256B (block_log2 == 8) swizzle modes inLayout::new(crates/victory-formats/src/texture.rs:294-300) aligns multisampled layout validation with GFX10 AddrLib while keepingSW_64KB_Z_XandSW_64KB_R_XMSAA layouts accepted and breaking no supported pixel-access paths.SW_4KB_R_X(mode 23) is still accepted forsamples > 1by the negative checks, and the new test covers the six baseS/Dmodes (not the_S_T/_D_T/_S_X/_D_Xvariants directly).cargo test --locked -p victory-formats -- --test-threads=1: 47 passed, 0 failed, 5 ignored (includingstandard_and_display_swizzles_reject_multisampling).cargo test --locked -p victory-hle --lib -- --test-threads=1 modules::xg::: 4 passed, 0 failed.cargo clippy -p victory-formats -p victory-hle --all-targets --locked -- -D warnings(default and--all-features): clean.cargo xtask policy: 191 files ok;rustfmt --edition 2024: clean on changed hunks.Synthetic tests only; no game data used.
Imported from Marvisak/VIctory. Originally posted by Jackster on 2026-11-26T22:29:02Z.
Windows 11,
63bcca4+ this PR:cargo test -p victory-formats: 47 passed / 0 failed / 5 ignored.texture::tests::standard_and_display_swizzles_reject_multisamplingby name: 1 passed.cargo clippy -p victory-formats --all-targets -- -D warnings: clean.The test covers the six standard/display swizzles at 2, 4 and 8 samples and the two render controls (
SW_64KB_Z_X,SW_64KB_R_Xstay valid at 4 samples, andSW_64KB_R_Xat one sample). No main-side control was run: unpatchedmainhas nostandard()/display()orblock_log2 != 8rejection, so those assertions cannot hold there by construction. Synthetic only. AI-assisted.Imported from Marvisak/VIctory. Originally posted by cloph-dsp on 2026-11-27T01:07:56Z.
Independent Windows verification of PR #3385 (
fix(formats): reject unsupported MSAA swizzles), head58295957, merge base940d32f.cargo test --locked -p victory-formats --lib -- texture::tests::standard_and_display_swizzles_reject_multisampling --exact --test-threads=1 --quiet→test result: ok. 1 passed; 0 failed; 43 filtered out, exit 0.git diff --check 940d32f HEAD→ clean, exit 0.origin/mainat940d32f(git grepexit 1). Only the named synthetic test was run; full crate suite not run here.Windows, Rust 1.100.0/MSVC, worktree-local
CARGO_TARGET_DIR,CARGO_BUILD_JOBS=2. AI-assisted (Hy4 flash). GPU/driver N/A (CPU parser test). No game data, assets, extracted shaders or DRM used.Imported from Marvisak/VIctory. Originally posted by rezioliver-collab on 2026-11-27T02:59:27Z.
I checked the extended swizzles mentioned in review through the public constructor on an Apple M1. The fixture called
Texture::newfor all 32 swizzle codes at 0, 1, 2, 4 and 8 samples, using three formats (two with a separate stencil plane), two dimensions and three mip settings. That gave 2,880 synthetic descriptors per revision.Compared with merge base
940d32f6, PR58295957newly rejected 324 descriptors, all in the 12 standard/display modes including the T and X variants. For all 657 descriptors accepted by both, total size, alignment, plane count and stencil offset matched exactly. Both rejected the remaining 1,899. Mode 23 still accepted a valid single-mip MSAA descriptor, consistent with the review observation.AI-assisted with 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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.