formats(texture): avoid mip layout scratch allocations and reject 1D BC layouts #89
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: launcher
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
run report
security: hold
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs gpu test
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Androtim--MiniVI!89
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/89/head"
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?
@Androtim on GitHub · 2026-11-29 08:22 UTC · original
Androtim:feat/iter90-formats-mip-alloc-and-1d-bc→main· +144 −4 · 1 files · 1 commits · merged 2026-11-29 09:06 UTCSummary
Adapted from upstream
VIctory-NVIDIAPRs #1259 (0445761) and #1016 (facd4b0) (GPL-3.0), extracted cleanly offorigin/main(7fe6886) with zero overlap against open PRs:crates/victory-formats/src/texture.rs): PreallocatesVec::with_capacity(d.mips as usize)inLayout::linearand replaces thesizesheapVecinLayout::tiledwith a fixed[0u64; MAX_MIPS as usize]stack array.crates/victory-formats/src/texture.rs): Requiresd.block == 1alongsided.height == 1whend.dimension == Dimension::Tex1d.MAX_MIPS/MAX_EXTENT) and 1D BC rejection alongside existing uncompressed 1D and 2D/3D BC layouts.Verification
cargo xtask policy:asset policy: 303 files okcargo test -p victory-formats --lib --locked: 58 passed; 0 failed; 5 ignored (pre-existing benchmarks/external-data tests), including all 8 newly added testscargo clippy --workspace --all-targets -- -D warnings: 0 warningscargo clippy --workspace --all-targets --features diagnostics -- -D warnings: 0 warnings--release --locked+objdump -p: standard Windows system DLLs only@Androtim on GitHub · 2026-11-29 09:02 UTC · original
Automated triage for the maintainers (not an approval).
Verdict:
merge-candidate· CI (check):passingTriage Review
Clean, focused change in
crates/victory-formats/src/texture.rswith CI passing and no overlap with other open PRs.Verified Changes
Layout::new, L299): Tightens theDimension::Tex1dcheck tod.height == 1 && d.block == 1, rejecting 4×4 BC formats on 1D textures consistently with the existing multisampled.block == 1guard (L295).Layout::linearL318,Layout::tiledL426/L439):mipswithVec::with_capacity(d.mips as usize)inLayout::linear(matchingLayout::tiledat L377).sizesVecinLayout::tiledwith[0u64; MAX_MIPS as usize]. BecauseLayout::newenforces(1..=MAX_MIPS).contains(&d.mips)(L288),i as usizein0..d.mipsis strictly in-bounds and every slot read in0..first_tail_mip as usize(L457-L460) is populated beforehand.MAX_MIPS/MAX_EXTENTbounds and tail-only layouts) and 1D BC rejection without regressing uncompressed 1D or 2D/3D BC layouts.Verdict
merge-candidate— pure CPU layout calculation/validation invictory-formatswith passing CI and good test coverage; no local GPU smoke test needed. (Triage assessment only, not formal maintainer approval.)Generated with Antigravity CLI (
agy).