summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChad Versace <[email protected]>2015-07-14 10:59:30 -0700
committerChad Versace <[email protected]>2015-07-14 10:59:30 -0700
commit08f7731f67dfb7926d66928619e84e4dd33624d3 (patch)
treea0f7e9c941caea1c1ff09efbdd11e413c46afdd8
parent0c8456ef1e33fafa6074966e8f19dae4d19740ed (diff)
vk/0.132: Add vkDestroyFramebuffer()
-rw-r--r--include/vulkan/vulkan.h5
-rw-r--r--src/vulkan/device.c25
2 files changed, 24 insertions, 6 deletions
diff --git a/include/vulkan/vulkan.h b/include/vulkan/vulkan.h
index 4527f2b51a7..13d93094978 100644
--- a/include/vulkan/vulkan.h
+++ b/include/vulkan/vulkan.h
@@ -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,
diff --git a/src/vulkan/device.c b/src/vulkan/device.c
index b35e0ea97b5..a632a4f7e37 100644
--- a/src/vulkan/device.c
+++ b/src/vulkan/device.c
@@ -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,