microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
23.09k stars 6.37k forks source link

[imgui] vulkan-binding but with dynamic function loading #36453

Open qbojj opened 9 months ago

qbojj commented 9 months ago

Is your feature request related to a problem? Please describe.

imgui port exposes vulkan-binding but it uses static function loading. Because of this I have encountered some very hard to diagnose errors (device losses) (that is probably because I have my system configured badly).

Proposed solution

Add something like vulkan-binding-no-prototypes that compiles vulkan-bindings but with added preprocessor flag VK_NO_PROTOTYPES (it should be declared as private)

Describe alternatives you've considered

modify the vulkan-bindings but it would be a breaking change as when compiling with VK_NO_PROTOTYPES , imgui requires a call to ImGui_ImplVulkan_LoadFunctions

Additional context

No response

JonLiu1993 commented 8 months ago

@qbojj, thank you for posting this issue, could you please provide more information according to your needs, I am still a little confused about this feature.

qbojj commented 8 months ago

Essentially, Imgui_ImplVulkan normally links with a dynamic library (Vulkan loader) by default. However, there's an option called IMGUI_IMPL_VULKAN_NO_PROTOTYPES that makes it utilize dynamically loaded functions through the ImGui_ImplVulkan_LoadFunctions function, which is a standard practice for Vulkan libraries.

The issue arose when I was using SDL_Vulkan_GetVkGetInstanceProcAddr alongside a debugging tool that was injecting itself into the get-proc-addr. In this scenario, Imgui was utilizing a non-injected version of vulkan, causing some problems.

To address this, I would expect there to be a second port that also defines the IMGUI_IMPL_VULKAN_NO_PROTOTYPES , ensuring consistency and compatibility with the rest of the program.

github-actions[bot] commented 2 months ago

This is an automated message. Per our repo policy, stale issues get closed if there has been no activity in the past 180 days. The issue will be automatically closed in 14 days. If you wish to keep this issue open, please add a new comment.

qbojj commented 2 months ago

.