From 1d9220d9d17b0a27d5946d48339cb2cfa43aae11 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 29 Feb 2016 23:22:56 +0100 Subject: [PATCH] (Vulkan) Add vkCmdBindVertexBuffers function pointer --- gfx/common/vulkan_common.c | 8 ++++++-- gfx/common/vulkan_common.h | 3 +++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/gfx/common/vulkan_common.c b/gfx/common/vulkan_common.c index 75c78bef44..db5e81ff31 100644 --- a/gfx/common/vulkan_common.c +++ b/gfx/common/vulkan_common.c @@ -641,7 +641,7 @@ void vulkan_draw_triangles(vk_t *vk, const struct vk_draw_triangles *call) } /* VBO is already uploaded. */ - vkCmdBindVertexBuffers(vk->cmd, 0, 1, + VKFUNC(vkCmdBindVertexBuffers)(vk->cmd, 0, 1, &call->vbo->buffer, &call->vbo->offset); /* Draw the quad */ @@ -725,7 +725,7 @@ void vulkan_draw_quad(vk_t *vk, const struct vk_draw_quad *quad) 0.0f, 0.0f, 1.0f, 1.0f, &quad->color); - vkCmdBindVertexBuffers(vk->cmd, 0, 1, + VKFUNC(vkCmdBindVertexBuffers)(vk->cmd, 0, 1, &range.buffer, &range.offset); } @@ -1156,6 +1156,7 @@ bool vulkan_context_init(gfx_ctx_vulkan_data_t *vk, 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); VK_GET_INSTANCE_PROC_ADDR(vk, vk->context.instance, DestroyImageView); @@ -1292,6 +1293,9 @@ bool vulkan_context_init(gfx_ctx_vulkan_data_t *vk, /* Image commands */ VK_GET_INSTANCE_PROC_ADDR(vk, vk->context.instance, CmdCopyImage); + /* Vertex input descriptions */ + VK_GET_INSTANCE_PROC_ADDR(vk, vk->context.instance, CmdBindVertexBuffers); + /* Descriptor Set commands */ VK_GET_INSTANCE_PROC_ADDR(vk, vk->context.instance, CmdBindDescriptorSets); diff --git a/gfx/common/vulkan_common.h b/gfx/common/vulkan_common.h index 8bbe6335fc..5ec8ea2e4a 100644 --- a/gfx/common/vulkan_common.h +++ b/gfx/common/vulkan_common.h @@ -245,6 +245,9 @@ typedef struct vulkan_context /* Pipeline commands */ PFN_vkCmdBindPipeline vkCmdBindPipeline; + /* Vertex input descriptions */ + PFN_vkCmdBindVertexBuffers vkCmdBindVertexBuffers; + /* Render Pass commands */ PFN_vkCmdBeginRenderPass vkCmdBeginRenderPass; PFN_vkCmdEndRenderPass vkCmdEndRenderPass;