[PR #1860] [MERGED] D3D-3D-VIEW-ARRAY-RANGE: use the single array layer for Vulkan 3D views #1873

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

📋 Pull Request Information

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

Base: main ← Head: fix/title-3d-view-array-range


📝 Commits (1)

  • 8573141 Use the single Vulkan array layer for 3D image views

📊 Changes

3 files changed (+35 additions, -6 deletions)

View changed files

📝 runtime/shims/d3d12_vulkan_device.cpp (+6 -6)
📝 runtime/src/gfx10_descriptors.h (+10 -0)
📝 runtime/test/gfx10_descriptors_test.cpp (+19 -0)

📄 Description

Claimed in the coordination issue as: D3D-3D-VIEW-ARRAY-RANGE

What and why

A title-written GFX10 Texture3D descriptor can carry a nonzero BASE_ARRAY in the same word as its depth. The runtime used that field as Vulkan's baseArrayLayer. Both the sampled and storage image view creation paths now use array layer zero and a count of one for a 3D view. Mips, aspects, 2D array layers and the original descriptor bytes used as the bindless key are preserved.

In GFX10 SRV mode, hardware ignores the volume's BASE_ARRAY. In raw UAV mode it is a W-slice offset. The raw descriptor path refuses that offset rather than binding a whole-mip storage view in its place. The API path continues to use Vulkan's sliced-view extension for partial D3D12 Texture3D UAVs.

Runtime finding · Mesa's GFX10 descriptor builder · Vulkan image view valid usage

Tested

  • Built and ran gfx10_descriptors_test directly with MSVC. The new assertions cover sampled 3D T#s with nonzero BASE_ARRAY, recognition of a raw UAV W-slice offset, the mip range and 2D array layers. Restoring the old range mapping made the new 3D assertion fail.
  • Ran a synthetic Vulkan A/B test on lavapipe with Khronos Validation 1.3.204. A 33×33×33 storage-capable volume and nonzero BASE_ARRAY triggered the older layer's 01482 and 01483 VUIDs with the old range. The fixed range created the view with zero validation errors.
  • python -I -B scripts/run_semantic_tests.py tests/semantic passed 6,261 tests across 489 files.
  • Full Windows shim and game boot were outside these results. CMake requires Windows SDK 10.0.26100 or newer for the shim build.

GPUs tested: n/a (software Vulkan on lavapipe)

AI-assisted.

Checklist

  • Based on current main and merges cleanly.
  • One topic.
  • No game data, keys or decryption.

🔄 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/1860 **Author:** [@lixonik](https://github.com/lixonik) **Created:** 11/25/2026 **Status:** ✅ Merged **Merged:** 11/25/2026 **Merged by:** [@aslan2142](https://github.com/aslan2142) **Base:** `main` ← **Head:** `fix/title-3d-view-array-range` --- ### 📝 Commits (1) - [`8573141`](https://github.com/ubiquitarianism/leonida/commit/857314142c35983b792ca49652a25bb16ffb9371) Use the single Vulkan array layer for 3D image views ### 📊 Changes **3 files changed** (+35 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `runtime/shims/d3d12_vulkan_device.cpp` (+6 -6) 📝 `runtime/src/gfx10_descriptors.h` (+10 -0) 📝 `runtime/test/gfx10_descriptors_test.cpp` (+19 -0) </details> ### 📄 Description Claimed in the coordination issue as: [D3D-3D-VIEW-ARRAY-RANGE](https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7163394940) ### What and why A title-written GFX10 Texture3D descriptor can carry a nonzero `BASE_ARRAY` in the same word as its depth. The runtime used that field as Vulkan's `baseArrayLayer`. Both the sampled and storage image view creation paths now use array layer zero and a count of one for a 3D view. Mips, aspects, 2D array layers and the original descriptor bytes used as the bindless key are preserved. In GFX10 SRV mode, hardware ignores the volume's `BASE_ARRAY`. In raw UAV mode it is a W-slice offset. The raw descriptor path refuses that offset rather than binding a whole-mip storage view in its place. The API path continues to use Vulkan's sliced-view extension for partial D3D12 Texture3D UAVs. [Runtime finding](https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7163255196) · [Mesa's GFX10 descriptor builder](https://chromium.googlesource.com/external/gitlab.freedesktop.org/mesa/mesa/+/418c4cfa6708a0e0b1175e72fb8fd27d3ca1615a/src/amd/common/ac_descriptors.c#533) · [Vulkan image view valid usage](https://docs.vulkan.org/refpages/latest/refpages/source/VkImageViewCreateInfo.html) ### Tested - Built and ran `gfx10_descriptors_test` directly with MSVC. The new assertions cover sampled 3D T#s with nonzero `BASE_ARRAY`, recognition of a raw UAV W-slice offset, the mip range and 2D array layers. Restoring the old range mapping made the new 3D assertion fail. - Ran a synthetic Vulkan A/B test on lavapipe with Khronos Validation 1.3.204. A 33×33×33 storage-capable volume and nonzero `BASE_ARRAY` triggered the older layer's 01482 and 01483 VUIDs with the old range. The fixed range created the view with zero validation errors. - `python -I -B scripts/run_semantic_tests.py tests/semantic` passed 6,261 tests across 489 files. - Full Windows shim and game boot were outside these results. CMake requires Windows SDK 10.0.26100 or newer for the shim build. GPUs tested: n/a (software Vulkan on lavapipe) AI-assisted. ### Checklist - [x] Based on current `main` and merges cleanly. - [x] One topic. - [x] No game data, keys or decryption. --- <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:15 +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#1873
No description provided.