Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
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
cmdOpticalFlowExecuteNV
createOpticalFlowSessionNV
destroyOpticalFlowSessionNV
getPhysicalDeviceOpticalFlowImageFormatsNV
New Structures
OpticalFlowImageFormatPropertiesNV
OpticalFlowSessionCreateInfoNV
Extending
OpticalFlowSessionCreateInfoNV
:Extending
PhysicalDeviceFeatures2
,DeviceCreateInfo
:Extending
PhysicalDeviceImageFormatInfo2
,ImageCreateInfo
:Extending
PhysicalDeviceProperties2
:
New Enums
OpticalFlowGridSizeFlagBitsNV
OpticalFlowPerformanceLevelNV
OpticalFlowSessionBindingPointNV
OpticalFlowSessionCreateFlagBitsNV
OpticalFlowUsageFlagBitsNV
New Bitmasks
New Enum Constants
NV_OPTICAL_FLOW_SPEC_VERSION
Extending
AccessFlagBits2
:Extending
Format
:Extending
FormatFeatureFlagBits2
:Extending
ObjectType
:Extending
PipelineStageFlagBits2
:Extending
QueueFlagBits
:Extending
StructureType
:STRUCTURE_TYPE_OPTICAL_FLOW_EXECUTE_INFO_NV
STRUCTURE_TYPE_OPTICAL_FLOW_IMAGE_FORMAT_INFO_NV
STRUCTURE_TYPE_OPTICAL_FLOW_IMAGE_FORMAT_PROPERTIES_NV
STRUCTURE_TYPE_OPTICAL_FLOW_SESSION_CREATE_INFO_NV
STRUCTURE_TYPE_OPTICAL_FLOW_SESSION_CREATE_PRIVATE_DATA_INFO_NV
STRUCTURE_TYPE_PHYSICAL_DEVICE_OPTICAL_FLOW_FEATURES_NV
STRUCTURE_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 #
:: 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)
-
physicalDevice
must be a validPhysicalDevice
handle
-
pOpticalFlowImageFormatInfo
must be a valid pointer to a validOpticalFlowImageFormatInfoNV
structure -
pFormatCount
must be a valid pointer to auint32_t
value -
If the value referenced by
pFormatCount
is not0
, andpImageFormatProperties
is notNULL
,pImageFormatProperties
must be a valid pointer to an array ofpFormatCount
OpticalFlowImageFormatPropertiesNV
structures
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 #
:: 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)
-
device
must be a validDevice
handle
-
pCreateInfo
must be a valid pointer to a validOpticalFlowSessionCreateInfoNV
structure - If
pAllocator
is notNULL
,pAllocator
must be a valid pointer to a validAllocationCallbacks
structure -
pSession
must be a valid pointer to aOpticalFlowSessionNV
handle
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 #
:: forall io. MonadIO io | |
=> Device |
|
-> OpticalFlowSessionNV |
|
-> ("allocator" ::: Maybe AllocationCallbacks) |
|
-> io () |
vkDestroyOpticalFlowSessionNV - Destroy optical flow session object
Valid Usage (Implicit)
-
device
must be a validDevice
handle
-
session
must be a validOpticalFlowSessionNV
handle - If
pAllocator
is notNULL
,pAllocator
must be a valid pointer to a validAllocationCallbacks
structure -
session
must 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
device
is the device which owns the optical flow session objectsession
.
session
is the optical flow session object to which the image view is to be bound.bindingPoint
specifies the binding pointOpticalFlowSessionBindingPointNV
to which the image view is bound.view
is aImageView
to be bound.- layout must specify the layout that the image subresources
accessible from
view
will be in at the time the optical flow vectors are calculated withcmdOpticalFlowExecuteNV
on aDevice
.
Valid Usage (Implicit)
-
device
must be a validDevice
handle
-
session
must be a validOpticalFlowSessionNV
handle -
bindingPoint
must be a validOpticalFlowSessionBindingPointNV
value - If
view
is notNULL_HANDLE
,view
must be a validImageView
handle -
layout
must be a validImageLayout
value -
session
must have been created, allocated, or retrieved fromdevice
- If
view
is 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 #
:: forall io. MonadIO io | |
=> CommandBuffer |
|
-> OpticalFlowSessionNV |
|
-> OpticalFlowExecuteInfoNV |
|
-> io () |
vkCmdOpticalFlowExecuteNV - Calculate optical flow vectors
Valid Usage (Implicit)
-
commandBuffer
must be a validCommandBuffer
handle
-
session
must be a validOpticalFlowSessionNV
handle -
pExecuteInfo
must be a valid pointer to a validOpticalFlowExecuteInfoNV
structure -
commandBuffer
must be in the recording state - The
CommandPool
thatcommandBuffer
was 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
, andsession
must have been created, allocated, or retrieved from the sameDevice
Host Synchronization
- Host access to the
CommandPool
thatcommandBuffer
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 | 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
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
PhysicalDeviceOpticalFlowPropertiesNV | |
|
Instances
data OpticalFlowImageFormatInfoNV Source #
VkOpticalFlowImageFormatInfoNV - Structure describing optical flow image format info
Valid Usage (Implicit)
See Also
VK_NV_optical_flow,
OpticalFlowUsageFlagsNV
,
StructureType
,
getPhysicalDeviceOpticalFlowImageFormatsNV
OpticalFlowImageFormatInfoNV | |
|
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
Instances
data OpticalFlowSessionCreateInfoNV (es :: [Type]) Source #
VkOpticalFlowSessionCreateInfoNV - Structure specifying parameters of a newly created optical flow session
Valid Usage
-
width
must be greater than or equal toPhysicalDeviceOpticalFlowPropertiesNV
::minWidth
and less than or equal toPhysicalDeviceOpticalFlowPropertiesNV
::maxWidth
-
height
must be greater than or equal toPhysicalDeviceOpticalFlowPropertiesNV
::minHeight
and less than or equal toPhysicalDeviceOpticalFlowPropertiesNV
::maxHeight
-
imageFormat
must be one of the formats returned bygetPhysicalDeviceOpticalFlowImageFormatsNV
forOPTICAL_FLOW_USAGE_INPUT_BIT_NV
-
flowVectorFormat
must be one of the formats returned bygetPhysicalDeviceOpticalFlowImageFormatsNV
forOPTICAL_FLOW_USAGE_OUTPUT_BIT_NV
-
costFormat
must be one of the formats returned bygetPhysicalDeviceOpticalFlowImageFormatsNV
forOPTICAL_FLOW_USAGE_COST_BIT_NV
ifOPTICAL_FLOW_SESSION_CREATE_ENABLE_COST_BIT_NV
is set inflags
-
outputGridSize
must be exactly one of the bits reported inPhysicalDeviceOpticalFlowPropertiesNV
::supportedOutputGridSizes
-
hintGridSize
must be exactly one of the bits reported inPhysicalDeviceOpticalFlowPropertiesNV
::supportedHintGridSizes
ifOPTICAL_FLOW_SESSION_CREATE_ENABLE_HINT_BIT_NV
is set inflags
-
OPTICAL_FLOW_SESSION_CREATE_ENABLE_HINT_BIT_NV
must not be set inflags
ifPhysicalDeviceOpticalFlowPropertiesNV
::hintSupported
isFALSE
-
OPTICAL_FLOW_SESSION_CREATE_ENABLE_COST_BIT_NV
must not be set inflags
ifPhysicalDeviceOpticalFlowPropertiesNV
::costSupported
isFALSE
-
OPTICAL_FLOW_SESSION_CREATE_ENABLE_GLOBAL_FLOW_BIT_NV
must not be set inflags
ifPhysicalDeviceOpticalFlowPropertiesNV
::globalFlowSupported
isFALSE
-
OPTICAL_FLOW_SESSION_CREATE_ALLOW_REGIONS_BIT_NV
must not be set inflags
ifPhysicalDeviceOpticalFlowPropertiesNV
::maxNumRegionsOfInterest
is 0 -
OPTICAL_FLOW_SESSION_CREATE_BOTH_DIRECTIONS_BIT_NV
must not be set inflags
ifPhysicalDeviceOpticalFlowPropertiesNV
::bidirectionalFlowSupported
isFALSE
Valid Usage (Implicit)
-
sType
must beSTRUCTURE_TYPE_OPTICAL_FLOW_SESSION_CREATE_INFO_NV
-
pNext
must beNULL
or a pointer to a valid instance ofOpticalFlowSessionCreatePrivateDataInfoNV
- The
sType
value of each struct in thepNext
chain must be unique -
imageFormat
must be a validFormat
value -
flowVectorFormat
must be a validFormat
value - If
costFormat
is not0
,costFormat
must be a validFormat
value -
outputGridSize
must be a valid combination ofOpticalFlowGridSizeFlagBitsNV
values -
outputGridSize
must not be0
-
hintGridSize
must be a valid combination ofOpticalFlowGridSizeFlagBitsNV
values -
If
performanceLevel
is not0
,performanceLevel
must be a validOpticalFlowPerformanceLevelNV
value -
flags
must be a valid combination ofOpticalFlowSessionCreateFlagBitsNV
values
See Also
VK_NV_optical_flow,
Format
, OpticalFlowGridSizeFlagsNV
,
OpticalFlowPerformanceLevelNV
, OpticalFlowSessionCreateFlagsNV
,
StructureType
,
createOpticalFlowSessionNV
OpticalFlowSessionCreateInfoNV | |
|
Instances
data OpticalFlowSessionCreatePrivateDataInfoNV Source #
VkOpticalFlowSessionCreatePrivateDataInfoNV - Structure for NV internal use only
Valid Usage (Implicit)
See Also
OpticalFlowSessionCreatePrivateDataInfoNV | |
|
Instances
data OpticalFlowExecuteInfoNV Source #
VkOpticalFlowExecuteInfoNV - Structure specifying parameters of a optical flow vector calculation
Valid Usage
-
regionCount
must be 0 ifOPTICAL_FLOW_SESSION_CREATE_ALLOW_REGIONS_BIT_NV
was not set forOpticalFlowSessionNV
on which this command is operating
Valid Usage (Implicit)
-
sType
must beSTRUCTURE_TYPE_OPTICAL_FLOW_EXECUTE_INFO_NV
-
pNext
must beNULL
-
flags
must be a valid combination ofOpticalFlowExecuteFlagBitsNV
values - If
regionCount
is not0
,pRegions
must be a valid pointer to an array ofregionCount
Rect2D
structures
See Also
VK_NV_optical_flow,
OpticalFlowExecuteFlagsNV
, Rect2D
,
StructureType
,
cmdOpticalFlowExecuteNV
OpticalFlowExecuteInfoNV | |
|
Instances
Show OpticalFlowExecuteInfoNV Source # | |
Defined in Vulkan.Extensions.VK_NV_optical_flow showsPrec :: Int -> OpticalFlowExecuteInfoNV -> ShowS # show :: OpticalFlowExecuteInfoNV -> String # showList :: [OpticalFlowExecuteInfoNV] -> ShowS # | |
FromCStruct OpticalFlowExecuteInfoNV Source # | |
ToCStruct OpticalFlowExecuteInfoNV Source # | |
Defined in Vulkan.Extensions.VK_NV_optical_flow 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 |
newtype OpticalFlowGridSizeFlagBitsNV Source #
VkOpticalFlowGridSizeFlagBitsNV - Bits specifying grid sizes for optical flow operations
See Also
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
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
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
Instances
newtype OpticalFlowSessionCreateFlagBitsNV Source #
VkOpticalFlowSessionCreateFlagBitsNV - Bits specifying flags for optical flow session
See Also
Instances
newtype OpticalFlowExecuteFlagBitsNV Source #
VkOpticalFlowExecuteFlagBitsNV - Bits specifying flags for a optical flow vector calculation
See Also
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