|
|
@ -13,6 +13,7 @@ |
|
|
|
|
|
|
|
// CHANGELOG
|
|
|
|
// (minor and older changes stripped away, please see git history for details)
|
|
|
|
// 2019-04-01: Vulkan: Support for 32-bit index buffer (#define ImDrawIdx unsigned int).
|
|
|
|
// 2019-02-16: Vulkan: Viewport and clipping rectangles correctly using draw_data->FramebufferScale to allow retina display.
|
|
|
|
// 2018-11-30: Misc: Setting up io.BackendRendererName so it can be displayed in the About Window.
|
|
|
|
// 2018-08-25: Vulkan: Fixed mishandled VkSurfaceCapabilitiesKHR::maxImageCount=0 case.
|
|
|
@ -216,9 +217,9 @@ void ImGui_ImplVulkan_RenderDrawData(ImDrawData* draw_data, VkCommandBuffer comm |
|
|
|
// Create the Vertex and Index buffers:
|
|
|
|
size_t vertex_size = draw_data->TotalVtxCount * sizeof(ImDrawVert); |
|
|
|
size_t index_size = draw_data->TotalIdxCount * sizeof(ImDrawIdx); |
|
|
|
if (!fd->VertexBuffer || fd->VertexBufferSize < vertex_size) |
|
|
|
if (fd->VertexBuffer == VK_NULL_HANDLE || fd->VertexBufferSize < vertex_size) |
|
|
|
CreateOrResizeBuffer(fd->VertexBuffer, fd->VertexBufferMemory, fd->VertexBufferSize, vertex_size, VK_BUFFER_USAGE_VERTEX_BUFFER_BIT); |
|
|
|
if (!fd->IndexBuffer || fd->IndexBufferSize < index_size) |
|
|
|
if (fd->IndexBuffer == VK_NULL_HANDLE || fd->IndexBufferSize < index_size) |
|
|
|
CreateOrResizeBuffer(fd->IndexBuffer, fd->IndexBufferMemory, fd->IndexBufferSize, index_size, VK_BUFFER_USAGE_INDEX_BUFFER_BIT); |
|
|
|
|
|
|
|
// Upload vertex/index data into a single contiguous GPU buffer
|
|
|
@ -262,7 +263,7 @@ void ImGui_ImplVulkan_RenderDrawData(ImDrawData* draw_data, VkCommandBuffer comm |
|
|
|
VkBuffer vertex_buffers[1] = { fd->VertexBuffer }; |
|
|
|
VkDeviceSize vertex_offset[1] = { 0 }; |
|
|
|
vkCmdBindVertexBuffers(command_buffer, 0, 1, vertex_buffers, vertex_offset); |
|
|
|
vkCmdBindIndexBuffer(command_buffer, fd->IndexBuffer, 0, VK_INDEX_TYPE_UINT16); |
|
|
|
vkCmdBindIndexBuffer(command_buffer, fd->IndexBuffer, 0, sizeof(ImDrawIdx) == 2 ? VK_INDEX_TYPE_UINT16 : VK_INDEX_TYPE_UINT32); |
|
|
|
} |
|
|
|
|
|
|
|
// Setup viewport:
|
|
|
|