vkCreateImage - go through funcptr

This commit is contained in:
twinaphex 2016-02-29 16:48:55 +01:00
parent 3677144d18
commit 6836b5f868
2 changed files with 4 additions and 2 deletions

View File

@ -258,7 +258,7 @@ struct vk_texture vulkan_create_texture(vk_t *vk,
break; break;
} }
vkCreateImage(device, &info, NULL, &tex.image); vk->context->fp.vkCreateImage(device, &info, NULL, &tex.image);
#if 0 #if 0
vulkan_track_alloc(tex.image); vulkan_track_alloc(tex.image);
#endif #endif
@ -296,7 +296,7 @@ struct vk_texture vulkan_create_texture(vk_t *vk,
type = VULKAN_TEXTURE_STAGING; type = VULKAN_TEXTURE_STAGING;
vkDestroyImage(device, tex.image, NULL); vkDestroyImage(device, tex.image, NULL);
info.usage = VK_IMAGE_USAGE_TRANSFER_SRC_BIT; info.usage = VK_IMAGE_USAGE_TRANSFER_SRC_BIT;
vkCreateImage(device, &info, NULL, &tex.image); vk->context->fp.vkCreateImage(device, &info, NULL, &tex.image);
vkGetImageMemoryRequirements(device, tex.image, &mem_reqs); vkGetImageMemoryRequirements(device, tex.image, &mem_reqs);
alloc.allocationSize = mem_reqs.size; alloc.allocationSize = mem_reqs.size;
alloc.memoryTypeIndex = vulkan_find_memory_type_fallback(&vk->context->memory_properties, alloc.memoryTypeIndex = vulkan_find_memory_type_fallback(&vk->context->memory_properties,
@ -1053,6 +1053,7 @@ bool vulkan_context_init(gfx_ctx_vulkan_data_t *vk,
VK_GET_INSTANCE_PROC_ADDR(vk, vk->context.instance, CreateFence); VK_GET_INSTANCE_PROC_ADDR(vk, vk->context.instance, CreateFence);
VK_GET_INSTANCE_PROC_ADDR(vk, vk->context.instance, ResetFences); VK_GET_INSTANCE_PROC_ADDR(vk, vk->context.instance, ResetFences);
VK_GET_INSTANCE_PROC_ADDR(vk, vk->context.instance, WaitForFences); VK_GET_INSTANCE_PROC_ADDR(vk, vk->context.instance, WaitForFences);
VK_GET_INSTANCE_PROC_ADDR(vk, vk->context.instance, CreateImage);
VK_GET_INSTANCE_PROC_ADDR(vk, vk->context.instance, CmdCopyImage); VK_GET_INSTANCE_PROC_ADDR(vk, vk->context.instance, CmdCopyImage);
VK_GET_INSTANCE_PROC_ADDR(vk, vk->context.instance, CmdSetScissor); VK_GET_INSTANCE_PROC_ADDR(vk, vk->context.instance, CmdSetScissor);
VK_GET_INSTANCE_PROC_ADDR(vk, vk->context.instance, CmdSetViewport); VK_GET_INSTANCE_PROC_ADDR(vk, vk->context.instance, CmdSetViewport);

View File

@ -142,6 +142,7 @@ typedef struct vulkan_context
PFN_vkCreateFramebuffer vkCreateFramebuffer; PFN_vkCreateFramebuffer vkCreateFramebuffer;
PFN_vkCreateCommandPool vkCreateCommandPool; PFN_vkCreateCommandPool vkCreateCommandPool;
PFN_vkGetDeviceQueue vkGetDeviceQueue; PFN_vkGetDeviceQueue vkGetDeviceQueue;
PFN_vkCreateImage vkCreateImage;
PFN_vkCreateInstance vkCreateInstance; PFN_vkCreateInstance vkCreateInstance;
PFN_vkCreateRenderPass vkCreateRenderPass; PFN_vkCreateRenderPass vkCreateRenderPass;
PFN_vkCreatePipelineLayout vkCreatePipelineLayout; PFN_vkCreatePipelineLayout vkCreatePipelineLayout;