Coder Social home page Coder Social logo

Glfw + Vulkan: backend don't properly handle when vkQueuePresentKHR & vkAcquireNextImageKHR produce VK_ERROR_OUT_OF_DATE_KHR about imgui HOT 5 CLOSED

InsideBSITheSecond avatar InsideBSITheSecond commented on May 29, 2024
Glfw + Vulkan: backend don't properly handle when vkQueuePresentKHR & vkAcquireNextImageKHR produce VK_ERROR_OUT_OF_DATE_KHR

from imgui.

Comments (5)

InsideBSITheSecond avatar InsideBSITheSecond commented on May 29, 2024

So after digging a bit deeper into this I found that my issue may be related to #3758
When I skip the error check as shown in the middle of the video (just after vkAcquireNextImageKHR), it keep executing until it reaches vkQueuePresentKHR cff8162 after which it get stuck on the first vkDeviceWaitIdle it encounters at line 1419 in ImGui_ImplVulkanH_CreateWindowSwapChain (after entering ImGui_ImplVulkanH_CreateOrResizeWindow).

Producing 2 validation errors on the way
from vkQueueSubmit around line 1854 (imgui_impl_vulkan.cpp):
[vulkan] Debug report from ObjectType: 5 Message: Validation Error: [ VUID-vkQueueSubmit-pWaitSemaphores-03238 ] Object 0: handle = 0x9f58380000000064, type = VK_OBJECT_TYPE_SEMAPHORE; Object 1: handle = 0x5555558a7030, type = VK_OBJECT_TYPE_QUEUE; | MessageID = 0xb50452b0 | vkQueueSubmit(): pSubmits[0].pWaitSemaphores[0] queue (VkQueue 0x5555558a7030[]) is waiting on semaphore (VkSemaphore 0x9f58380000000064[]) that has no way to be signaled. The Vulkan spec states: All elements of the pWaitSemaphores member of all elements of pSubmits created with a VkSemaphoreType of VK_SEMAPHORE_TYPE_BINARY must reference a semaphore signal operation that has been submitted for execution and any semaphore signal operations on which it depends must have also been submitted for execution (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-vkQueueSubmit-pWaitSemaphores-03238)

from vkQueuePresentKHR near line 1878 (imgui_impl_vulkan.cpp)
[vulkan] Debug report from ObjectType: 27 Message: Validation Error: [ VUID-VkPresentInfoKHR-pImageIndices-01430 ] Object 0: handle = 0x625f640000000058, type = VK_OBJECT_TYPE_SWAPCHAIN_KHR; | MessageID = 0x48ad24c6 | vkQueuePresentKHR(): pPresentInfo->pSwapchains[0] image at index 1 was not acquired from the swapchain. The Vulkan spec states: Each element of pImageIndices must be the index of a presentable image acquired from the swapchain specified by the corresponding element of the pSwapchains array, and the presented image subresource must be in the VK_IMAGE_LAYOUT_PRESENT_SRC_KHR or VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR layout at the time the operation is executed on a VkDevice (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-VkPresentInfoKHR-pImageIndices-01430)

and if I try to not only skip the check but call ImGui_ImplVulkanH_CreateOrResizeWindow like here cff8162 I get:

[vulkan] Debug report from ObjectType: 1 Message: Validation Error: [ VUID-VkSubmitInfo-pWaitSemaphores-parameter ] Object 0: handle = 0x555555928e50, type = VK_OBJECT_TYPE_INSTANCE; | MessageID = 0xb0d79520 | vkQueueSubmit(): pSubmits[0].pWaitSemaphores[0] Invalid VkSemaphore Object 0x7ffff236fbe8. The Vulkan spec states: If waitSemaphoreCount is not 0, pWaitSemaphores must be a valid pointer to an array of waitSemaphoreCount valid VkSemaphore handles (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-VkSubmitInfo-pWaitSemaphores-parameter)

[vulkan] Debug report from ObjectType: 1 Message: Validation Error: [ VUID-VkSubmitInfo-pSignalSemaphores-parameter ] Object 0: handle = 0x555555928e50, type = VK_OBJECT_TYPE_INSTANCE; | MessageID = 0xb108ab13 | vkQueueSubmit(): pSubmits[0].pSignalSemaphores[0] Invalid VkSemaphore Object 0x100000001. The Vulkan spec states: If signalSemaphoreCount is not 0, pSignalSemaphores must be a valid pointer to an array of signalSemaphoreCount valid VkSemaphore handles (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-VkSubmitInfo-pSignalSemaphores-parameter)

EDIT:
Long story short: vkQueuePresentKHR & vkAcquireNextImageKHR produce VK_ERROR_OUT_OF_DATE_KHR in certain situations and it seems like it's not handled properly when it happens

from imgui.

InsideBSITheSecond avatar InsideBSITheSecond commented on May 29, 2024

#7513 should fix this

from imgui.

ocornut avatar ocornut commented on May 29, 2024

For the records, linking to past similar stuff done for main viewport:

from imgui.

ocornut avatar ocornut commented on May 29, 2024

I realize that #3390 aimed to solve the same problem, but it ended up in Vulkan-confusion-procrastination-quagmire.
So hopefully we can close 4-5 issues/pr together here.

from imgui.

ocornut avatar ocornut commented on May 29, 2024

This should now be fixed, see other PR:
#3390 (comment)

Both PR were AFAIK near identical in results, given the complexity of this, I would appreciate if everyone affected could confirm that it fixes the situation for them. Thanks everyone!

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.