CopperSpice API  1.9.1
QVulkanFunctions Class Reference

Provides cross platform access to the instance level core Vulkan API. More...

Public Methods

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)


class QVulkanInstance

Detailed Description

The CsVulkan library links with the Vulkan API. Applications which link with CsVulkan do not need to link to the Vulkan libraries. Many of the Vulkan functions are resolved dynamically at run time. The methods in the classes QVulkanFunctions and QVulkanDeviceFunctions provide access to the full Vulkan API, excluding any extensions.

Every QVulkanInstance provides one QVulkanFunctions object which is retrievable by calling the QVulkanInstance::functions() method.


The following shows how a user application can access a method in this class.

void MyWindow::render()
VkPhysicalDeviceFeatures features;
QVulkanInstance *instance = vulkanInstance();
QVulkanFunctions *f = instance->functions();
VkResult error = f->vkGetPhysicalDeviceFeatures(device, &features);
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 itself.

Additional Functions

There are two approaches to access additional Vulkan API functions which are not included in this class.

This first technique is to call either QVulkanInstance::getInstanceProcAddr() or QVulkanFunctions::vkGetDeviceProcAddr() in your application. The return value will be a valid function pointer if the Vulkan API function exists in the Vulkan libraries. If the function pointer is a nullptr, the function your application is calling is not available in the current Vulkan implementation. Linking with the Vulkan API is not required.

The other approach is to link your application with the Vulkan API and call the given Vulkan function directly. If the function your application is calling is not available in the current Vulkan implementation, your program will link however it will not run.

Vulkan Documentation

For more information about a specific function refer to the following documentation.  Vulkan 1.3

See also
QVulkanInstance, QVulkanDeviceFunctions, QWindow::setVulkanInstance(), QWindow::setSurfaceType()

Method Documentation

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

Calls vkCreateDevice() in the Vulkan API.

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

Calls vkEnumerateDeviceExtensionProperties() in the Vulkan API.

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

Calls vkEnumerateDeviceLayerProperties() in the Vulkan API.

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

Calls vkEnumerateInstanceExtensionProperties() in the Vulkan API.

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

Calls vkEnumerateInstanceLayerProperties() in the Vulkan API.

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

Calls vkEnumeratePhysicalDevices() in the Vulkan API.

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

Calls vkGetDeviceProcAddr() in the Vulkan API.

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

Calls vkGetPhysicalDeviceFeatures() in the Vulkan API.

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

Calls vkGetPhysicalDeviceFormatProperties() in the Vulkan API.

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

Calls vkGetPhysicalDeviceImageFormatProperties() in the Vulkan API.

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

Calls vkGetPhysicalDeviceMemoryProperties() in the Vulkan API.

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

Calls vkGetPhysicalDeviceProperties() in the Vulkan API.

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

Calls vkGetPhysicalDeviceQueueFamilyProperties() in the Vulkan API.

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

Calls vkGetPhysicalDeviceSparseImageFormatProperties() in the Vulkan API.