Issue in qvulkanwindow.cpp ?
-
wrote on 5 Apr 2025, 17:09 last edited by patrik777 26 days ago
I've encountered an issue with QVulkanWindow on Windows that produces validation layer errors. I initially developed a large portion of my Vulkan application on Linux, but when moving to Windows, I started getting validation errors.
When running my application with Vulkan validation layers enabled, I receive this error:vkDebug: vkAcquireNextImageKHR(): Semaphore must not have any pending operations.
The Vulkan spec states: If semaphore is not VK_NULL_HANDLE, it must not have any uncompleted signal or wait operations pending (https://vulkan.lunarg.com/doc/view/1.4.309.0/windows/antora/spec/latest/chapters/VK_KHR_surface/wsi.html#VUID-vkAcquireNextImageKHR-semaphore-01779)To confirm this wasn't an issue with my code, I ran the "hellovulkantriangle" example that ships with Qt, and it produces the same validation error. This suggests the problem is in the Qt Vulkan implementation itself or with how is the class supposed to be used. This is my code, that has same structure as in qt example:
void BaseGame::startNextFrame() { vt::Functions *functions = vt::Functions::instance(); GameEnvironment *gameEnv = GameEnvironment::instance(); VkCommandBuffer cb = p_instruments->window->currentCommandBuffer(); VkRenderPassBeginInfo p_rpBeginInfo = {}; p_rpBeginInfo.sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO; p_rpBeginInfo.renderPass = p_instruments->window->defaultRenderPass(); p_rpBeginInfo.framebuffer = p_instruments->window->currentFramebuffer(); p_rpBeginInfo.renderArea.extent.width = 800; p_rpBeginInfo.renderArea.extent.height = 600; p_rpBeginInfo.clearValueCount = p_instruments->window->sampleCountFlagBits() > VK_SAMPLE_COUNT_1_BIT ? 3 : 2; p_rpBeginInfo.pClearValues = m_clearValues; p_instruments->devFuncs->vkCmdBeginRenderPass(cb, &p_rpBeginInfo, VK_SUBPASS_CONTENTS_INLINE); functions->setViewport(cb, {0, 0}, {gameEnv->swapChainImageSize().width(), 800}); functions->setScissors(cb, {0, 0}, {gameEnv->swapChainImageSize().width(), 600}); p_instruments->devFuncs->vkCmdEndRenderPass(cb); p_instruments->window->frameReady(); p_instruments->window->requestUpdate(); }
Did anybody encounter the same issue as me? What could be a workaround? Thank you.
Qt version: 6.7.3
Vulkan version: 1.4.309.0
1/1