External Compute Queues
External compute queues are used to join compatible external APIs to a
VkDevice
, allowing workloads submitted through these external APIs to
be executed simultaneously to workloads submitted through Vulkan.
External compute queues are represented by VkExternalComputeQueueNV
handles:
// Provided by VK_NV_external_compute_queue
VK_DEFINE_HANDLE(VkExternalComputeQueueNV)
To create an external compute queue for use by compatible external APIs call:
// Provided by VK_NV_external_compute_queue
VkResult vkCreateExternalComputeQueueNV(
VkDevice device,
const VkExternalComputeQueueCreateInfoNV* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkExternalComputeQueueNV* pExternalQueue);
-
device
is the VkDevice that the external queue will be a part of. -
pCreateInfo
is a pointer to a VkExternalComputeQueueCreateInfoNV structure specifying configuration info for creating the external queue. -
pAllocator
controls host memory allocation as described in the Memory Allocation chapter. -
pExternalQueue
is a pointer to a VkExternalComputeQueueNV object that will be filled with the handle for the created external queue.
To destroy a previously created external compute queue call:
// Provided by VK_NV_external_compute_queue
void vkDestroyExternalComputeQueueNV(
VkDevice device,
VkExternalComputeQueueNV externalQueue,
const VkAllocationCallbacks* pAllocator);
-
device
is the logical device that destroys the external queue. -
externalQueue
is the VkExternalComputeQueueNV to destroy. -
pAllocator
controls host memory allocation as described in the Memory Allocation chapter.
To query the implementation-specific data that must be passed to compatible external APIs during their initialization process call:
// Provided by VK_NV_external_compute_queue
void vkGetExternalComputeQueueDataNV(
VkExternalComputeQueueNV externalQueue,
VkExternalComputeQueueDataParamsNV* params,
void* pData);
-
externalQueue
is the VkExternalComputeQueueNV to query the data for. -
params
is a pointer to a VkExternalComputeQueueDataParamsNV structure specifying parameters required for retrieval of the implementation-specific data. -
pData
is a pointer to application-allocated memory in which the requested data will be returned.
The VkExternalComputeQueueDeviceCreateInfoNV
structure is defined as:
// Provided by VK_NV_external_compute_queue
typedef struct VkExternalComputeQueueDeviceCreateInfoNV {
VkStructureType sType;
const void* pNext;
uint32_t reservedExternalQueues;
} VkExternalComputeQueueDeviceCreateInfoNV;
-
sType
is a VkStructureType value identifying this structure. -
pNext
isNULL
or a pointer to a structure extending this structure. -
reservedExternalQueues
is the maximum number of external queues an application can create at once. This must be less than or equal to themaxExternalQueues
value reported by VkPhysicalDeviceExternalComputeQueuePropertiesNV
The VkExternalComputeQueueCreateInfoNV
structure is defined as:
// Provided by VK_NV_external_compute_queue
typedef struct VkExternalComputeQueueCreateInfoNV {
VkStructureType sType;
const void* pNext;
VkQueue preferredQueue;
} VkExternalComputeQueueCreateInfoNV;
-
sType
is a VkStructureType value identifying this structure. -
pNext
isNULL
or a pointer to a structure extending this structure. -
preferredQueue
is aVkQueue
supporting graphics commands.
When creating a VkExternalComputeQueueNV
, the preferredQueue
field is a strong scheduling hint as to which VkQueue
Vulkan graphics
workloads will be submitted to with the expectation that execution will
overlap with execution of work submitted by the external API.
The VkExternalComputeQueueDataParamsNV
structure is defined as:
// Provided by VK_NV_external_compute_queue
typedef struct VkExternalComputeQueueDataParamsNV {
VkStructureType sType;
const void* pNext;
uint32_t deviceIndex;
} VkExternalComputeQueueDataParamsNV;
-
sType
is a VkStructureType value identifying this structure. -
pNext
isNULL
or a pointer to a structure extending this structure. -
deviceIndex
is the index of the device within a device group that the data is being queried for. This is ignored if device groups are not utilized.
The VkPhysicalDeviceExternalComputeQueuePropertiesNV
structure is
defined as:
// Provided by VK_NV_external_compute_queue
typedef struct VkPhysicalDeviceExternalComputeQueuePropertiesNV {
VkStructureType sType;
void* pNext;
uint32_t externalDataSize;
uint32_t maxExternalQueues;
} VkPhysicalDeviceExternalComputeQueuePropertiesNV;
-
sType
is a VkStructureType value identifying this structure. -
pNext
isNULL
or a pointer to a structure extending this structure. -
externalDataSize
is the minimum size of the memory allocation that applications can pass to vkGetExternalComputeQueueDataNV. -
maxExternalQueues
is the maximum number of external queues that an application can create.