| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Vulkan.Extensions.VK_NV_optical_flow
Description
Name
VK_NV_optical_flow - device extension
VK_NV_optical_flow
- Name String
VK_NV_optical_flow
- Extension Type
- Device extension
- Registered Extension Number
- 465
- Revision
- 1
- Ratification Status
- Not ratified
- Extension and Version Dependencies
- VK_KHR_get_physical_device_properties2 and VK_KHR_format_feature_flags2 and VK_KHR_synchronization2
- Contact
Other Extension Metadata
- Last Modified Date
- 2022-09-26
- Contributors
- Carsten Rohde, NVIDIA
- Vipul Parashar, NVIDIA
- Jeff Bolz, NVIDIA
- Eric Werness, NVIDIA
Description
Optical flow are fundamental algorithms in computer vision (CV) area. This extension allows applications to estimate 2D displacement of pixels between two frames.
Note
This extension is designed to be used with upcoming NVIDIA Optical Flow SDK Version 5 which will be available on NVIDIA Developer webpage.
New Object Types
New Commands
cmdOpticalFlowExecuteNVcreateOpticalFlowSessionNVdestroyOpticalFlowSessionNVgetPhysicalDeviceOpticalFlowImageFormatsNV
New Structures
OpticalFlowImageFormatPropertiesNVOpticalFlowSessionCreateInfoNVExtending
OpticalFlowSessionCreateInfoNV:Extending
PhysicalDeviceFeatures2,DeviceCreateInfo:Extending
PhysicalDeviceImageFormatInfo2,ImageCreateInfo:Extending
PhysicalDeviceProperties2:
New Enums
OpticalFlowGridSizeFlagBitsNVOpticalFlowPerformanceLevelNVOpticalFlowSessionBindingPointNVOpticalFlowSessionCreateFlagBitsNVOpticalFlowUsageFlagBitsNV
New Bitmasks
New Enum Constants
NV_OPTICAL_FLOW_SPEC_VERSIONExtending
AccessFlagBits2:Extending
Format:Extending
FormatFeatureFlagBits2:Extending
ObjectType:Extending
PipelineStageFlagBits2:Extending
QueueFlagBits:Extending
StructureType:STRUCTURE_TYPE_OPTICAL_FLOW_EXECUTE_INFO_NVSTRUCTURE_TYPE_OPTICAL_FLOW_IMAGE_FORMAT_INFO_NVSTRUCTURE_TYPE_OPTICAL_FLOW_IMAGE_FORMAT_PROPERTIES_NVSTRUCTURE_TYPE_OPTICAL_FLOW_SESSION_CREATE_INFO_NVSTRUCTURE_TYPE_OPTICAL_FLOW_SESSION_CREATE_PRIVATE_DATA_INFO_NVSTRUCTURE_TYPE_PHYSICAL_DEVICE_OPTICAL_FLOW_FEATURES_NVSTRUCTURE_TYPE_PHYSICAL_DEVICE_OPTICAL_FLOW_PROPERTIES_NV
Examples
// Example querying available input formats
VkOpticalFlowImageFormatInfoNV ofFormatInfo = { VK_STRUCTURE_TYPE_OPTICAL_FLOW_IMAGE_FORMAT_INFO_NV };
ofFormatInfo.usage = VK_OPTICAL_FLOW_USAGE_INPUT_BIT_NV;
uint32_t count = 0;
vkGetPhysicalDeviceOpticalFlowImageFormatsNV(physicalDevice, &ofFormatInfo, &count, NULL);
VkOpticalFlowImageFormatPropertiesNV* fmt = new VkOpticalFlowImageFormatPropertiesNV[count];
memset(fmt, 0, count * sizeof(VkOpticalFlowImageFormatPropertiesNV));
for (uint32_t i = 0; i < count; i++) {
fmt[i].sType = VK_STRUCTURE_TYPE_OPTICAL_FLOW_IMAGE_FORMAT_PROPERTIES_NV;
}
vkGetPhysicalDeviceOpticalFlowImageFormatsNV(physicalDevice, &ofFormatInfo, &count, fmt);
// Pick one of the available formats
VkFormat inputFormat = fmt[0].format;
// Check feature support for optimal tiling
VkFormatProperties3 formatProperties3 = { VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3 };
VkFormatProperties2 formatProperties2 = { VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2, &formatProperties3 };
vkGetPhysicalDeviceFormatProperties2(physicalDevice, inputFormat, &formatProperties2);
if (!(formatProperties3.optimalTilingFeatures & VK_FORMAT_FEATURE_2_OPTICAL_FLOW_IMAGE_BIT_NV)) {
return false;
}
// Check support for image creation parameters
VkPhysicalDeviceImageFormatInfo2 imageFormatInfo2 = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2, &ofFormatInfo };
imageFormatInfo2.format = inputFormat;
imageFormatInfo2.type = VK_IMAGE_TYPE_2D;
imageFormatInfo2.tiling = VK_IMAGE_TILING_OPTIMAL;
imageFormatInfo2.usage = VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT;
VkImageFormatProperties2 imageFormatProperties2 = { VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2 };
if (vkGetPhysicalDeviceImageFormatProperties2(physicalDevice, &imageFormatInfo2, &imageFormatProperties2) != VK_SUCCESS) {
return false;
}
VkImageCreateInfo imageCreateInfo = { VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO, &ofFormatInfo };
imageCreateInfo.imageType = VK_IMAGE_TYPE_2D;
imageCreateInfo.format = inputFormat;
imageCreateInfo.extent = { width, height, (uint32_t)1};
imageCreateInfo.mipLevels = 1;
imageCreateInfo.arrayLayers = 1;
imageCreateInfo.samples = VK_SAMPLE_COUNT_1_BIT;
imageCreateInfo.usage = VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT;;
imageCreateInfo.tiling = VK_IMAGE_TILING_OPTIMAL;
vkCreateImage(device, &imageCreateInfo, NULL, &input);
"allocate memory, bind image, create view"
"do the same for reference and output"
// Create optical flow session
VkOpticalFlowSessionCreateInfoNV sessionCreateInfo = { VK_STRUCTURE_TYPE_OPTICAL_FLOW_SESSION_CREATE_INFO_NV };
sessionCreateInfo.width = width;
sessionCreateInfo.height = height;
sessionCreateInfo.imageFormat = inputFormat;
sessionCreateInfo.flowVectorFormat = outputFormat;
sessionCreateInfo.outputGridSize = VK_OPTICAL_FLOW_GRID_SIZE_4X4_BIT_NV;
sessionCreateInfo.performanceLevel = VK_OPTICAL_FLOW_PERFORMANCE_LEVEL_SLOW_NV;
VkOpticalFlowSessionNV session;
vkCreateOpticalFlowSessionNV(device, &sessionCreateInfo, NULL, &session);
"allocate command buffer"
"transfer images to VK_PIPELINE_STAGE_2_OPTICAL_FLOW_BIT_NV"
"transfer input images to VK_ACCESS_2_OPTICAL_FLOW_READ_BIT_NV and output image to VK_ACCESS_2_OPTICAL_FLOW_WRITE_BIT_NV"
vkBindOpticalFlowSessionImageNV(device, session, VK_OPTICAL_FLOW_SESSION_BINDING_POINT_INPUT_NV, inputView, VK_IMAGE_LAYOUT_GENERAL);
vkBindOpticalFlowSessionImageNV(device, session, VK_OPTICAL_FLOW_SESSION_BINDING_POINT_REFERENCE_NV, refView, VK_IMAGE_LAYOUT_GENERAL);
vkBindOpticalFlowSessionImageNV(device, session, VK_OPTICAL_FLOW_SESSION_BINDING_POINT_FLOW_VECTOR_NV, outputView, VK_IMAGE_LAYOUT_GENERAL);
VkOpticalFlowExecuteInfoNV opticalFlowExecuteInfo = { VK_STRUCTURE_TYPE_OPTICAL_FLOW_EXECUTE_INFO_NV };
vkCmdOpticalFlowExecuteNV(cmd, session, &opticalFlowExecuteInfo);
"submit command buffer"Version History
Revision 1, 2022-09-26 (Carsten Rohde)
- Internal revisions
See Also
OpticalFlowExecuteFlagBitsNV, OpticalFlowExecuteFlagsNV,
OpticalFlowExecuteInfoNV, OpticalFlowGridSizeFlagBitsNV,
OpticalFlowGridSizeFlagsNV, OpticalFlowImageFormatInfoNV,
OpticalFlowImageFormatPropertiesNV, OpticalFlowPerformanceLevelNV,
OpticalFlowSessionBindingPointNV,
OpticalFlowSessionCreateFlagBitsNV, OpticalFlowSessionCreateFlagsNV,
OpticalFlowSessionCreateInfoNV,
OpticalFlowSessionCreatePrivateDataInfoNV,
OpticalFlowSessionNV,
OpticalFlowUsageFlagBitsNV, OpticalFlowUsageFlagsNV,
PhysicalDeviceOpticalFlowFeaturesNV,
PhysicalDeviceOpticalFlowPropertiesNV,
bindOpticalFlowSessionImageNV, cmdOpticalFlowExecuteNV,
createOpticalFlowSessionNV, destroyOpticalFlowSessionNV,
getPhysicalDeviceOpticalFlowImageFormatsNV
Document Notes
For more information, see the Vulkan Specification
This page is a generated document. Fixes and changes should be made to the generator scripts, not directly.
Synopsis
- getPhysicalDeviceOpticalFlowImageFormatsNV :: forall io. MonadIO io => PhysicalDevice -> OpticalFlowImageFormatInfoNV -> io (Result, "imageFormatProperties" ::: Vector OpticalFlowImageFormatPropertiesNV)
- createOpticalFlowSessionNV :: forall a io. (Extendss OpticalFlowSessionCreateInfoNV a, PokeChain a, MonadIO io) => Device -> OpticalFlowSessionCreateInfoNV a -> ("allocator" ::: Maybe AllocationCallbacks) -> io OpticalFlowSessionNV
- withOpticalFlowSessionNV :: forall a io r. (Extendss OpticalFlowSessionCreateInfoNV a, PokeChain a, MonadIO io) => Device -> OpticalFlowSessionCreateInfoNV a -> Maybe AllocationCallbacks -> (io OpticalFlowSessionNV -> (OpticalFlowSessionNV -> io ()) -> r) -> r
- destroyOpticalFlowSessionNV :: forall io. MonadIO io => Device -> OpticalFlowSessionNV -> ("allocator" ::: Maybe AllocationCallbacks) -> io ()
- bindOpticalFlowSessionImageNV :: forall io. MonadIO io => Device -> OpticalFlowSessionNV -> OpticalFlowSessionBindingPointNV -> ImageView -> ImageLayout -> io ()
- cmdOpticalFlowExecuteNV :: forall io. MonadIO io => CommandBuffer -> OpticalFlowSessionNV -> OpticalFlowExecuteInfoNV -> io ()
- data PhysicalDeviceOpticalFlowFeaturesNV = PhysicalDeviceOpticalFlowFeaturesNV {
- opticalFlow :: Bool
- data PhysicalDeviceOpticalFlowPropertiesNV = PhysicalDeviceOpticalFlowPropertiesNV {
- supportedOutputGridSizes :: OpticalFlowGridSizeFlagsNV
- supportedHintGridSizes :: OpticalFlowGridSizeFlagsNV
- hintSupported :: Bool
- costSupported :: Bool
- bidirectionalFlowSupported :: Bool
- globalFlowSupported :: Bool
- minWidth :: Word32
- minHeight :: Word32
- maxWidth :: Word32
- maxHeight :: Word32
- maxNumRegionsOfInterest :: Word32
- data OpticalFlowImageFormatInfoNV = OpticalFlowImageFormatInfoNV {}
- data OpticalFlowImageFormatPropertiesNV = OpticalFlowImageFormatPropertiesNV {}
- data OpticalFlowSessionCreateInfoNV (es :: [Type]) = OpticalFlowSessionCreateInfoNV {}
- data OpticalFlowSessionCreatePrivateDataInfoNV = OpticalFlowSessionCreatePrivateDataInfoNV {}
- data OpticalFlowExecuteInfoNV = OpticalFlowExecuteInfoNV {}
- type OpticalFlowGridSizeFlagsNV = OpticalFlowGridSizeFlagBitsNV
- newtype OpticalFlowGridSizeFlagBitsNV where
- OpticalFlowGridSizeFlagBitsNV Flags
- pattern OPTICAL_FLOW_GRID_SIZE_UNKNOWN_NV :: OpticalFlowGridSizeFlagBitsNV
- pattern OPTICAL_FLOW_GRID_SIZE_1X1_BIT_NV :: OpticalFlowGridSizeFlagBitsNV
- pattern OPTICAL_FLOW_GRID_SIZE_2X2_BIT_NV :: OpticalFlowGridSizeFlagBitsNV
- pattern OPTICAL_FLOW_GRID_SIZE_4X4_BIT_NV :: OpticalFlowGridSizeFlagBitsNV
- pattern OPTICAL_FLOW_GRID_SIZE_8X8_BIT_NV :: OpticalFlowGridSizeFlagBitsNV
- type OpticalFlowUsageFlagsNV = OpticalFlowUsageFlagBitsNV
- newtype OpticalFlowUsageFlagBitsNV where
- OpticalFlowUsageFlagBitsNV Flags
- pattern OPTICAL_FLOW_USAGE_UNKNOWN_NV :: OpticalFlowUsageFlagBitsNV
- pattern OPTICAL_FLOW_USAGE_INPUT_BIT_NV :: OpticalFlowUsageFlagBitsNV
- pattern OPTICAL_FLOW_USAGE_OUTPUT_BIT_NV :: OpticalFlowUsageFlagBitsNV
- pattern OPTICAL_FLOW_USAGE_HINT_BIT_NV :: OpticalFlowUsageFlagBitsNV
- pattern OPTICAL_FLOW_USAGE_COST_BIT_NV :: OpticalFlowUsageFlagBitsNV
- pattern OPTICAL_FLOW_USAGE_GLOBAL_FLOW_BIT_NV :: OpticalFlowUsageFlagBitsNV
- newtype OpticalFlowPerformanceLevelNV where
- OpticalFlowPerformanceLevelNV Int32
- pattern OPTICAL_FLOW_PERFORMANCE_LEVEL_UNKNOWN_NV :: OpticalFlowPerformanceLevelNV
- pattern OPTICAL_FLOW_PERFORMANCE_LEVEL_SLOW_NV :: OpticalFlowPerformanceLevelNV
- pattern OPTICAL_FLOW_PERFORMANCE_LEVEL_MEDIUM_NV :: OpticalFlowPerformanceLevelNV
- pattern OPTICAL_FLOW_PERFORMANCE_LEVEL_FAST_NV :: OpticalFlowPerformanceLevelNV
- newtype OpticalFlowSessionBindingPointNV where
- OpticalFlowSessionBindingPointNV Int32
- pattern OPTICAL_FLOW_SESSION_BINDING_POINT_UNKNOWN_NV :: OpticalFlowSessionBindingPointNV
- pattern OPTICAL_FLOW_SESSION_BINDING_POINT_INPUT_NV :: OpticalFlowSessionBindingPointNV
- pattern OPTICAL_FLOW_SESSION_BINDING_POINT_REFERENCE_NV :: OpticalFlowSessionBindingPointNV
- pattern OPTICAL_FLOW_SESSION_BINDING_POINT_HINT_NV :: OpticalFlowSessionBindingPointNV
- pattern OPTICAL_FLOW_SESSION_BINDING_POINT_FLOW_VECTOR_NV :: OpticalFlowSessionBindingPointNV
- pattern OPTICAL_FLOW_SESSION_BINDING_POINT_BACKWARD_FLOW_VECTOR_NV :: OpticalFlowSessionBindingPointNV
- pattern OPTICAL_FLOW_SESSION_BINDING_POINT_COST_NV :: OpticalFlowSessionBindingPointNV
- pattern OPTICAL_FLOW_SESSION_BINDING_POINT_BACKWARD_COST_NV :: OpticalFlowSessionBindingPointNV
- pattern OPTICAL_FLOW_SESSION_BINDING_POINT_GLOBAL_FLOW_NV :: OpticalFlowSessionBindingPointNV
- type OpticalFlowSessionCreateFlagsNV = OpticalFlowSessionCreateFlagBitsNV
- newtype OpticalFlowSessionCreateFlagBitsNV where
- OpticalFlowSessionCreateFlagBitsNV Flags
- pattern OPTICAL_FLOW_SESSION_CREATE_ENABLE_HINT_BIT_NV :: OpticalFlowSessionCreateFlagBitsNV
- pattern OPTICAL_FLOW_SESSION_CREATE_ENABLE_COST_BIT_NV :: OpticalFlowSessionCreateFlagBitsNV
- pattern OPTICAL_FLOW_SESSION_CREATE_ENABLE_GLOBAL_FLOW_BIT_NV :: OpticalFlowSessionCreateFlagBitsNV
- pattern OPTICAL_FLOW_SESSION_CREATE_ALLOW_REGIONS_BIT_NV :: OpticalFlowSessionCreateFlagBitsNV
- pattern OPTICAL_FLOW_SESSION_CREATE_BOTH_DIRECTIONS_BIT_NV :: OpticalFlowSessionCreateFlagBitsNV
- type OpticalFlowExecuteFlagsNV = OpticalFlowExecuteFlagBitsNV
- newtype OpticalFlowExecuteFlagBitsNV where
- type NV_OPTICAL_FLOW_SPEC_VERSION = 1
- pattern NV_OPTICAL_FLOW_SPEC_VERSION :: forall a. Integral a => a
- type NV_OPTICAL_FLOW_EXTENSION_NAME = "VK_NV_optical_flow"
- pattern NV_OPTICAL_FLOW_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
- newtype OpticalFlowSessionNV = OpticalFlowSessionNV Word64
Documentation
getPhysicalDeviceOpticalFlowImageFormatsNV Source #
Arguments
| :: forall io. MonadIO io | |
| => PhysicalDevice |
|
| -> OpticalFlowImageFormatInfoNV |
|
| -> io (Result, "imageFormatProperties" ::: Vector OpticalFlowImageFormatPropertiesNV) |
vkGetPhysicalDeviceOpticalFlowImageFormatsNV - Query image formats for optical flow
Description
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 INCOMPLETE
will be returned instead of SUCCESS, to
indicate that not all the available values were returned. Before
creating an image to be used as a optical flow frame, obtain the
supported image creation parameters by querying with
getPhysicalDeviceFormatProperties2
and
getPhysicalDeviceImageFormatProperties2
using one of the reported formats and adding
OpticalFlowImageFormatInfoNV to the pNext chain of
PhysicalDeviceImageFormatInfo2.
When querying the parameters with
getPhysicalDeviceImageFormatProperties2
for images used for optical flow operations, the
OpticalFlowImageFormatInfoNV::usage field should contain one or more
of the bits defined in OpticalFlowUsageFlagBitsNV.
Valid Usage (Implicit)
-
physicalDevicemust be a validPhysicalDevicehandle
-
pOpticalFlowImageFormatInfomust be a valid pointer to a validOpticalFlowImageFormatInfoNVstructure -
pFormatCountmust be a valid pointer to auint32_tvalue -
If the value referenced by
pFormatCountis not0, andpImageFormatPropertiesis notNULL,pImageFormatPropertiesmust be a valid pointer to an array ofpFormatCountOpticalFlowImageFormatPropertiesNVstructures
Return Codes
Note
FORMAT_B8G8R8A8_UNORM,
FORMAT_R8_UNORM and
FORMAT_G8_B8R8_2PLANE_420_UNORM are
initially supported for images with
optical usage
OPTICAL_FLOW_USAGE_INPUT_BIT_NV.
FORMAT_R16G16_S10_5_NV is initially
supported for images with
optical flow usage
OPTICAL_FLOW_USAGE_OUTPUT_BIT_NV, OPTICAL_FLOW_USAGE_HINT_BIT_NV and
OPTICAL_FLOW_USAGE_GLOBAL_FLOW_BIT_NV.
FORMAT_R8_UINT and
FORMAT_R32_UINT are initially supported for
images with
optical flow usage
OPTICAL_FLOW_USAGE_COST_BIT_NV. It is recommended to use
FORMAT_R8_UINT because of the lower
bandwidth.
See Also
VK_NV_optical_flow,
OpticalFlowImageFormatInfoNV, OpticalFlowImageFormatPropertiesNV,
PhysicalDevice
createOpticalFlowSessionNV Source #
Arguments
| :: forall a io. (Extendss OpticalFlowSessionCreateInfoNV a, PokeChain a, MonadIO io) | |
| => Device |
|
| -> OpticalFlowSessionCreateInfoNV a |
|
| -> ("allocator" ::: Maybe AllocationCallbacks) |
|
| -> io OpticalFlowSessionNV |
vkCreateOpticalFlowSessionNV - Creates an optical flow session object
Valid Usage (Implicit)
-
devicemust be a validDevicehandle
-
pCreateInfomust be a valid pointer to a validOpticalFlowSessionCreateInfoNVstructure - If
pAllocatoris notNULL,pAllocatormust be a valid pointer to a validAllocationCallbacksstructure -
pSessionmust be a valid pointer to aOpticalFlowSessionNVhandle
Return Codes
See Also
VK_NV_optical_flow,
AllocationCallbacks,
Device, OpticalFlowSessionCreateInfoNV,
OpticalFlowSessionNV
withOpticalFlowSessionNV :: forall a io r. (Extendss OpticalFlowSessionCreateInfoNV a, PokeChain a, MonadIO io) => Device -> OpticalFlowSessionCreateInfoNV a -> Maybe AllocationCallbacks -> (io OpticalFlowSessionNV -> (OpticalFlowSessionNV -> io ()) -> r) -> r Source #
A convenience wrapper to make a compatible pair of calls to
createOpticalFlowSessionNV and destroyOpticalFlowSessionNV
To ensure that destroyOpticalFlowSessionNV is always called: pass
bracket (or the allocate function from your
favourite resource management library) as the last argument.
To just extract the pair pass (,) as the last argument.
destroyOpticalFlowSessionNV Source #
Arguments
| :: forall io. MonadIO io | |
| => Device |
|
| -> OpticalFlowSessionNV |
|
| -> ("allocator" ::: Maybe AllocationCallbacks) |
|
| -> io () |
vkDestroyOpticalFlowSessionNV - Destroy optical flow session object
Valid Usage (Implicit)
-
devicemust be a validDevicehandle
-
sessionmust be a validOpticalFlowSessionNVhandle - If
pAllocatoris notNULL,pAllocatormust be a valid pointer to a validAllocationCallbacksstructure -
sessionmust have been created, allocated, or retrieved fromdevice
See Also
VK_NV_optical_flow,
AllocationCallbacks,
Device,
OpticalFlowSessionNV
bindOpticalFlowSessionImageNV :: forall io. MonadIO io => Device -> OpticalFlowSessionNV -> OpticalFlowSessionBindingPointNV -> ImageView -> ImageLayout -> io () Source #
vkBindOpticalFlowSessionImageNV - Bind image to an optical flow session
Parameters
deviceis the device which owns the optical flow session objectsession.
sessionis the optical flow session object to which the image view is to be bound.bindingPointspecifies the binding pointOpticalFlowSessionBindingPointNVto which the image view is bound.viewis aImageViewto be bound.- layout must specify the layout that the image subresources
accessible from
viewwill be in at the time the optical flow vectors are calculated withcmdOpticalFlowExecuteNVon aDevice.
Valid Usage (Implicit)
-
devicemust be a validDevicehandle
-
sessionmust be a validOpticalFlowSessionNVhandle -
bindingPointmust be a validOpticalFlowSessionBindingPointNVvalue - If
viewis notNULL_HANDLE,viewmust be a validImageViewhandle -
layoutmust be a validImageLayoutvalue -
sessionmust have been created, allocated, or retrieved fromdevice - If
viewis a valid handle, it must have been created, allocated, or retrieved fromdevice
Return Codes
See Also
VK_NV_optical_flow,
Device,
ImageLayout,
ImageView, OpticalFlowSessionBindingPointNV,
OpticalFlowSessionNV
cmdOpticalFlowExecuteNV Source #
Arguments
| :: forall io. MonadIO io | |
| => CommandBuffer |
|
| -> OpticalFlowSessionNV |
|
| -> OpticalFlowExecuteInfoNV |
|
| -> io () |
vkCmdOpticalFlowExecuteNV - Calculate optical flow vectors
Valid Usage (Implicit)
-
commandBuffermust be a validCommandBufferhandle
-
sessionmust be a validOpticalFlowSessionNVhandle -
pExecuteInfomust be a valid pointer to a validOpticalFlowExecuteInfoNVstructure -
commandBuffermust be in the recording state - The
CommandPoolthatcommandBufferwas allocated from must support optical flow operations - This command must only be called outside of a render pass instance
- This command must only be called outside of a video coding scope
- Both of
commandBuffer, andsessionmust have been created, allocated, or retrieved from the sameDevice
Host Synchronization
- Host access to the
CommandPoolthatcommandBufferwas 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 | Opticalflow | Action |
See Also
VK_NV_optical_flow,
CommandBuffer, OpticalFlowExecuteInfoNV,
OpticalFlowSessionNV
data PhysicalDeviceOpticalFlowFeaturesNV Source #
VkPhysicalDeviceOpticalFlowFeaturesNV - Structure describing the optical flow features supported by the implementation
Members
This structure describes the following feature:
Description
If the PhysicalDeviceOpticalFlowFeaturesNV structure is included in
the pNext chain of the
PhysicalDeviceFeatures2
structure passed to
getPhysicalDeviceFeatures2,
it is filled in to indicate whether each corresponding feature is
supported. PhysicalDeviceOpticalFlowFeaturesNV can also be used in
the pNext chain of DeviceCreateInfo to
selectively enable these features.
Valid Usage (Implicit)
See Also
Constructors
| PhysicalDeviceOpticalFlowFeaturesNV | |
Fields
| |
Instances
data PhysicalDeviceOpticalFlowPropertiesNV Source #
VkPhysicalDeviceOpticalFlowPropertiesNV - Structure describing properties supported by VK_NV_optical_flow
Description
If the PhysicalDeviceOpticalFlowPropertiesNV structure is included in
the pNext chain of the
PhysicalDeviceProperties2
structure passed to
getPhysicalDeviceProperties2,
it is filled in with each corresponding implementation-dependent
property.
Valid Usage (Implicit)
See Also
VK_NV_optical_flow,
Bool32, OpticalFlowGridSizeFlagsNV,
StructureType
Constructors
| PhysicalDeviceOpticalFlowPropertiesNV | |
Fields
| |
Instances
data OpticalFlowImageFormatInfoNV Source #
VkOpticalFlowImageFormatInfoNV - Structure describing optical flow image format info
Valid Usage (Implicit)
See Also
VK_NV_optical_flow,
OpticalFlowUsageFlagsNV,
StructureType,
getPhysicalDeviceOpticalFlowImageFormatsNV
Constructors
| OpticalFlowImageFormatInfoNV | |
Fields
| |
Instances
data OpticalFlowImageFormatPropertiesNV Source #
VkOpticalFlowImageFormatPropertiesNV - Structure describing properties of an optical flow image format
Valid Usage (Implicit)
See Also
VK_NV_optical_flow,
Format,
StructureType,
getPhysicalDeviceOpticalFlowImageFormatsNV
Constructors
| OpticalFlowImageFormatPropertiesNV | |
Instances
data OpticalFlowSessionCreateInfoNV (es :: [Type]) Source #
VkOpticalFlowSessionCreateInfoNV - Structure specifying parameters of a newly created optical flow session
Valid Usage
-
widthmust be greater than or equal toPhysicalDeviceOpticalFlowPropertiesNV::minWidthand less than or equal toPhysicalDeviceOpticalFlowPropertiesNV::maxWidth
-
heightmust be greater than or equal toPhysicalDeviceOpticalFlowPropertiesNV::minHeightand less than or equal toPhysicalDeviceOpticalFlowPropertiesNV::maxHeight -
imageFormatmust be one of the formats returned bygetPhysicalDeviceOpticalFlowImageFormatsNVforOPTICAL_FLOW_USAGE_INPUT_BIT_NV -
flowVectorFormatmust be one of the formats returned bygetPhysicalDeviceOpticalFlowImageFormatsNVforOPTICAL_FLOW_USAGE_OUTPUT_BIT_NV -
costFormatmust be one of the formats returned bygetPhysicalDeviceOpticalFlowImageFormatsNVforOPTICAL_FLOW_USAGE_COST_BIT_NVifOPTICAL_FLOW_SESSION_CREATE_ENABLE_COST_BIT_NVis set inflags -
outputGridSizemust be exactly one of the bits reported inPhysicalDeviceOpticalFlowPropertiesNV::supportedOutputGridSizes -
hintGridSizemust be exactly one of the bits reported inPhysicalDeviceOpticalFlowPropertiesNV::supportedHintGridSizesifOPTICAL_FLOW_SESSION_CREATE_ENABLE_HINT_BIT_NVis set inflags -
OPTICAL_FLOW_SESSION_CREATE_ENABLE_HINT_BIT_NVmust not be set inflagsifPhysicalDeviceOpticalFlowPropertiesNV::hintSupportedisFALSE -
OPTICAL_FLOW_SESSION_CREATE_ENABLE_COST_BIT_NVmust not be set inflagsifPhysicalDeviceOpticalFlowPropertiesNV::costSupportedisFALSE -
OPTICAL_FLOW_SESSION_CREATE_ENABLE_GLOBAL_FLOW_BIT_NVmust not be set inflagsifPhysicalDeviceOpticalFlowPropertiesNV::globalFlowSupportedisFALSE -
OPTICAL_FLOW_SESSION_CREATE_ALLOW_REGIONS_BIT_NVmust not be set inflagsifPhysicalDeviceOpticalFlowPropertiesNV::maxNumRegionsOfInterestis 0 -
OPTICAL_FLOW_SESSION_CREATE_BOTH_DIRECTIONS_BIT_NVmust not be set inflagsifPhysicalDeviceOpticalFlowPropertiesNV::bidirectionalFlowSupportedisFALSE
Valid Usage (Implicit)
-
sTypemust beSTRUCTURE_TYPE_OPTICAL_FLOW_SESSION_CREATE_INFO_NV
-
pNextmust beNULLor a pointer to a valid instance ofOpticalFlowSessionCreatePrivateDataInfoNV - The
sTypevalue of each struct in thepNextchain must be unique -
imageFormatmust be a validFormatvalue -
flowVectorFormatmust be a validFormatvalue - If
costFormatis not0,costFormatmust be a validFormatvalue -
outputGridSizemust be a valid combination ofOpticalFlowGridSizeFlagBitsNVvalues -
outputGridSizemust not be0 -
hintGridSizemust be a valid combination ofOpticalFlowGridSizeFlagBitsNVvalues -
If
performanceLevelis not0,performanceLevelmust be a validOpticalFlowPerformanceLevelNVvalue -
flagsmust be a valid combination ofOpticalFlowSessionCreateFlagBitsNVvalues
See Also
VK_NV_optical_flow,
Format, OpticalFlowGridSizeFlagsNV,
OpticalFlowPerformanceLevelNV, OpticalFlowSessionCreateFlagsNV,
StructureType,
createOpticalFlowSessionNV
Constructors
| OpticalFlowSessionCreateInfoNV | |
Fields
| |
Instances
data OpticalFlowSessionCreatePrivateDataInfoNV Source #
VkOpticalFlowSessionCreatePrivateDataInfoNV - Structure for NV internal use only
Valid Usage (Implicit)
See Also
Constructors
| OpticalFlowSessionCreatePrivateDataInfoNV | |
Fields
| |
Instances
data OpticalFlowExecuteInfoNV Source #
VkOpticalFlowExecuteInfoNV - Structure specifying parameters of a optical flow vector calculation
Valid Usage
-
regionCountmust be 0 ifOPTICAL_FLOW_SESSION_CREATE_ALLOW_REGIONS_BIT_NVwas not set forOpticalFlowSessionNVon which this command is operating
Valid Usage (Implicit)
-
sTypemust beSTRUCTURE_TYPE_OPTICAL_FLOW_EXECUTE_INFO_NV
-
pNextmust beNULL -
flagsmust be a valid combination ofOpticalFlowExecuteFlagBitsNVvalues - If
regionCountis not0,pRegionsmust be a valid pointer to an array ofregionCountRect2Dstructures
See Also
VK_NV_optical_flow,
OpticalFlowExecuteFlagsNV, Rect2D,
StructureType,
cmdOpticalFlowExecuteNV
Constructors
| OpticalFlowExecuteInfoNV | |
Fields
| |
Instances
| Show OpticalFlowExecuteInfoNV Source # | |
Defined in Vulkan.Extensions.VK_NV_optical_flow Methods showsPrec :: Int -> OpticalFlowExecuteInfoNV -> ShowS # show :: OpticalFlowExecuteInfoNV -> String # showList :: [OpticalFlowExecuteInfoNV] -> ShowS # | |
| FromCStruct OpticalFlowExecuteInfoNV Source # | |
Defined in Vulkan.Extensions.VK_NV_optical_flow Methods peekCStruct :: Ptr OpticalFlowExecuteInfoNV -> IO OpticalFlowExecuteInfoNV Source # | |
| ToCStruct OpticalFlowExecuteInfoNV Source # | |
Defined in Vulkan.Extensions.VK_NV_optical_flow Methods withCStruct :: OpticalFlowExecuteInfoNV -> (Ptr OpticalFlowExecuteInfoNV -> IO b) -> IO b Source # pokeCStruct :: Ptr OpticalFlowExecuteInfoNV -> OpticalFlowExecuteInfoNV -> IO b -> IO b Source # withZeroCStruct :: (Ptr OpticalFlowExecuteInfoNV -> IO b) -> IO b Source # pokeZeroCStruct :: Ptr OpticalFlowExecuteInfoNV -> IO b -> IO b Source # cStructSize :: Int Source # | |
| Zero OpticalFlowExecuteInfoNV Source # | |
Defined in Vulkan.Extensions.VK_NV_optical_flow Methods | |
newtype OpticalFlowGridSizeFlagBitsNV Source #
VkOpticalFlowGridSizeFlagBitsNV - Bits specifying grid sizes for optical flow operations
See Also
Constructors
| OpticalFlowGridSizeFlagBitsNV Flags |
Bundled Patterns
| pattern OPTICAL_FLOW_GRID_SIZE_UNKNOWN_NV :: OpticalFlowGridSizeFlagBitsNV | |
| pattern OPTICAL_FLOW_GRID_SIZE_1X1_BIT_NV :: OpticalFlowGridSizeFlagBitsNV |
|
| pattern OPTICAL_FLOW_GRID_SIZE_2X2_BIT_NV :: OpticalFlowGridSizeFlagBitsNV |
|
| pattern OPTICAL_FLOW_GRID_SIZE_4X4_BIT_NV :: OpticalFlowGridSizeFlagBitsNV |
|
| pattern OPTICAL_FLOW_GRID_SIZE_8X8_BIT_NV :: OpticalFlowGridSizeFlagBitsNV |
|
Instances
newtype OpticalFlowUsageFlagBitsNV Source #
VkOpticalFlowUsageFlagBitsNV - Bits specifying usage for optical flow operations
See Also
Constructors
| OpticalFlowUsageFlagBitsNV Flags |
Bundled Patterns
| pattern OPTICAL_FLOW_USAGE_UNKNOWN_NV :: OpticalFlowUsageFlagBitsNV | |
| pattern OPTICAL_FLOW_USAGE_INPUT_BIT_NV :: OpticalFlowUsageFlagBitsNV |
|
| pattern OPTICAL_FLOW_USAGE_OUTPUT_BIT_NV :: OpticalFlowUsageFlagBitsNV |
|
| pattern OPTICAL_FLOW_USAGE_HINT_BIT_NV :: OpticalFlowUsageFlagBitsNV |
|
| pattern OPTICAL_FLOW_USAGE_COST_BIT_NV :: OpticalFlowUsageFlagBitsNV |
|
| pattern OPTICAL_FLOW_USAGE_GLOBAL_FLOW_BIT_NV :: OpticalFlowUsageFlagBitsNV |
|
Instances
newtype OpticalFlowPerformanceLevelNV Source #
VkOpticalFlowPerformanceLevelNV - Optical flow performance level types
See Also
Constructors
| OpticalFlowPerformanceLevelNV Int32 |
Bundled Patterns
| pattern OPTICAL_FLOW_PERFORMANCE_LEVEL_UNKNOWN_NV :: OpticalFlowPerformanceLevelNV | |
| pattern OPTICAL_FLOW_PERFORMANCE_LEVEL_SLOW_NV :: OpticalFlowPerformanceLevelNV |
|
| pattern OPTICAL_FLOW_PERFORMANCE_LEVEL_MEDIUM_NV :: OpticalFlowPerformanceLevelNV |
|
| pattern OPTICAL_FLOW_PERFORMANCE_LEVEL_FAST_NV :: OpticalFlowPerformanceLevelNV |
|
Instances
newtype OpticalFlowSessionBindingPointNV Source #
VkOpticalFlowSessionBindingPointNV - Binding points of an optical flow session
See Also
Constructors
| OpticalFlowSessionBindingPointNV Int32 |
Bundled Patterns
Instances
newtype OpticalFlowSessionCreateFlagBitsNV Source #
VkOpticalFlowSessionCreateFlagBitsNV - Bits specifying flags for optical flow session
See Also
Constructors
| OpticalFlowSessionCreateFlagBitsNV Flags |
Bundled Patterns
Instances
newtype OpticalFlowExecuteFlagBitsNV Source #
VkOpticalFlowExecuteFlagBitsNV - Bits specifying flags for a optical flow vector calculation
See Also
Constructors
| OpticalFlowExecuteFlagBitsNV Flags |
Bundled Patterns
| pattern OPTICAL_FLOW_EXECUTE_DISABLE_TEMPORAL_HINTS_BIT_NV :: OpticalFlowExecuteFlagBitsNV |
|
Instances
type NV_OPTICAL_FLOW_SPEC_VERSION = 1 Source #
pattern NV_OPTICAL_FLOW_SPEC_VERSION :: forall a. Integral a => a Source #
type NV_OPTICAL_FLOW_EXTENSION_NAME = "VK_NV_optical_flow" Source #
pattern NV_OPTICAL_FLOW_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a Source #
newtype OpticalFlowSessionNV Source #
VkOpticalFlowSessionNV - Opaque handle to an optical flow session object
See Also
VK_NV_optical_flow,
bindOpticalFlowSessionImageNV,
cmdOpticalFlowExecuteNV,
createOpticalFlowSessionNV,
destroyOpticalFlowSessionNV
Constructors
| OpticalFlowSessionNV Word64 |