Function Prototype

vkCmdOpticalFlowExecuteNV

Calculate optical flow vectors

Default direction of flow estimation is forward which calculates the optical flow from input frame to reference frame. Optionally backward flow estimation can be additionally calculated. An output flow vector (Vx, Vy) means that current pixel (x, y) of input frame can be found at location (x+Vx, y+Vy) in reference frame. A backward flow vector (Vx, Vy) means that current pixel (x, y) of reference frame can be found at location (x+Vx, y+Vy) in input frame.

To calculate optical flow vectors from two input frames, call:

void vkCmdOpticalFlowExecuteNV(
    VkCommandBuffer commandBuffer,
    VkOpticalFlowSessionNV session,
    const VkOpticalFlowExecuteInfoNV* pExecuteInfo);
  • commandBuffer is the command buffer into which the command will be recorded.
  • session is the optical flow session object on which this command is operating.
  • pExecuteInfo Info is a pointer to a VkOpticalFlowExecuteInfoNV.

Valid Usage (Implicit)

VUID-vkCmdOpticalFlowExecuteNV-pExecuteInfo-parameter

pExecuteInfo must be a valid pointer to a valid VkOpticalFlowExecuteInfoNV structure

VUID-vkCmdOpticalFlowExecuteNV-commandBuffer-cmdpool

The VkCommandPool that commandBuffer was allocated from must support VK_QUEUE_OPTICAL_FLOW_BIT_NV operations

VUID-vkCmdOpticalFlowExecuteNV-renderpass

This command must only be called outside of a render pass instance

VUID-vkCmdOpticalFlowExecuteNV-suspended

This command must not be called between suspended render pass instances

VUID-vkCmdOpticalFlowExecuteNV-videocoding

This command must only be called outside of a video coding scope

VUID-vkCmdOpticalFlowExecuteNV-commonparent

Both of commandBuffer, and session must have been created, allocated, or retrieved from the same VkDevice

Host Synchronization

  • Host access to the VkCommandPool that commandBuffer was allocated from must be externally synchronized