XG: report tail mips with OffsetBytes zero #1659
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!1659
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1659"
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?
@Shad0wrend on GitHub · 2026-11-28 23:07 UTC · original
Shad0wrend:xg/mip-tail-offset→main· +11 −5 · 1 files · 1 commits · closed without mergingWhat
The GDK's
XG_MIPLEVEL_LAYOUTsays a mip-tail level reportsOffsetBytes == 0; its position inside the tail is then given byMipTailOffsetElementsX/Y/Z.XGSuggestSwizzleMode's layout was instead reportingt.offset, a byte offset inside the tail block, inOffsetBytes, and only filled the element position for 3D textures. A title following the documented contract would mislocate packed tail mips.OffsetBytes == 0and fill the element position (xbits 0-10,ybits 11-21) whether the texture is 2D or 3D.Validation
cargo test --release --locked -p victory -p victory-gpu -p victory-hle— green (29 + 2 + 550 + 199 + 1 tests, 0 failures).layout_and_copies_through_the_objectnow checksOffsetBytes == 0and comparestail_positionwith the element position fromvictory-formats; all xg tests pass.cargo clippy --release -p victory-hle --all-targets --locked -- -D warningswith pre-existing upstream lints allowed — clean.cargo run --release --quiet -p xtask -- policy --staged— 1 file ok.No game paths, logs or binaries are included.
@babuakhil on GitHub · 2026-11-28 23:28 UTC · original
Checked on Windows 11, Rust 1.98.1 (pinned), applied on current
main(d4b5d51); cherry-picks cleanly. Clippy reports nothing inxg.rs(it stops at the twovictory-shadererrors already onmain, #1517), the xg tests pass including the updatedlayout_and_copies_through_the_object, andcargo test -p victory-hle --libgives 199 passed, 0 failed.I can't check the GDK header here, so I looked at whether the two ways of locating a tail mip agree in this layer.
victory-formats, the tail block is the first block of each slice ("Standard mips from the smallest up, after the tail block"), so a tail mip'sMip::offsetis 0 andt.offsetis also its byte offset from the start of the slice.main's 2DOffsetBytes = t.offsettherefore pointed at the right bytes; whatmaingot wrong for 2D is leavingMipTailOffsetElementsX/Yat 0, so a title that follows the header (OffsetBytes0, position from the element fields) would put every 2D tail mip at element (0, 0). This PR fills those in, which is the part that fixes something.SW_64KB_S,_D,_S_X,_D_Xand_R_X, at 1–16 bytes per element and seven sizes from 4×4 to 2048×512 and 1×4096, with full mip chains: 1135 tail mips, every one with its tail block at slice offset 0. For the 454 thatLayout::offsetcan address,offset(mip, 0, 0, 0)(which shifts byt.x,t.y) equalst.offsetin every case, with no mismatches. The other 681 get an error fromoffset(), so they're unchecked.So for 2D,
OffsetBytes = 0plus the element position describes the same placemaindescribed with the byte offset alone. WhetherOffsetBytesshould be 0 for a tail mip is the header's call, which I can't confirm from here.38fe2dc65fto0301d2c731@Shad0wrend on GitHub · 2026-11-29 01:39 UTC · original
Closing per maintainer request; not pursuing these changes.
Pull request closed