diff --git a/src/gui/vulkan/qvulkanwindow.cpp b/src/gui/vulkan/qvulkanwindow.cpp index 6d12377a600..3eabf729603 100644 --- a/src/gui/vulkan/qvulkanwindow.cpp +++ b/src/gui/vulkan/qvulkanwindow.cpp @@ -2210,6 +2210,23 @@ VkQueue QVulkanWindow::graphicsQueue() const return d->gfxQueue; } +/*! + Returns the family index of the active graphics queue. + + \note Calling this function is only valid from the invocation of + QVulkanWindowRenderer::initResources() up until + QVulkanWindowRenderer::releaseResources(). Implementations of + QVulkanWindowRenderer::updateQueueCreateInfo() can also call this + function. + + \since 5.15 + */ +uint32_t QVulkanWindow::graphicsQueueFamilyIndex() const +{ + Q_D(const QVulkanWindow); + return d->gfxQueueFamilyIdx; +} + /*! Returns the active graphics command pool. diff --git a/src/gui/vulkan/qvulkanwindow.h b/src/gui/vulkan/qvulkanwindow.h index 927c81042fe..91690581380 100644 --- a/src/gui/vulkan/qvulkanwindow.h +++ b/src/gui/vulkan/qvulkanwindow.h @@ -112,6 +112,7 @@ public: const VkPhysicalDeviceProperties *physicalDeviceProperties() const; VkDevice device() const; VkQueue graphicsQueue() const; + uint32_t graphicsQueueFamilyIndex() const; VkCommandPool graphicsCommandPool() const; uint32_t hostVisibleMemoryIndex() const; uint32_t deviceLocalMemoryIndex() const;