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

index 4527f2b51a76502bffe9ee92c84d40ec4dbb773a..13d9309497833e9a2201f18088b1eb1096611f8e 100644 (file)
@@ -2067,6 +2067,7 @@ typedef VkResult (VKAPI *PFN_vkDestroyDynamicColorBlendState)(VkDevice device, V
 typedef VkResult (VKAPI *PFN_vkCreateDynamicDepthStencilState)(VkDevice device, const VkDynamicDepthStencilStateCreateInfo* pCreateInfo, VkDynamicDepthStencilState* pState);
 typedef VkResult (VKAPI *PFN_vkDestroyDynamicDepthStencilState)(VkDevice device, VkDynamicDepthStencilState dynamicDepthStencilState);
 typedef VkResult (VKAPI *PFN_vkCreateFramebuffer)(VkDevice device, const VkFramebufferCreateInfo* pCreateInfo, VkFramebuffer* pFramebuffer);
+typedef VkResult (VKAPI *PFN_vkDestroyFramebuffer)(VkDevice device, VkFramebuffer framebuffer);
 typedef VkResult (VKAPI *PFN_vkCreateRenderPass)(VkDevice device, const VkRenderPassCreateInfo* pCreateInfo, VkRenderPass* pRenderPass);
 typedef VkResult (VKAPI *PFN_vkGetRenderAreaGranularity)(VkDevice device, VkRenderPass renderPass, VkExtent2D* pGranularity);
 typedef VkResult (VKAPI *PFN_vkCreateCommandBuffer)(VkDevice device, const VkCmdBufferCreateInfo* pCreateInfo, VkCmdBuffer* pCmdBuffer);
@@ -2558,6 +2559,10 @@ VkResult VKAPI vkCreateFramebuffer(
     const VkFramebufferCreateInfo*              pCreateInfo,
     VkFramebuffer*                              pFramebuffer);
 
+VkResult VKAPI vkDestroyFramebuffer(
+    VkDevice                                    device,
+    VkFramebuffer                               framebuffer);
+
 VkResult VKAPI vkCreateRenderPass(
     VkDevice                                    device,
     const VkRenderPassCreateInfo*               pCreateInfo,
index b35e0ea97b5c18d87e477fc7485bc36d98cdf296..a632a4f7e37faa76ffec1fcee0991a7c8a73a46f 100644 (file)
@@ -1262,8 +1262,10 @@ VkResult anv_DestroyObject(
    case VK_OBJECT_TYPE_DYNAMIC_DS_STATE:
       return anv_DestroyDynamicDepthStencilState(_device, (VkDynamicDepthStencilState) _object);
 
-   case VK_OBJECT_TYPE_COMMAND_BUFFER:
    case VK_OBJECT_TYPE_FRAMEBUFFER:
+      return anv_DestroyFramebuffer(_device, (VkFramebuffer) _object);
+
+   case VK_OBJECT_TYPE_COMMAND_BUFFER:
       (object->destructor)(device, object, objType);
       return VK_SUCCESS;
 
@@ -3818,11 +3820,8 @@ anv_framebuffer_destroy(struct anv_device *device,
 
    assert(obj_type == VK_OBJECT_TYPE_FRAMEBUFFER);
 
-   anv_DestroyObject(anv_device_to_handle(device),
-                     VK_OBJECT_TYPE_DYNAMIC_VP_STATE,
-                     fb->vp_state);
-
-   anv_device_free(device, fb);
+   anv_DestroyFramebuffer(anv_device_to_handle(device),
+                          anv_framebuffer_to_handle(fb));
 }
 
 VkResult anv_CreateFramebuffer(
@@ -3889,6 +3888,20 @@ VkResult anv_CreateFramebuffer(
    return VK_SUCCESS;
 }
 
+VkResult anv_DestroyFramebuffer(
+    VkDevice                                    _device,
+    VkFramebuffer                               _fb)
+{
+   ANV_FROM_HANDLE(anv_device, device, _device);
+   ANV_FROM_HANDLE(anv_framebuffer, fb, _fb);
+
+   anv_DestroyDynamicViewportState(anv_device_to_handle(device),
+                                   fb->vp_state);
+   anv_device_free(device, fb);
+
+   return VK_SUCCESS;
+}
+
 VkResult anv_CreateRenderPass(
     VkDevice                                    _device,
     const VkRenderPassCreateInfo*               pCreateInfo,