D3D12.X: title_textures LAST_CONTENT is not cleared on shadow unmap/remap, leaving uncovered textures permanently unmapped under XCL_TEXTURE_LEVEL_PAGES=1 #2460
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl#2460
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@microwave805 on GitHub · 2026-11-25 19:30 UTC · original
Static audit on
main @ c7e1799found thatLAST_CONTENTincrates/xcl/src/hle/d3d12x/title_textures.rsis not cleared when a shadowed placed texture is unmapped or remapped — leaving uncovered textures permanently unmapped (all black) underXCL_TEXTURE_LEVEL_PAGES=1(#2306) or sampling stale/corrupted tiles without it. Part of #1773, Part of #1833.Where
crates/xcl/src/hle/d3d12x/title_textures.rs:392-401(register),539-558(forget),845-847(same_as_last_upload),1112-1138(upload_all)crates/xcl/src/hle/d3d12x/vram.rs:1036-1089(unmap_superseded,remap_if_unmapped)Root cause
Ais uploaded once; its CPU content hash is cached inLAST_CONTENT[A].Bis created:register(B)callsvram::unmap_superseded(A)(title_textures.rs:400), which unmaps all ofA's tiles, sets every lazy level group's mapped flag tofalse(vram.rs:1051), and releasesA's tiles tocooling.LAST_CONTENT[A]is not removed.Bis later released:title_textures::forget(B)removes onlyB(notremap_ptrs) fromLAST_CONTENT(title_textures.rs:540).Table::removemarksA.pending = true, andvram::remap_if_unmapped(A)runs (title_textures.rs:551):XCL_TEXTURE_LEVEL_PAGES=1:remap_if_unmappedsetst.mapped = truewhile leaving all level groups unmapped (vram.rs:1076-1079), relying on the pending upload inupload_allto callmap_levels_with_texels(&A, &subs)(title_textures.rs:1137).XCL_TEXTURE_LEVEL_PAGES=1:remap_if_unmappedbinds fresh/recycled pool tiles (stale VRAM / overwritten byB), relying on the pending upload to restoreA's texels.upload_all(title_textures.rs:1112-1121) runsunchanged_skip()(default ON). BecauseA's CPU memory still hashes toLAST_CONTENT[A],same_as_last_upload(A, h)returnstrueand executescontinue, skipping bothmap_levels_with_texelsandtexture::upload_batch.Trigger
Upload placed texture
A→ create overlapping different-range placed textureB→ releaseB→ submit GPU work samplingA(defaultXCL_TEXTURE_SKIP_UNCHANGED=1). UnderXCL_TEXTURE_LEVEL_PAGES=1,Astays permanently unmapped (samples all black/zeros) until its CPU bytes change; withoutXCL_TEXTURE_LEVEL_PAGES=1,Asamples stale/corrupted tiles.Fix direction
Remove every pointer in
unmap_ptrs(inregister/retire_overlapping) andremap_ptrs(inforget, beforeremap_if_unmapped) fromLAST_CONTENT.AI use
main @ c7e1799and issue drafting.@AngeloMaiale on GitHub · 2026-11-25 22:57 UTC · original
Working on this: clearing LAST_CONTENT for superseded/uncovered textures on unmap and remap in title_textures.rs, with a GPU regression test.