-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vulkan backend performance validation layer warning #4238
Comments
While there are probably some improvements that could be made to the way memory is allocated in the backend (I know I've been sitting on some improvements to the D3D12 backend for a while), properly following the intent of that best practice would require either adding a lot of complexity or constraining the design of the Vulkan backend for what is probably marginal performance gains at best.
I'm not super familiar with the Vulkan validation layer, but my understanding is that you can use debug message callbacks to accomplish this. Otherwise, you could just temporarily modify |
Posted by @rickyjames35 in #7027
I believe this warning layer is idiotic. In principle it makes senses to not over-allocate small fragmented blocks, but a single warning layer enabled across a whole application doesn't seem sane and it only drives people to blindly think in terms of satisfying a warning layer at a point in their development path where they probably don't need to. That said:
On a personal level, when you say "I'm still new to Vulkan" my sincere and well-intended suggestion is that you should not be enabling a warning of this kind as it would lead you to over-engineer and distract you from learning. Perhaps the warning layer in question has a system to toggle specific warnings? |
Pretty sure it's the mesh data, which is allocated somewhat suboptimally, but not for lack of honoring this specific validation layer warning. (IE: If we're gonna get pedantic about how the D3D12/Vulkan backends allocate mesh data, there's easier wins without pulling in AMD's memory allocator libraries--this is what I was getting at in my 2021 comment.) Since the buffers are only allocated when they need to grow and there's only two of them, anything to be gained here will be extraordinarily marginal performance-wise.
I'm inclined to agree. If @rickyjames35 is already using Vulkan Memory Allocator this warning isn't going to be super useful anyway. |
It's not that we don't understand the issue, it's that solving it properly isn't really worthwhile. In the backends simplicity and easy of integration is paramount, which makes anything like Vulkan Memory Allocator a non-starter. We could just up our minimum allocation to make the validation layer happy just for the sake of it, but that's not following best practices--it's just making the validation layer happy.
I don't have a strong opinion on this change (seems sensible at a glance), but this is sort-of the core issue with coming to an open source project and decrying the fact that it isn't following best practices. It'd be one thing if you knew this was a fine change because you were experienced with Vulkan--no guess and check--and were submitting a short and simple PR. But by raising issues this way it's just creating more work for everyone who works on Dear ImGui...all for something that happens once during initialization in most apps (and only occasionally in others.) |
Should be fixed by #7189 |
Version: 18307
Branch: master
Back-ends: imgui_impl_vulkan.cpp
Compiler: g++ 10
Operating System: Ubuntu 20.04
Imgui rendering causes performance warnings with the performance validation layers enabled (i.e.
vk::ValidationFeatureEnableEXT::eBestPractices
). For example the functionImGui_ImplVulkan_RenderDrawData
will give the following warnings:The problem is these errors drown errors within the parent program, making it more difficult to asses performance bugs for release builds, and vulkan doesn't have a mechanism to delete valitation in specific snippets.
For example, create the instance like this:
And call
ImGui_ImplVulkan_RenderDrawData
in the render loop.The text was updated successfully, but these errors were encountered: