[PR #1814] [MERGED] D3D-CLEAR-UAV-3D-SLICE: clear selected 3D UAV slices and rectangles #1828

Closed
opened 2026-11-26 21:19:06 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1814
Author: @timbot103
Created: 11/25/2026
Status: ✅ Merged
Merged: 11/25/2026
Merged by: @aslan2142

Base: main ← Head: d3d-clear-uav-3d-slice


📝 Commits (1)

  • 926e9d3 D3D-CLEAR-UAV-3D-SLICE: clear selected 3D UAV slices and rectangles

📊 Changes

9 files changed (+757 additions, -76 deletions)

View changed files

📝 docs/d3d12_vulkan.md (+15 -12)
📝 runtime/CMakeLists.txt (+1 -1)
📝 runtime/shims/d3d12_com.cpp (+19 -9)
📝 runtime/src/command_list.h (+2 -2)
📝 runtime/src/gfx10_descriptors.h (+16 -3)
📝 runtime/src/vulkan_replay.h (+54 -17)
📝 runtime/test/d3d12_texture_uav_test.cpp (+90 -5)
📝 runtime/test/d3d12_uav_clear_test.cpp (+299 -24)
📝 runtime/test/replay_uav_clear_offset_test.cpp (+261 -3)

📄 Description

Claimed in the coordination issue as: D3D-CLEAR-UAV-3D-SLICE

What and why

ClearUnorderedAccessViewUint and ClearUnorderedAccessViewFloat can now clear selected W slices of a 3D texture mip and apply XY rectangles to each selected slice. A tagged descriptor carries the W range through a descriptor copy. An untagged descriptor uses the bound resource's mip depth, and an unpredicated whole-mip clear uses the existing fast path.

The staged path fills up to 64 KiB of scratch once and reuses the pattern across tiles and slices. It supports direct and compute queues, clips rectangles to the mip, and orders overlapping writes. It refuses predicated staged clears and incompatible 3D view/backing formats. The existing packed RGB9E5 representation on R32_UINT is supported.

Tested

  • Built all 11 UAV/clear/replay test binaries and linked gta6rt with MSVC 2022, Ninja and RelWithDebInfo. A clean build matched the warning set on unmodified 0d80bc5df.
  • Ran 14 invocations on each GPU with Khronos validation and synchronization validation enabled and disabled. Across the four configurations, 52 invocations passed, two skipped and two failed. There were zero Vulkan validation errors.
  • Native D3D12 WARP and Vulkan produced identical Uint and Float readbacks for partial W clears and rectangles at mip 1. The comparison covered every texel on direct and dedicated compute queues, including the adjacent slices and mip. The full texture UAV test also passed 14 GPU cases, 10 compared with WARP, on both GPUs.
  • Both GPUs accepted a predicate on direct and compute lists using the graphics family, then refused a predicated staged clear. On the dedicated compute families the existing backend refused predicate capture before clear replay.
  • Regression controls caught both undersized and oversized untagged descriptor depths. Omitting the mip-1 RGB9E5 Uint write left 48 incorrect bytes in the seeded slice.
  • The RTX 5080 skipped the native RGB9E5 render-target probe in both modes. Radeon failed the existing default D32 NaN depth-clear test in both modes (15 texels read 1, WARP expected NaN). Both outcomes reproduced on unmodified 0d80bc5df. The 3D UAV clear tests passed in all four configurations.

GPUs tested: NVIDIA GeForce RTX 5080, driver 616.64, Vulkan 1.4.351; AMD Radeon(TM) Graphics, driver 25.10.30.02 (Windows 32.0.21030.2001), Vulkan 1.4.315. Both on Windows 11 Pro build 26200.

AI-assisted: yes (Gemini, Codex, Claude)

Checklist

  • Based on current main at 0d80bc5df.
  • One topic, 3D UAV clear ranges and rectangles.
  • No game data, keys or decryption. The repository content check passed for every changed file.
  • Translator contract table — not applicable to this runtime-only change.

🔄 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/1814 **Author:** [@timbot103](https://github.com/timbot103) **Created:** 11/25/2026 **Status:** ✅ Merged **Merged:** 11/25/2026 **Merged by:** [@aslan2142](https://github.com/aslan2142) **Base:** `main` ← **Head:** `d3d-clear-uav-3d-slice` --- ### 📝 Commits (1) - [`926e9d3`](https://github.com/ubiquitarianism/leonida/commit/926e9d3ef34649d2b39375fd12657d1f700aa779) D3D-CLEAR-UAV-3D-SLICE: clear selected 3D UAV slices and rectangles ### 📊 Changes **9 files changed** (+757 additions, -76 deletions) <details> <summary>View changed files</summary> 📝 `docs/d3d12_vulkan.md` (+15 -12) 📝 `runtime/CMakeLists.txt` (+1 -1) 📝 `runtime/shims/d3d12_com.cpp` (+19 -9) 📝 `runtime/src/command_list.h` (+2 -2) 📝 `runtime/src/gfx10_descriptors.h` (+16 -3) 📝 `runtime/src/vulkan_replay.h` (+54 -17) 📝 `runtime/test/d3d12_texture_uav_test.cpp` (+90 -5) 📝 `runtime/test/d3d12_uav_clear_test.cpp` (+299 -24) 📝 `runtime/test/replay_uav_clear_offset_test.cpp` (+261 -3) </details> ### 📄 Description Claimed in the coordination issue as: [D3D-CLEAR-UAV-3D-SLICE](https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7161533493) ### What and why `ClearUnorderedAccessViewUint` and `ClearUnorderedAccessViewFloat` can now clear selected W slices of a 3D texture mip and apply XY rectangles to each selected slice. A tagged descriptor carries the W range through a descriptor copy. An untagged descriptor uses the bound resource's mip depth, and an unpredicated whole-mip clear uses the existing fast path. The staged path fills up to 64 KiB of scratch once and reuses the pattern across tiles and slices. It supports direct and compute queues, clips rectangles to the mip, and orders overlapping writes. It refuses predicated staged clears and incompatible 3D view/backing formats. The existing packed RGB9E5 representation on R32_UINT is supported. ### Tested - Built all 11 UAV/clear/replay test binaries and linked `gta6rt` with MSVC 2022, Ninja and `RelWithDebInfo`. A clean build matched the warning set on unmodified `0d80bc5df`. - Ran 14 invocations on each GPU with Khronos validation and synchronization validation enabled and disabled. Across the four configurations, 52 invocations passed, two skipped and two failed. There were zero Vulkan validation errors. - Native D3D12 WARP and Vulkan produced identical Uint and Float readbacks for partial W clears and rectangles at mip 1. The comparison covered every texel on direct and dedicated compute queues, including the adjacent slices and mip. The full texture UAV test also passed 14 GPU cases, 10 compared with WARP, on both GPUs. - Both GPUs accepted a predicate on direct and compute lists using the graphics family, then refused a predicated staged clear. On the dedicated compute families the existing backend refused predicate capture before clear replay. - Regression controls caught both undersized and oversized untagged descriptor depths. Omitting the mip-1 RGB9E5 Uint write left 48 incorrect bytes in the seeded slice. - The RTX 5080 skipped the native RGB9E5 render-target probe in both modes. Radeon failed the existing default D32 NaN depth-clear test in both modes (15 texels read `1`, WARP expected NaN). Both outcomes reproduced on unmodified `0d80bc5df`. The 3D UAV clear tests passed in all four configurations. GPUs tested: NVIDIA GeForce RTX 5080, driver 616.64, Vulkan 1.4.351; AMD Radeon(TM) Graphics, driver 25.10.30.02 (Windows 32.0.21030.2001), Vulkan 1.4.315. Both on Windows 11 Pro build 26200. AI-assisted: yes (Gemini, Codex, Claude) ### Checklist - [x] Based on current `main` at `0d80bc5df`. - [x] One topic, 3D UAV clear ranges and rectangles. - [x] No game data, keys or decryption. The repository content check passed for every changed file. - [x] Translator contract table — not applicable to this runtime-only change. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 21:19:06 +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#1828
No description provided.