vkd3d: Lay out virtual descriptor heap buffer and image bindings consecutively instead of interleaving them.

Slightly simplifies descriptor write addressing, and makes layouts
essentially the same as array layouts, differing only in the binding
details, and therefore easier to understand. This also simplifies the
addition of storage buffer bindings, which can all be added onto the end.
This commit is contained in:
Conor McCarthy
2024-09-13 00:23:06 +10:00
committed by Henri Verbeet
parent 0b8a53d75d
commit bfaab9700d
Notes: Henri Verbeet 2024-10-17 17:39:00 +02:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Conor McCarthy (@cmccarthy)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1070
2 changed files with 10 additions and 6 deletions

View File

@@ -2795,7 +2795,7 @@ static bool vk_write_descriptor_set_from_d3d12_desc(VkWriteDescriptorSet *vk_des
/* We use separate bindings for buffer and texture SRVs/UAVs.
* See d3d12_root_signature_init(). For unbounded ranges the
* descriptors exist in two consecutive sets, otherwise they occur
* in pairs in one set. */
* as consecutive ranges within a set. */
if (range->descriptor_count == UINT_MAX)
{
if (vk_descriptor_type != VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER
@@ -2807,11 +2807,9 @@ static bool vk_write_descriptor_set_from_d3d12_desc(VkWriteDescriptorSet *vk_des
}
else
{
if (!use_array)
vk_descriptor_write->dstBinding = vk_binding + 2 * index;
if (vk_descriptor_type != VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER
&& vk_descriptor_type != VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER)
++vk_descriptor_write->dstBinding;
vk_descriptor_write->dstBinding += use_array ? 1 : range->descriptor_count;
}
if (vk_descriptor_type == VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER