From 3677144d184af3fa559064adbc4a76834ea4f0d8 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 29 Feb 2016 16:47:21 +0100 Subject: [PATCH] Start going through VKFUNC --- gfx/common/vulkan_common.c | 5 ++++- gfx/common/vulkan_common.h | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gfx/common/vulkan_common.c b/gfx/common/vulkan_common.c index 348cf3fa18..1d89d3af87 100644 --- a/gfx/common/vulkan_common.c +++ b/gfx/common/vulkan_common.c @@ -101,6 +101,9 @@ void vulkan_copy_staging_to_dynamic(vk_t *vk, VkCommandBuffer cmd, struct vk_texture *staging) { VkImageCopy region; + struct vulkan_context_fp *vkcfp = + vk->context ? (struct vulkan_context_fp*)&vk->context->fp : NULL; + retro_assert(dynamic->type == VULKAN_TEXTURE_DYNAMIC); retro_assert(staging->type == VULKAN_TEXTURE_STAGING); @@ -126,7 +129,7 @@ void vulkan_copy_staging_to_dynamic(vk_t *vk, VkCommandBuffer cmd, region.srcSubresource.layerCount = 1; region.dstSubresource = region.srcSubresource; - vk->context->fp.vkCmdCopyImage(vk->cmd, + VKFUNC(vkCmdCopyImage)(vk->cmd, staging->image, VK_IMAGE_LAYOUT_GENERAL, dynamic->image, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 1, ®ion); diff --git a/gfx/common/vulkan_common.h b/gfx/common/vulkan_common.h index 7b59b3da38..893cc7b910 100644 --- a/gfx/common/vulkan_common.h +++ b/gfx/common/vulkan_common.h @@ -127,9 +127,11 @@ enum vulkan_wsi_type VULKAN_WSI_XLIB }; +#define VKFUNC(sym) (vkcfp->sym) + typedef struct vulkan_context { - struct + struct vulkan_context_fp { PFN_vkDestroyFence vkDestroyFence; PFN_vkCreateFence vkCreateFence;