Bug 14644 - add poolUsage/maxSets to VkDescriptorPoolCreateInfo
authorCourtney Goeltzenleuchter <courtney@LunarG.com>
Wed, 16 Sep 2015 22:12:45 +0000 (16:12 -0600)
committerCourtney Goeltzenleuchter <courtney@LunarG.com>
Thu, 17 Sep 2015 21:32:11 +0000 (15:32 -0600)
Bug 14644 - vkCreateDescriptorPool should have poolUsage/maxSets as part of VkDescriptorPoolCreateInfo
merge request #342

demos/cube.c
demos/tri.c
icd/nulldrv/nulldrv.c
include/vulkan.h
layers/draw_state.cpp
layers/param_checker.cpp
loader/trampoline.c
vulkan.py

index aa74335585456bc6ae520cde82519729ed06197d..49eb5835003fc691ef23c64cc6ae0b203f1529c8 100644 (file)
@@ -1775,13 +1775,14 @@ static void demo_prepare_descriptor_pool(struct demo *demo)
     const VkDescriptorPoolCreateInfo descriptor_pool = {
         .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO,
         .pNext = NULL,
+        .poolUsage = VK_DESCRIPTOR_POOL_USAGE_ONE_SHOT,
+        .maxSets = 1,
         .count = 2,
         .pTypeCount = type_counts,
     };
     VkResult U_ASSERT_ONLY err;
 
     err = vkCreateDescriptorPool(demo->device,
-            VK_DESCRIPTOR_POOL_USAGE_ONE_SHOT, 1,
             &descriptor_pool, &demo->desc_pool);
     assert(!err);
 }
index 57661395c4a75d612f3289d9b0f402eb94e2eb18..2f6b81e89f49323bc89b8dab661e6ee15663635f 100644 (file)
@@ -1415,13 +1415,14 @@ static void demo_prepare_descriptor_pool(struct demo *demo)
     const VkDescriptorPoolCreateInfo descriptor_pool = {
         .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO,
         .pNext = NULL,
+        .poolUsage = VK_DESCRIPTOR_POOL_USAGE_ONE_SHOT,
+        .maxSets = 1,
         .count = 1,
         .pTypeCount = &type_count,
     };
     VkResult U_ASSERT_ONLY err;
 
     err = vkCreateDescriptorPool(demo->device,
-            VK_DESCRIPTOR_POOL_USAGE_ONE_SHOT, 1,
             &descriptor_pool, &demo->desc_pool);
     assert(!err);
 }
index bb67967b22c4ec3e3b7dcfe671947c7821134078..12015e39eb2c54c0809ecbbbd626e9e89a479dfc 100644 (file)
@@ -610,8 +610,6 @@ static VkResult nulldrv_cmd_create(struct nulldrv_dev *dev,
 }
 
 static VkResult nulldrv_desc_pool_create(struct nulldrv_dev *dev,
-                                    VkDescriptorPoolUsage usage,
-                                    uint32_t max_sets,
                                     const VkDescriptorPoolCreateInfo *info,
                                     struct nulldrv_desc_pool **pool_ret)
 {
@@ -2273,16 +2271,14 @@ ICD_EXPORT void VKAPI vkDestroyPipelineLayout(
 }
 
 ICD_EXPORT VkResult VKAPI vkCreateDescriptorPool(
-    VkDevice                                   device,
-    VkDescriptorPoolUsage                  poolUsage,
-    uint32_t                                     maxSets,
-    const VkDescriptorPoolCreateInfo*     pCreateInfo,
-    VkDescriptorPool*                       pDescriptorPool)
+    VkDevice                                    device,
+    const VkDescriptorPoolCreateInfo*           pCreateInfo,
+    VkDescriptorPool*                           pDescriptorPool)
 {
     NULLDRV_LOG_FUNC;
     struct nulldrv_dev *dev = nulldrv_dev(device);
 
-    return nulldrv_desc_pool_create(dev, poolUsage, maxSets, pCreateInfo,
+    return nulldrv_desc_pool_create(dev, pCreateInfo,
             (struct nulldrv_desc_pool **) pDescriptorPool);
 }
 
index 25d25eec6dd6964a13d7bf50af054501d5ca583a..e63841fd3b6b0f3754018e32e71d36b1276912f5 100644 (file)
@@ -41,7 +41,7 @@ extern "C" {
     ((major << 22) | (minor << 12) | patch)
 
 // Vulkan API version supported by this file
-#define VK_API_VERSION VK_MAKE_VERSION(0, 168, 0)
+#define VK_API_VERSION VK_MAKE_VERSION(0, 169, 0)
 
 
 #if defined(__cplusplus) && (_MSC_VER >= 1800 || __cplusplus >= 201103L)
@@ -1763,6 +1763,8 @@ typedef struct {
 typedef struct {
     VkStructureType                             sType;
     const void*                                 pNext;
+    VkDescriptorPoolUsage                       poolUsage;
+    uint32_t                                    maxSets;
     uint32_t                                    count;
     const VkDescriptorTypeCount*                pTypeCount;
 } VkDescriptorPoolCreateInfo;
@@ -2175,7 +2177,7 @@ typedef VkResult (VKAPI *PFN_vkCreateSampler)(VkDevice device, const VkSamplerCr
 typedef void (VKAPI *PFN_vkDestroySampler)(VkDevice device, VkSampler sampler);
 typedef VkResult (VKAPI *PFN_vkCreateDescriptorSetLayout)(VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, VkDescriptorSetLayout* pSetLayout);
 typedef void (VKAPI *PFN_vkDestroyDescriptorSetLayout)(VkDevice device, VkDescriptorSetLayout descriptorSetLayout);
-typedef VkResult (VKAPI *PFN_vkCreateDescriptorPool)(VkDevice device, VkDescriptorPoolUsage poolUsage, uint32_t maxSets, const VkDescriptorPoolCreateInfo* pCreateInfo, VkDescriptorPool* pDescriptorPool);
+typedef VkResult (VKAPI *PFN_vkCreateDescriptorPool)(VkDevice device, const VkDescriptorPoolCreateInfo* pCreateInfo, VkDescriptorPool* pDescriptorPool);
 typedef void (VKAPI *PFN_vkDestroyDescriptorPool)(VkDevice device, VkDescriptorPool descriptorPool);
 typedef VkResult (VKAPI *PFN_vkResetDescriptorPool)(VkDevice device, VkDescriptorPool descriptorPool);
 typedef VkResult (VKAPI *PFN_vkAllocDescriptorSets)(VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorSetUsage setUsage, uint32_t count, const VkDescriptorSetLayout* pSetLayouts, VkDescriptorSet* pDescriptorSets);
@@ -2651,8 +2653,6 @@ void VKAPI vkDestroyDescriptorSetLayout(
 
 VkResult VKAPI vkCreateDescriptorPool(
     VkDevice                                    device,
-    VkDescriptorPoolUsage                       poolUsage,
-    uint32_t                                    maxSets,
     const VkDescriptorPoolCreateInfo*           pCreateInfo,
     VkDescriptorPool*                           pDescriptorPool);
 
index 172260eb7be85529dae02f3bf4115b15f7e105fc..78304fb4f45311e46c871b78d3ff40fc140e394f 100644 (file)
@@ -1840,9 +1840,9 @@ VkResult VKAPI vkCreatePipelineLayout(VkDevice device, const VkPipelineLayoutCre
     return result;
 }
 
-VK_LAYER_EXPORT VkResult VKAPI vkCreateDescriptorPool(VkDevice device, VkDescriptorPoolUsage poolUsage, uint32_t maxSets, const VkDescriptorPoolCreateInfo* pCreateInfo, VkDescriptorPool* pDescriptorPool)
+VK_LAYER_EXPORT VkResult VKAPI vkCreateDescriptorPool(VkDevice device, const VkDescriptorPoolCreateInfo* pCreateInfo, VkDescriptorPool* pDescriptorPool)
 {
-    VkResult result = get_dispatch_table(draw_state_device_table_map, device)->CreateDescriptorPool(device, poolUsage, maxSets, pCreateInfo, pDescriptorPool);
+    VkResult result = get_dispatch_table(draw_state_device_table_map, device)->CreateDescriptorPool(device, pCreateInfo, pDescriptorPool);
     if (VK_SUCCESS == result) {
         // Insert this pool into Global Pool LL at head
         if (log_msg(mdd(device), VK_DBG_REPORT_INFO_BIT, VK_OBJECT_TYPE_DESCRIPTOR_POOL, (*pDescriptorPool).handle, 0, DRAWSTATE_OUT_OF_MEMORY, "DS",
@@ -1863,8 +1863,8 @@ VK_LAYER_EXPORT VkResult VKAPI vkCreateDescriptorPool(VkDevice device, VkDescrip
                 pNewNode->createInfo.pTypeCount = new VkDescriptorTypeCount[typeCountSize];
                 memcpy((void*)pNewNode->createInfo.pTypeCount, pCreateInfo->pTypeCount, typeCountSize);
             }
-            pNewNode->poolUsage  = poolUsage;
-            pNewNode->maxSets      = maxSets;
+            pNewNode->poolUsage  = pCreateInfo->poolUsage;
+            pNewNode->maxSets      = pCreateInfo->maxSets;
             pNewNode->pool       = *pDescriptorPool;
             poolMap[pDescriptorPool->handle] = pNewNode;
         }
index 583363ae7e0258f9fa06670ded7accb2dd5d93be..3b3cc0681ecfaea664a218f759b458918eab59f2 100644 (file)
@@ -4741,6 +4741,7 @@ bool PostCreateDescriptorPool(
         return false;
     }
 
+    /* TODOVV: How do we validate maxSets? Probably belongs in the limits layer? */
 
     if(pDescriptorPool != nullptr)
     {
@@ -4758,16 +4759,14 @@ bool PostCreateDescriptorPool(
 
 VK_LAYER_EXPORT VkResult VKAPI vkCreateDescriptorPool(
     VkDevice device,
-    VkDescriptorPoolUsage poolUsage,
-    uint32_t maxSets,
     const VkDescriptorPoolCreateInfo* pCreateInfo,
     VkDescriptorPool* pDescriptorPool)
 {
     PreCreateDescriptorPool(device, pCreateInfo);
 
-    VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateDescriptorPool(device, poolUsage, maxSets, pCreateInfo, pDescriptorPool);
+    VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateDescriptorPool(device, pCreateInfo, pDescriptorPool);
 
-    PostCreateDescriptorPool(device, poolUsage, maxSets, pDescriptorPool, result);
+    PostCreateDescriptorPool(device, pCreateInfo->poolUsage, pCreateInfo->maxSets, pDescriptorPool, result);
 
     return result;
 }
index b24e82256c15ad1f4f49a85ddc47f9641648f05e..ee0a46951b0240d73c585fa0a19c549c1b29e73d 100644 (file)
@@ -925,13 +925,13 @@ LOADER_EXPORT void VKAPI vkDestroyDescriptorSetLayout(VkDevice device, VkDescrip
     disp->DestroyDescriptorSetLayout(device, descriptorSetLayout);
 }
 
-LOADER_EXPORT VkResult VKAPI vkCreateDescriptorPool(VkDevice device, VkDescriptorPoolUsage poolUsage, uint32_t maxSets, const VkDescriptorPoolCreateInfo* pCreateInfo, VkDescriptorPool* pDescriptorPool)
+LOADER_EXPORT VkResult VKAPI vkCreateDescriptorPool(VkDevice device, const VkDescriptorPoolCreateInfo* pCreateInfo, VkDescriptorPool* pDescriptorPool)
 {
     const VkLayerDispatchTable *disp;
 
     disp = loader_get_dispatch(device);
 
-    return disp->CreateDescriptorPool(device, poolUsage, maxSets, pCreateInfo, pDescriptorPool);
+    return disp->CreateDescriptorPool(device, pCreateInfo, pDescriptorPool);
 }
 
 LOADER_EXPORT void VKAPI vkDestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool)
index d6479892529f2647174ee239f2c04dec051eff55..0e5292e2097df72b7ffaa167bccc2db199130dfe 100755 (executable)
--- a/vulkan.py
+++ b/vulkan.py
@@ -618,8 +618,6 @@ core = Extension(
 
         Proto("VkResult", "CreateDescriptorPool",
             [Param("VkDevice", "device"),
-             Param("VkDescriptorPoolUsage", "poolUsage"),
-             Param("uint32_t", "maxSets"),
              Param("const VkDescriptorPoolCreateInfo*", "pCreateInfo"),
              Param("VkDescriptorPool*", "pDescriptorPool")]),