gpt4 book ai didi

c++ - 关于如何处理vulkan queue family的问题

转载 作者:行者123 更新时间:2023-11-28 01:13:55 24 4
gpt4 key购买 nike

我正在听这个图 https://vulkan-tutorial.com/Drawing_a_triangle/Presentation/Window_surface

当我读到这篇文章时,我有一些问题。关于队列族

下面的代码是

检查有能力呈现到您的窗口表面的队列族

VkBool32 presentSupport = false;
vkGetPhysicalDeviceSurfaceSupportKHR(device, i, surface, &presentSupport);

if (presentSupport) {
indices.presentFamily = i;
}

这篇文章有这句话。

Note that it's very likely that these end up being the same queue family after all, but throughout the program we will treat them as if they were separate queues for a uniform approach

  1. 为什么要将它们视为统一方法的独立队列?

you could add logic to explicitly prefer a physical device that supports drawing and presentation in the same queue for improved performance.

  1. 添加逻辑以明确首选支持同一队列中的绘图和演示的物理设备。为什么要提高性能?

最佳答案

why treat them as if they were separate queues for a uniform approach?

教程的重点是指导,通常使用尽可能清晰直接的代码。为特殊情况添加一堆逻辑只会混淆示例代码。这对于本系列的早期教程尤其重要。

why improve performance ?

假设您可以使用不同的同步选项,或者如果您知道您将在与渲染图像相同的队列中呈现,则可以不为转移交换链图像的所有权添加障碍。

但这可能不是什么大问题。

关于c++ - 关于如何处理vulkan queue family的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59357510/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com