Placed textures larger on the PC than on the console get memory of their own (Minecraft logo squares) #86
No reviewers
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!86
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/86/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?
@Foniass on GitHub · 2026-11-23 02:17 UTC · original
Foniass:fix/placed-texture-overlap→main· +39 −0 · 1 files · 1 commits · merged 2026-11-23 10:36 UTCMinecraft's loading screen showed three small magenta/black squares and a white speck along the bottom edge of the MINECRAFT logo (HANDOFF lists them as open: "small magenta / black 'missing texture' quads on the loading screen's logo"). Nothing is missing. On the PC the logo texture is larger than on the console and covers the textures the game packed after it.
Cause
Titles place textures in their heaps by the console's size:
GetResourceAllocationInfoanswers with XG's. XCL places the PC texture at the console's offset, but the PC driver's layout can be larger. Minecraft's heap (RTX 5070 Ti):textures/ui/title.png, 1937×333The logo's last 0x40000 bytes are the memory of the next four textures. The three 16×16s are the game's magenta/black missing-texture image; written into the logo's tail they show as 16×16-texel squares exactly 256 texels apart in its bottom rows. The white speck is the text texture.
How it was found: in a full-size frame dump the squares sit inside the logo's quad (painting that pixel shader green with
XCL_DEBUG_MAGENTAhides them), andtitle.pngitself has plain black there. XCL has a fallback for this, "memory of its own", but it only applied when the PC refused the placement (past the heap's end). Here the PC accepts it, and the overlap goes unnoticed. The developer saw the same squares on AMD, so it isn't NVIDIA-only.Fix
own_memory_if_larger_on_the_pc: a texture placed in a heap whose PC size is larger than its XG size gets a committed resource of the heap's kind, as in the past-the-end case. The console's aliasing of that one placement is lost (the same trade-off as before). Buffers and textures that fit are placed as before. The first 8 such textures are logged with both sizes.Checked
cargo build --workspace --releasethencargo test --workspace --releaseon the RTX 5070 Ti: 372 passed, 0 failed. 41 GPU tests print SKIPPED (no wave64 on NVIDIA), as onmain.🤖 Generated with Claude Code
@Lum7nt on GitHub · 2026-11-23 04:44 UTC · original
Tested this branch locally and verified against
mainand our MSAA work (#43) — all 343 library tests pass and it merges cleanly.Great catch on the PC padding overflow stomping adjacent textures in the heap! Two small suggestions for robustness:
Retry with
COMMONstate on creation failure:In the existing past-the-end fallback (
real.rs:2011), if committed resource creation fails with the requested state, it retries withD3D12_RESOURCE_STATE_COMMON(state 0) to handle driver quirks (e.g. UAV state requested without UAV bind flag). Inown_memory_if_larger_on_the_pc, ifdev_create_committed_resourcefails, it currently returnsNone, falling through todev_create_placed_resourceand re-introducing the overlap. Adding the state 0 retry prevents that:Resource Tracking:
dev_create_committed_resource_xregisters newly created committed resources withregister_resource(ptr, false). Callingregister_resource(unsafe { *ppv }, false)whenhr >= 0ensures XCL's texture/aliasing tracker knows the resource is committed rather than placed.@certified-retart on GitHub · 2026-11-23 05:56 UTC · original
Tested head \
8ad0b447\ on a dual-GPU Windows 10 setup (NVIDIA RTX 5070 + AMD Radeon 9800X3D iGPU) with D3D12 Agility SDK 1.619.1 (#75):No regressions on either adapter, and the \creator!\ macro for \dev_create_committed_resource\ already calls \dopt(*ppv, Kind::Resource)\ on success.
@ivall on GitHub · 2026-11-23 10:36 UTC · original
Merged – great find. On the RX 9070 Minecraft logs the logo and the 16×16 textures after it getting memory of their own, as you describe. I also took @Lum7nt's suggestion (
9284dcd): when the PC refuses the title's state for the committed resource, it retries with COMMON instead of falling back to the overlapping placement. Tested on Windows 11 with an RX 9070 (RDNA4):cargo test --workspacegreen with the retail samples (shader pack, console DLLs, texture archive), lib tests also withXCL_SPLIT_WAVE64=1; Unicorn Overlord, Minecraft and Fortnite run with this round merged. Thanks!@Foniass on GitHub · 2026-11-23 10:47 UTC · original
Thanks @Lum7nt and @certified-retart for testing it.
On the two suggestions:
COMMON. The past-the-end fallback onmain(dev_create_placed_resource_x) has no such retry: it creates the committed resource once, in the title's state masked to the PC's (PC_RESOURCE_STATES). The new path does the same. If that creation fails,own_memory_if_larger_on_the_pcreturnsNoneand the texture is placed as the title asked, which is whatmaindoes today, so a failure costs no more than before. A retry inCOMMONwould hand the title a texture in a state other than the one its barriers start from (its first transition names the state it asked for). The debug layer reports that, and drivers are free to mishandle it, so I'd keep the title's state.register_resourcein the tree. As @certified-retart says, thecreator!wrapper ofdev_create_committed_resourceadopts the new resource (adopt(*ppv, Kind::Resource)), the same path the past-the-end fallback goes through.Also re-checked today on current
main(d70f8e9, RTX 5070 Ti): the workspace suite passes, and Minecraft's menu renders at 60 fps.