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

index eb5514c59eb0a10dbdf2607ebe5c6c9130c6acb4..949b7df8c5f89a6f1bfc55cef944f5607700ef41 100644 (file)
@@ -2059,6 +2059,7 @@ typedef VkResult (VKAPI *PFN_vkResetDescriptorPool)(VkDevice device, VkDescripto
 typedef VkResult (VKAPI *PFN_vkAllocDescriptorSets)(VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorSetUsage setUsage, uint32_t count, const VkDescriptorSetLayout* pSetLayouts, VkDescriptorSet* pDescriptorSets, uint32_t* pCount);
 typedef VkResult (VKAPI *PFN_vkUpdateDescriptorSets)(VkDevice device, uint32_t writeCount, const VkWriteDescriptorSet* pDescriptorWrites, uint32_t copyCount, const VkCopyDescriptorSet* pDescriptorCopies);
 typedef VkResult (VKAPI *PFN_vkCreateDynamicViewportState)(VkDevice device, const VkDynamicViewportStateCreateInfo* pCreateInfo, VkDynamicViewportState* pState);
+typedef VkResult (VKAPI *PFN_vkDestroyDynamicViewportState)(VkDevice device, VkDynamicViewportState dynamicViewportState);
 typedef VkResult (VKAPI *PFN_vkCreateDynamicRasterState)(VkDevice device, const VkDynamicRasterStateCreateInfo* pCreateInfo, VkDynamicRasterState* pState);
 typedef VkResult (VKAPI *PFN_vkCreateDynamicColorBlendState)(VkDevice device, const VkDynamicColorBlendStateCreateInfo* pCreateInfo, VkDynamicColorBlendState* pState);
 typedef VkResult (VKAPI *PFN_vkCreateDynamicDepthStencilState)(VkDevice device, const VkDynamicDepthStencilStateCreateInfo* pCreateInfo, VkDynamicDepthStencilState* pState);
@@ -2518,6 +2519,10 @@ VkResult VKAPI vkCreateDynamicViewportState(
     const VkDynamicViewportStateCreateInfo*     pCreateInfo,
     VkDynamicViewportState*                     pState);
 
+VkResult VKAPI vkDestroyDynamicViewportState(
+    VkDevice                                    device,
+    VkDynamicViewportState                      dynamicViewportState);
+
 VkResult VKAPI vkCreateDynamicRasterState(
     VkDevice                                    device,
     const VkDynamicRasterStateCreateInfo*       pCreateInfo,
index 9d1c0019a68db6d640e578731bcc3dc6bef90339..0b2914e7d8e388096cac5b7e2dbe79bc86e5dd6e 100644 (file)
@@ -1253,8 +1253,10 @@ VkResult anv_DestroyObject(
       anv_device_free(device, (void *) _object);
       return VK_SUCCESS;
 
-   case VK_OBJECT_TYPE_COMMAND_BUFFER:
    case VK_OBJECT_TYPE_DYNAMIC_VP_STATE:
+      return anv_DestroyDynamicViewportState(_device, (VkDynamicViewportState) _object);
+
+   case VK_OBJECT_TYPE_COMMAND_BUFFER:
    case VK_OBJECT_TYPE_FRAMEBUFFER:
       (object->destructor)(device, object, objType);
       return VK_SUCCESS;
@@ -2143,15 +2145,12 @@ anv_dynamic_vp_state_destroy(struct anv_device *device,
                              struct anv_object *object,
                              VkObjectType obj_type)
 {
-   struct anv_dynamic_vp_state *state = (void *)object;
+   struct anv_dynamic_vp_state *vp_state = (void *) object;
 
    assert(obj_type == VK_OBJECT_TYPE_DYNAMIC_VP_STATE);
 
-   anv_state_pool_free(&device->dynamic_state_pool, state->sf_clip_vp);
-   anv_state_pool_free(&device->dynamic_state_pool, state->cc_vp);
-   anv_state_pool_free(&device->dynamic_state_pool, state->scissor);
-
-   anv_device_free(device, state);
+   anv_DestroyDynamicViewportState(anv_device_to_handle(device),
+                                   anv_dynamic_vp_state_to_handle(vp_state));
 }
 
 VkResult anv_CreateDynamicViewportState(
@@ -2241,6 +2240,22 @@ VkResult anv_CreateDynamicViewportState(
    return VK_SUCCESS;
 }
 
+VkResult anv_DestroyDynamicViewportState(
+    VkDevice                                    _device,
+    VkDynamicViewportState                      _vp_state)
+{
+   ANV_FROM_HANDLE(anv_device, device, _device);
+   ANV_FROM_HANDLE(anv_dynamic_vp_state, vp_state, _vp_state);
+
+   anv_state_pool_free(&device->dynamic_state_pool, vp_state->sf_clip_vp);
+   anv_state_pool_free(&device->dynamic_state_pool, vp_state->cc_vp);
+   anv_state_pool_free(&device->dynamic_state_pool, vp_state->scissor);
+
+   anv_device_free(device, vp_state);
+
+   return VK_SUCCESS;
+}
+
 VkResult anv_CreateDynamicRasterState(
     VkDevice                                    _device,
     const VkDynamicRasterStateCreateInfo*       pCreateInfo,