vkGetPhysicalDeviceSurfaceSupportKHR
函数原型
| VkResult vkGetPhysicalDeviceSurfaceSupportKHR(
VkPhysicalDevice physicalDevice,
uint32_t queueFamilyIndex,
VkSurfaceKHR surface,
VkBool32* pSupported);
|
描述
查询物理设备的队列族是否支持显式到指定surface。
参数
-
physicalDevice
: 查询的物理设备。
-
queueFamilyIndex
: 队列族索引。
-
surface
: 想要呈现画面的surface。
-
pSupported
: VkBool32的指针,保存查询结果,VK_TRUE表示支持,VK_FALSE表示不支持。
返回值
VK_SUCCESS
: 查询成功。 - 其他 : 查询失败。
代码示例
| int32_t presentFamily = -1;
VkBool32 presentSupport = false;
vkGetPhysicalDeviceSurfaceSupportKHR(device, index, surface, &presentSupport);
if (presentSupport) {
presentFamily = index;
}
|