d3d12_xs: support differently shaped depth textures at one base #689

Closed
QemmHD wants to merge 1 commit from upstream-pr/689 into old-pr/9991
QemmHD commented 2026-11-24 12:08:23 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by QemmHD on 2026-11-24T12:08:23Z.


Claimed in #14 as RT-DEPTH-SAME-BASE-SHAPES. Direct follow-up to #261, targeted at its branch so the review shows only this change.

What and why

Slot 133 can place multiple depth/UAV textures with different extents or array sizes at the same guest address. The existing placement table rejects the second shape. Keep a separate real attachment and storage-plane backing for each incompatible shape. Keep the shared backing for exact compatible placements. The caller still synchronizes a shape switch with an aliasing barrier and initializes the newly active texture. Distinct-base partial overlaps are still refused, including when a same-base group grows toward a neighboring placement.

Tested

  • Windows, MSVC 2022 x64, RTX 4070 SUPER. All 14 focused tests passed on the local integration of #261, with zero skips.
  • A synthetic test switches between a small texture and a larger array at one base. It uses explicit alias barriers and full depth clears, writes through a UAV, and checks each layer by readback. It also covers exact alias sharing and range overlap checks.
  • The offline boot on the local integration advanced past the earlier slot 133 placement failure and reached a later exception.
  • This patch applies to the exact #261 head at 632cb75ad. Diff and repository game-data checks passed.

AI-assisted: yes (Codex).

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5471840993 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/689). Originally posted by [QemmHD](https://github.com/QemmHD) on 2026-11-24T12:08:23Z. --- Claimed in #14 as [RT-DEPTH-SAME-BASE-SHAPES](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7131014204). Direct follow-up to #261, targeted at its branch so the review shows only this change. ### What and why Slot 133 can place multiple depth/UAV textures with different extents or array sizes at the same guest address. The existing placement table rejects the second shape. Keep a separate real attachment and storage-plane backing for each incompatible shape. Keep the shared backing for exact compatible placements. The caller still synchronizes a shape switch with an aliasing barrier and initializes the newly active texture. Distinct-base partial overlaps are still refused, including when a same-base group grows toward a neighboring placement. ### Tested - Windows, MSVC 2022 x64, RTX 4070 SUPER. All 14 focused tests passed on the local integration of #261, with zero skips. - A synthetic test switches between a small texture and a larger array at one base. It uses explicit alias barriers and full depth clears, writes through a UAV, and checks each layer by readback. It also covers exact alias sharing and range overlap checks. - The offline boot on the local integration advanced past the earlier slot 133 placement failure and reached a later exception. - This patch applies to the exact #261 head at `632cb75ad`. Diff and repository game-data checks passed. AI-assisted: yes (Codex).
MoonEyes commented 2026-11-29 14:40:08 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-29T14:40:08Z.


Closing: main already handles differently shaped depth textures at one base, in runtime/shims/d3d12_xs_placed_depth.h:104-107 (same_shape via compatible()), with tests in runtime/test/d3d12_placed_depth_test.h. Checked on current main just now. Reopen with a pointer if a case is still missing. Thanks!

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7257482407 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/689#issuecomment-7257482407). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-29T14:40:08Z. --- Closing: main already handles differently shaped depth textures at one base, in runtime/shims/d3d12_xs_placed_depth.h:104-107 (same_shape via compatible()), with tests in runtime/test/d3d12_placed_depth_test.h. Checked on current main just now. Reopen with a pointer if a case is still missing. Thanks!

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!689
No description provided.