Reject multisampled linear texture layouts #629
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/629"
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 AlanQiang0418 on 2026-11-24T05:55:09Z.
Layout::newaccepted a 256 × 256 linear RGBA8 surface at 2× MSAA and returned an addressable 262,144-byte layout, the same size as at 1×. The linear path calculates row sizes and offsets for a single sample. AMD’s GFX10 address library rejects this combination during swizzle validation. AMD reference implementationThis change rejects the descriptor with
Error::Invalidbefore constructing the layout. The regression test covers 2×, 4× and 8×, checks that the 1× linear texture stays addressable, and checks the allocation size for each sample count withSW_64KB_R_X.The regression test failed on
d2a4baeand passed with the fix.cargo test --locked -p victory-formatson Windows passed 21 tests. The three tests that require external data were skipped. The staged asset-policy check passed. Testing used synthetic descriptors.Imported from Marvisak/VIctory. Originally posted by LAKSHYA-cmd-tech on 2026-11-24T05:56:58Z.
Review: APPROVED
Tested on Windows 11 with Rust 1.98.1 (x86_64-pc-windows-msvc).
Imported from Marvisak/VIctory. Originally posted by geiyiliyabumo on 2026-11-24T10:52:58Z.
Independent verification & code review on Windows 11 Pro (build 26100, Rust
1.98.1), cleanly merged ontomain(ffe310e):cargo xtask policy: PASS (154 files ok)cargo clippy -p victory-formats --all-targets --locked -- -D warnings: PASScargo test -p victory-formats --locked: 24 passed, 0 failed, 4 ignored (including newtexture::tests::linear_layouts_require_one_sample)Diff review (
crates/victory-formats/src/texture.rs): minimal, exact, and well-tested — rejectingd.samples > 1forSwizzle::LINEARprevents under-sized linear layouts while preserving tiled MSAA (SW_64KB_R_Xetc.).AI-assisted; synthetic tests only, no game files.
Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T11:15:58Z.
Review: APPROVED
Tested
350f91con Windows 11, RTX 5070, MSVC:cargo test -p victory-formats21 passed, includinglinear_layouts_require_one_sample.cargo clippy -p victory-formats --all-targetsis clean.Error::Invalidmatches addrlib's swizzle validation, and the test confirms the tiled MSAA path still scales by sample count.AI-assisted (Claude Code).
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T11:24:04Z.
Review: APPROVED
Correct and conservative: multisampled textures now require a tiled swizzle (
d.swizzle != Swizzle::LINEARadded to thesamples > 1clause), since linear layouts can't express per-sample tiles. Single-sample linear textures are untouched (samples == 1short-circuits), and tiled MSAA still passes withsize == single * samples.The new test pins both directions: LINEAR + {2,4,8} samples →
Err(Error::Invalid), tiled + samples → accepted with the expected size. Verified locally: test-merge with current main (ffe310e) clean;cargo test -p victory-formats --locked(macOS arm64, rustc 1.98.1) → 24 passed / 0 failed / 4 ignored (includes the new test).Imported from Marvisak/VIctory. Originally posted by molodayamama on 2026-11-24T14:08:38Z.
Independent Windows check of
350f91c23a9402b2a556a84c208a80030910ae3f(Windows 10 22H2 19045, Rust 1.98.1, MSVC x64).cargo test --locked -p victory-formats --lib linear_layouts_require_one_sample -- --nocapture: 1 passed.The new fixture passed for rejecting multisampled linear layouts. This checks the texture descriptor validation before allocation or GPU work.
Only source-built synthetic fixtures were used. AI-assisted verification.
Imported from Marvisak/VIctory. Originally posted by Yoshi-233 on 2026-11-25T02:47:22Z.
I checked the backport on native x86-64 Linux (Ubuntu 24.04.5, Rust 1.98.1). On
Zettrox/ztrx@90b529f, the new test failed before the fix: a 256×256 RGBA8 linear descriptor returned 262,144 bytes at 1×, 2×, 4× and 8×. Your patch applied unchanged. Afterwards only 1× succeeded for linear; the tiledSW_64KB_R_Xcontrol still returned 262,144 / 524,288 / 1,048,576 / 2,097,152 bytes. All eight outcomes matched upstream940d32f.The downstream
victory-formatslibrary suite passed 25 tests after the backport, with four repository-marked tests ignored. This was a CPU-only descriptor check with synthetic inputs.