Skip to content

[upstream #1028] D3D12.X: map and unmap 3D texture mips separately - #110

Closed
ufoptg wants to merge 1 commit into
mainfrom
upstream-pr/1028
Closed

ufoptg wants to merge 1 commit into
mainfrom
upstream-pr/1028

Conversation

@ufoptg

@ufoptg ufoptg commented Nov 24, 2026

Copy link
Copy Markdown
Owner

On RX 6800, one linear tile-mapping region leaves upper 3D mips reading zero, and a NULL update over the same region leaves them mapped. By the spec one region from subresource 0 covers every mip; this maps and unmaps 3D textures with one region per standard mip plus the packed tail instead. Requested follow-up to xcl-dev#470; independent of it.

What is in it

  • vram.rs: tile_regions builds the regions from GetResourceTiling, shared by map and unmap. 2D textures and unexpected tilings keep the linear region.
  • title_textures.rs: a 128×128×128 five-mip volume, and a check that every 3D mip reads zero after retirement.

Tested

  • RX 6800, driver 32.0.21045.29003; Ryzen 5 5600X3D, 64 GB; Windows 11 Pro 26200; Rust 1.98.1 MSVC; DXC 1.8.2502.11. Debug tests; release smoke runs.
  • Clean b3c53e98de18b2150b361303010f702ba3610f31: cargo test --workspace --no-fail-fast -- --test-threads=4: 741 passed, 0 failed, 41 ignored.
  • SKIPPED (no debug layer, not coverage): test_title_draws_with_a_root_signature_under_the_debug_layer, uploads_start_from_each_subresources_state.
  • placed_title_textures_share_vram_and_preserve_pixels with only the map half reverted to one linear region fails with 3D 128x128x128 5 mips: subresource 2 mismatch; with only the unmap half reverted it fails the after-retirement check; as committed it passes.

Regression run
scripts/smoke.ps1 -Game 'G:\xcl\assets\GTA6.Xbox.v1.0.2.1' -Seconds 60, release, XCL_DATA_ROOT=%TEMP%\xcl-mips-game-data, XCL_COHERENT_MB=512, XCL_FRAME_DUMP=300, no scripted input. Three alternating clean pairs (main/head frames): 954/864, 968/957, 983/617, plus an earlier 1004/741. The spread is the title's, not this change's: an instrumented build of both commits counted 1,487 UpdateTileMappings map calls in 60 s, only one of them on a 3D texture this PR splits, and the same total mapping time (98–109 ms in both); its three pairs were 853/914, 805/980, 978/982. The blocks below are the middle clean pair.

Main (47efa2e):

xcl-smoke v1
commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3
gpu: AMD Radeon RX 6800
title: GTA6.Xbox.v1.0.2.1
seconds: 60
exit: 0x0
frames shown: 968 (PresentX 969)
presents per 2 s (last 3): 60 51 60
device removals: 0
crashes: 0
peak commit: 16115 MB

This head (b3c53e9):

xcl-smoke v1
commit: b3c53e98de18b2150b361303010f702ba3610f31
gpu: AMD Radeon RX 6800
title: GTA6.Xbox.v1.0.2.1
seconds: 60
exit: 0x0
frames shown: 957 (PresentX 957)
presents per 2 s (last 3): 55 47 58
device removals: 0
crashes: 0
peak commit: 16945 MB

Not tested

AI use

  • T3 Code through Codex (gpt-6.1-sol): implementation, tests, first description.
  • Claude Code (Claude Opus 5.5): review, rebase, comment and description cleanup, full test run, revert check, the smoke pairs above and the mapping instrumentation.
  • Codex (GPT-6; exact runtime model identifier unavailable): earlier smoke runs and publishing.

Mirror of xcl-dev#1028 (auto-synced, do not edit).

By the spec, one linear UpdateTileMappings region from subresource 0
covers every mip of a reserved texture. On RX 6800 (32.0.21045) it
leaves upper 3D mips unmapped, and a NULL update over it leaves them
mapped. Build one region per standard mip plus the packed tail from
GetResourceTiling for both operations; 2D textures and unexpected
tilings keep the linear region.

The texture-placement GPU test gains a 128x128x128 five-mip volume and
checks every 3D mip reads zero after retirement. It fails at mip 2
without the map change and after retirement without the unmap change.

Assisted-by: T3 Code through Codex (gpt-6.1-sol)
Assisted-by: Claude Code (Claude Opus 5.5)
@ufoptg

ufoptg commented Nov 25, 2026

Copy link
Copy Markdown
Owner Author

Upstream PR xcl-dev#1028 was closed or merged.

@ufoptg ufoptg closed this Nov 25, 2026
@ufoptg
ufoptg deleted the upstream-pr/1028 branch November 25, 2026 00:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants