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

index c4ab8c7da2a8c5e5e35b6ffa4675c711f49e5802..015ab11d890f167a251461d019999862e128467c 100644 (file)
@@ -2036,6 +2036,7 @@ typedef VkResult (VKAPI *PFN_vkCreateImageView)(VkDevice device, const VkImageVi
 typedef VkResult (VKAPI *PFN_vkCreateColorAttachmentView)(VkDevice device, const VkColorAttachmentViewCreateInfo* pCreateInfo, VkColorAttachmentView* pView);
 typedef VkResult (VKAPI *PFN_vkCreateDepthStencilView)(VkDevice device, const VkDepthStencilViewCreateInfo* pCreateInfo, VkDepthStencilView* pView);
 typedef VkResult (VKAPI *PFN_vkCreateShaderModule)(VkDevice device, const VkShaderModuleCreateInfo* pCreateInfo, VkShaderModule* pShaderModule);
+typedef VkResult (VKAPI *PFN_vkDestroyShaderModule)(VkDevice device, VkShaderModule shaderModule);
 typedef VkResult (VKAPI *PFN_vkCreateShader)(VkDevice device, const VkShaderCreateInfo* pCreateInfo, VkShader* pShader);
 typedef VkResult (VKAPI *PFN_vkCreatePipelineCache)(VkDevice device, const VkPipelineCacheCreateInfo* pCreateInfo, VkPipelineCache* pPipelineCache);
 typedef size_t (VKAPI *PFN_vkGetPipelineCacheSize)(VkDevice device, VkPipelineCache pipelineCache);
@@ -2392,6 +2393,10 @@ VkResult VKAPI vkCreateShaderModule(
     const VkShaderModuleCreateInfo*             pCreateInfo,
     VkShaderModule*                             pShaderModule);
 
+VkResult VKAPI vkDestroyShaderModule(
+    VkDevice                                    device,
+    VkShaderModule                              shaderModule);
+
 VkResult VKAPI vkCreateShader(
     VkDevice                                    device,
     const VkShaderCreateInfo*                   pCreateInfo,
index 0256b66791fe5c2494a24326401a65b8a6bc15f2..76c44ba507e7404514ee0f0d355dacacdd9e5ce6 100644 (file)
@@ -1228,8 +1228,10 @@ VkResult anv_DestroyObject(
    case VK_OBJECT_TYPE_BUFFER:
       return anv_DestroyBuffer(_device, (VkBuffer) _object);
 
-   case VK_OBJECT_TYPE_SHADER:
    case VK_OBJECT_TYPE_SHADER_MODULE:
+      return anv_DestroyShaderModule(_device, (VkShaderModule) _object);
+
+   case VK_OBJECT_TYPE_SHADER:
    case VK_OBJECT_TYPE_PIPELINE_LAYOUT:
    case VK_OBJECT_TYPE_SAMPLER:
    case VK_OBJECT_TYPE_DESCRIPTOR_SET:
index 6396e6cc0f625bbde9079a3c2aa40973dffe62b0..76a3825070196d90484fa61799063e80d5cdd7ad 100644 (file)
@@ -55,6 +55,18 @@ VkResult anv_CreateShaderModule(
    return VK_SUCCESS;
 }
 
+VkResult anv_DestroyShaderModule(
+    VkDevice                                    _device,
+    VkShaderModule                              _module)
+{
+   ANV_FROM_HANDLE(anv_device, device, _device);
+   ANV_FROM_HANDLE(anv_shader_module, module, _module);
+
+   anv_device_free(device, module);
+
+   return VK_SUCCESS;
+}
+
 VkResult anv_CreateShader(
     VkDevice                                    _device,
     const VkShaderCreateInfo*                   pCreateInfo,