Data graphs
Data graph pipelines encapsulate computational graphs that operate on whole resources (e.g. tensors). The graph operations that form these computational graphs are executed by graph processing engines.
Pipeline Creation
To create data graph pipelines, call:
// Provided by VK_ARM_data_graph
VkResult vkCreateDataGraphPipelinesARM(
VkDevice device,
VkDeferredOperationKHR deferredOperation,
VkPipelineCache pipelineCache,
uint32_t createInfoCount,
const VkDataGraphPipelineCreateInfoARM* pCreateInfos,
const VkAllocationCallbacks* pAllocator,
VkPipeline* pPipelines);
-
deviceis the logical device that creates the data graph pipelines. -
deferredOperationis VK_NULL_HANDLE or the handle of a valid VkDeferredOperationKHR request deferral object for this command. -
pipelineCacheis either VK_NULL_HANDLE, indicating that pipeline caching is disabled; or the handle of a valid pipeline cache object, in which case use of that cache is enabled for the duration of the command. -
createInfoCountis the length of thepCreateInfosandpPipelinesarrays. -
pCreateInfosis a pointer to an array of VkDataGraphPipelineCreateInfoARM structures. -
pAllocatorcontrols host memory allocation as described in the Memory Allocation chapter. -
pPipelinesis a pointer to an array of VkPipeline handles in which the resulting data graph pipelines objects are returned.
The implementation will create a pipeline in each element of
pPipelines from the corresponding element of pCreateInfos.
If the creation of any pipeline fails, that pipeline will be set to
VK_NULL_HANDLE.
The VkDataGraphPipelineCreateInfoARM structure is defined as:
// Provided by VK_ARM_data_graph
typedef struct VkDataGraphPipelineCreateInfoARM {
VkStructureType sType;
const void* pNext;
VkPipelineCreateFlags2 flags;
VkPipelineLayout layout;
uint32_t resourceInfoCount;
const VkDataGraphPipelineResourceInfoARM* pResourceInfos;
} VkDataGraphPipelineCreateInfoARM;
-
sTypeis a VkStructureType value identifying this structure. -
pNextisNULLor a pointer to a structure extending this structure. -
flagsis a bitmask of VkPipelineCreateFlagBits2KHR specifying how the pipeline will be generated. -
layoutis the description of binding locations used by both the pipeline and descriptor sets used with the pipeline. -
resourceInfoCountis the length of thepResourceInfosarray. -
pResourceInfosis a pointer to an array of VkDataGraphPipelineResourceInfoARM structures.
Applications can create a data graph pipeline entirely from data present in
a pipeline cache.
This is done by including a VkDataGraphPipelineIdentifierCreateInfoARM
structure in the pNext chain.
If the required data is not found in the pipeline cache, creating the data
graph pipeline is not possible and the implementation must fail as
specified by VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT.
Applications can create a data graph pipeline without providing a pipeline
cache or shader module by invoking one of the models provided by the
implementation.
This is done by including
VkDataGraphPipelineBuiltinModelCreateInfoQCOM in the pNext
chain.
When an identifier or built-in model is used to create a data graph pipeline, implementations may fail pipeline creation with VK_PIPELINE_COMPILE_REQUIRED for any reason.
The data graph engines for this pipeline can be selected by including a
VkDataGraphProcessingEngineCreateInfoARM to the pNext chain of
this structure.
Otherwise,
VK_PHYSICAL_DEVICE_DATA_GRAPH_PROCESSING_ENGINE_TYPE_DEFAULT_ARM will
be used as the sole data graph engine.
The data graph operations that this pipeline uses must be supported for the data graph engines selected for this pipeline as retrieved by vkGetPhysicalDeviceQueueFamilyDataGraphPropertiesARM.
The VkDataGraphPipelineShaderModuleCreateInfoARM structure is defined
as:
// Provided by VK_ARM_data_graph
typedef struct VkDataGraphPipelineShaderModuleCreateInfoARM {
VkStructureType sType;
const void* pNext;
VkShaderModule module;
const char* pName;
const VkSpecializationInfo* pSpecializationInfo;
uint32_t constantCount;
const VkDataGraphPipelineConstantARM* pConstants;
} VkDataGraphPipelineShaderModuleCreateInfoARM;
-
sTypeis a VkStructureType value identifying this structure. -
pNextisNULLor a pointer to a structure extending this structure. -
moduleis optionally a VkShaderModule object containing the description of the graph. -
pNameis a pointer to a null-terminated UTF-8 string specifying the graph entry point name for this pipeline. -
pSpecializationInfois a pointer to a VkSpecializationInfo structure as described in Specialization Constants, orNULL. -
constantCountis the length of thepConstantsarray. -
pConstantsis a pointer to an array of VkDataGraphPipelineConstantARM structures.
If module is not VK_NULL_HANDLE, the pipeline’s graph is defined
by module.
If module is VK_NULL_HANDLE, the pipeline’s graph is defined by
the chained VkShaderModuleCreateInfo.
The VkDataGraphPipelineIdentifierCreateInfoARM structure is defined
as:
// Provided by VK_ARM_data_graph
typedef struct VkDataGraphPipelineIdentifierCreateInfoARM {
VkStructureType sType;
const void* pNext;
uint32_t identifierSize;
const uint8_t* pIdentifier;
} VkDataGraphPipelineIdentifierCreateInfoARM;
-
sTypeis a VkStructureType value identifying this structure. -
pNextisNULLor a pointer to a structure extending this structure. -
identifierSizeis the size in bytes of the identifier data accessible viapIdentifier. -
pIdentifieris a pointer toidentifierSizebytes of data that describe the pipeline being created.
The pIdentifier can be retrieved from the device by calling
vkGetDataGraphPipelinePropertiesARM and searching the results for a
VkDataGraphPipelinePropertyQueryResultARM structure with
property set to VK_DATA_GRAPH_PIPELINE_PROPERTY_IDENTIFIER_ARM.
The VkDataGraphPipelineBuiltinModelCreateInfoQCOM structure is defined
as:
// Provided by VK_QCOM_data_graph_model
typedef struct VkDataGraphPipelineBuiltinModelCreateInfoQCOM {
VkStructureType sType;
const void* pNext;
const VkPhysicalDeviceDataGraphOperationSupportARM* pOperation;
} VkDataGraphPipelineBuiltinModelCreateInfoQCOM;
-
sTypeis a VkStructureType value identifying this structure. -
pNextisNULLor a pointer to a structure extending this structure. -
pOperationis a VkPhysicalDeviceDataGraphOperationSupportARM specifying the built-in operation.
The pipelineCache is ignored for the creation of this pipeline.
Applications can specify arguments to the built-in operation named in
pOperation with VkDataGraphPipelineCompilerControlCreateInfoARM.
Applications should verify that the pVendorOptions, layout, and
other state included with this pipeline creation are compatible with the
pOperation.
Implementations may fail if any state is not compatible and return
VK_PIPELINE_COMPILE_REQUIRED.
|
Built-in models are defined by the provider of the model, therefore Vulkan does not define model compatibility. The application should refer to the provider of the built-in model for guidance on compatibility. |
The VkDataGraphPipelineCompilerControlCreateInfoARM structure is
defined as:
// Provided by VK_ARM_data_graph
typedef struct VkDataGraphPipelineCompilerControlCreateInfoARM {
VkStructureType sType;
const void* pNext;
const char* pVendorOptions;
} VkDataGraphPipelineCompilerControlCreateInfoARM;
-
sTypeis a VkStructureType value identifying this structure. -
pNextisNULLor a pointer to a structure extending this structure. -
pVendorOptionsis a null-terminated UTF-8 string specifying implementation-specific options that affect the creation of a data graph pipeline.
The VkDataGraphPipelineConstantARM structure is defined as:
// Provided by VK_ARM_data_graph
typedef struct VkDataGraphPipelineConstantARM {
VkStructureType sType;
const void* pNext;
uint32_t id;
const void* pConstantData;
} VkDataGraphPipelineConstantARM;
-
sTypeis a VkStructureType value identifying this structure. -
pNextis a pointer to a structure extending this structure. -
idis the unique identifier of the graph constant this structure describes. -
pConstantDatais a pointer to the data for this graph constant.
The size and layout of the data pointed to by pConstantData is
specified by a specific structure in the pNext chain for each type of
graph constant.
For graph constants of tensor type, the layout of the data is specified by a VkTensorDescriptionARM structure. The data must be laid out according to the following members of this structure:
-
VkTensorDescriptionARM::
tiling -
VkTensorDescriptionARM::
format -
VkTensorDescriptionARM::
dimensionCount -
VkTensorDescriptionARM::
pDimensions -
VkTensorDescriptionARM::
pStrides
The presence of a
VkDataGraphPipelineConstantTensorSemiStructuredSparsityInfoARM
structure in the pNext chain has no impact on the expected layout of
the data pointed to by pConstantData.
The VkDataGraphPipelineConstantTensorSemiStructuredSparsityInfoARM
structure is defined as:
// Provided by VK_ARM_data_graph with VK_ARM_tensors
typedef struct VkDataGraphPipelineConstantTensorSemiStructuredSparsityInfoARM {
VkStructureType sType;
const void* pNext;
uint32_t dimension;
uint32_t zeroCount;
uint32_t groupSize;
} VkDataGraphPipelineConstantTensorSemiStructuredSparsityInfoARM;
-
sTypeis a VkStructureType value identifying this structure. -
pNextisNULLor a pointer to a structure extending this structure. -
dimensionis the dimension of the tensor along which its data is sparse. -
zeroCountis the number of tensor elements that must be zero in every group ofgroupSizeelements. -
groupSizeis the number of tensor elements in a group.
|
This extension does not provide applications with a way of knowing which
combinations of |
The VkDataGraphPipelineResourceInfoARM structure is defined as:
// Provided by VK_ARM_data_graph
typedef struct VkDataGraphPipelineResourceInfoARM {
VkStructureType sType;
const void* pNext;
uint32_t descriptorSet;
uint32_t binding;
uint32_t arrayElement;
} VkDataGraphPipelineResourceInfoARM;
-
sTypeis a VkStructureType value identifying this structure. -
pNextisNULLor a pointer to a structure extending this structure. -
descriptorSetis the descriptor set number of the resource being described. -
bindingis the binding number of the resource being described. -
arrayElementis the element in the resource array ifdescriptorSetandbindingidentifies an array of resources or0otherwise.
The VkDataGraphPipelineResourceInfoImageLayoutARM structure is defined
as:
// Provided by VK_ARM_data_graph_optical_flow
typedef struct VkDataGraphPipelineResourceInfoImageLayoutARM {
VkStructureType sType;
const void* pNext;
VkImageLayout layout;
} VkDataGraphPipelineResourceInfoImageLayoutARM;
-
sTypeis a VkStructureType value identifying this structure. -
pNextisNULLor a pointer to a structure extending this structure. -
layoutspecifies the layout that the image subresource accessible from the view provided as a graph pipeline resource must be in at the time where the graph pipeline being created is dispatched.
The VkDataGraphPipelineSingleNodeCreateInfoARM structure is defined
as:
// Provided by VK_ARM_data_graph_optical_flow
typedef struct VkDataGraphPipelineSingleNodeCreateInfoARM {
VkStructureType sType;
void* pNext;
VkDataGraphPipelineNodeTypeARM nodeType;
uint32_t connectionCount;
const VkDataGraphPipelineSingleNodeConnectionARM* pConnections;
} VkDataGraphPipelineSingleNodeCreateInfoARM;
-
sTypeis a VkStructureType value identifying this structure. -
pNextisNULLor a pointer to a structure extending this structure. -
nodeTypeis a VkDataGraphPipelineNodeTypeARM describing the type of this node. -
connectionCountis the length of thepConnectionsarray. -
pConnectionsis a pointer to an array ofconnectionCountVkDataGraphPipelineSingleNodeConnectionARM structures.
Possible values of VkDataGraphPipelineNodeTypeARM, specifying the type of a data graph pipeline node, are:
// Provided by VK_ARM_data_graph_optical_flow
typedef enum VkDataGraphPipelineNodeTypeARM {
// Provided by VK_ARM_data_graph_optical_flow
VK_DATA_GRAPH_PIPELINE_NODE_TYPE_OPTICAL_FLOW_ARM = 1000631000,
} VkDataGraphPipelineNodeTypeARM;
-
VK_DATA_GRAPH_PIPELINE_NODE_TYPE_OPTICAL_FLOW_ARM corresponds to an optical flow node.
The VkDataGraphPipelineSingleNodeConnectionARM structure is defined
as:
// Provided by VK_ARM_data_graph_optical_flow
typedef struct VkDataGraphPipelineSingleNodeConnectionARM {
VkStructureType sType;
void* pNext;
uint32_t set;
uint32_t binding;
VkDataGraphPipelineNodeConnectionTypeARM connection;
} VkDataGraphPipelineSingleNodeConnectionARM;
-
sTypeis a VkStructureType value identifying this structure. -
pNextisNULLor a pointer to a structure extending this structure. -
setis the descriptor set number of the graph pipeline layout resource to be connected to this connection point. -
bindingis the binding number of the graph pipeline layout resource to be connected to this connection point. -
connectionis a VkDataGraphPipelineNodeConnectionTypeARM specifying the connection point to link to a graph pipeline layout resource.
Possible values of VkDataGraphPipelineNodeConnectionTypeARM, specifying the connection points of a data graph pipeline node, are:
// Provided by VK_ARM_data_graph_optical_flow
typedef enum VkDataGraphPipelineNodeConnectionTypeARM {
// Provided by VK_ARM_data_graph_optical_flow
VK_DATA_GRAPH_PIPELINE_NODE_CONNECTION_TYPE_OPTICAL_FLOW_INPUT_ARM = 1000631000,
// Provided by VK_ARM_data_graph_optical_flow
VK_DATA_GRAPH_PIPELINE_NODE_CONNECTION_TYPE_OPTICAL_FLOW_REFERENCE_ARM = 1000631001,
// Provided by VK_ARM_data_graph_optical_flow
VK_DATA_GRAPH_PIPELINE_NODE_CONNECTION_TYPE_OPTICAL_FLOW_HINT_ARM = 1000631002,
// Provided by VK_ARM_data_graph_optical_flow
VK_DATA_GRAPH_PIPELINE_NODE_CONNECTION_TYPE_OPTICAL_FLOW_FLOW_VECTOR_ARM = 1000631003,
// Provided by VK_ARM_data_graph_optical_flow
VK_DATA_GRAPH_PIPELINE_NODE_CONNECTION_TYPE_OPTICAL_FLOW_COST_ARM = 1000631004,
} VkDataGraphPipelineNodeConnectionTypeARM;
-
VK_DATA_GRAPH_PIPELINE_NODE_CONNECTION_TYPE_OPTICAL_FLOW_INPUT_ARM specifies the connection point for the input image of an optical flow node.
-
VK_DATA_GRAPH_PIPELINE_NODE_CONNECTION_TYPE_OPTICAL_FLOW_REFERENCE_ARM specifies the connection point for the input reference image of an optical flow node.
-
VK_DATA_GRAPH_PIPELINE_NODE_CONNECTION_TYPE_OPTICAL_FLOW_HINT_ARM specifies the connection point for the optional external hint flow vector map of an optical flow node.
-
VK_DATA_GRAPH_PIPELINE_NODE_CONNECTION_TYPE_OPTICAL_FLOW_FLOW_VECTOR_ARM specifies the connection point for the output flow vector map of an optical flow node.
-
VK_DATA_GRAPH_PIPELINE_NODE_CONNECTION_TYPE_OPTICAL_FLOW_COST_ARM specifies the connection point for the optional output cost map of an optical flow node.
Sessions
Graph pipelines execute within data graph pipeline sessions that provide a context for their execution as well as binding points for the memory they need (e.g. transient storage).
Graph pipeline sessions are represented by
VkDataGraphPipelineSessionARM handles:
// Provided by VK_ARM_data_graph
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDataGraphPipelineSessionARM)
To create a data graph pipeline session, call
// Provided by VK_ARM_data_graph
VkResult vkCreateDataGraphPipelineSessionARM(
VkDevice device,
const VkDataGraphPipelineSessionCreateInfoARM* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkDataGraphPipelineSessionARM* pSession);
-
deviceis the logical device that creates the data graph pipeline session. -
pCreateInfois a pointer to a VkDataGraphPipelineSessionCreateInfoARM structure. -
pAllocatorcontrols host memory allocation as described in the Memory Allocation chapter. -
pSessionis a pointer to a VkDataGraphPipelineSessionARM handle in which the resulting data graph pipeline session object is returned.
The VkDataGraphPipelineSessionCreateInfoARM structure is defined as:
// Provided by VK_ARM_data_graph
typedef struct VkDataGraphPipelineSessionCreateInfoARM {
VkStructureType sType;
const void* pNext;
VkDataGraphPipelineSessionCreateFlagsARM flags;
VkPipeline dataGraphPipeline;
} VkDataGraphPipelineSessionCreateInfoARM;
-
sTypeis a VkStructureType value identifying this structure. -
pNextisNULLor a pointer to a structure extending this structure. -
flagsis a bitmask of VkDataGraphPipelineSessionCreateFlagBitsARM describing additional parameters of the session. -
dataGraphPipelineis the VkPipeline handle of the data graph pipeline for which a session is being created.
Bits which can be set in
VkDataGraphPipelineSessionCreateInfoARM::flags, specifying
additional parameters of a data graph pipeline session, are:
// Provided by VK_ARM_data_graph
// Flag bits for VkDataGraphPipelineSessionCreateFlagBitsARM
typedef VkFlags64 VkDataGraphPipelineSessionCreateFlagBitsARM;
static const VkDataGraphPipelineSessionCreateFlagBitsARM VK_DATA_GRAPH_PIPELINE_SESSION_CREATE_PROTECTED_BIT_ARM = 0x00000001ULL;
// Provided by VK_ARM_data_graph_optical_flow
static const VkDataGraphPipelineSessionCreateFlagBitsARM VK_DATA_GRAPH_PIPELINE_SESSION_CREATE_OPTICAL_FLOW_CACHE_BIT_ARM = 0x00000002ULL;
-
VK_DATA_GRAPH_PIPELINE_SESSION_CREATE_PROTECTED_BIT_ARM specifies that the data graph pipeline session is backed by protected memory.
-
VK_DATA_GRAPH_PIPELINE_SESSION_CREATE_OPTICAL_FLOW_CACHE_BIT_ARM specifies that the data graph pipeline session has a cache for optical flow operations. Enabling the cache is required for the implementation to use temporal hints.
// Provided by VK_ARM_data_graph
typedef VkFlags64 VkDataGraphPipelineSessionCreateFlagsARM;
VkDataGraphPipelineSessionCreateFlagsARM is a bitmask type for setting
a mask of zero or more VkDataGraphPipelineSessionCreateFlagBitsARM.
To determine the bind point requirements for a data graph pipeline session, call:
// Provided by VK_ARM_data_graph
VkResult vkGetDataGraphPipelineSessionBindPointRequirementsARM(
VkDevice device,
const VkDataGraphPipelineSessionBindPointRequirementsInfoARM* pInfo,
uint32_t* pBindPointRequirementCount,
VkDataGraphPipelineSessionBindPointRequirementARM* pBindPointRequirements);
-
deviceis the logical device that owns the data graph pipeline session. -
pInfois a pointer to a VkDataGraphPipelineSessionBindPointRequirementsInfoARM structure containing parameters for the bind point requirements query. -
pBindPointRequirementCountis a pointer to an integer related to the number of bind point available or queried, as described below. -
pBindPointRequirementsis eitherNULLor a pointer to an array of VkDataGraphPipelineSessionBindPointRequirementARM structures.
If pBindPointRequirements is NULL, then the number of bind points
associated with the data graph pipeline session is returned in
pBindPointRequirementCount.
Otherwise, pBindPointRequirementCount must point to a variable set by
the user to the number of elements in the pBindPointRequirements
array, and on return the variable is overwritten with the number of
structures actually written to pBindPointRequirements.
If pBindPointRequirementCount is less than the number of bind points
associated with the data graph pipeline session, at most
pBindPointRequirementCount structures will be written, and
VK_INCOMPLETE will be returned instead of VK_SUCCESS, to
indicate that not all the required bind points were returned.
// Provided by VK_ARM_data_graph
typedef struct VkDataGraphPipelineSessionBindPointRequirementsInfoARM {
VkStructureType sType;
const void* pNext;
VkDataGraphPipelineSessionARM session;
} VkDataGraphPipelineSessionBindPointRequirementsInfoARM;
-
sTypeis a VkStructureType value identifying this structure. -
pNextisNULLor a pointer to a structure extending this structure. -
sessionis a VkDataGraphPipelineSessionARM specifying the data graph pipeline session whose bind point requirements are being queried.
// Provided by VK_ARM_data_graph
typedef struct VkDataGraphPipelineSessionBindPointRequirementARM {
VkStructureType sType;
void* pNext;
VkDataGraphPipelineSessionBindPointARM bindPoint;
VkDataGraphPipelineSessionBindPointTypeARM bindPointType;
uint32_t numObjects;
} VkDataGraphPipelineSessionBindPointRequirementARM;
-
sTypeis a VkStructureType value identifying this structure. -
pNextisNULLor a pointer to a structure extending this structure. -
bindPointis a VkDataGraphPipelineSessionBindPointARM specifying the data graph pipeline session bind point being required. -
bindPointTypeis a VkDataGraphPipelineSessionBindPointTypeARM specifying the type of object required forbindPoint. -
numObjectsis the number of objects required forbindPoint.
Implementations must always return 1 for numObjects if
bindPoint is one of the following bind points:
Possible values of VkDataGraphPipelineSessionBindPointARM, specifying the bind point of a data graph pipeline session, are:
// Provided by VK_ARM_data_graph
typedef enum VkDataGraphPipelineSessionBindPointARM {
VK_DATA_GRAPH_PIPELINE_SESSION_BIND_POINT_TRANSIENT_ARM = 0,
// Provided by VK_ARM_data_graph_optical_flow
VK_DATA_GRAPH_PIPELINE_SESSION_BIND_POINT_OPTICAL_FLOW_CACHE_ARM = 1000631001,
} VkDataGraphPipelineSessionBindPointARM;
-
VK_DATA_GRAPH_PIPELINE_SESSION_BIND_POINT_TRANSIENT_ARM corresponds to the transient data produced and consumed during one dispatch of a data graph pipeline in a data graph pipeline session. This transient data is never reused by subsequent dispatches and can safely be clobbered once a vkCmdDispatchDataGraphARM command completes execution.
-
VK_DATA_GRAPH_PIPELINE_SESSION_BIND_POINT_OPTICAL_FLOW_CACHE_ARM corresponds to the cache for optical flow operations.
Possible values of VkDataGraphPipelineSessionBindPointTypeARM, specifying the type of a bind point of a data graph pipeline session, are:
// Provided by VK_ARM_data_graph
typedef enum VkDataGraphPipelineSessionBindPointTypeARM {
VK_DATA_GRAPH_PIPELINE_SESSION_BIND_POINT_TYPE_MEMORY_ARM = 0,
} VkDataGraphPipelineSessionBindPointTypeARM;
-
VK_DATA_GRAPH_PIPELINE_SESSION_BIND_POINT_TYPE_MEMORY_ARM corresponds to a memory allocation.
To determine the memory requirements for a data graph pipeline session, call:
// Provided by VK_ARM_data_graph
void vkGetDataGraphPipelineSessionMemoryRequirementsARM(
VkDevice device,
const VkDataGraphPipelineSessionMemoryRequirementsInfoARM* pInfo,
VkMemoryRequirements2* pMemoryRequirements);
-
deviceis the logical device that owns the data graph pipeline session. -
pInfois a pointer to a VkDataGraphPipelineSessionMemoryRequirementsInfoARM structure containing parameters for the memory requirements query. -
pMemoryRequirementsis a pointer to a VkMemoryRequirements2 structure in which the memory requirements of the data graph pipeline session object are returned.
The VkDataGraphPipelineSessionMemoryRequirementsInfoARM structure is
defined as:
// Provided by VK_ARM_data_graph
typedef struct VkDataGraphPipelineSessionMemoryRequirementsInfoARM {
VkStructureType sType;
const void* pNext;
VkDataGraphPipelineSessionARM session;
VkDataGraphPipelineSessionBindPointARM bindPoint;
uint32_t objectIndex;
} VkDataGraphPipelineSessionMemoryRequirementsInfoARM;
-
sTypeis a VkStructureType value identifying this structure. -
pNextisNULLor a pointer to a structure extending this structure. -
sessionis the data graph pipeline session to query. -
bindPointis the bind point of a data graph pipeline session for which memory requirements are being queried. -
objectIndexis the index of the object whose memory requirements are being queried.
To attach memory to a data graph pipeline session object, call:
// Provided by VK_ARM_data_graph
VkResult vkBindDataGraphPipelineSessionMemoryARM(
VkDevice device,
uint32_t bindInfoCount,
const VkBindDataGraphPipelineSessionMemoryInfoARM* pBindInfos);
-
deviceis the logical device that owns the data graph pipeline session and memory. -
bindInfoCountis the length of thepBindInfosarray. -
pBindInfosis a pointer to an array of VkBindDataGraphPipelineSessionMemoryInfoARM structures describing graph pipeline sessions and memory to bind.
The VkBindDataGraphPipelineSessionMemoryInfoARM structure is defined
as:
// Provided by VK_ARM_data_graph
typedef struct VkBindDataGraphPipelineSessionMemoryInfoARM {
VkStructureType sType;
const void* pNext;
VkDataGraphPipelineSessionARM session;
VkDataGraphPipelineSessionBindPointARM bindPoint;
uint32_t objectIndex;
VkDeviceMemory memory;
VkDeviceSize memoryOffset;
} VkBindDataGraphPipelineSessionMemoryInfoARM;
-
sTypeis a VkStructureType value identifying this structure. -
pNextisNULLor a pointer to a structure extending this structure. -
sessionis the data graph pipeline session to be attached to memory. -
bindPointis the data graph pipeline session bind point to whichmemoryis to be attached. -
objectIndexis the index of the object forbindPointat whichmemoryis to be attached. -
memoryis a VkDeviceMemory object describing the device memory to attach. -
memoryOffsetis the start offset of the resion ofmemorywhich is to be bound to the data graph pipeline session.
To destroy a data graph pipeline session, call:
// Provided by VK_ARM_data_graph
void vkDestroyDataGraphPipelineSessionARM(
VkDevice device,
VkDataGraphPipelineSessionARM session,
const VkAllocationCallbacks* pAllocator);
-
deviceis the logical device that destroys the data graph pipeline session. -
sessionis the handle of the data graph pipeline session to destroy. -
pAllocatorcontrols host memory allocation as described in the Memory Allocation chapter.
Dispatch
To record a data graph pipeline dispatch, call:
// Provided by VK_ARM_data_graph
void vkCmdDispatchDataGraphARM(
VkCommandBuffer commandBuffer,
VkDataGraphPipelineSessionARM session,
const VkDataGraphPipelineDispatchInfoARM* pInfo);
-
commandBufferis the command buffer into which the command will be recorded. -
sessionis the VkDataGraphPipelineSessionARM that data graph pipeline being dispatched will use. -
pInfoisNULLor a pointer to a VkDataGraphPipelineDispatchInfoARM structure.
The VkDataGraphPipelineDispatchInfoARM structure is defined as:
// Provided by VK_ARM_data_graph
typedef struct VkDataGraphPipelineDispatchInfoARM {
VkStructureType sType;
void* pNext;
VkDataGraphPipelineDispatchFlagsARM flags;
} VkDataGraphPipelineDispatchInfoARM;
-
sTypeis a VkStructureType value identifying this structure. -
pNextisNULLor a pointer to a structure extending this structure. -
flagsis a bitmask of VkDataGraphPipelineDispatchFlagBitsARM describing additional parameters of the dispatch.
Bits which can be set in
VkDataGraphPipelineDispatchInfoARM::flags, specifying additional
parameters of a data graph pipeline dispatch, are:
// Provided by VK_ARM_data_graph
// Flag bits for VkDataGraphPipelineDispatchFlagBitsARM
typedef VkFlags64 VkDataGraphPipelineDispatchFlagBitsARM;
// Provided by VK_ARM_data_graph
typedef VkFlags64 VkDataGraphPipelineDispatchFlagsARM;
VkDataGraphPipelineDispatchFlagsARM is a bitmask type for setting a
mask of zero or more VkDataGraphPipelineDispatchFlagBitsARM.
Properties
To query the properties of a data graph pipeline that can be obtained, call:
// Provided by VK_ARM_data_graph
VkResult vkGetDataGraphPipelineAvailablePropertiesARM(
VkDevice device,
const VkDataGraphPipelineInfoARM* pPipelineInfo,
uint32_t* pPropertiesCount,
VkDataGraphPipelinePropertyARM* pProperties);
-
deviceis the logical device that created the data graph pipeline. -
pPipelineInfois a VkDataGraphPipelineInfoARM that describes the VkPipeline being queried. -
pPropertiesCountis a pointer to an integer related to the number of properties available or queried, as described below. -
pPropertiesis eitherNULLor a pointer to an array of VkDataGraphPipelinePropertyARM enums.
If pProperties is NULL, then the number of properties associated
with the data graph pipeline is returned in pPropertiesCount.
Otherwise, pPropertiesCount must point to a variable set by the user
to the number of elements in the pProperties array, and on return the
variable is overwritten with the number of enums actually written to
pProperties.
If pPropertiesCount is less than the number of properties associated
with the data graph pipeline, at most pPropertiesCount structures will
be written, and VK_INCOMPLETE will be returned instead of
VK_SUCCESS, to indicate that not all the available properties were
returned.
To query properties of a data graph pipeline, call:
// Provided by VK_ARM_data_graph
VkResult vkGetDataGraphPipelinePropertiesARM(
VkDevice device,
const VkDataGraphPipelineInfoARM* pPipelineInfo,
uint32_t propertiesCount,
VkDataGraphPipelinePropertyQueryResultARM* pProperties);
-
deviceis the logical device that created the data graph pipeline. -
pPipelineInfois a VkDataGraphPipelineInfoARM that describes the VkPipeline being queried. -
propertiesCountis the length of thepPropertiesarray. -
pPropertiesis a pointer to an array of VkDataGraphPipelinePropertyQueryResultARM structures.
The VkDataGraphPipelineInfoARM structure is defined as:
// Provided by VK_ARM_data_graph
typedef struct VkDataGraphPipelineInfoARM {
VkStructureType sType;
const void* pNext;
VkPipeline dataGraphPipeline;
} VkDataGraphPipelineInfoARM;
-
sTypeis a VkStructureType value identifying this structure. -
pNextisNULLor a pointer to a structure extending this structure. -
dataGraphPipelineis a VkPipeline handle.
The VkDataGraphPipelinePropertyQueryResultARM structure is defined as:
// Provided by VK_ARM_data_graph
typedef struct VkDataGraphPipelinePropertyQueryResultARM {
VkStructureType sType;
void* pNext;
VkDataGraphPipelinePropertyARM property;
VkBool32 isText;
size_t dataSize;
void* pData;
} VkDataGraphPipelinePropertyQueryResultARM;
-
sTypeis a VkStructureType value identifying this structure. -
pNextisNULLor a pointer to a structure extending this structure. -
propertyis a VkDataGraphPipelinePropertyARM specifying the property of the data graph pipeline being queried. -
isTextspecifies whether the returned data is text or opaque data. IfisTextis VK_TRUE then the data returned inpDatais text and guaranteed to be a null-terminated UTF-8 string. -
dataSizeis an integer related to the size, in bytes, of the data, as described below. -
pDatais eitherNULLor a pointer to a block of memory into which the implementation will return the property data.
If pData is NULL, then the size, in bytes, of the property data is
returned in dataSize.
Otherwise, dataSize must be the size of the buffer, in bytes, pointed
to by pData and on return dataSize is overwritten with the
number of bytes of data actually written to pData including any
trailing NUL character.
If dataSize is less than the size, in bytes, of the property data, at
most dataSize bytes of data will be written to pData, and
VK_INCOMPLETE will be returned by
vkGetDataGraphPipelinePropertiesARM instead of VK_SUCCESS, to
indicate that not all the available property data was returned.
If isText is VK_TRUE and pData is not NULL and
dataSize is not zero, the last byte written to pData will be a
NUL character.
Possible values of
VkDataGraphPipelinePropertyQueryResultARM::property, specifying
the property of the data graph pipeline being queried, are:
// Provided by VK_ARM_data_graph
typedef enum VkDataGraphPipelinePropertyARM {
VK_DATA_GRAPH_PIPELINE_PROPERTY_CREATION_LOG_ARM = 0,
VK_DATA_GRAPH_PIPELINE_PROPERTY_IDENTIFIER_ARM = 1,
} VkDataGraphPipelinePropertyARM;
-
VK_DATA_GRAPH_PIPELINE_PROPERTY_CREATION_LOG_ARM corresponds to a human-readable log produced during the creation of a data graph pipeline. It may contain information about errors encountered during the creation or other information generally useful for debugging. This property can be queried for any data graph pipeline.
-
VK_DATA_GRAPH_PIPELINE_PROPERTY_IDENTIFIER_ARM corresponds to an opaque identifier for the data graph pipeline. It can be used to create a graph pipeline from a pipeline cache without the need to provide any creation data beyond the identifier, using a VkDataGraphPipelineIdentifierCreateInfoARM structure.
Processing Engines
Data graph pipelines execute on one or more data graph processing engines. Each queue family of a VkPhysicalDevice that supports VK_QUEUE_DATA_GRAPH_BIT_ARM may provide access to processing engines. Processing engines may be foreign. Foreign processing engines require the use of external memory and semaphores to exchange data and synchronize with data graph pipelines that target them. Each processing engine may support a selection of graph operations. There exists a default processing engine that enables implementations to support some operations without tying support to specific processing engines. This allows implementations to avoid being specific about the processing engines that they use internally or to remove the necessity for applications to choose the specific processing engine used to execute a given set of operations.
To query the properties of a data graph processing engine for a specific queue family of a physical device, call:
// Provided by VK_ARM_data_graph
void vkGetPhysicalDeviceQueueFamilyDataGraphProcessingEnginePropertiesARM(
VkPhysicalDevice physicalDevice,
const VkPhysicalDeviceQueueFamilyDataGraphProcessingEngineInfoARM* pQueueFamilyDataGraphProcessingEngineInfo,
VkQueueFamilyDataGraphProcessingEnginePropertiesARM* pQueueFamilyDataGraphProcessingEngineProperties);
-
physicalDeviceis the physical device to query. -
pQueueFamilyDataGraphProcessingEngineInfois a pointer to a VkPhysicalDeviceQueueFamilyDataGraphProcessingEngineInfoARM structure that specifies the data graph processing engine and queue family to query. -
pQueueFamilyDataGraphProcessingEnginePropertiesis a pointer to a VkQueueFamilyDataGraphProcessingEnginePropertiesARM structure in which the queries properties are returned.
The VkPhysicalDeviceQueueFamilyDataGraphProcessingEngineInfoARM
structure is defined as:
// Provided by VK_ARM_data_graph
typedef struct VkPhysicalDeviceQueueFamilyDataGraphProcessingEngineInfoARM {
VkStructureType sType;
const void* pNext;
uint32_t queueFamilyIndex;
VkPhysicalDeviceDataGraphProcessingEngineTypeARM engineType;
} VkPhysicalDeviceQueueFamilyDataGraphProcessingEngineInfoARM;
-
sTypeis a VkStructureType value identifying this structure. -
pNextisNULLor a pointer to a structure extending this structure. -
queueFamilyIndexspecifies the queue family being queried. -
engineTypeis a VkPhysicalDeviceDataGraphProcessingEngineTypeARM specifying the engine type whose properties are being queried.
The VkQueueFamilyDataGraphProcessingEnginePropertiesARM structure is
defined as:
// Provided by VK_ARM_data_graph
typedef struct VkQueueFamilyDataGraphProcessingEnginePropertiesARM {
VkStructureType sType;
void* pNext;
VkExternalSemaphoreHandleTypeFlags foreignSemaphoreHandleTypes;
VkExternalMemoryHandleTypeFlags foreignMemoryHandleTypes;
} VkQueueFamilyDataGraphProcessingEnginePropertiesARM;
-
sTypeis a VkStructureType value identifying this structure. -
pNextisNULLor a pointer to a structure extending this structure. -
foreignSemaphoreHandleTypesis a VkExternalSemaphoreHandleTypeFlags that describes the external semaphore handle types supported by a foreign data graph processing engine. -
foreignMemoryHandleTypesis a VkExternalMemoryHandleTypeFlags that describes the external memory handle types supported by a foreign data graph processing engine.
The VkPhysicalDeviceDataGraphProcessingEngineARM structure is defined
as:
// Provided by VK_ARM_data_graph
typedef struct VkPhysicalDeviceDataGraphProcessingEngineARM {
VkPhysicalDeviceDataGraphProcessingEngineTypeARM type;
VkBool32 isForeign;
} VkPhysicalDeviceDataGraphProcessingEngineARM;
-
typeis a VkPhysicalDeviceDataGraphProcessingEngineTypeARM that specifies the type of the processing engine. -
isForeignspecifies whether the processing engine is foreign.
The defined data graph processing engines are:
// Provided by VK_ARM_data_graph
typedef enum VkPhysicalDeviceDataGraphProcessingEngineTypeARM {
VK_PHYSICAL_DEVICE_DATA_GRAPH_PROCESSING_ENGINE_TYPE_DEFAULT_ARM = 0,
// Provided by VK_QCOM_data_graph_model
VK_PHYSICAL_DEVICE_DATA_GRAPH_PROCESSING_ENGINE_TYPE_NEURAL_QCOM = 1000629000,
// Provided by VK_QCOM_data_graph_model
VK_PHYSICAL_DEVICE_DATA_GRAPH_PROCESSING_ENGINE_TYPE_COMPUTE_QCOM = 1000629001,
} VkPhysicalDeviceDataGraphProcessingEngineTypeARM;
-
VK_PHYSICAL_DEVICE_DATA_GRAPH_PROCESSING_ENGINE_TYPE_DEFAULT_ARM corresponds to the default data graph processing engine.
-
VK_PHYSICAL_DEVICE_DATA_GRAPH_PROCESSING_ENGINE_TYPE_NEURAL_QCOM specifies an engine that specializes in neural processing.
-
VK_PHYSICAL_DEVICE_DATA_GRAPH_PROCESSING_ENGINE_TYPE_COMPUTE_QCOM specifies an engine that uses compute processing to execute data graphs.
The VkDataGraphProcessingEngineCreateInfoARM structure is defined as:
// Provided by VK_ARM_data_graph
typedef struct VkDataGraphProcessingEngineCreateInfoARM {
VkStructureType sType;
const void* pNext;
uint32_t processingEngineCount;
VkPhysicalDeviceDataGraphProcessingEngineARM* pProcessingEngines;
} VkDataGraphProcessingEngineCreateInfoARM;
-
sTypeis a VkStructureType value identifying this structure. -
pNextisNULLor a pointer to a structure extending this structure. -
processingEngineCountis the number of elements inpProcessingEngines. -
pProcessingEnginesis a pointer to an array ofprocessingEngineCountVkPhysicalDeviceDataGraphProcessingEngineARM structures.
Operations
Data graph processing engines execute data graph operations. Operations may be of a fixed-function nature, configurable or not, or may , for example, be provided as part of a SPIR-V extended instruction set.
To query the data graph processing engines and operations they support for a specific queue family of a physical device, call:
// Provided by VK_ARM_data_graph
VkResult vkGetPhysicalDeviceQueueFamilyDataGraphPropertiesARM(
VkPhysicalDevice physicalDevice,
uint32_t queueFamilyIndex,
uint32_t* pQueueFamilyDataGraphPropertyCount,
VkQueueFamilyDataGraphPropertiesARM* pQueueFamilyDataGraphProperties);
-
physicalDeviceis the physical device to query. -
queueFamilyIndexis the index of the queue family being queried. -
pQueueFamilyDataGraphPropertyCountis a pointer to an integer related to the number of properties available or queried. -
pQueueFamilyDataGraphPropertiesis eitherNULLor a pointer to an array of VkQueueFamilyDataGraphPropertiesARM structures.
If pQueueFamilyDataGraphProperties is NULL, then the number of
properties available is returned in
pQueueFamilyDataGraphPropertyCount.
Otherwise, pQueueFamilyDataGraphPropertyCount must point to a
variable set by the application to the number of elements in the
pQueueFamilyDataGraphProperties array, and on return the variable is
overwritten with the number of structures actually written to
pQueueFamilyDataGraphProperties.
If pQueueFamilyDataGraphPropertyCount is less than the number of
properties available, at most pQueueFamilyDataGraphPropertyCount
structures will be written, and VK_INCOMPLETE will be returned instead
of VK_SUCCESS, to indicate that not all the available properties were
returned.
If the dataGraphModel feature is supported, the implementation must return at least one property with engine type VK_PHYSICAL_DEVICE_DATA_GRAPH_PROCESSING_ENGINE_TYPE_NEURAL_QCOM or VK_PHYSICAL_DEVICE_DATA_GRAPH_PROCESSING_ENGINE_TYPE_COMPUTE_QCOM.
The VkQueueFamilyDataGraphPropertiesARM structure is defined as:
// Provided by VK_ARM_data_graph
typedef struct VkQueueFamilyDataGraphPropertiesARM {
VkStructureType sType;
void* pNext;
VkPhysicalDeviceDataGraphProcessingEngineARM engine;
VkPhysicalDeviceDataGraphOperationSupportARM operation;
} VkQueueFamilyDataGraphPropertiesARM;
-
sTypeis a VkStructureType value identifying this structure. -
pNextisNULLor a pointer to a structure extending this structure. -
engineis a VkPhysicalDeviceDataGraphProcessingEngineARM structure describing a data graph processing engine. -
operationis a VkPhysicalDeviceDataGraphOperationSupportARM structure describing one or more operations supported by a data graph processing engine.
The VkPhysicalDeviceDataGraphOperationSupportARM structure is defined
as:
// Provided by VK_ARM_data_graph
typedef struct VkPhysicalDeviceDataGraphOperationSupportARM {
VkPhysicalDeviceDataGraphOperationTypeARM operationType;
char name[VK_MAX_PHYSICAL_DEVICE_DATA_GRAPH_OPERATION_SET_NAME_SIZE_ARM];
uint32_t version;
} VkPhysicalDeviceDataGraphOperationSupportARM;
-
sTypeis a VkStructureType value identifying this structure. -
pNextisNULLor a pointer to a structure extending this structure. -
operationTypeis a VkPhysicalDeviceDataGraphOperationTypeARM enum specifying the type of the operation whose support is being described. -
nameis a pointer to a null-terminated UTF-8 string specifying the name of the operation whose support is being described. -
versionis an integer specifying the version of the operation whose support is being described.
VK_MAX_PHYSICAL_DEVICE_DATA_GRAPH_OPERATION_SET_NAME_SIZE_ARM is the
length in char values of an array containing the name of a data graph
operation, as returned in
VkPhysicalDeviceDataGraphOperationSupportARM::name.
#define VK_MAX_PHYSICAL_DEVICE_DATA_GRAPH_OPERATION_SET_NAME_SIZE_ARM 128U
The defined data graph operations are:
// Provided by VK_ARM_data_graph
typedef enum VkPhysicalDeviceDataGraphOperationTypeARM {
VK_PHYSICAL_DEVICE_DATA_GRAPH_OPERATION_TYPE_SPIRV_EXTENDED_INSTRUCTION_SET_ARM = 0,
// Provided by VK_QCOM_data_graph_model
VK_PHYSICAL_DEVICE_DATA_GRAPH_OPERATION_TYPE_NEURAL_MODEL_QCOM = 1000629000,
// Provided by VK_QCOM_data_graph_model
VK_PHYSICAL_DEVICE_DATA_GRAPH_OPERATION_TYPE_BUILTIN_MODEL_QCOM = 1000629001,
// Provided by VK_ARM_data_graph_optical_flow
VK_PHYSICAL_DEVICE_DATA_GRAPH_OPERATION_TYPE_OPTICAL_FLOW_ARM = 1000631000,
} VkPhysicalDeviceDataGraphOperationTypeARM;
-
VK_PHYSICAL_DEVICE_DATA_GRAPH_OPERATION_TYPE_SPIRV_EXTENDED_INSTRUCTION_SET_ARM corresponds to operations provided by a SPIR-V extended instruction set.
-
VK_PHYSICAL_DEVICE_DATA_GRAPH_OPERATION_TYPE_NEURAL_MODEL_QCOM specifies an operation that executes neural models provided by the application.
-
VK_PHYSICAL_DEVICE_DATA_GRAPH_OPERATION_TYPE_BUILTIN_MODEL_QCOM specifies an operation that executes specialized built-in models provided by the implementation.
-
VK_PHYSICAL_DEVICE_DATA_GRAPH_OPERATION_TYPE_OPTICAL_FLOW_ARM corresponds to fixed-function optical flow as defined by
VK_ARM_data_graph_optical_flow.
To query the properties of a data graph processing engine and operation set combination for a specific queue family of a physical device, call:
// Provided by VK_ARM_data_graph_instruction_set_tosa, VK_ARM_data_graph_optical_flow
VkResult vkGetPhysicalDeviceQueueFamilyDataGraphEngineOperationPropertiesARM(
VkPhysicalDevice physicalDevice,
uint32_t queueFamilyIndex,
const VkQueueFamilyDataGraphPropertiesARM* pQueueFamilyDataGraphProperties,
VkBaseOutStructure* pProperties);
-
physicalDeviceis the physical device to query. -
queueFamilyIndexis the index of the queue family being queried. -
pQueueFamilyDataGraphPropertiesis a pointer to a VkQueueFamilyDataGraphPropertiesARM structure that selects the processing engine and operation set for which the properties are queried. -
pPropertiesis a pointer to a structure in which the properties are returned.
Data Graph Operations Requirements
Physical devices that support the dataGraphShaderModule feature must support an operation whose
VkPhysicalDeviceDataGraphOperationSupportARM::operationType is
VK_PHYSICAL_DEVICE_DATA_GRAPH_OPERATION_TYPE_SPIRV_EXTENDED_INSTRUCTION_SET_ARM
and name and version are as described in the following table for
at least one processing engine in at least one queue family when specific
extensions are supported at a specific version:
| Extension | Extension specification version | Operation name | Operation version |
|---|---|---|---|
1 |
|
0 |
Physical devices that support VK_ARM_data_graph_optical_flow must support the following VkPhysicalDeviceDataGraphOperationSupportARM for at least one processing engine in at least one queue family:
-
operationType: VK_PHYSICAL_DEVICE_DATA_GRAPH_OPERATION_TYPE_OPTICAL_FLOW_ARM -
name:OpticalFlow -
version:1
TOSA
The VkQueueFamilyDataGraphTOSAPropertiesARM structure is defined as:
// Provided by VK_ARM_data_graph_instruction_set_tosa
typedef struct VkQueueFamilyDataGraphTOSAPropertiesARM {
VkStructureType sType;
void* pNext;
uint32_t profileCount;
const VkDataGraphTOSANameQualityARM* pProfiles;
uint32_t extensionCount;
const VkDataGraphTOSANameQualityARM* pExtensions;
VkDataGraphTOSALevelARM level;
} VkQueueFamilyDataGraphTOSAPropertiesARM;
-
sTypeis a VkStructureType value identifying this structure. -
pNextisNULLor a pointer to a structure extending this structure. -
profileCountis the length of thepProfilesarray. -
pProfilesis a pointer to an array of VkDataGraphTOSANameQualityARM structures describing the TOSA profiles supported. -
extensionCountis the length of thepExtensionsarray. -
pExtensionsis a pointer to an array of VkDataGraphTOSANameQualityARM structures describing the TOSA extensions supported. -
levelis a VkDataGraphTOSALevelARM describing the TOSA level supported.
The VkDataGraphTOSANameQualityARM structure is defined as:
// Provided by VK_ARM_data_graph_instruction_set_tosa
typedef struct VkDataGraphTOSANameQualityARM {
char name[VK_MAX_DATA_GRAPH_TOSA_NAME_SIZE_ARM];
VkDataGraphTOSAQualityFlagsARM qualityFlags;
} VkDataGraphTOSANameQualityARM;
-
nameis a pointer to a null-terminated UTF-8 string specifying the name of the TOSA profile or extension. -
qualityLevelis a VkDataGraphTOSAQualityFlagsARM describing the quality of the support for the TOSA profile or extension.
VK_MAX_DATA_GRAPH_TOSA_NAME_SIZE_ARM is the length in char values
of an array containing the name of a data graph TOSA profile or extension,
as returned in VkDataGraphTOSANameQualityARM::name.
#define VK_MAX_DATA_GRAPH_TOSA_NAME_SIZE_ARM 128U
Bits which can be set in
VkDataGraphTOSANameQualityARM::qualityLevel, describing the
quality of a TOSA profile or extension, are:
// Provided by VK_ARM_data_graph_instruction_set_tosa
typedef enum VkDataGraphTOSAQualityFlagBitsARM {
VK_DATA_GRAPH_TOSA_QUALITY_ACCELERATED_ARM = 0x00000001,
VK_DATA_GRAPH_TOSA_QUALITY_CONFORMANT_ARM = 0x00000002,
VK_DATA_GRAPH_TOSA_QUALITY_EXPERIMENTAL_ARM = 0x00000004,
VK_DATA_GRAPH_TOSA_QUALITY_DEPRECATED_ARM = 0x00000008,
} VkDataGraphTOSAQualityFlagBitsARM;
-
VK_DATA_GRAPH_TOSA_QUALITY_ACCELERATED_ARM specifies that the implementation of the TOSA profile or extension is accelerated.
-
VK_DATA_GRAPH_TOSA_QUALITY_CONFORMANT_ARM specifies that the implementation of the TOSA profile or extension is conformant.
-
VK_DATA_GRAPH_TOSA_QUALITY_EXPERIMENTAL_ARM specifies that the TOSA profile or extension is experimental.
-
VK_DATA_GRAPH_TOSA_QUALITY_DEPRECATED_ARM specifies that the TOSA profile or extension is deprecated.
// Provided by VK_ARM_data_graph_instruction_set_tosa
typedef VkFlags VkDataGraphTOSAQualityFlagsARM;
VkDataGraphTOSAQualityFlagsARM is a bitmask type for setting a mask of
zero or more VkDataGraphTOSAQualityFlagBitsARM.
The defined data graph TOSA levels are:
// Provided by VK_ARM_data_graph_instruction_set_tosa
typedef enum VkDataGraphTOSALevelARM {
VK_DATA_GRAPH_TOSA_LEVEL_NONE_ARM = 0,
VK_DATA_GRAPH_TOSA_LEVEL_8K_ARM = 1,
} VkDataGraphTOSALevelARM;
-
VK_DATA_GRAPH_TOSA_LEVEL_NONE_ARM corresponds to the none TOSA level, as described in the TOSA specification.
-
VK_DATA_GRAPH_TOSA_LEVEL_8K_ARM corresponds to the 8K TOSA level, as described in the TOSA specification.
Optical flow
An optical flow fixed-function node in a graph calculates the forward optical flow between an input image and a reference image. An output flow vector (Vx, Vy) means that current pixel (x, y) of the input image can be found at location (x+Vx, y+Vy) in the reference image.
An optical flow fixed function nodes have the following graph node connection points:
-
VK_DATA_GRAPH_PIPELINE_NODE_CONNECTION_TYPE_OPTICAL_FLOW_INPUT_ARM
-
VK_DATA_GRAPH_PIPELINE_NODE_CONNECTION_TYPE_OPTICAL_FLOW_REFERENCE_ARM
-
VK_DATA_GRAPH_PIPELINE_NODE_CONNECTION_TYPE_OPTICAL_FLOW_HINT_ARM
-
VK_DATA_GRAPH_PIPELINE_NODE_CONNECTION_TYPE_OPTICAL_FLOW_FLOW_VECTOR_ARM
-
VK_DATA_GRAPH_PIPELINE_NODE_CONNECTION_TYPE_OPTICAL_FLOW_COST_ARM
The VkQueueFamilyDataGraphOpticalFlowPropertiesARM structure is
defined as:
// Provided by VK_ARM_data_graph_optical_flow
typedef struct VkQueueFamilyDataGraphOpticalFlowPropertiesARM {
VkStructureType sType;
void* pNext;
VkDataGraphOpticalFlowGridSizeFlagsARM supportedOutputGridSizes;
VkDataGraphOpticalFlowGridSizeFlagsARM supportedHintGridSizes;
VkBool32 hintSupported;
VkBool32 costSupported;
uint32_t minWidth;
uint32_t minHeight;
uint32_t maxWidth;
uint32_t maxHeight;
} VkQueueFamilyDataGraphOpticalFlowPropertiesARM;
-
sTypeis a VkStructureType value identifying this structure. -
pNextisNULLor a pointer to a structure extending this structure. -
supportedOutputGridSizesare the supported VkDataGraphOpticalFlowGridSizeFlagsARM which can be specified inVkDataGraphPipelineOpticalFlowCreateInfoARM::outputGridSize. -
supportedHintGridSizesare the supported VkDataGraphOpticalFlowGridSizeFlagsARM which can be specified inVkDataGraphPipelineOpticalFlowCreateInfoARM::hintGridSize. -
hintSupportedis a boolean describing whether using hint flow vector map is supported in an optical flow graph pipeline. -
costSupportedis a boolean describing whether cost map generation is supported in an optical flow graph pipeline. -
minWidthis the minimum width in pixels for images used in an optical flow graph pipeline. -
minHeightis the minimum height in pixels for images used in an optical flow graph pipeline. -
maxWidthis the maximum width in pixels for images used in an optical flow graph pipeline. -
maxHeightis the maximum height in pixels for images used in an optical flow graph pipeline.
Image formats
To enumerate the supported image formats for a specific data graph optical flow usage, call:
// Provided by VK_ARM_data_graph_optical_flow
VkResult vkGetPhysicalDeviceQueueFamilyDataGraphOpticalFlowImageFormatsARM(
VkPhysicalDevice physicalDevice,
uint32_t queueFamilyIndex,
const VkQueueFamilyDataGraphPropertiesARM* pQueueFamilyDataGraphProperties,
const VkDataGraphOpticalFlowImageFormatInfoARM* pOpticalFlowImageFormatInfo,
uint32_t* pFormatCount,
VkDataGraphOpticalFlowImageFormatPropertiesARM* pImageFormatProperties);
-
physicalDeviceis the physical device being queried. -
queueFamilyIndexis the index of the queue family being queried. -
pQueueFamilyDataGraphPropertiesis a pointer to a VkQueueFamilyDataGraphPropertiesARM structure that selects the processing engine and operation set for which the properties are queried. -
pOpticalFlowImageFormatInfois a pointer to a VkDataGraphOpticalFlowImageFormatInfoARM structure specifying the optical flow usage for which information is returned. -
pFormatCountis a pointer to an integer related to the number of optical flow properties available or queried, as described below. -
pImageFormatPropertiesis a pointer to an array of VkDataGraphOpticalFlowImageFormatPropertiesARM structures in which supported formats and image parameters are returned.
If pImageFormatProperties is NULL, then the number of optical flow
properties supported for the given physicalDevice is returned in
pFormatCount.
Otherwise, pFormatCount must point to a variable set by the user to
the number of elements in the pImageFormatProperties array, and on
return the variable is overwritten with the number of values actually
written to pImageFormatProperties.
If the value of pFormatCount is less than the number of optical flow
properties supported, at most pFormatCount values will be written to
pImageFormatProperties, and VK_INCOMPLETE will be returned
instead of VK_SUCCESS, to indicate that not all the available values
were returned.
Before creating an image to be used as a optical flow image, obtain the
supported image creation parameters by querying with
vkGetPhysicalDeviceFormatProperties2 and
vkGetPhysicalDeviceImageFormatProperties2 using one of the reported
formats and adding VkDataGraphOpticalFlowImageFormatInfoARM to the
pNext chain of VkPhysicalDeviceImageFormatInfo2.
When querying the parameters with
vkGetPhysicalDeviceImageFormatProperties2 for images used for optical
flow operations, the
VkDataGraphOpticalFlowImageFormatInfoARM::usage field should
contain one or more of the bits defined in
VkDataGraphOpticalFlowImageUsageFlagBitsARM.
|
VK_FORMAT_B8G8R8A8_UNORM, VK_FORMAT_R8G8B8A8_UNORM, VK_FORMAT_R8G8B8_UNORM, VK_FORMAT_B8G8R8_UNORM, VK_FORMAT_R8_UNORM, and VK_FORMAT_B10G11R11_UFLOAT_PACK32 are initially supported for images with optical flow usage VK_DATA_GRAPH_OPTICAL_FLOW_IMAGE_USAGE_INPUT_BIT_ARM. VK_FORMAT_R16G16_SFLOAT is initially supported for images with optical flow usage VK_DATA_GRAPH_OPTICAL_FLOW_IMAGE_USAGE_OUTPUT_BIT_ARM and VK_DATA_GRAPH_OPTICAL_FLOW_IMAGE_USAGE_HINT_BIT_ARM. VK_FORMAT_R16_UINT is initially supported for images with optical flow usage VK_DATA_GRAPH_OPTICAL_FLOW_IMAGE_USAGE_COST_BIT_ARM. |
The VkDataGraphOpticalFlowImageFormatInfoARM structure is defined as:
// Provided by VK_ARM_data_graph_optical_flow
typedef struct VkDataGraphOpticalFlowImageFormatInfoARM {
VkStructureType sType;
const void* pNext;
VkDataGraphOpticalFlowImageUsageFlagsARM usage;
} VkDataGraphOpticalFlowImageFormatInfoARM;
-
sTypeis a VkStructureType value identifying this structure. -
pNextisNULLor a pointer to a structure extending this structure. -
usageis a bitmask of VkDataGraphOpticalFlowImageUsageFlagBitsARM describing the intended optical flow usage of the image.
Bits which can be set in
VkDataGraphOpticalFlowImageFormatInfoARM::usage, controlling
optical flow usage, are:
// Provided by VK_ARM_data_graph_optical_flow
typedef enum VkDataGraphOpticalFlowImageUsageFlagBitsARM {
VK_DATA_GRAPH_OPTICAL_FLOW_IMAGE_USAGE_UNKNOWN_ARM = 0,
VK_DATA_GRAPH_OPTICAL_FLOW_IMAGE_USAGE_INPUT_BIT_ARM = 0x00000001,
VK_DATA_GRAPH_OPTICAL_FLOW_IMAGE_USAGE_OUTPUT_BIT_ARM = 0x00000002,
VK_DATA_GRAPH_OPTICAL_FLOW_IMAGE_USAGE_HINT_BIT_ARM = 0x00000004,
VK_DATA_GRAPH_OPTICAL_FLOW_IMAGE_USAGE_COST_BIT_ARM = 0x00000008,
} VkDataGraphOpticalFlowImageUsageFlagBitsARM;
-
VK_DATA_GRAPH_OPTICAL_FLOW_IMAGE_USAGE_INPUT_BIT_ARM specifies that the image can be used as input or reference image for an optical flow operation.
-
VK_DATA_GRAPH_OPTICAL_FLOW_IMAGE_USAGE_OUTPUT_BIT_ARM specifies that the image can be used as output flow vector map for an optical flow operation.
-
VK_DATA_GRAPH_OPTICAL_FLOW_IMAGE_USAGE_HINT_BIT_ARM specifies that the image can be used as hint flow vector map for an optical flow operation.
-
VK_DATA_GRAPH_OPTICAL_FLOW_IMAGE_USAGE_COST_BIT_ARM specifies that the image can be used as output cost map for an optical flow operation.
// Provided by VK_ARM_data_graph_optical_flow
typedef VkFlags VkDataGraphOpticalFlowImageUsageFlagsARM;
VkDataGraphOpticalFlowImageUsageFlagsARM is a bitmask type for setting
a mask of zero or more VkDataGraphOpticalFlowImageUsageFlagBitsARM.
The VkDataGraphOpticalFlowImageFormatPropertiesARM structure is defined as:
// Provided by VK_ARM_data_graph_optical_flow
typedef struct VkDataGraphOpticalFlowImageFormatPropertiesARM {
VkStructureType sType;
void* pNext;
VkFormat format;
} VkDataGraphOpticalFlowImageFormatPropertiesARM;
-
sTypeis a VkStructureType value identifying this structure. -
pNextisNULLor a pointer to a structure extending this structure. -
formatis a VkFormat that specifies the format that can be used with the specified optical flow image usages.
Pipeline creation
The VkDataGraphPipelineOpticalFlowCreateInfoARM structure is defined
as:
// Provided by VK_ARM_data_graph_optical_flow
typedef struct VkDataGraphPipelineOpticalFlowCreateInfoARM {
VkStructureType sType;
void* pNext;
uint32_t width;
uint32_t height;
VkFormat imageFormat;
VkFormat flowVectorFormat;
VkFormat costFormat;
VkDataGraphOpticalFlowGridSizeFlagsARM outputGridSize;
VkDataGraphOpticalFlowGridSizeFlagsARM hintGridSize;
VkDataGraphOpticalFlowPerformanceLevelARM performanceLevel;
VkDataGraphOpticalFlowCreateFlagsARM flags;
} VkDataGraphPipelineOpticalFlowCreateInfoARM;
-
sTypeis a VkStructureType value identifying this structure. -
pNextisNULLor a pointer to a structure extending this structure. -
widthis the width in pixels of the input or reference image to be bound to this optical flow pipeline. -
heightis the height in pixels of the input or reference image to be bound to this optical flow pipeline. -
imageFormatis the VkFormat of the input and reference image to be bound to this optical flow pipeline. -
flowVectorFormatis the VkFormat of the flow vector maps (output or hint) to be bound to this optical flow pipeline. -
costFormatis the VkFormat of the cost maps to be bound to this optical flow pipeline. -
outputGridSizeis exactly one bit of VkDataGraphOpticalFlowGridSizeFlagsARM specifying the grid size of the output flow and cost maps to be bound to this optical flow pipeline. The size of the output flow and cost maps is a function of the input image dimensions andoutputGridSizeand is calculated as follows:
OutputWidth = ⌈width/ OutputGridWidth ⌉
OutputHeight = ⌈height/ OutputGridHeight ⌉
where OutputGridWidth and OutputGridHeight are determined byoutputGridSize. -
hintGridSizeis one exactly bit of VkDataGraphOpticalFlowGridSizeFlagsARM specifying the grid size of the hint flow vector map to be bound to this optical flow pipeline. The size of the hint maps is a function of the input image dimensions andhintGridSizeand is calculated as follows:
HintWidth = ⌈width/ HintGridWidth ⌉
HintHeight = ⌈height/ HintGridHeight ⌉
where HintGridWidth and HintGridHeight are determined byhintGridSize. -
performanceLevelis the VkDataGraphOpticalFlowPerformanceLevelARM used for this optical flow pipeline. -
flagsare the VkDataGraphOpticalFlowCreateFlagsARM used for this optical flow pipeline.
Optical flow vectors are generated block-wise, one vector for each block of
NxN pixels (referred to as grid).
Bits which can be set in
VkDataGraphPipelineOpticalFlowCreateInfoARM::outputGridSize and
VkDataGraphPipelineOpticalFlowCreateInfoARM::hintGridSize, or
which are returned in
VkQueueFamilyDataGraphOpticalFlowPropertiesARM::supportedOutputGridSizes
and
VkQueueFamilyDataGraphOpticalFlowPropertiesARM::supportedHintGridSizes
controlling optical flow grid sizes, are:
// Provided by VK_ARM_data_graph_optical_flow
typedef enum VkDataGraphOpticalFlowGridSizeFlagBitsARM {
VK_DATA_GRAPH_OPTICAL_FLOW_GRID_SIZE_UNKNOWN_ARM = 0,
VK_DATA_GRAPH_OPTICAL_FLOW_GRID_SIZE_1X1_BIT_ARM = 0x00000001,
VK_DATA_GRAPH_OPTICAL_FLOW_GRID_SIZE_2X2_BIT_ARM = 0x00000002,
VK_DATA_GRAPH_OPTICAL_FLOW_GRID_SIZE_4X4_BIT_ARM = 0x00000004,
VK_DATA_GRAPH_OPTICAL_FLOW_GRID_SIZE_8X8_BIT_ARM = 0x00000008,
} VkDataGraphOpticalFlowGridSizeFlagBitsARM;
-
VK_DATA_GRAPH_OPTICAL_FLOW_GRID_SIZE_1X1_BIT_ARM specifies that grid is 1x1 pixel.
-
VK_DATA_GRAPH_OPTICAL_FLOW_GRID_SIZE_2X2_BIT_ARM specifies that grid is 2x2 pixel.
-
VK_DATA_GRAPH_OPTICAL_FLOW_GRID_SIZE_4X4_BIT_ARM specifies that grid is 4x4 pixel.
-
VK_DATA_GRAPH_OPTICAL_FLOW_GRID_SIZE_8X8_BIT_ARM specifies that grid is 8x8 pixel.
// Provided by VK_ARM_data_graph_optical_flow
typedef VkFlags VkDataGraphOpticalFlowGridSizeFlagsARM;
VkDataGraphOpticalFlowGridSizeFlagsARM is a bitmask type for setting a
mask of zero or more VkDataGraphOpticalFlowGridSizeFlagBitsARM.
Optical flow exposes performance levels which the user can choose based on the desired performance and quality requirement. The optical flow performance level types are defined with the following:
// Provided by VK_ARM_data_graph_optical_flow
typedef enum VkDataGraphOpticalFlowPerformanceLevelARM {
VK_DATA_GRAPH_OPTICAL_FLOW_PERFORMANCE_LEVEL_UNKNOWN_ARM = 0,
VK_DATA_GRAPH_OPTICAL_FLOW_PERFORMANCE_LEVEL_SLOW_ARM = 1,
VK_DATA_GRAPH_OPTICAL_FLOW_PERFORMANCE_LEVEL_MEDIUM_ARM = 2,
VK_DATA_GRAPH_OPTICAL_FLOW_PERFORMANCE_LEVEL_FAST_ARM = 3,
} VkDataGraphOpticalFlowPerformanceLevelARM;
-
VK_DATA_GRAPH_OPTICAL_FLOW_PERFORMANCE_LEVEL_SLOW_ARM is a level with slower performance but higher quality.
-
VK_DATA_GRAPH_OPTICAL_FLOW_PERFORMANCE_LEVEL_MEDIUM_ARM is a level with medium performance and medium quality.
-
VK_DATA_GRAPH_OPTICAL_FLOW_PERFORMANCE_LEVEL_FAST_ARM is a preset with higher performance but lower quality.
Bits which can be set in
VkDataGraphPipelineOpticalFlowCreateInfoARM::flags, controlling
optical flow pipeline operations, are:
// Provided by VK_ARM_data_graph_optical_flow
typedef enum VkDataGraphOpticalFlowCreateFlagBitsARM {
VK_DATA_GRAPH_OPTICAL_FLOW_CREATE_ENABLE_HINT_BIT_ARM = 0x00000001,
VK_DATA_GRAPH_OPTICAL_FLOW_CREATE_ENABLE_COST_BIT_ARM = 0x00000002,
VK_DATA_GRAPH_OPTICAL_FLOW_CREATE_RESERVED_30_BIT_ARM = 0x40000000,
} VkDataGraphOpticalFlowCreateFlagBitsARM;
-
VK_DATA_GRAPH_OPTICAL_FLOW_CREATE_ENABLE_HINT_BIT_ARM specifies that a VkImageView with external flow vector map will be used as hints in performing the motion search and must be connected to VK_DATA_GRAPH_PIPELINE_NODE_CONNECTION_TYPE_OPTICAL_FLOW_HINT_ARM.
-
VK_DATA_GRAPH_OPTICAL_FLOW_CREATE_ENABLE_COST_BIT_ARM specifies that the cost for the forward flow is generated in a VkImageView which must be connected to VK_DATA_GRAPH_PIPELINE_NODE_CONNECTION_TYPE_OPTICAL_FLOW_COST_ARM. The cost is the confidence level of the flow vector for each grid in the image. The cost implies how (in)accurate the flow vector is. Higher cost value implies the flow vector to be less accurate and vice-versa.
VkDataGraphOpticalFlowCreateFlagsARM is a bitmask type for setting a
mask of zero or more VkDataGraphOpticalFlowCreateFlagBitsARM.
// Provided by VK_ARM_data_graph_optical_flow
typedef VkFlags VkDataGraphOpticalFlowCreateFlagsARM;
Pipeline dispatch
The VkDataGraphPipelineOpticalFlowDispatchInfoARM structure is defined as:
// Provided by VK_ARM_data_graph_optical_flow
typedef struct VkDataGraphPipelineOpticalFlowDispatchInfoARM {
VkStructureType sType;
void* pNext;
VkDataGraphOpticalFlowExecuteFlagsARM flags;
uint32_t meanFlowL1NormHint;
} VkDataGraphPipelineOpticalFlowDispatchInfoARM;
-
sTypeis a VkStructureType value identifying this structure. -
pNextisNULLor a pointer to a structure extending this structure. -
flagsare the VkDataGraphOpticalFlowExecuteFlagsARM used for this command. -
meanFlowL1NormHintis an integer used to hint to the implementation that the mean L1 norm of flow vectors is expected to be centered around this value (in number of pixels of the input image). The implementation may use this value to influence how flow vectors are computed. Different values may result in different flow vectors and will affect the cost of computing the flow vectors. A value of 0 means that the application does not wish to provide a hint.
Bits which can be set in
VkDataGraphPipelineOpticalFlowDispatchInfoARM::flags,
controlling optical flow execution, are:
// Provided by VK_ARM_data_graph_optical_flow
typedef enum VkDataGraphOpticalFlowExecuteFlagBitsARM {
VK_DATA_GRAPH_OPTICAL_FLOW_EXECUTE_DISABLE_TEMPORAL_HINTS_BIT_ARM = 0x00000001,
VK_DATA_GRAPH_OPTICAL_FLOW_EXECUTE_INPUT_UNCHANGED_BIT_ARM = 0x00000002,
VK_DATA_GRAPH_OPTICAL_FLOW_EXECUTE_REFERENCE_UNCHANGED_BIT_ARM = 0x00000004,
VK_DATA_GRAPH_OPTICAL_FLOW_EXECUTE_INPUT_IS_PREVIOUS_REFERENCE_BIT_ARM = 0x00000008,
VK_DATA_GRAPH_OPTICAL_FLOW_EXECUTE_REFERENCE_IS_PREVIOUS_INPUT_BIT_ARM = 0x00000010,
} VkDataGraphOpticalFlowExecuteFlagBitsARM;
-
VK_DATA_GRAPH_OPTICAL_FLOW_EXECUTE_DISABLE_TEMPORAL_HINTS_BIT_ARM specifies that temporal hints from previously generated flow vector map are not used. If temporal hints are enabled, the optical flow vector map from previous vkCmdDispatchDataGraphARM calls in the same graph pipeline session may be automatically used as hints for the current vkCmdDispatchDataGraphARM call, to take advantage of temporal correlation in a video sequence. Temporal hints should be disabled if there is a-priori knowledge of no temporal correlation (e.g. a scene change, independent successive image pairs).
-
VK_DATA_GRAPH_OPTICAL_FLOW_EXECUTE_INPUT_UNCHANGED_BIT_ARM specifies that the contents of the input image are the same as in the previously executed vkCmdDispatchDataGraphARM call in the same graph pipeline session.
-
VK_DATA_GRAPH_OPTICAL_FLOW_EXECUTE_REFERENCE_UNCHANGED_BIT_ARM specifies that the contents of the reference image are the same as in the previously executed vkCmdDispatchDataGraphARM call in the same graph pipeline session.
-
VK_DATA_GRAPH_OPTICAL_FLOW_EXECUTE_INPUT_IS_PREVIOUS_REFERENCE_BIT_ARM specifies that the contents of the input image are the same as the contents of the reference image in the previously executed vkCmdDispatchDataGraphARM call in the same graph pipeline session.
-
VK_DATA_GRAPH_OPTICAL_FLOW_EXECUTE_REFERENCE_IS_PREVIOUS_INPUT_BIT_ARM specifies that the contents of the reference image are the same as the contents of the input image in the previously executed vkCmdDispatchDataGraphARM call in the same graph pipeline session.
VkDataGraphOpticalFlowExecuteFlagsARM is a bitmask type for setting a
mask of zero or more VkDataGraphOpticalFlowExecuteFlagBitsARM.
// Provided by VK_ARM_data_graph_optical_flow
typedef VkFlags VkDataGraphOpticalFlowExecuteFlagsARM;