(desc->pDepthStencilAttachment != NULL);
}
+static void
+radv_destroy_render_pass(struct radv_device *device,
+ const VkAllocationCallbacks *pAllocator,
+ struct radv_render_pass *pass)
+{
+ vk_object_base_finish(&pass->base);
+ vk_free2(&device->vk.alloc, pAllocator, pass->subpass_attachments);
+ vk_free2(&device->vk.alloc, pAllocator, pass);
+}
+
VkResult radv_CreateRenderPass(
VkDevice _device,
const VkRenderPassCreateInfo* pCreateInfo,
subpass_attachment_count * sizeof(struct radv_subpass_attachment), 8,
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if (pass->subpass_attachments == NULL) {
- vk_free2(&device->vk.alloc, pAllocator, pass);
+ radv_destroy_render_pass(device, pAllocator, pass);
return vk_error(device->instance, VK_ERROR_OUT_OF_HOST_MEMORY);
}
} else
subpass_attachment_count * sizeof(struct radv_subpass_attachment), 8,
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if (pass->subpass_attachments == NULL) {
- vk_free2(&device->vk.alloc, pAllocator, pass);
+ radv_destroy_render_pass(device, pAllocator, pass);
return vk_error(device->instance, VK_ERROR_OUT_OF_HOST_MEMORY);
}
} else
if (!_pass)
return;
- vk_object_base_finish(&pass->base);
- vk_free2(&device->vk.alloc, pAllocator, pass->subpass_attachments);
- vk_free2(&device->vk.alloc, pAllocator, pass);
+ radv_destroy_render_pass(device, pAllocator, pass);
}
void radv_GetRenderAreaGranularity(