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

index 2d1dff1144123230b0d475db21fe73041f8c7a5a..1cc4d8c298846b1b9e41af411f562290a1b639ad 100644 (file)
@@ -2050,6 +2050,7 @@ typedef VkResult (VKAPI *PFN_vkDestroyPipeline)(VkDevice device, VkPipeline pipe
 typedef VkResult (VKAPI *PFN_vkCreatePipelineLayout)(VkDevice device, const VkPipelineLayoutCreateInfo* pCreateInfo, VkPipelineLayout* pPipelineLayout);
 typedef VkResult (VKAPI *PFN_vkDestroyPipelineLayout)(VkDevice device, VkPipelineLayout pipelineLayout);
 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_vkCreateDescriptorPool)(VkDevice device, VkDescriptorPoolUsage poolUsage, uint32_t maxSets, const VkDescriptorPoolCreateInfo* pCreateInfo, VkDescriptorPool* pDescriptorPool);
 typedef VkResult (VKAPI *PFN_vkResetDescriptorPool)(VkDevice device, VkDescriptorPool descriptorPool);
@@ -2466,6 +2467,10 @@ VkResult VKAPI vkCreateSampler(
     const VkSamplerCreateInfo*                  pCreateInfo,
     VkSampler*                                  pSampler);
 
+VkResult VKAPI vkDestroySampler(
+    VkDevice                                    device,
+    VkSampler                                   sampler);
+
 VkResult VKAPI vkCreateDescriptorSetLayout(
     VkDevice                                    device,
     const VkDescriptorSetLayoutCreateInfo*      pCreateInfo,
index 7c896cdd20ca94efce8de22ec2ae9e76500d7049..b42d6f4f3b4eed928a6b37ca800f04179e08e19b 100644 (file)
@@ -1240,6 +1240,8 @@ VkResult anv_DestroyObject(
       return anv_DestroyPipelineLayout(_device, (VkPipelineLayout) _object);
 
    case VK_OBJECT_TYPE_SAMPLER:
+      return anv_DestroySampler(_device, (VkSampler) _object);
+
    case VK_OBJECT_TYPE_DESCRIPTOR_SET:
    case VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT:
    case VK_OBJECT_TYPE_DYNAMIC_RS_STATE:
@@ -1818,6 +1820,18 @@ VkResult anv_CreateSampler(
    return VK_SUCCESS;
 }
 
+VkResult anv_DestroySampler(
+    VkDevice                                    _device,
+    VkSampler                                   _sampler)
+{
+   ANV_FROM_HANDLE(anv_device, device, _device);
+   ANV_FROM_HANDLE(anv_sampler, sampler, _sampler);
+
+   anv_device_free(device, sampler);
+
+   return VK_SUCCESS;
+}
+
 // Descriptor set functions
 
 VkResult anv_CreateDescriptorSetLayout(