Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Issue in qvulkanwindow.cpp ?
Forum Updated to NodeBB v4.3 + New Features

Issue in qvulkanwindow.cpp ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 4 Posters 186 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    patrik777
    wrote on last edited by patrik777
    #1

    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 Reply Last reply
    0
    • T Offline
      T Offline
      ty0509
      wrote last edited by
      #2

      I also have this issue, and it did not occur on Qt 6.6.2. If you haven't use any of the qt 6.7 new features maybe consider downgrading the version for now?

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote last edited by
        #3

        Hi,

        Looks like it could be a regression. Can you check if it still happens with the latest version of Qt ? It's the 6.9 series at this time.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • E Offline
          E Offline
          Eugen B.
          wrote last edited by
          #4

          I have just tried similar code with 6.9.1, the issue is present there as well.

          1 Reply Last reply
          0
          • E Offline
            E Offline
            Eugen B.
            wrote last edited by
            #5

            Seems to be the problem with QVulkanWindowPrivate handling of semaphores: it uses only two sets of semaphores, while number of images in the swapchain is 3. Number of sets of semaphores is limited by frameLag variable, which is hardcoded to be 2 (https://github.com/qt/qtbase/blob/e2bd1de82a0a8605a1732ea92c4a5e478018bd46/src/gui/vulkan/qvulkanwindow_p.h#L103). The code also references an example from VK_KHR_swapchain spec, which seems to have been removed.

            If you build your QT from source, there might be a way to fix this - set frameLag to MAX_FRAME_LAG. Unfortunately, I use binary distribution and can't quickly check if that helps.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote last edited by
              #6

              You should check the bug report system to see if it's something known and if not, please open a ticket providing minimal compilable example that triggers the crash.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved