Git Product home page Git Product logo

Comments (3)

danylorudenko avatar danylorudenko commented on May 27, 2024

Just as I pressed publish, another find:

While this can be a long discussion I decided to avoid modifying ImGui files and tried to settle with handling such cases via the callback. I give priority to loading device-level functions and if I fail, fallback to instance-level functions.
image

Spoiler: it didn't help. vkBeginRenderingKHR and vkEndRenderingKHR could not be found in device, so they're still requested from the instance.
image

But I found another difference in regards of obtaining vulkan functions:

ImGui uses KHR variant
image

While my ImportTable uses clean variant
image

So I returned to imgui_impl_vulkan.cpp and removed KHR postfix in the strings for Begin/End rendering and we're golden! Functions successfully obtained from the device
image
image

Note: For my app I create Vulkan 1.3 instance and have validation layers enabled for it

from imgui.

danylorudenko avatar danylorudenko commented on May 27, 2024

Because it can be very setup-specific, here's my Vulkan SDK version, driver and related hardware:

Vulkan SDK: 1.3.261.0
Nvidia GeForce RTX 3070
Driver version: 543.33

from imgui.

ocornut avatar ocornut commented on May 27, 2024

Hello,

Thanks for the careful report! Dealing with fringe backend-related issues, and in particular Vulkan ones, has been too time consuming so for now I haven't really read this.
The (unfortunate :) goal is that the vulkan backend should ideally work for everyone in every condition.

I am open to PR with solution given than you carefully research the reason current things are in place this way (you can generally use git blame). The trail gives: 121072c, 7812e83, #5446, #5037, see discussions in those threads.

Thank you!

So I have defines that force ImGui to do almost the same thing:
#define IMGUI_IMPL_VULKAN_HAS_DYNAMIC_RENDERING

FYI you shouldn't need to define this, it's defined automatically when the Vulkan header version has it.

Is it worth providing Device-level function loading?

Unless I am mistaken, in your specific configuration IMGUI_IMPL_VULKAN_USE_LOADER will NOT be defined, therefore this code in imgui_impl_vulkan never runs:

ImGuiImplVulkanFuncs_vkCmdBeginRenderingKHR = reinterpret_cast<PFN_vkCmdBeginRenderingKHR>(vkGetInstanceProcAddr(info->Instance, "vkCmdBeginRenderingKHR"));
ImGuiImplVulkanFuncs_vkCmdEndRenderingKHR = reinterpret_cast<PFN_vkCmdEndRenderingKHR>(vkGetInstanceProcAddr(info->Instance, "vkCmdEndRenderingKHR"));

Therefore the only function loading code that runs is through your loader?
I am right? In that case it wouldn't be of any use if those two lines where complemented with the equivalent call to vkGetDeviceProcAddr() ?

So I returned to imgui_impl_vulkan.cpp and removed KHR postfix in the strings for Begin/End rendering and we're golden! Functions successfully obtained from the device

I noticed by looking at your screenshots that your version of the code is before b720c0f. This was meant to solve another issue but it interfere in same places of the code making this a little confusion.

    1. Could you update to latest?
    1. Then confirm things based on latest and help decide what we can do in the backend to fix this for you?

Thanks a lot!

from imgui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.