From b44faa22ab27b9f486aa2c2e2897f59239eb51c1 Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Fri, 22 Nov 2024 08:48:43 +0200 Subject: [PATCH] anv: document the X4 Foundations workaround a bit more Signed-off-by: Lionel Landwerlin Reviewed-by: Ivan Briano Part-of: --- src/intel/vulkan/anv_descriptor_set.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/intel/vulkan/anv_descriptor_set.c b/src/intel/vulkan/anv_descriptor_set.c index d89049807d0..4b74b6ac180 100644 --- a/src/intel/vulkan/anv_descriptor_set.c +++ b/src/intel/vulkan/anv_descriptor_set.c @@ -1423,6 +1423,14 @@ VkResult anv_CreateDescriptorPool( ANV_PIPELINE_DESCRIPTOR_SET_LAYOUT_TYPE_INDIRECT : ANV_PIPELINE_DESCRIPTOR_SET_LAYOUT_TYPE_DIRECT; + /* Workaround application bugs when we're allocating surfaces & samplers in + * separate heaps (!indirect_descriptors). Some applications will specify a + * count of samplers too small and we might fail allocations in + * vkAllocateDescriptorsSets(). + * + * Find the highest count across all descriptor types and use that for + * samplers. + */ uint32_t max_descriptor_count = 0; if (device->physical->instance->anv_upper_bound_descriptor_pool_sampler && !device->physical->indirect_descriptors) {