[PR #1128] [CLOSED] d3d12: support 3D depth resources and slice clears #1162

Closed
opened 2026-11-26 20:20:17 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1128
Author: @bobcatchris
Created: 11/24/2026
Status: ❌ Closed

Base: main ← Head: fix/3d-depth-resource


📝 Commits (1)

  • b5998c8 d3d12: support 3D depth resources and slice clears

📊 Changes

6 files changed (+190 additions, -19 deletions)

View changed files

📝 docs/d3d12_vulkan.md (+4 -3)
📝 runtime/shims/d3d12_vulkan_device.cpp (+5 -6)
📝 runtime/src/vulkan_backend.h (+5 -3)
📝 runtime/src/vulkan_replay.h (+18 -6)
📝 runtime/test/d3d12_clear_test.cpp (+128 -0)
📝 runtime/test/replay_clear_gate_test.cpp (+30 -1)

📄 Description

Claimed in the coordination issue as: D3D-3D-DEPTH-RESOURCE

Depends on: none

Fixes: none

What and why

Native D3D12 accepts a single-sample TEXTURE3D resource with ALLOW_DEPTH_STENCIL, while Leonida refused it in both format selection and allocation validation. This removes those refusals, creates Vulkan 3D depth images with VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT, allows depth/stencil aspects in volume subresource ranges, and clears a partial-volume DSV through a 2D-array attachment view instead of incorrectly clearing the whole volume. Typeless depth attachment views now request depth/stencil usage rather than color-attachment usage. Original finding and Vulkan feasibility evidence by @Dezmonius.

Tested

  • Baseline replay_clear_gate_test with the new cases: 3 failures (slice clear path, selected W slice, whole-volume path).
  • Patched replay_clear_gate_test: passes.
  • Patched full runtime build (gta6rt, TLS host, d3d12_clear_test): succeeds with MSVC 19.44.
  • LEONIDA_VK_VALIDATION=1 d3d12_clear_test --volume: passes on RX 7900 XTX; the new 3D-depth case correctly skips because this AMD driver reports no support for the required 3D D16 format/usage/flags combination. Existing 3D RTV readback remains validation-clean.
  • ctest -R "^(replay_clear_gate|gfx10_descriptors)$": 2/2 passed.
  • Docs CLI-flag and link tests: 4/4 and 16/16 passed.
  • scripts/check_no_game_data.py: clean; patch security sweep: 0 hits.

GPUs tested: AMD Radeon RX 7900 XTX, driver 32.0.32029.2010, Windows 11 (new GPU case skipped: 3D D16 depth unsupported; CPU replay path and existing volume RTV validated)

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly.
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption, including in logs or reports quoted here.
  • N/A — not a translator rule.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/1128 **Author:** [@bobcatchris](https://github.com/bobcatchris) **Created:** 11/24/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/3d-depth-resource` --- ### 📝 Commits (1) - [`b5998c8`](https://github.com/ubiquitarianism/leonida/commit/b5998c82ae89467ffc2b7fd51656e0ae15270718) d3d12: support 3D depth resources and slice clears ### 📊 Changes **6 files changed** (+190 additions, -19 deletions) <details> <summary>View changed files</summary> 📝 `docs/d3d12_vulkan.md` (+4 -3) 📝 `runtime/shims/d3d12_vulkan_device.cpp` (+5 -6) 📝 `runtime/src/vulkan_backend.h` (+5 -3) 📝 `runtime/src/vulkan_replay.h` (+18 -6) 📝 `runtime/test/d3d12_clear_test.cpp` (+128 -0) 📝 `runtime/test/replay_clear_gate_test.cpp` (+30 -1) </details> ### 📄 Description Claimed in the coordination issue as: D3D-3D-DEPTH-RESOURCE Depends on: none Fixes: none ### What and why Native D3D12 accepts a single-sample `TEXTURE3D` resource with `ALLOW_DEPTH_STENCIL`, while Leonida refused it in both format selection and allocation validation. This removes those refusals, creates Vulkan 3D depth images with `VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT`, allows depth/stencil aspects in volume subresource ranges, and clears a partial-volume DSV through a 2D-array attachment view instead of incorrectly clearing the whole volume. Typeless depth attachment views now request depth/stencil usage rather than color-attachment usage. Original finding and Vulkan feasibility evidence by @Dezmonius. ### Tested - Baseline `replay_clear_gate_test` with the new cases: 3 failures (slice clear path, selected W slice, whole-volume path). - Patched `replay_clear_gate_test`: passes. - Patched full runtime build (`gta6rt`, TLS host, `d3d12_clear_test`): succeeds with MSVC 19.44. - `LEONIDA_VK_VALIDATION=1 d3d12_clear_test --volume`: passes on RX 7900 XTX; the new 3D-depth case correctly skips because this AMD driver reports no support for the required 3D D16 format/usage/flags combination. Existing 3D RTV readback remains validation-clean. - `ctest -R "^(replay_clear_gate|gfx10_descriptors)$"`: 2/2 passed. - Docs CLI-flag and link tests: 4/4 and 16/16 passed. - `scripts/check_no_game_data.py`: clean; patch security sweep: 0 hits. GPUs tested: AMD Radeon RX 7900 XTX, driver 32.0.32029.2010, Windows 11 (new GPU case skipped: 3D D16 depth unsupported; CPU replay path and existing volume RTV validated) AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly. - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption, including in logs or reports quoted here. - [x] N/A — not a translator rule. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:20:17 +01:00
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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.

Dependencies

No dependencies set

Reference
starred/leonida#1162
No description provided.