簡體   English   中英

在 Vulkan Qt 中獲取隊列族

[英]Get Queue Families in Vulkan Qt

我正在使用QVulkanWindow示例,嘗試加載圖像並將其顯示在 Qt 窗口中。

這將設置 Vulkan 實例:

if (!inst.create())
    qFatal("Failed to create Vulkan instance: %d", inst.errorCode());

VulkanWindow w;
w.setVulkanInstance(&inst);

現在在initResources()類的initResources()中,我想從設備獲取 GraphicsQueue:

m_devFuncs->vkGetDeviceQueue(device, VK_QUEUE_GRAPHICS_BIT, 0, &graphicsQueue);

我得到的錯誤是:

vkDebug: Validation: 0:  [ VUID-vkGetDeviceQueue-queueFamilyIndex-00384 ] Object: 0x564e779a5f90 (Type = 3) | 
vkGetDeviceQueue: queueFamilyIndex (= 1) is not one of the queue families given via VkDeviceQueueCreateInfo structures when the device was created. 
The Vulkan spec states: queueFamilyIndex must be one of the queue family indices specified when device was created, via the VkDeviceQueueCreateInfo structure 

Qt沒有設置圖形隊列嗎? 還是我做錯了? 還是應該創建自己的 VkInstance 並將其傳遞給 Qt?

VK_QUEUE_GRAPHICS_BIT是一個枚舉數,而不是一個隊列族索引。 所以該代碼從根本上是不正確的。

QVulkanWindowgraphicsQueue()方法返回一個您可以使用的VkQueue

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM