[PR #1164] d3d12: choose sparse-capable queues for sparse textures (D3D-SPARSE-IMAGE-QUEUE-FAMILY) #1195

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

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1164
Author: @lixonik
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: d3d-sparse-image-queue-family


📝 Commits (1)

  • fb50e0b Select sparse-capable queues for image-only residency

📊 Changes

3 files changed (+30 additions, -24 deletions)

View changed files

📝 runtime/shims/d3d12_vulkan_device.cpp (+4 -10)
📝 runtime/src/queue_families.h (+9 -8)
📝 runtime/test/vk_queue_test.cpp (+17 -6)

📄 Description

Claimed in the coordination issue as D3D-SPARSE-IMAGE-QUEUE-FAMILY.

What and why

Queue selection used sparse buffer residency as its gate, while the device can expose sparse 2D textures independently. With sparse textures and no sparse buffers, a D3D12 COPY or COMPUTE queue could keep a dedicated Vulkan queue without VK_QUEUE_SPARSE_BINDING_BIT. Tile mapping on that queue would then pass an invalid queue to vkQueueBindSparse.

Use the same sparse aliasing prerequisites for device initialization and queue selection. Apply the fallback when either sparse buffer or sparse 2D image residency is available, retaining dedicated queues that support sparse binding. Add a synthetic image-only case to the queue-family picker tests.

Tested

  • With the former buffer-only gate restored, the new image-only assertion fails. With the fix, the synthetic picker passes all seven layouts on Windows with MSVC and on Ubuntu with GCC.
  • Compiled the modified Windows runtime translation unit and vk_queue_test.cpp with MSVC.
  • The Ubuntu vk_queue_test also passed the CPU queue-slot checks. Its GPU portion reported skip because the local Ubuntu environment has no Vulkan loader.
  • Full translator semantic suite passed (470 files, 6,141 tests). Python compile checks and make_game.py --help passed.
  • git diff --check and scripts/check_no_game_data.py passed.

GPUs tested: n/a (CPU-only synthetic checks).

AI-assisted.

Checklist

  • Based on current main.
  • One topic.
  • No game data, keys or decryption.
  • No new 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/1164 **Author:** [@lixonik](https://github.com/lixonik) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `d3d-sparse-image-queue-family` --- ### 📝 Commits (1) - [`fb50e0b`](https://github.com/ubiquitarianism/leonida/commit/fb50e0b14f7c9bd0d56abcdb01841fc1226a17b6) Select sparse-capable queues for image-only residency ### 📊 Changes **3 files changed** (+30 additions, -24 deletions) <details> <summary>View changed files</summary> 📝 `runtime/shims/d3d12_vulkan_device.cpp` (+4 -10) 📝 `runtime/src/queue_families.h` (+9 -8) 📝 `runtime/test/vk_queue_test.cpp` (+17 -6) </details> ### 📄 Description Claimed in the coordination issue as [D3D-SPARSE-IMAGE-QUEUE-FAMILY](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7142010267). ### What and why Queue selection used sparse buffer residency as its gate, while the device can expose sparse 2D textures independently. With sparse textures and no sparse buffers, a D3D12 COPY or COMPUTE queue could keep a dedicated Vulkan queue without `VK_QUEUE_SPARSE_BINDING_BIT`. Tile mapping on that queue would then pass an invalid queue to `vkQueueBindSparse`. Use the same sparse aliasing prerequisites for device initialization and queue selection. Apply the fallback when either sparse buffer or sparse 2D image residency is available, retaining dedicated queues that support sparse binding. Add a synthetic image-only case to the queue-family picker tests. ### Tested - With the former buffer-only gate restored, the new image-only assertion fails. With the fix, the synthetic picker passes all seven layouts on Windows with MSVC and on Ubuntu with GCC. - Compiled the modified Windows runtime translation unit and `vk_queue_test.cpp` with MSVC. - The Ubuntu `vk_queue_test` also passed the CPU queue-slot checks. Its GPU portion reported skip because the local Ubuntu environment has no Vulkan loader. - Full translator semantic suite passed (470 files, 6,141 tests). Python compile checks and `make_game.py --help` passed. - `git diff --check` and `scripts/check_no_game_data.py` passed. GPUs tested: n/a (CPU-only synthetic checks). AI-assisted. ### Checklist - [x] Based on current `main`. - [x] One topic. - [x] No game data, keys or decryption. - [x] No new translator rule. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#1195
No description provided.