|
@@ -22,6 +22,7 @@
|
|
|
|
|
|
// CHANGELOG
|
|
|
// (minor and older changes stripped away, please see git history for details)
|
|
|
+// 2020-04-26: Vulkan: Fixed edge case where render callbacks wouldn't be called if the ImDrawData didn't have vertices.
|
|
|
// 2019-08-01: Vulkan: Added support for specifying multisample count. Set ImGui_ImplVulkan_InitInfo::MSAASamples to one of the VkSampleCountFlagBits values to use, default is non-multisampled as before.
|
|
|
// 2019-05-29: Vulkan: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag.
|
|
|
// 2019-04-30: Vulkan: Added support for special ImDrawCallback_ResetRenderState callback to reset render state.
|
|
@@ -274,6 +275,7 @@ static void ImGui_ImplVulkan_SetupRenderState(ImDrawData* draw_data, VkCommandBu
|
|
|
}
|
|
|
|
|
|
// Bind Vertex And Index Buffer:
|
|
|
+ if (draw_data->TotalVtxCount > 0)
|
|
|
{
|
|
|
VkBuffer vertex_buffers[1] = { rb->VertexBuffer };
|
|
|
VkDeviceSize vertex_offset[1] = { 0 };
|
|
@@ -314,7 +316,7 @@ void ImGui_ImplVulkan_RenderDrawData(ImDrawData* draw_data, VkCommandBuffer comm
|
|
|
// Avoid rendering when minimized, scale coordinates for retina displays (screen coordinates != framebuffer coordinates)
|
|
|
int fb_width = (int)(draw_data->DisplaySize.x * draw_data->FramebufferScale.x);
|
|
|
int fb_height = (int)(draw_data->DisplaySize.y * draw_data->FramebufferScale.y);
|
|
|
- if (fb_width <= 0 || fb_height <= 0 || draw_data->TotalVtxCount == 0)
|
|
|
+ if (fb_width <= 0 || fb_height <= 0)
|
|
|
return;
|
|
|
|
|
|
ImGui_ImplVulkan_InitInfo* v = &g_VulkanInitInfo;
|
|
@@ -343,6 +345,7 @@ void ImGui_ImplVulkan_RenderDrawData(ImDrawData* draw_data, VkCommandBuffer comm
|
|
|
CreateOrResizeBuffer(rb->IndexBuffer, rb->IndexBufferMemory, rb->IndexBufferSize, index_size, VK_BUFFER_USAGE_INDEX_BUFFER_BIT);
|
|
|
|
|
|
// Upload vertex/index data into a single contiguous GPU buffer
|
|
|
+ if (vertex_size > 0)
|
|
|
{
|
|
|
ImDrawVert* vtx_dst = NULL;
|
|
|
ImDrawIdx* idx_dst = NULL;
|