From c8b9bb609f4913691226eeb628f75c35b8e1eab8 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 29 Feb 2016 23:19:23 +0100 Subject: [PATCH] (Vulkan) More image function pointers --- gfx/common/vulkan_common.c | 6 ++++-- gfx/common/vulkan_common.h | 10 ++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/gfx/common/vulkan_common.c b/gfx/common/vulkan_common.c index cbe3ab17f4..75c78bef44 100644 --- a/gfx/common/vulkan_common.c +++ b/gfx/common/vulkan_common.c @@ -374,7 +374,7 @@ struct vk_texture vulkan_create_texture(vk_t *vk, memset(old, 0, sizeof(*old)); } - vkBindImageMemory(device, tex.image, tex.memory, 0); + VKFUNC(vkBindImageMemory)(device, tex.image, tex.memory, 0); view.image = tex.image; view.viewType = VK_IMAGE_VIEW_TYPE_2D; @@ -394,7 +394,7 @@ struct vk_texture vulkan_create_texture(vk_t *vk, VKFUNC(vkCreateImageView)(device, &view, NULL, &tex.view); - vkGetImageSubresourceLayout(device, tex.image, &subresource, &layout); + VKFUNC(vkGetImageSubresourceLayout)(device, tex.image, &subresource, &layout); tex.stride = layout.rowPitch; tex.offset = layout.offset; tex.size = layout.size; @@ -1153,6 +1153,8 @@ bool vulkan_context_init(gfx_ctx_vulkan_data_t *vk, /* Images */ VK_GET_INSTANCE_PROC_ADDR(vk, vk->context.instance, CreateImage); VK_GET_INSTANCE_PROC_ADDR(vk, vk->context.instance, DestroyImage); + VK_GET_INSTANCE_PROC_ADDR(vk, vk->context.instance, BindImageMemory); + VK_GET_INSTANCE_PROC_ADDR(vk, vk->context.instance, GetImageSubresourceLayout); /* Image Views */ VK_GET_INSTANCE_PROC_ADDR(vk, vk->context.instance, CreateImageView); diff --git a/gfx/common/vulkan_common.h b/gfx/common/vulkan_common.h index d4d55a9ad1..8bbe6335fc 100644 --- a/gfx/common/vulkan_common.h +++ b/gfx/common/vulkan_common.h @@ -166,13 +166,16 @@ typedef struct vulkan_context /* Images */ PFN_vkCreateImage vkCreateImage; PFN_vkDestroyImage vkDestroyImage; - PFN_vkCmdCopyImage vkCmdCopyImage; + PFN_vkGetImageSubresourceLayout vkGetImageSubresourceLayout; + + /* Images (Resource Memory Association) */ + PFN_vkBindImageMemory vkBindImageMemory; /* Image Views */ PFN_vkCreateImageView vkCreateImageView; PFN_vkDestroyImageView vkDestroyImageView; - /* Resource Memory Association */ + /* Image Views (Resource Memory Association) */ PFN_vkGetImageMemoryRequirements vkGetImageMemoryRequirements; /* Queues */ @@ -236,6 +239,9 @@ typedef struct vulkan_context PFN_vkCreateRenderPass vkCreateRenderPass; PFN_vkDestroyRenderPass vkDestroyRenderPass; + /* Image commands */ + PFN_vkCmdCopyImage vkCmdCopyImage; + /* Pipeline commands */ PFN_vkCmdBindPipeline vkCmdBindPipeline;