Backends: Vulkan: Amends, fix miscast on 32-bit systems with the right ImTextureID=ImU64. (#914)

docking
ocornut 3 years ago
parent ceb26bac48
commit 6e63fcaca3

@ -543,14 +543,12 @@ void ImGui_ImplVulkan_RenderDrawData(ImDrawData* draw_data, VkCommandBuffer comm
// Bind DescriptorSet with font or user texture
VkDescriptorSet desc_set[1] = { (VkDescriptorSet)pcmd->TextureId };
#if UINTPTR_MAX == 0xffffffff
if (sizeof(ImTextureID) < sizeof(ImU64))
{
// We don't support texture switches if ImTextureID hasn't been redefined to be 64-bit. Do a flaky check that other textures haven't been used.
IM_ASSERT(pcmd->TextureId == (ImTextureID)bd->FontDescriptorSet);
desc_set[0] = bd->FontDescriptorSet;
}
#endif
vkCmdBindDescriptorSets(command_buffer, VK_PIPELINE_BIND_POINT_GRAPHICS, bd->PipelineLayout, 0, 1, desc_set, 0, NULL);
// Draw
@ -708,7 +706,7 @@ bool ImGui_ImplVulkan_CreateFontsTexture(VkCommandBuffer command_buffer)
}
// Store our identifier
io.Fonts->SetTexID((ImTextureID)(intptr_t)bd->FontDescriptorSet);
io.Fonts->SetTexID((ImTextureID)bd->FontDescriptorSet);
return true;
}

Loading…
Cancel
Save