vkCmdOpticalFlowExecuteNV(3)

# vkCmdOpticalFlowExecuteNV(3) Manual Page

## Name

vkCmdOpticalFlowExecuteNV - Calculate optical flow vectors

## C Specification

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:

    // Provided by VK_NV_optical_flow
    void vkCmdOpticalFlowExecuteNV(
        VkCommandBuffer                             commandBuffer,
        VkOpticalFlowSessionNV                      session,
        const VkOpticalFlowExecuteInfoNV*           pExecuteInfo);

## Parameters

- `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.

## Description

Valid Usage (Implicit)

- VUID-vkCmdOpticalFlowExecuteNV-commandBuffer-parameter
  `commandBuffer` must be a valid VkCommandBuffer handle

- VUID-vkCmdOpticalFlowExecuteNV-session-parameter
  `session` must be a valid VkOpticalFlowSessionNV handle

- VUID-vkCmdOpticalFlowExecuteNV-pExecuteInfo-parameter
  `pExecuteInfo` must be a valid pointer to a valid VkOpticalFlowExecuteInfoNV structure

- VUID-vkCmdOpticalFlowExecuteNV-commandBuffer-recording
  `commandBuffer` must be in the recording state

- 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

Command Properties

Command Buffer Levels | Render Pass Scope | Video Coding Scope | Supported Queue Types | Command Type
--- | --- | --- | --- | ---
Primary Secondary | Outside | Outside | VK_QUEUE_OPTICAL_FLOW_BIT_NV | Action

Conditional Rendering

vkCmdOpticalFlowExecuteNV is not affected by conditional rendering

## See Also

VK_NV_optical_flow, VkCommandBuffer, VkOpticalFlowExecuteInfoNV, VkOpticalFlowSessionNV

## 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 2014-2026 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0