'Get Vulkan swap chain image from QQuickWindow
I'm trying to incorporate external Vulkan render commands inside the Qt Quick scenegraph following the example here. I would like to get access to current swap chain image and issue draw commands on it. QVulkanWindow has QVulkanWindow::currentSwapChainImageIndex() and QVulkanWindow::swapChainImage(int index), however I don't know how to get these from a QQuickWindow. QQuickWindow has an associated QSGRendererInterface that can be used as follows:
// m_window is a QQuickWindow*
auto instance = m_window->vulkanInstance();
QSGRendererInterface *rif = m_window->rendererInterface();
auto physicalDevice = *reinterpret_cast<VkPhysicalDevice*>(rif->getResource(m_window, QSGRendererInterface::PhysicalDeviceResource));
Is there a way to query the current swap chain image for a QQuickWindow?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
