vk/0.132: Add vkDestroyDescriptorSetLayout()
authorChad Versace <chad.versace@intel.com>
Tue, 14 Jul 2015 17:36:49 +0000 (10:36 -0700)
committerChad Versace <chad.versace@intel.com>
Tue, 14 Jul 2015 17:36:49 +0000 (10:36 -0700)
include/vulkan/vulkan.h
src/vulkan/device.c

index 1cc4d8c298846b1b9e41af411f562290a1b639ad..33885c09abc2a9d0a3f6aaa844512700e4024563 100644 (file)
@@ -2052,6 +2052,7 @@ typedef VkResult (VKAPI *PFN_vkDestroyPipelineLayout)(VkDevice device, VkPipelin
 typedef VkResult (VKAPI *PFN_vkCreateSampler)(VkDevice device, const VkSamplerCreateInfo* pCreateInfo, VkSampler* pSampler);
 typedef VkResult (VKAPI *PFN_vkDestroySampler)(VkDevice device, VkSampler sampler);
 typedef VkResult (VKAPI *PFN_vkCreateDescriptorSetLayout)(VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, VkDescriptorSetLayout* pSetLayout);
+typedef VkResult (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_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);
@@ -2476,6 +2477,10 @@ VkResult VKAPI vkCreateDescriptorSetLayout(
     const VkDescriptorSetLayoutCreateInfo*      pCreateInfo,
     VkDescriptorSetLayout*                      pSetLayout);
 
+VkResult VKAPI vkDestroyDescriptorSetLayout(
+    VkDevice                                    device,
+    VkDescriptorSetLayout                       descriptorSetLayout);
+
 VkResult VKAPI vkCreateDescriptorPool(
     VkDevice                                    device,
     VkDescriptorPoolUsage                       poolUsage,
index b42d6f4f3b4eed928a6b37ca800f04179e08e19b..e54920efcf6562c330f38737199b93551f06614a 100644 (file)
@@ -1242,8 +1242,10 @@ VkResult anv_DestroyObject(
    case VK_OBJECT_TYPE_SAMPLER:
       return anv_DestroySampler(_device, (VkSampler) _object);
 
-   case VK_OBJECT_TYPE_DESCRIPTOR_SET:
    case VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT:
+      return anv_DestroyDescriptorSetLayout(_device, (VkDescriptorSetLayout) _object);
+
+   case VK_OBJECT_TYPE_DESCRIPTOR_SET:
    case VK_OBJECT_TYPE_DYNAMIC_RS_STATE:
    case VK_OBJECT_TYPE_DYNAMIC_CB_STATE:
    case VK_OBJECT_TYPE_DYNAMIC_DS_STATE:
@@ -1985,6 +1987,18 @@ VkResult anv_CreateDescriptorSetLayout(
    return VK_SUCCESS;
 }
 
+VkResult anv_DestroyDescriptorSetLayout(
+    VkDevice                                    _device,
+    VkDescriptorSetLayout                       _set_layout)
+{
+   ANV_FROM_HANDLE(anv_device, device, _device);
+   ANV_FROM_HANDLE(anv_descriptor_set_layout, set_layout, _set_layout);
+
+   anv_device_free(device, set_layout);
+
+   return VK_SUCCESS;
+}
+
 VkResult anv_CreateDescriptorPool(
     VkDevice                                    device,
     VkDescriptorPoolUsage                       poolUsage,