VkDeferredOperationInfoKHR(3)

# VkDeferredOperationInfoKHR(3) Manual Page

## Name

VkDeferredOperationInfoKHR - Deferred operation request

Loading... please wait.

## C Specification

The `VkDeferredOperationInfoKHR` structure is defined as:

    typedef struct VkDeferredOperationInfoKHR {
        VkStructureType           sType;
        const void*               pNext;
        VkDeferredOperationKHR    operationHandle;
    } VkDeferredOperationInfoKHR;

## Members

- `sType` is the type of this structure.

- `pNext` is `NULL` or a pointer to an extension-specific structure.

- `operationHandle` is a handle to a tracking object to associate with the deferred operation.

## Description

The application can request deferral of an operation by adding this structure to the argument list of a command or by providing this in the `pNext` chain of a relevant structure for an operation when the corresponding command is invoked. If this structure is not present, no deferral is requested. If `operationHandle` is VK_NULL_HANDLE, no deferral is requested and the command proceeds as if no VkDeferredOperationInfoKHR structure was provided.

When an application requests an operation deferral, the implementation may defer the operation. When deferral is requested and the implementation defers any operation, the implementation must return `VK_OPERATION_DEFERRED_KHR` as the success code if no errors occurred. When deferral is requested, the implementation should defer the operation when the workload is significant, however if the implementation chooses not to defer any of the requested operations and instead executes all of them immediately, the implementation must return `VK_OPERATION_NOT_DEFERRED_KHR` as the success code if no errors occurred.

A deferred operation is created complete with an initial result value of `VK_SUCCESS`. The deferred operation becomes pending when an operation has been successfully deferred with that `operationHandle`.

A deferred operation is considered pending until the deferred operation completes. A pending deferred operation becomes complete when it has been fully executed by one or more threads. Pending deferred operations will never complete until they are joined by an application thread, using vkDeferredOperationJoinKHR. Applications can join multiple threads to the same deferred operation, enabling concurrent execution of subtasks within that operation.

The application can query the status of a VkDeferredOperationKHR using the vkGetDeferredOperationMaxConcurrencyKHR or vkGetDeferredOperationResultKHR commands.

From the perspective of other commands - parameters to the original command that are externally synchronized must not be accessed before the deferred operation completes, and the result of the deferred operation (e.g. object creation) are not considered complete until the deferred operation completes.

If the deferred operation is one which creates an object (for example, a pipeline object), the implementation must allocate that object as it normally would, and return a valid handle to the application. This object is a pending object, and must not be used by the application until the deferred operation is completed (unless otherwise specified by the deferral extension). When the deferred operation is complete, the application should call vkGetDeferredOperationResultKHR to obtain the result of the operation. If `vkGetDeferredOperationResultKHR` indicates failure, the application must destroy the pending object using an appropriate command, so that the implementation has an opportunity to recover the handle. The application must not perform this destruction until the deferred operation is complete. Construction of the pending object uses the same allocator which would have been used if the operation had not been deferred.

Valid Usage

- Any previous deferred operation that was associated with `operationHandle` must be complete

Valid Usage (Implicit)

- `sType` must be `VK_STRUCTURE_TYPE_DEFERRED_OPERATION_INFO_KHR`

## See Also

VkDeferredOperationKHR, VkStructureType

## Document Notes

For more information, see the Vulkan Specification

This page is extracted from the Vulkan Specification. Fixes and changes should be made to the Specification, not directly.

## Copyright

Copyright (c) 2014-2020 Khronos Group. This work is licensed under a Creative Commons Attribution 4.0 International License.