D3D12.X: render targets share video-memory pages on a macOS host too #2492
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!2492
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2492"
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?
@vakaobr on GitHub · 2026-11-25 20:13 UTC · original
vakaobr:d3d12x/mac-render-targets-on-pages→main· +286 −1 · 2 files · 3 commits · draftStacked on #2402; only the top commit belongs here. Part of #258.
On a macOS host, #2402 keeps every GPU-owned texture (
vram::place: render targets, depth targets, UAVs) in an arena, sinceplace_on_pagesreturns atrequire_alignedthere; its RT/DS flag check is never reached by a title's texture. Render targets can share the title's video-memory pages on D3DMetal: with two reserved textures on the same tiles, anR8G8B8A8_UNORMrender target (RT + UAV) cleared through one reads back through the other with 0 of 4096 pixels wrong. AD32_FLOATdepth target reads back with 3968 of 4096 wrong, so depth targets, and the GPU-owned textures that were not probed, keep their arenas. Windows is unchanged.What is in it
crates/xcl/src/hle/d3d12x/vram.rs: on a Mac,place_on_pageslets render targets through therequire_alignedreturn; they getALLOW_UNORDERED_ACCESSfromnative_page_flags, and a format without typed UAV still stays in its arena. New testrender_targets_at_one_address_share_their_pages: two render targets placed throughvram::placeat one address must be on the shared pages, and a clear through one reads back through the other.Tested
x86_64-pc-windows-gnu, debug.vramtests need #1904 and a deferred release for D3DMetal's threads (then #2474, now #2445 + #2498), so they ran on a stack: #2361 + #1904 + #1789 + #2474 + #2402, one test per process in the CrossOver bottle.render_targets_at_one_address_share_their_pages: fails without this change (not placed on the pages), passes with it (0 of 65536 pixels wrong).hle::d3d12x::vram::tests+hle::d3d12x::title_textures::tests, 38 tests: without this change 36 passed, 1 failed (the new test), 1 ignored (churn_update_tile_mappings_timing); with it 37 passed, 0 failed, 1 ignored. No SKIPPED.CreateReservedResource/UpdateTileMappingsprobes on the same Mac; those probes are not in this PR.Regression run
scripts/smoke.ps1on.Not tested
mac_host(), but I did not build or run it there.native_page_flags/reservable), not by a test.AI use
@DavidM1911 on GitHub · 2026-11-25 20:53 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.