From d45f0e0946dde22e333edfead2bc84a365f77fb4 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 29 Feb 2016 19:39:49 +0100 Subject: [PATCH] Some cleanups --- gfx/common/vulkan_common.c | 2 ++ gfx/common/vulkan_common.h | 16 ++++++++++++---- gfx/drivers/vulkan.c | 19 +++++++++++++------ 3 files changed, 27 insertions(+), 10 deletions(-) diff --git a/gfx/common/vulkan_common.c b/gfx/common/vulkan_common.c index dcc0045a2b..4ccb004e8e 100644 --- a/gfx/common/vulkan_common.c +++ b/gfx/common/vulkan_common.c @@ -1246,6 +1246,8 @@ bool vulkan_context_init(gfx_ctx_vulkan_data_t *vk, /* Clear commands */ VK_GET_INSTANCE_PROC_ADDR(vk, vk->context.instance, CmdClearAttachments); + + /* Drawing commands */ VK_GET_INSTANCE_PROC_ADDR(vk, vk->context.instance, CmdDraw); VK_GET_INSTANCE_PROC_ADDR(vk, diff --git a/gfx/common/vulkan_common.h b/gfx/common/vulkan_common.h index a6b77848ed..10a96697c0 100644 --- a/gfx/common/vulkan_common.h +++ b/gfx/common/vulkan_common.h @@ -179,20 +179,28 @@ typedef struct vulkan_context PFN_vkCreateSampler vkCreateSampler; PFN_vkDestroySampler vkDestroySampler; + /* Render Passes */ + PFN_vkCreateRenderPass vkCreateRenderPass; + /* Clear commands */ PFN_vkCmdClearAttachments vkCmdClearAttachments; + /* Drawing commands */ + PFN_vkCmdDraw vkCmdDraw; + + /* Fragment operations */ + PFN_vkCmdSetScissor vkCmdSetScissor; + + /* Fixed-function vertex postprocessing */ + PFN_vkCmdSetViewport vkCmdSetViewport; + PFN_vkCreateInstance vkCreateInstance; - PFN_vkCreateRenderPass vkCreateRenderPass; PFN_vkGetPhysicalDeviceFormatProperties vkGetPhysicalDeviceFormatProperties; PFN_vkEnumeratePhysicalDevices vkEnumeratePhysicalDevices; PFN_vkGetPhysicalDeviceProperties vkGetPhysicalDeviceProperties; PFN_vkGetPhysicalDeviceMemoryProperties vkGetPhysicalDeviceMemoryProperties; PFN_vkGetPhysicalDeviceQueueFamilyProperties vkGetPhysicalDeviceQueueFamilyProperties; - PFN_vkCmdSetScissor vkCmdSetScissor; - PFN_vkCmdSetViewport vkCmdSetViewport; - PFN_vkCmdDraw vkCmdDraw; PFN_vkCreateDevice vkCreateDevice; PFN_vkDestroyDevice vkDestroyDevice; PFN_vkGetPhysicalDeviceSurfaceSupportKHR vkGetPhysicalDeviceSurfaceSupportKHR; diff --git a/gfx/drivers/vulkan.c b/gfx/drivers/vulkan.c index e5616e0d5d..43b12bf03b 100644 --- a/gfx/drivers/vulkan.c +++ b/gfx/drivers/vulkan.c @@ -541,7 +541,9 @@ static void vulkan_deinit_command_buffers(vk_t *vk) } } -static void vulkan_deinit_pipeline_layout(vk_t *vk) +static void vulkan_deinit_pipeline_layout( + struct vulkan_context_fp *vkcfp, + vk_t *vk) { vkDestroyPipelineLayout(vk->context->device, vk->pipelines.layout, NULL); @@ -549,17 +551,22 @@ static void vulkan_deinit_pipeline_layout(vk_t *vk) vk->pipelines.set_layout, NULL); } -static void vulkan_deinit_pipelines(vk_t *vk) +static void vulkan_deinit_pipelines( + struct vulkan_context_fp *vkcfp, + vk_t *vk) { unsigned i; - vulkan_deinit_pipeline_layout(vk); + + vulkan_deinit_pipeline_layout(vkcfp, vk); vkDestroyPipeline(vk->context->device, vk->pipelines.alpha_blend, NULL); vkDestroyPipeline(vk->context->device, vk->pipelines.font, NULL); for (i = 0; i < 4; i++) vkDestroyPipeline(vk->context->device, vk->display.pipelines[i], NULL); } -static void vulkan_deinit_framebuffers(vk_t *vk) +static void vulkan_deinit_framebuffers( + struct vulkan_context_fp *vkcfp, + vk_t *vk) { unsigned i; for (i = 0; i < vk->num_swapchain_images; i++) @@ -718,8 +725,8 @@ static void vulkan_deinit_static_resources(vk_t *vk) static void vulkan_deinit_resources(vk_t *vk) { - vulkan_deinit_pipelines(vk); - vulkan_deinit_framebuffers(vk); + vulkan_deinit_pipelines(&vk->context->fp, vk); + vulkan_deinit_framebuffers(&vk->context->fp, vk); vulkan_deinit_descriptor_pool(vk); vulkan_deinit_textures(vk); vulkan_deinit_buffers(vk);