Skip to content
Snippets Groups Projects

vkd3d: Disable push descriptors when that's helpful to stay within 8 descriptor sets.

Merged Giovanni Mascellani requested to merge giomasce/vkd3d:eyjafjallajokull into master
1 unresolved thread
2 files
+ 27
4
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 27
0
@@ -1918,6 +1918,26 @@ static HRESULT vkd3d_init_device_caps(struct d3d12_device *device,
&& descriptor_indexing->descriptorBindingUniformTexelBufferUpdateAfterBind
&& descriptor_indexing->descriptorBindingStorageTexelBufferUpdateAfterBind;
/* Many Vulkan implementations allow up to 8 descriptor sets. Unfortunately
* using vkd3d with Vulkan heaps and push descriptors currently requires up
* to 9 descriptor sets (up to one for the push descriptors, up to one for
* the static samplers and seven for Vulkan heaps, one for each needed
* descriptor type). If we detect such situation, we disable push
* descriptors, which allows us to stay within the limits (not doing so is
* fatal on many implmentations).
*
* It is possible that a different strategy might be used. For example, we
* could move the static samplers to one of the seven Vulkan heaps sets. Or
* we could decide whether to create the push descriptor set when creating
* the root signature, depending on whether there are static samplers or
* not. */
if (device->vk_info.device_limits.maxBoundDescriptorSets == 8 && device->use_vk_heaps
&& device->vk_info.KHR_push_descriptor)
{
TRACE("Disabling VK_KHR_push_descriptor to save a descriptor set.\n");
device->vk_info.KHR_push_descriptor = VK_FALSE;
}
if (device->use_vk_heaps)
vkd3d_device_vk_heaps_descriptor_limits_init(&vulkan_info->descriptor_limits,
&physical_device_info->descriptor_indexing_properties);
@@ -1925,6 +1945,13 @@ static HRESULT vkd3d_init_device_caps(struct d3d12_device *device,
vkd3d_device_descriptor_limits_init(&vulkan_info->descriptor_limits,
&physical_device_info->properties2.properties.limits);
TRACE("Device %p: using %s descriptor heaps, with%s descriptor indexing, "
"with%s push descriptors, with%s mutable descriptors\n",
device, device->use_vk_heaps ? "Vulkan" : "virtual",
device->vk_info.EXT_descriptor_indexing ? "" : "out",
device->vk_info.KHR_push_descriptor ? "" : "out",
device->vk_info.EXT_mutable_descriptor_type ? "" : "out");
vkd3d_chain_physical_device_info_structures(physical_device_info, device);
return S_OK;
Loading