From f0458495f45d81fd0d9aec27c27ea96b0c0f219a Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 29 Feb 2016 19:41:25 +0100 Subject: [PATCH] Go through funcptr for vkDestroyPipeline --- gfx/common/vulkan_common.c | 1 + gfx/common/vulkan_common.h | 1 + gfx/drivers/vulkan.c | 10 +++++++--- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/gfx/common/vulkan_common.c b/gfx/common/vulkan_common.c index 4ccb004e8e..764d67559e 100644 --- a/gfx/common/vulkan_common.c +++ b/gfx/common/vulkan_common.c @@ -1158,6 +1158,7 @@ bool vulkan_context_init(gfx_ctx_vulkan_data_t *vk, VK_GET_INSTANCE_PROC_ADDR(vk, vk->context.instance, CreatePipelineLayout); VK_GET_INSTANCE_PROC_ADDR(vk, vk->context.instance, CreatePipelineCache); VK_GET_INSTANCE_PROC_ADDR(vk, vk->context.instance, CmdBindPipeline); + VK_GET_INSTANCE_PROC_ADDR(vk, vk->context.instance, DestroyPipeline); VK_GET_INSTANCE_PROC_ADDR(vk, vk->context.instance, CreateCommandPool); diff --git a/gfx/common/vulkan_common.h b/gfx/common/vulkan_common.h index 10a96697c0..ec6610c341 100644 --- a/gfx/common/vulkan_common.h +++ b/gfx/common/vulkan_common.h @@ -157,6 +157,7 @@ typedef struct vulkan_context PFN_vkCmdBindPipeline vkCmdBindPipeline; PFN_vkCreatePipelineLayout vkCreatePipelineLayout; PFN_vkCreatePipelineCache vkCreatePipelineCache; + PFN_vkDestroyPipeline vkDestroyPipeline; /* Descriptor pools */ PFN_vkCreateDescriptorPool vkCreateDescriptorPool; diff --git a/gfx/drivers/vulkan.c b/gfx/drivers/vulkan.c index 43b12bf03b..3bcc01b80e 100644 --- a/gfx/drivers/vulkan.c +++ b/gfx/drivers/vulkan.c @@ -558,10 +558,14 @@ static void vulkan_deinit_pipelines( unsigned i; vulkan_deinit_pipeline_layout(vkcfp, vk); - vkDestroyPipeline(vk->context->device, vk->pipelines.alpha_blend, NULL); - vkDestroyPipeline(vk->context->device, vk->pipelines.font, NULL); + VKFUNC(vkDestroyPipeline)(vk->context->device, + vk->pipelines.alpha_blend, NULL); + VKFUNC(vkDestroyPipeline)(vk->context->device, + vk->pipelines.font, NULL); + for (i = 0; i < 4; i++) - vkDestroyPipeline(vk->context->device, vk->display.pipelines[i], NULL); + VKFUNC(vkDestroyPipeline)(vk->context->device, + vk->display.pipelines[i], NULL); } static void vulkan_deinit_framebuffers(