[Mesa-dev] [PATCH 4/7] anv: descriptorPool: allocate additional space for a hidden ubo

Lionel Landwerlin llandwerlin at gmail.com
Mon Nov 21 17:47:37 UTC 2016


This additional buffer will store workaround border colors for integer
formats on Gen7.5.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
---
 src/intel/vulkan/anv_descriptor_set.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/src/intel/vulkan/anv_descriptor_set.c b/src/intel/vulkan/anv_descriptor_set.c
index 82f2d1e..30aa50e 100644
--- a/src/intel/vulkan/anv_descriptor_set.c
+++ b/src/intel/vulkan/anv_descriptor_set.c
@@ -371,6 +371,24 @@ VkResult anv_CreateDescriptorPool(
       }
    }
 
+   if (device->info.is_haswell) {
+      uint32_t sampler_count = 0;
+      for (uint32_t i = 0; i < pCreateInfo->poolSizeCount; i++) {
+         switch (pCreateInfo->pPoolSizes[i].type) {
+         case VK_DESCRIPTOR_TYPE_SAMPLER:
+         case VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER:
+            sampler_count += pCreateInfo->pPoolSizes[i].descriptorCount;
+            break;
+         default:
+            break;
+         }
+      }
+      if (sampler_count > 0) {
+         buffer_count++;
+         descriptor_count++;
+      }
+   }
+
    const size_t size =
       sizeof(*pool) +
       pCreateInfo->maxSets * sizeof(struct anv_descriptor_set) +
-- 
2.10.2



More information about the mesa-dev mailing list