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. QVulkanWindow freezes until window resize on macOS only

QVulkanWindow freezes until window resize on macOS only

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 972 Views 2 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.
  • braernochB Offline
    braernochB Offline
    braernoch
    wrote on last edited by
    #1
    TL;DR:

    The content of my QVulkanWindow widget freezes until I resize the MainWindow, on macOS only. Is this a known issue?

    Context:

    I've made a Vulkan-based Qt app (QMainWindow with Dock and GUI + QVulkanWindow centralWidget for rendered content). I've got the app binary running on Linux, macOS, and Windows.

    On macOS only, the content of the QVulkanWindow widget will periodically freeze and not update until the window is resized. The only Vulkan-related code called upon resize is releaseSwapChainResources() and initSwapChainResources(). The only code at all that I am calling in either of those is to update the renderExtent with the new size in initSwapChainResources():

    // Update render extent
    const QSize vkwSize = vr_qvw->swapChainImageSize();
    VkExtent2D renderExtent = {static_cast<uint32_t>(vkwSize.width()), static_cast<uint32_t>(vkwSize.height())};
    this->vr_vkw->updateExtent(renderExtent);
    this->vr_extent = renderExtent;
    

    The only error-adjacent messages I get when running my application are expected artifacts of using Vulkan with Qt:

    vkDebug: vkCreateMacOSSurfaceMVK() is deprecated. Use vkCreateMetalSurfaceEXT() from the VK_EXT_metal_surface extension.
    vkDebug: VK_ERROR_FEATURE_NOT_PRESENT: Metal does not support disabling primitive restart.
    
    Illustration:

    For example, my program when running can look like this:

    app_frame.png

    And the render will freeze looking like that. While frozen, I can still interact with the application and with the QVulkanWindow in particular. For example, I'll right-click and drag to rotate the model down to see it from above. The content will not change and will still look like the above, because it is frozen.

    But if I inspect the frames with XCode, I see that the MTLDrawablePresent HAS been updated correctly:

    xcode_api_dump.png

    Upon resizing the MainWindow, which calls releaseSwapChainResources() and initSwapChainResources(), the QVulkanWindow will be unfrozen, updating to the new frame as seen in MTLDrawable present, and working correctly until it randomly freezes again. No error messages are displayed at any time.

    I'm working on making an MRE, but that's taking time as my application uses a handmade, monolithic Vulkan program library. You can see the current source of my program here: https://github.com/nolnoch/atomix

    Does anyone know why this would happen?

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

      Hi,

      Sorry I can't answer that question currently but I would suggest to add:

      • which version of Qt you are using
      • which version of macOS you are running your code on
      • which version of the Vulkan library you have

      By the way, are you using the same versions on each OS ?

      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
      • braernochB Offline
        braernochB Offline
        braernoch
        wrote on last edited by
        #3

        Hi, I tried to update the post, but it says I can only edit within 30min.

        Versions:

        • Qt: 6.8.1 (issue present with 6.5.3 and 6.8.0) [for all platforms]
        • Vulkan: 1.3.296 (with same SDK version of MoltenVK for macOS) [for all platforms]
        • Windows: 11
        • Linux: 24.04 LTS
        • macOS: Sequoia 15.1.1

        Yes, I use the same packages for all platforms.

        1 Reply Last reply
        0
        • braernochB Offline
          braernochB Offline
          braernoch
          wrote on last edited by
          #4

          As for an MRE, this problem reproduces with the stock "hellovulkantriangle" example from Qt.

          Issue is present in all tested Qt versions: 6.5.3, 6.8.0, 6.8.1, 6.9.0
          Using Vulkan: 1.3.296 with bundled MotenVK
          On macOS: Sequoia 15.1

          1 Reply Last reply
          0
          • braernochB braernoch referenced this topic on
          • C Offline
            C Offline
            CalebS
            wrote on last edited by
            #5

            I am experiencing the same issue.. Did you ever find a way to make it work?

            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