vk/0.170.2: Remove the pCount parameter from AllocDescriptorSets
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 6 Oct 2015 16:32:01 +0000 (09:32 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 6 Oct 2015 16:32:01 +0000 (09:32 -0700)
include/vulkan/vulkan.h
src/vulkan/anv_device.c
src/vulkan/anv_meta.c

index 26fc48b5acba23f05cce25a81d8d59eda886d269..470e2f4de2cb4e9205bf0cceb4e70b2ba5ca672a 100644 (file)
@@ -2153,7 +2153,7 @@ typedef void (VKAPI *PFN_vkDestroyDescriptorSetLayout)(VkDevice device, VkDescri
 typedef VkResult (VKAPI *PFN_vkCreateDescriptorPool)(VkDevice device, VkDescriptorPoolUsage poolUsage, uint32_t maxSets, 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, uint32_t* pCount);
+typedef VkResult (VKAPI *PFN_vkAllocDescriptorSets)(VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorSetUsage setUsage, uint32_t count, const VkDescriptorSetLayout* pSetLayouts, VkDescriptorSet* pDescriptorSets);
 typedef VkResult (VKAPI *PFN_vkFreeDescriptorSets)(VkDevice device, VkDescriptorPool descriptorPool, uint32_t count, const VkDescriptorSet* pDescriptorSets);
 typedef VkResult (VKAPI *PFN_vkUpdateDescriptorSets)(VkDevice device, uint32_t writeCount, const VkWriteDescriptorSet* pDescriptorWrites, uint32_t copyCount, const VkCopyDescriptorSet* pDescriptorCopies);
 typedef VkResult (VKAPI *PFN_vkCreateDynamicViewportState)(VkDevice device, const VkDynamicViewportStateCreateInfo* pCreateInfo, VkDynamicViewportState* pState);
@@ -2651,8 +2651,7 @@ VkResult VKAPI vkAllocDescriptorSets(
     VkDescriptorSetUsage                        setUsage,
     uint32_t                                    count,
     const VkDescriptorSetLayout*                pSetLayouts,
-    VkDescriptorSet*                            pDescriptorSets,
-    uint32_t*                                   pCount);
+    VkDescriptorSet*                            pDescriptorSets);
 
 VkResult VKAPI vkFreeDescriptorSets(
     VkDevice                                    device,
index f92b5fbf21bb44c65f81160403b14e835d2c604b..3ab91726024c1d302cb481110c9584f2c9bba92e 100644 (file)
@@ -1652,29 +1652,28 @@ VkResult anv_AllocDescriptorSets(
     VkDescriptorSetUsage                        setUsage,
     uint32_t                                    count,
     const VkDescriptorSetLayout*                pSetLayouts,
-    VkDescriptorSet*                            pDescriptorSets,
-    uint32_t*                                   pCount)
+    VkDescriptorSet*                            pDescriptorSets)
 {
    ANV_FROM_HANDLE(anv_device, device, _device);
 
-   VkResult result;
+   VkResult result = VK_SUCCESS;
    struct anv_descriptor_set *set;
+   uint32_t i;
 
-   for (uint32_t i = 0; i < count; i++) {
+   for (i = 0; i < count; i++) {
       ANV_FROM_HANDLE(anv_descriptor_set_layout, layout, pSetLayouts[i]);
 
       result = anv_descriptor_set_create(device, layout, &set);
-      if (result != VK_SUCCESS) {
-         *pCount = i;
-         return result;
-      }
+      if (result != VK_SUCCESS)
+         break;
 
       pDescriptorSets[i] = anv_descriptor_set_to_handle(set);
    }
 
-   *pCount = count;
+   if (result != VK_SUCCESS)
+      anv_FreeDescriptorSets(_device, descriptorPool, i, pDescriptorSets);
 
-   return VK_SUCCESS;
+   return result;
 }
 
 VkResult anv_FreeDescriptorSets(
index 77c47dac247dffe7769f086b8f654a2b05f102cc..0fb4c50adba7d446fe799e3d8b14607ad59a8192 100644 (file)
@@ -806,11 +806,10 @@ meta_emit_blit(struct anv_cmd_buffer *cmd_buffer,
          sizeof(struct vue_header),
       });
 
-   uint32_t count;
    VkDescriptorSet set;
    anv_AllocDescriptorSets(anv_device_to_handle(device), dummy_desc_pool,
                            VK_DESCRIPTOR_SET_USAGE_ONE_SHOT,
-                           1, &device->meta_state.blit.ds_layout, &set, &count);
+                           1, &device->meta_state.blit.ds_layout, &set);
    anv_UpdateDescriptorSets(anv_device_to_handle(device),
       1, /* writeCount */
       (VkWriteDescriptorSet[]) {