QVulkanFunctions 類

The QVulkanFunctions class provides cross-platform access to the instance level core Vulkan 1.0 API. 更多...

頭: #include <QVulkanFunctions>
qmake: QT += gui
Since: Qt 5.10

公共函數

~QVulkanFunctions ()
VkResult vkCreateDevice (VkPhysicalDevice physicalDevice , const VkDeviceCreateInfo * pCreateInfo , const VkAllocationCallbacks * pAllocator , VkDevice * pDevice )
VkResult vkEnumerateDeviceExtensionProperties (VkPhysicalDevice physicalDevice , const char * pLayerName , uint32_t * pPropertyCount , VkExtensionProperties * pProperties )
VkResult vkEnumerateDeviceLayerProperties (VkPhysicalDevice physicalDevice , uint32_t * pPropertyCount , VkLayerProperties * pProperties )
VkResult vkEnumerateInstanceExtensionProperties (const char * pLayerName , uint32_t * pPropertyCount , VkExtensionProperties * pProperties )
VkResult vkEnumerateInstanceLayerProperties (uint32_t * pPropertyCount , VkLayerProperties * pProperties )
VkResult vkEnumeratePhysicalDevices (VkInstance instance , uint32_t * pPhysicalDeviceCount , VkPhysicalDevice * pPhysicalDevices )
PFN_vkVoidFunction vkGetDeviceProcAddr (VkDevice device , const char * pName )
void vkGetPhysicalDeviceFeatures (VkPhysicalDevice physicalDevice , VkPhysicalDeviceFeatures * pFeatures )
void vkGetPhysicalDeviceFormatProperties (VkPhysicalDevice physicalDevice , VkFormat format , VkFormatProperties * pFormatProperties )
VkResult vkGetPhysicalDeviceImageFormatProperties (VkPhysicalDevice physicalDevice , VkFormat format , VkImageType type , VkImageTiling tiling , VkImageUsageFlags usage , VkImageCreateFlags flags , VkImageFormatProperties * pImageFormatProperties )
void vkGetPhysicalDeviceMemoryProperties (VkPhysicalDevice physicalDevice , VkPhysicalDeviceMemoryProperties * pMemoryProperties )
void vkGetPhysicalDeviceProperties (VkPhysicalDevice physicalDevice , VkPhysicalDeviceProperties * pProperties )
void vkGetPhysicalDeviceQueueFamilyProperties (VkPhysicalDevice physicalDevice , uint32_t * pQueueFamilyPropertyCount , VkQueueFamilyProperties * pQueueFamilyProperties )
void vkGetPhysicalDeviceSparseImageFormatProperties (VkPhysicalDevice physicalDevice , VkFormat format , VkImageType type , VkSampleCountFlagBits samples , VkImageUsageFlags usage , VkImageTiling tiling , uint32_t * pPropertyCount , VkSparseImageFormatProperties * pProperties )

詳細描述

The QVulkanFunctions class provides cross-platform access to the instance level core Vulkan 1.0 API.

默認情況下,Qt 和 Qt 應用程序未鏈接到任何 Vulkan 庫。相反,在運行時動態解析所有函數。每個 QVulkanInstance 提供 QVulkanFunctions 可檢索對象憑藉 QVulkanInstance::functions (). This does not contain device level functions in order to avoid the potential overhead of an internal dispatching. Instead, functions that rely on a device, or a dispatchable child object of a device, are exposed via QVulkanDeviceFunctions and QVulkanInstance::deviceFunctions (). QVulkanFunctions and QVulkanDeviceFunctions together provides access to the full core Vulkan API, excluding any extensions.

注意: QVulkanFunctions instances cannot be constructed directly.

典型用法如下:

    void Window::render()
    {
        QVulkanInstance *inst = vulkanInstance();
        QVulkanFunctions *f = inst->functions();
        ...
        VkResult err = f->vkAllocateCommandBuffers(device, &cmdBufInfo, &cmdBuf);
        ...
    }
					

