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

index 015ab11d890f167a251461d019999862e128467c..91d67156126ff731cc07f18d439871ef54044127 100644 (file)
@@ -2038,6 +2038,7 @@ typedef VkResult (VKAPI *PFN_vkCreateDepthStencilView)(VkDevice device, const Vk
 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_vkDestroyShader)(VkDevice device, VkShader shader);
 typedef VkResult (VKAPI *PFN_vkCreatePipelineCache)(VkDevice device, const VkPipelineCacheCreateInfo* pCreateInfo, VkPipelineCache* pPipelineCache);
 typedef size_t (VKAPI *PFN_vkGetPipelineCacheSize)(VkDevice device, VkPipelineCache pipelineCache);
 typedef VkResult (VKAPI *PFN_vkGetPipelineCacheData)(VkDevice device, VkPipelineCache pipelineCache, void* pData);
@@ -2402,6 +2403,10 @@ VkResult VKAPI vkCreateShader(
     const VkShaderCreateInfo*                   pCreateInfo,
     VkShader*                                   pShader);
 
+VkResult VKAPI vkDestroyShader(
+    VkDevice                                    device,
+    VkShader                                    shader);
+
 VkResult VKAPI vkCreatePipelineCache(
     VkDevice                                    device,
     const VkPipelineCacheCreateInfo*            pCreateInfo,
index 76c44ba507e7404514ee0f0d355dacacdd9e5ce6..2c110726d5f6bd6f08f65ef5d3289f721a4c1446 100644 (file)
@@ -1232,6 +1232,8 @@ VkResult anv_DestroyObject(
       return anv_DestroyShaderModule(_device, (VkShaderModule) _object);
 
    case VK_OBJECT_TYPE_SHADER:
+      return anv_DestroyShader(_device, (VkShader) _object);
+
    case VK_OBJECT_TYPE_PIPELINE_LAYOUT:
    case VK_OBJECT_TYPE_SAMPLER:
    case VK_OBJECT_TYPE_DESCRIPTOR_SET:
index 76a3825070196d90484fa61799063e80d5cdd7ad..991ab9f21c298c5285849253a6cab7c5b42dd6db 100644 (file)
@@ -98,6 +98,19 @@ VkResult anv_CreateShader(
    return VK_SUCCESS;
 }
 
+VkResult anv_DestroyShader(
+    VkDevice                                    _device,
+    VkShader                                    _shader)
+{
+   ANV_FROM_HANDLE(anv_device, device, _device);
+   ANV_FROM_HANDLE(anv_shader, shader, _shader);
+
+   anv_device_free(device, shader);
+
+   return VK_SUCCESS;
+}
+
+
 VkResult anv_CreatePipelineCache(
     VkDevice                                    device,
     const VkPipelineCacheCreateInfo*            pCreateInfo,