Report the correct padded depth for thin-tiled 3D mip chains #4180
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!4180
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-4179"
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?
@RanoGames on GitHub · 2026-11-30 17:05 UTC · original
RanoGames:fix/thin-volume-mip-depth→main· +29 −10 · 1 files · 1 commits · closed without mergingWhat it changes
For a 256×256×8 RGBA8 texture with two mips in
SW_64KB_R_X, XG reported a padded depth of 1 for mip 0. That gave it a size of 256 KiB. All eight slices occupy 2 MiB.A thin-tiled 3D texture stores one mip chain per depth slice. The logical depth shrinks at each mip, while the padded depth uses the resource's slice count. This change reports that count for both standard mips and mips packed into the tail, following AMD addrlib's
ComputeSurfaceInfoMacroTiled.How it was tested
cargo test --locked -p victory-formatspassed on Windows (86 passed, 7 ignored).cargo clippy --locked -p victory-formats --all-targets -- -D warningspassed.Checked for overlap
@babuakhil on GitHub · 2026-11-30 18:57 UTC · original
Checked on Windows 11 (Rust 1.98.1, pinned), applied on current
main(e1251c31); cherry-picks cleanly. Clippy onvictory-formatsis clean with-D warnings, andcargo test -p victory-formatsgives 86 passed, 0 failed, 7 ignored. Not tested in the game.Only thin volumes change.
Mip::depth_pitchis read in one place, XG'smip_out(xg.rs:293for the padded depth,:305for the mip size), so this only changes what XG reports to the title. A throwaway test (not part of this PR) built 636 layouts onmainand on this PR: 2D and 3D; everyS,D,S_X,D_X,R_XandZ_Xmode (4 KB and 64 KB); 1, 4 and 16 bytes per element; four sizes; depths 1 to 64; full mip chains. It compared every mip'sdepth_pitch:S,D)R,Z)With this PR, every mip of every thin volume reports
depth_pitch == slices, wheremainreported 1 for each. A mip's reported size (pitch × rows × bpe × depth_pitch) never exceeds the layout's total in any of the 636, on either branch. Your example:SW_64KB_R_X256×256×8 RGBA8 mip 0 goes from 256 KiB to 2 MiB, of a 3 MiB surface.That matches AMD's GFX10 addrlib as far as I could read it:
Gfx10Lib::ComputeSurfaceInfoMacroTiledsetspMipInfo[i].depth = IsTex3d(pIn->resourceType) ? pOut->numSlices : 1for mips in and out of the tail.One question for later, not for this PR: those addrlib lines don't branch on thin or thick, while
main(and this PR) still gives thick volumes a per-mip depth (padded_dim(d.depth, i, 1)rounded to the block). I only read part of that file, so I may have missed a thick-specific path. It may be worth checking whether thick mips should reportnumSlicestoo.2b26d697b1toc26aaf5fbb@trustno1-coder on GitHub · 2026-12-01 18:46 UTC · original
Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.
Pull request closed