注意: Windowing system interface (WSI) specifics and extensions are excluded. This class only covers core Vulkan commands, with the exception of instance creation, destruction, and function resolving, since such functionality is covered by QVulkanInstance 本身。

要訪問額外函數,應用程序可以使用 QVulkanInstance::getInstanceProcAddr () 和 vkGetDeviceProcAddr (). Applications can also decide to link to a Vulkan library directly, as platforms with an appropriate loader will typically export function symbols for the core commands. See vkGetInstanceProcAddr 手冊頁 瞭解更多信息。

另請參閱 QVulkanInstance , QVulkanDeviceFunctions , QWindow::setVulkanInstance (),和 QWindow::setSurfaceType ().

成員函數文檔編製

QVulkanFunctions:: ~QVulkanFunctions ()

Destroys the instance of QVulkanFunctions.

VkResult QVulkanFunctions:: vkCreateDevice ( VkPhysicalDevice physicalDevice , const VkDeviceCreateInfo * pCreateInfo , const VkAllocationCallbacks * pAllocator , VkDevice * pDevice )

VkResult QVulkanFunctions:: vkEnumerateDeviceExtensionProperties ( VkPhysicalDevice physicalDevice , const char * pLayerName , uint32_t * pPropertyCount , VkExtensionProperties * pProperties )

VkResult QVulkanFunctions:: vkEnumerateDeviceLayerProperties ( VkPhysicalDevice physicalDevice , uint32_t * pPropertyCount , VkLayerProperties * pProperties )

VkResult QVulkanFunctions:: vkEnumerateInstanceExtensionProperties (const char * pLayerName , uint32_t * pPropertyCount , VkExtensionProperties * pProperties )

VkResult QVulkanFunctions:: vkEnumerateInstanceLayerProperties ( uint32_t * pPropertyCount , VkLayerProperties * pProperties )

VkResult QVulkanFunctions:: vkEnumeratePhysicalDevices ( VkInstance instance , uint32_t * pPhysicalDeviceCount , VkPhysicalDevice * pPhysicalDevices )

PFN_vkVoidFunction QVulkanFunctions:: vkGetDeviceProcAddr ( VkDevice device , const char * pName )

void QVulkanFunctions:: vkGetPhysicalDeviceFeatures ( VkPhysicalDevice physicalDevice , VkPhysicalDeviceFeatures * pFeatures )

void QVulkanFunctions:: vkGetPhysicalDeviceFormatProperties ( VkPhysicalDevice physicalDevice , VkFormat format , VkFormatProperties * pFormatProperties )

VkResult QVulkanFunctions:: vkGetPhysicalDeviceImageFormatProperties ( VkPhysicalDevice physicalDevice , VkFormat format , VkImageType type , VkImageTiling tiling , VkImageUsageFlags usage , VkImageCreateFlags flags , VkImageFormatProperties * pImageFormatProperties )

void QVulkanFunctions:: vkGetPhysicalDeviceMemoryProperties ( VkPhysicalDevice physicalDevice , VkPhysicalDeviceMemoryProperties * pMemoryProperties )

void QVulkanFunctions:: vkGetPhysicalDeviceProperties ( VkPhysicalDevice physicalDevice , VkPhysicalDeviceProperties * pProperties )

void QVulkanFunctions:: vkGetPhysicalDeviceQueueFamilyProperties ( VkPhysicalDevice physicalDevice , uint32_t * pQueueFamilyPropertyCount , VkQueueFamilyProperties * pQueueFamilyProperties )

void QVulkanFunctions:: vkGetPhysicalDeviceSparseImageFormatProperties ( VkPhysicalDevice physicalDevice , VkFormat format , VkImageType type , VkSampleCountFlagBits samples , VkImageUsageFlags usage , VkImageTiling tiling , uint32_t * pPropertyCount , VkSparseImageFormatProperties * pProperties )