diff options
| author | ItsNotRexed <300290919+ItsNotRexed@users.noreply.github.com> | 2026-11-22 17:03:12 -0500 |
|---|---|---|
| committer | ItsNotRexed <300290919+ItsNotRexed@users.noreply.github.com> | 2026-11-22 17:03:12 -0500 |
| commit | 1f96ec3c5f99f9af4800fcfb1102a8d9a8bd4b87 (patch) | |
| tree | f0c103ae2de400ca6cbc0d28fe1c67002b187ba3 /runtime/src | |
| parent | 269c34b485fb48f544f6b82b3fa7bd2f64145582 (diff) | |
| parent | 389f949bc99d544aab0c870ea78216d497288b03 (diff) | |
Merge pull request #3652 from pmilewsskiedu-gif
Diffstat (limited to 'runtime/src')
| -rw-r--r-- | runtime/src/queue_families.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/runtime/src/queue_families.h b/runtime/src/queue_families.h index 32ef1eb1d..e7dd50fe6 100644 --- a/runtime/src/queue_families.h +++ b/runtime/src/queue_families.h | |||
| @@ -45,4 +45,24 @@ inline QueueFamilies pick_queue_families(std::span<const VkQueueFamilyProperties | |||
| 45 | return out; | 45 | return out; |
| 46 | } | 46 | } |
| 47 | 47 | ||
| 48 | // A D3D12 COPY/COMPUTE queue may call UpdateTileMappings at any time. Vulkan binds sparse | ||
| 49 | // pages on the VkQueue itself, so a family without SPARSE_BINDING cannot back that D3D12 | ||
| 50 | // queue when reserved buffers are offered. Use the graphics family (already checked for | ||
| 51 | // sparse support by the device) rather than submitting an invalid vkQueueBindSparse. | ||
| 52 | // Kept separate from the preference-only picker so devices without sparse resources keep | ||
| 53 | // their dedicated async families unchanged. | ||
| 54 | inline QueueFamilies sparse_capable_queue_families(std::span<const VkQueueFamilyProperties> families, | ||
| 55 | QueueFamilies chosen, bool sparse_buffers) { | ||
| 56 | if (!sparse_buffers || chosen.direct >= families.size() || | ||
| 57 | !(families[chosen.direct].queueFlags & VK_QUEUE_SPARSE_BINDING_BIT)) | ||
| 58 | return chosen; | ||
| 59 | if (chosen.compute >= families.size() || | ||
| 60 | !(families[chosen.compute].queueFlags & VK_QUEUE_SPARSE_BINDING_BIT)) | ||
| 61 | chosen.compute = chosen.direct; | ||
| 62 | if (chosen.copy >= families.size() || | ||
| 63 | !(families[chosen.copy].queueFlags & VK_QUEUE_SPARSE_BINDING_BIT)) | ||
| 64 | chosen.copy = chosen.direct; | ||
| 65 | return chosen; | ||
| 66 | } | ||
| 67 | |||
| 48 | } // namespace leonida | 68 | } // namespace leonida |