Class EXTTransformFeedback
- java.lang.Object
-
- org.lwjgl.vulkan.EXTTransformFeedback
-
public class EXTTransformFeedback extends java.lang.Object
This extension adds transform feedback to the Vulkan API by exposing the SPIR-VTransformFeedback
andGeometryStreams
capabilities to capture vertex, tessellation or geometry shader outputs to one or more buffers. It adds API functionality to bind transform feedback buffers to capture the primitives emitted by the graphics pipeline from SPIR-V outputs decorated for transform feedback. The transform feedback capture can be paused and resumed by way of storing and retrieving a byte counter. The captured data can be drawn again where the vertex count is derived from the byte counter without CPU intervention. If the implementation is capable, a vertex stream other than zero can be rasterized.All these features are designed to match the full capabilities of OpenGL core transform feedback functionality and beyond. Many of the features are optional to allow base OpenGL ES GPUs to also implement this extension.
The primary purpose of the functionality exposed by this extension is to support translation layers from other 3D APIs. This functionality is not considered forward looking, and is not expected to be promoted to a KHR extension or to core Vulkan. Unless this is needed for translation, it is recommended that developers use alternative techniques of using the GPU to process and capture vertex data.
- Name String
VK_EXT_transform_feedback
- Extension Type
- Device extension
- Registered Extension Number
- 29
- Revision
- 1
- Extension and Version Dependencies
- Requires Vulkan 1.0
- Requires
VK_KHR_get_physical_device_properties2
- Contact
- Piers Daniell pdaniell-nv
- Last Modified Data
- 2018-10-09
- Contributors
- Baldur Karlsson, Valve
- Boris Zanin, Mobica
- Daniel Rakos, AMD
- Donald Scorgie, Imagination
- Henri Verbeet, CodeWeavers
- Jan-Harald Fredriksen, Arm
- Jason Ekstrand, Intel
- Jeff Bolz, NVIDIA
- Jesse Barker, Unity
- Jesse Hall, Google
- Pierre-Loup Griffais, Valve
- Philip Rebohle, DXVK
- Ruihao Zhang, Qualcomm
- Samuel Pitoiset, Valve
- Slawomir Grajewski, Intel
- Stu Smith, Imagination Technologies
-
-
Field Summary
Fields Modifier and Type Field Description static int
VK_ACCESS_TRANSFORM_FEEDBACK_COUNTER_READ_BIT_EXT
VK_ACCESS_TRANSFORM_FEEDBACK_COUNTER_WRITE_BIT_EXT
VK_ACCESS_TRANSFORM_FEEDBACK_WRITE_BIT_EXTExtendsVkAccessFlagBits
.static int
VK_BUFFER_USAGE_TRANSFORM_FEEDBACK_BUFFER_BIT_EXT
VK_BUFFER_USAGE_TRANSFORM_FEEDBACK_COUNTER_BUFFER_BIT_EXTExtendsVkBufferUsageFlagBits
.static java.lang.String
VK_EXT_TRANSFORM_FEEDBACK_EXTENSION_NAME
The extension name.static int
VK_EXT_TRANSFORM_FEEDBACK_SPEC_VERSION
The extension specification version.static int
VK_PIPELINE_STAGE_TRANSFORM_FEEDBACK_BIT_EXT
ExtendsVkPipelineStageFlagBits
.static int
VK_QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT
ExtendsVkQueryType
.static int
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT
VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_STREAM_CREATE_INFO_EXTExtendsVkStructureType
.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
nvkCmdBeginTransformFeedbackEXT(VkCommandBuffer commandBuffer, int firstCounterBuffer, int counterBufferCount, long pCounterBuffers, long pCounterBufferOffsets)
Unsafe version of:CmdBeginTransformFeedbackEXT
static void
nvkCmdBindTransformFeedbackBuffersEXT(VkCommandBuffer commandBuffer, int firstBinding, int bindingCount, long pBuffers, long pOffsets, long pSizes)
Unsafe version of:CmdBindTransformFeedbackBuffersEXT
static void
nvkCmdEndTransformFeedbackEXT(VkCommandBuffer commandBuffer, int firstCounterBuffer, int counterBufferCount, long pCounterBuffers, long pCounterBufferOffsets)
Unsafe version of:CmdEndTransformFeedbackEXT
static void
vkCmdBeginQueryIndexedEXT(VkCommandBuffer commandBuffer, long queryPool, int query, int flags, int index)
Begin an indexed query.static void
vkCmdBeginTransformFeedbackEXT(VkCommandBuffer commandBuffer, int firstCounterBuffer, long[] pCounterBuffers, long[] pCounterBufferOffsets)
Array version of:CmdBeginTransformFeedbackEXT
static void
vkCmdBeginTransformFeedbackEXT(VkCommandBuffer commandBuffer, int firstCounterBuffer, java.nio.LongBuffer pCounterBuffers, java.nio.LongBuffer pCounterBufferOffsets)
Make transform feedback active in the command buffer.static void
vkCmdBindTransformFeedbackBuffersEXT(VkCommandBuffer commandBuffer, int firstBinding, long[] pBuffers, long[] pOffsets, long[] pSizes)
Array version of:CmdBindTransformFeedbackBuffersEXT
static void
vkCmdBindTransformFeedbackBuffersEXT(VkCommandBuffer commandBuffer, int firstBinding, java.nio.LongBuffer pBuffers, java.nio.LongBuffer pOffsets, java.nio.LongBuffer pSizes)
Bind transform feedback buffers to a command buffer.static void
vkCmdDrawIndirectByteCountEXT(VkCommandBuffer commandBuffer, int instanceCount, int firstInstance, long counterBuffer, long counterBufferOffset, int counterOffset, int vertexStride)
Draw primitives where the vertex count is derived from the counter byte value in the counter buffer.static void
vkCmdEndQueryIndexedEXT(VkCommandBuffer commandBuffer, long queryPool, int query, int index)
Ends a query.static void
vkCmdEndTransformFeedbackEXT(VkCommandBuffer commandBuffer, int firstCounterBuffer, long[] pCounterBuffers, long[] pCounterBufferOffsets)
Array version of:CmdEndTransformFeedbackEXT
static void
vkCmdEndTransformFeedbackEXT(VkCommandBuffer commandBuffer, int firstCounterBuffer, java.nio.LongBuffer pCounterBuffers, java.nio.LongBuffer pCounterBufferOffsets)
Make transform feedback inactive in the command buffer.
-
-
-
Field Detail
-
VK_EXT_TRANSFORM_FEEDBACK_SPEC_VERSION
The extension specification version.
-
VK_EXT_TRANSFORM_FEEDBACK_EXTENSION_NAME
The extension name.
-
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT, VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_STREAM_CREATE_INFO_EXT
-
VK_QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT
ExtendsVkQueryType
.
-
VK_BUFFER_USAGE_TRANSFORM_FEEDBACK_BUFFER_BIT_EXT, VK_BUFFER_USAGE_TRANSFORM_FEEDBACK_COUNTER_BUFFER_BIT_EXT
ExtendsVkBufferUsageFlagBits
.Enum values:
-
VK_ACCESS_TRANSFORM_FEEDBACK_WRITE_BIT_EXT, VK_ACCESS_TRANSFORM_FEEDBACK_COUNTER_READ_BIT_EXT, VK_ACCESS_TRANSFORM_FEEDBACK_COUNTER_WRITE_BIT_EXT
ExtendsVkAccessFlagBits
.Enum values:
-
VK_PIPELINE_STAGE_TRANSFORM_FEEDBACK_BIT_EXT
ExtendsVkPipelineStageFlagBits
.
-
-
Method Detail
-
nvkCmdBindTransformFeedbackBuffersEXT
public static void nvkCmdBindTransformFeedbackBuffersEXT(VkCommandBuffer commandBuffer, int firstBinding, int bindingCount, long pBuffers, long pOffsets, long pSizes)
Unsafe version of:CmdBindTransformFeedbackBuffersEXT
- Parameters:
bindingCount
- the number of transform feedback bindings whose state is updated by the command.
-
vkCmdBindTransformFeedbackBuffersEXT
public static void vkCmdBindTransformFeedbackBuffersEXT(VkCommandBuffer commandBuffer, int firstBinding, java.nio.LongBuffer pBuffers, java.nio.LongBuffer pOffsets, @Nullable java.nio.LongBuffer pSizes)
Bind transform feedback buffers to a command buffer.C Specification
To bind transform feedback buffers to a command buffer for use in subsequent draw commands, call:
void vkCmdBindTransformFeedbackBuffersEXT( VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets, const VkDeviceSize* pSizes);
Description
The values taken from elements
i
ofpBuffers
,pOffsets
andpSizes
replace the current state for the transform feedback bindingfirstBinding + i
, fori
in[0, bindingCount)
. The transform feedback binding is updated to start at the offset indicated bypOffsets
[i] from the start of the bufferpBuffers
[i].Valid Usage
VkPhysicalDeviceTransformFeedbackFeaturesEXT
::transformFeedback
must be enabledfirstBinding
must be less thanVkPhysicalDeviceTransformFeedbackPropertiesEXT
::maxTransformFeedbackBuffers
- The sum of
firstBinding
andbindingCount
must be less than or equal toVkPhysicalDeviceTransformFeedbackPropertiesEXT
::maxTransformFeedbackBuffers
- All elements of
pOffsets
must be less than the size of the corresponding element inpBuffers
- All elements of
pOffsets
must be a multiple of 4 - All elements of
pBuffers
must have been created with theBUFFER_USAGE_TRANSFORM_FEEDBACK_BUFFER_BIT_EXT
flag - If the optional
pSize
array is specified, each element ofpSizes
must either beWHOLE_SIZE
, or be less than or equal toVkPhysicalDeviceTransformFeedbackPropertiesEXT
::maxTransformFeedbackBufferSize
- All elements of
pSizes
must be less than or equal to the size of the corresponding buffer inpBuffers
- All elements of
pOffsets
pluspSizes
, where thepSizes
, element is notWHOLE_SIZE
, must be less than or equal to the size of the corresponding element inpBuffers
- Each element of
pBuffers
that is non-sparse must be bound completely and contiguously to a singleVkDeviceMemory
object - Transform feedback must not be active when the
vkCmdBindTransformFeedbackBuffersEXT
command is recorded
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handlepBuffers
must be a valid pointer to an array ofbindingCount
validVkBuffer
handlespOffsets
must be a valid pointer to an array ofbindingCount
VkDeviceSize
values- If
pSizes
is notNULL
,pSizes
must be a valid pointer to an array ofbindingCount
VkDeviceSize
values commandBuffer
must be in the recording state- The
VkCommandPool
thatcommandBuffer
was allocated from must support graphics operations - If
pSizes
is notNULL
,bindingCount
must be greater than 0 - Both of
commandBuffer
, and the elements ofpBuffers
must have been created, allocated, or retrieved from the sameVkDevice
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized - Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Properties
Command Buffer Levels Render Pass Scope Supported Queue Types Pipeline Type Primary Secondary Both Graphics - Parameters:
commandBuffer
- the command buffer into which the command is recorded.firstBinding
- the index of the first transform feedback binding whose state is updated by the command.pBuffers
- a pointer to an array of buffer handles.pOffsets
- a pointer to an array of buffer offsets.pSizes
- an optional array of buffer sizes, which specifies the maximum number of bytes to capture to the corresponding transform feedback buffer. IfpSizes
isNULL
, or the value of thepSizes
array element isWHOLE_SIZE
, then the maximum bytes captured will be the size of the corresponding buffer minus the buffer offset.
-
nvkCmdBeginTransformFeedbackEXT
public static void nvkCmdBeginTransformFeedbackEXT(VkCommandBuffer commandBuffer, int firstCounterBuffer, int counterBufferCount, long pCounterBuffers, long pCounterBufferOffsets)
Unsafe version of:CmdBeginTransformFeedbackEXT
- Parameters:
counterBufferCount
- the size of thepCounterBuffers
andpCounterBufferOffsets
arrays.
-
vkCmdBeginTransformFeedbackEXT
public static void vkCmdBeginTransformFeedbackEXT(VkCommandBuffer commandBuffer, int firstCounterBuffer, @Nullable java.nio.LongBuffer pCounterBuffers, @Nullable java.nio.LongBuffer pCounterBufferOffsets)
Make transform feedback active in the command buffer.C Specification
Transform feedback for specific transform feedback buffers is made active by calling:
void vkCmdBeginTransformFeedbackEXT( VkCommandBuffer commandBuffer, uint32_t firstCounterBuffer, uint32_t counterBufferCount, const VkBuffer* pCounterBuffers, const VkDeviceSize* pCounterBufferOffsets);
Description
The active transform feedback buffers will capture primitives emitted from the corresponding
XfbBuffer
in the bound graphics pipeline. AnyXfbBuffer
emitted that does not output to an active transform feedback buffer will not be captured.Valid Usage
VkPhysicalDeviceTransformFeedbackFeaturesEXT
::transformFeedback
must be enabled- Transform feedback must not be active
firstCounterBuffer
must be less thanVkPhysicalDeviceTransformFeedbackPropertiesEXT
::maxTransformFeedbackBuffers
- The sum of
firstCounterBuffer
andcounterBufferCount
must be less than or equal toVkPhysicalDeviceTransformFeedbackPropertiesEXT
::maxTransformFeedbackBuffers
- If
counterBufferCount
is not 0, andpCounterBuffers
is notNULL
,pCounterBuffers
must be a valid pointer to an array ofcounterBufferCount
VkBuffer
handles that are either valid orNULL_HANDLE
- For each buffer handle in the array, if it is not
NULL_HANDLE
it must reference a buffer large enough to hold 4 bytes at the corresponding offset from thepCounterBufferOffsets
array - If
pCounterBuffer
isNULL
, thenpCounterBufferOffsets
must also beNULL
- For each buffer handle in the
pCounterBuffers
array that is notNULL_HANDLE
it must have been created with ausage
value containingBUFFER_USAGE_TRANSFORM_FEEDBACK_COUNTER_BUFFER_BIT_EXT
- Transform feedback must not be made active in a render pass instance with multiview enabled
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handle- If
counterBufferCount
is not 0, andpCounterBufferOffsets
is notNULL
,pCounterBufferOffsets
must be a valid pointer to an array ofcounterBufferCount
VkDeviceSize
values commandBuffer
must be in the recording state- The
VkCommandPool
thatcommandBuffer
was allocated from must support graphics operations - This command must only be called inside of a render pass instance
- Both of
commandBuffer
, and the elements ofpCounterBuffers
that are valid handles must have been created, allocated, or retrieved from the sameVkDevice
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized - Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Properties
Command Buffer Levels Render Pass Scope Supported Queue Types Pipeline Type Primary Secondary Inside Graphics - Parameters:
commandBuffer
- the command buffer into which the command is recorded.firstCounterBuffer
- the index of the first transform feedback buffer corresponding topCounterBuffers
[0] andpCounterBufferOffsets
[0].pCounterBuffers
- an optional array of buffer handles to the counter buffers which contain a 4 byte integer value representing the byte offset from the start of the corresponding transform feedback buffer from where to start capturing vertex data. If the byte offset stored to the counter buffer location was done usingCmdEndTransformFeedbackEXT
it can be used to resume transform feedback from the previous location. IfpCounterBuffers
isNULL
, then transform feedback will start capturing vertex data to byte offset zero in all bound transform feedback buffers. For each element ofpCounterBuffers
that isNULL_HANDLE
, transform feedback will start capturing vertex data to byte zero in the corresponding bound transform feedback buffer.pCounterBufferOffsets
- an optional array of offsets within each of thepCounterBuffers
where the counter values were previously written. The location in each counter buffer at these offsets must be large enough to contain 4 bytes of data. This data is the number of bytes captured by the previous transform feedback to this buffer. IfpCounterBufferOffsets
isNULL
, then it is assumed the offsets are zero.
-
nvkCmdEndTransformFeedbackEXT
public static void nvkCmdEndTransformFeedbackEXT(VkCommandBuffer commandBuffer, int firstCounterBuffer, int counterBufferCount, long pCounterBuffers, long pCounterBufferOffsets)
Unsafe version of:CmdEndTransformFeedbackEXT
- Parameters:
counterBufferCount
- the size of thepCounterBuffers
andpCounterBufferOffsets
arrays.
-
vkCmdEndTransformFeedbackEXT
public static void vkCmdEndTransformFeedbackEXT(VkCommandBuffer commandBuffer, int firstCounterBuffer, @Nullable java.nio.LongBuffer pCounterBuffers, @Nullable java.nio.LongBuffer pCounterBufferOffsets)
Make transform feedback inactive in the command buffer.C Specification
Transform feedback for specific transform feedback buffers is made inactive by calling:
void vkCmdEndTransformFeedbackEXT( VkCommandBuffer commandBuffer, uint32_t firstCounterBuffer, uint32_t counterBufferCount, const VkBuffer* pCounterBuffers, const VkDeviceSize* pCounterBufferOffsets);
Valid Usage
VkPhysicalDeviceTransformFeedbackFeaturesEXT
::transformFeedback
must be enabled- Transform feedback must be active
firstCounterBuffer
must be less thanVkPhysicalDeviceTransformFeedbackPropertiesEXT
::maxTransformFeedbackBuffers
- The sum of
firstCounterBuffer
andcounterBufferCount
must be less than or equal toVkPhysicalDeviceTransformFeedbackPropertiesEXT
::maxTransformFeedbackBuffers
- If
counterBufferCount
is not 0, andpCounterBuffers
is notNULL
,pCounterBuffers
must be a valid pointer to an array ofcounterBufferCount
VkBuffer
handles that are either valid orNULL_HANDLE
- For each buffer handle in the array, if it is not
NULL_HANDLE
it must reference a buffer large enough to hold 4 bytes at the corresponding offset from thepCounterBufferOffsets
array - If
pCounterBuffer
isNULL
, thenpCounterBufferOffsets
must also beNULL
- For each buffer handle in the
pCounterBuffers
array that is notNULL_HANDLE
it must have been created with ausage
value containingBUFFER_USAGE_TRANSFORM_FEEDBACK_COUNTER_BUFFER_BIT_EXT
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handle- If
counterBufferCount
is not 0, andpCounterBufferOffsets
is notNULL
,pCounterBufferOffsets
must be a valid pointer to an array ofcounterBufferCount
VkDeviceSize
values commandBuffer
must be in the recording state- The
VkCommandPool
thatcommandBuffer
was allocated from must support graphics operations - This command must only be called inside of a render pass instance
- Both of
commandBuffer
, and the elements ofpCounterBuffers
that are valid handles must have been created, allocated, or retrieved from the sameVkDevice
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized - Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Properties
Command Buffer Levels Render Pass Scope Supported Queue Types Pipeline Type Primary Secondary Inside Graphics - Parameters:
commandBuffer
- the command buffer into which the command is recorded.firstCounterBuffer
- the index of the first transform feedback buffer corresponding topCounterBuffers
[0] andpCounterBufferOffsets
[0].pCounterBuffers
- an optional array of buffer handles to the counter buffers used to record the current byte positions of each transform feedback buffer where the next vertex output data would be captured. This can be used by a subsequentCmdBeginTransformFeedbackEXT
call to resume transform feedback capture from this position. It can also be used byCmdDrawIndirectByteCountEXT
to determine the vertex count of the draw call.pCounterBufferOffsets
- an optional array of offsets within each of thepCounterBuffers
where the counter values can be written. The location in each counter buffer at these offsets must be large enough to contain 4 bytes of data. The data stored at this location is the byte offset from the start of the transform feedback buffer binding where the next vertex data would be written. IfpCounterBufferOffsets
isNULL
, then it is assumed the offsets are zero.
-
vkCmdBeginQueryIndexedEXT
public static void vkCmdBeginQueryIndexedEXT(VkCommandBuffer commandBuffer, long queryPool, int query, int flags, int index)
Begin an indexed query.C Specification
To begin an indexed query, call:
void vkCmdBeginQueryIndexedEXT( VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, VkQueryControlFlags flags, uint32_t index);
Description
The
vkCmdBeginQueryIndexedEXT
command operates the same as theCmdBeginQuery
command, except that it also accepts a query type specificindex
parameter.Valid Usage
queryPool
must have been created with aqueryType
that differs from that of any queries that are active withincommandBuffer
- All queries used by the command must be unavailable
- If the precise occlusion queries feature is not enabled, or the
queryType
used to createqueryPool
was notQUERY_TYPE_OCCLUSION
,flags
must not containQUERY_CONTROL_PRECISE_BIT
query
must be less than the number of queries inqueryPool
- If the
queryType
used to createqueryPool
wasQUERY_TYPE_OCCLUSION
, theVkCommandPool
thatcommandBuffer
was allocated from must support graphics operations - If the
queryType
used to createqueryPool
wasQUERY_TYPE_PIPELINE_STATISTICS
and any of thepipelineStatistics
indicate graphics operations, theVkCommandPool
thatcommandBuffer
was allocated from must support graphics operations - If the
queryType
used to createqueryPool
wasQUERY_TYPE_PIPELINE_STATISTICS
and any of thepipelineStatistics
indicate compute operations, theVkCommandPool
thatcommandBuffer
was allocated from must support compute operations commandBuffer
must not be a protected command buffer- If called within a render pass instance, the sum of
query
and the number of bits set in the current subpass’s view mask must be less than or equal to the number of queries inqueryPool
- If the
queryType
used to createqueryPool
wasQUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT
theVkCommandPool
thatcommandBuffer
was allocated from must support graphics operations - If the
queryType
used to createqueryPool
wasQUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT
theindex
parameter must be less thanVkPhysicalDeviceTransformFeedbackPropertiesEXT
::maxTransformFeedbackStreams
- If the
queryType
used to createqueryPool
was notQUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT
theindex
must be zero - If the
queryType
used to createqueryPool
wasQUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT
thenVkPhysicalDeviceTransformFeedbackPropertiesEXT
::transformFeedbackQueries
must be supported
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handlequeryPool
must be a validVkQueryPool
handleflags
must be a valid combination ofVkQueryControlFlagBits
valuescommandBuffer
must be in the recording state- The
VkCommandPool
thatcommandBuffer
was allocated from must support graphics, or compute operations - Both of
commandBuffer
, andqueryPool
must have been created, allocated, or retrieved from the sameVkDevice
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized - Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Properties
Command Buffer Levels Render Pass Scope Supported Queue Types Pipeline Type Primary Secondary Both Graphics Compute - Parameters:
commandBuffer
- the command buffer into which this command will be recorded.queryPool
- the query pool that will manage the results of the query.query
- the query index within the query pool that will contain the results.flags
- a bitmask ofVkQueryControlFlagBits
specifying constraints on the types of queries that can be performed.index
- the query type specific index. When the query type isQUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT
the index represents the vertex stream.
-
vkCmdEndQueryIndexedEXT
public static void vkCmdEndQueryIndexedEXT(VkCommandBuffer commandBuffer, long queryPool, int query, int index)
Ends a query.C Specification
To end an indexed query after the set of desired draw or dispatch commands is recorded, call:
void vkCmdEndQueryIndexedEXT( VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, uint32_t index);
Description
The
vkCmdEndQueryIndexedEXT
command operates the same as theCmdEndQuery
command, except that it also accepts a query type specificindex
parameter.Valid Usage
- All queries used by the command must be active
query
must be less than the number of queries inqueryPool
commandBuffer
must not be a protected command buffer- If
vkCmdEndQueryIndexedEXT
is called within a render pass instance, the sum ofquery
and the number of bits set in the current subpass’s view mask must be less than or equal to the number of queries inqueryPool
- If the
queryType
used to createqueryPool
wasQUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT
theindex
parameter must be less thanVkPhysicalDeviceTransformFeedbackPropertiesEXT
::maxTransformFeedbackStreams
- If the
queryType
used to createqueryPool
was notQUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT
theindex
must be zero - If the
queryType
used to createqueryPool
wasQUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT
index
must equal theindex
used to begin the query
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handlequeryPool
must be a validVkQueryPool
handlecommandBuffer
must be in the recording state- The
VkCommandPool
thatcommandBuffer
was allocated from must support graphics, or compute operations - Both of
commandBuffer
, andqueryPool
must have been created, allocated, or retrieved from the sameVkDevice
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized - Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Properties
Command Buffer Levels Render Pass Scope Supported Queue Types Pipeline Type Primary Secondary Both Graphics Compute - Parameters:
commandBuffer
- the command buffer into which this command will be recorded.queryPool
- the query pool that is managing the results of the query.query
- the query index within the query pool where the result is stored.index
- the query type specific index.
-
vkCmdDrawIndirectByteCountEXT
public static void vkCmdDrawIndirectByteCountEXT(VkCommandBuffer commandBuffer, int instanceCount, int firstInstance, long counterBuffer, long counterBufferOffset, int counterOffset, int vertexStride)
Draw primitives where the vertex count is derived from the counter byte value in the counter buffer.C Specification
To record a non-indexed draw call, where the vertex count is based on a byte count read from a buffer and the passed in vertex stride parameter, call:
void vkCmdDrawIndirectByteCountEXT( VkCommandBuffer commandBuffer, uint32_t instanceCount, uint32_t firstInstance, VkBuffer counterBuffer, VkDeviceSize counterBufferOffset, uint32_t counterOffset, uint32_t vertexStride);
Description
When the command is executed, primitives are assembled in the same way as done with
CmdDraw
except thevertexCount
is calculated based on the byte count read fromcounterBuffer
at offsetcounterBufferOffset
. The assembled primitives execute the bound graphics pipeline.The effective
vertexCount
is calculated as follows:const uint32_t * counterBufferPtr = (const uint8_t *)counterBuffer.address + counterBufferOffset; vertexCount = floor(max(0, (*counterBufferPtr - counterOffset)) / vertexStride);
The effective
firstVertex
is zero.Valid Usage
- If a
VkImageView
is sampled withFILTER_LINEAR
as a result of this command, then the image view’s format features must containFORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT
- If a
VkImageView
is accessed using atomic operations as a result of this command, then the image view’s format features must containFORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT
- If a
VkImageView
is sampled withFILTER_CUBIC_EXT
as a result of this command, then the image view’s format features must containFORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT
- Any
VkImageView
being sampled withFILTER_CUBIC_EXT
as a result of this command must have aVkImageViewType
and format that supports cubic filtering, as specified byVkFilterCubicImageViewImageFormatPropertiesEXT
::filterCubic
returned byvkGetPhysicalDeviceImageFormatProperties2
- Any
VkImageView
being sampled withFILTER_CUBIC_EXT
with a reduction mode of eitherSAMPLER_REDUCTION_MODE_MIN_EXT
orSAMPLER_REDUCTION_MODE_MAX_EXT
as a result of this command must have aVkImageViewType
and format that supports cubic filtering together with minmax filtering, as specified byVkFilterCubicImageViewImageFormatPropertiesEXT
::filterCubicMinmax
returned byvkGetPhysicalDeviceImageFormatProperties2
- Any
VkImage
created with aVkImageCreateInfo
::flags
containingIMAGE_CREATE_CORNER_SAMPLED_BIT_NV
sampled as a result of this command must only be sampled using aVkSamplerAddressMode
ofSAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE
. - For each set n that is statically used by the
VkPipeline
bound to the pipeline bind point used by this command, a descriptor set must have been bound to n at the same pipeline bind point, with aVkPipelineLayout
that is compatible for set n, with theVkPipelineLayout
used to create the currentVkPipeline
, as described in Pipeline Layout Compatibility - For each push constant that is statically used by the
VkPipeline
bound to the pipeline bind point used by this command, a push constant value must have been set for the same pipeline bind point, with aVkPipelineLayout
that is compatible for push constants, with theVkPipelineLayout
used to create the currentVkPipeline
, as described in Pipeline Layout Compatibility - Descriptors in each bound descriptor set, specified via
vkCmdBindDescriptorSets
, must be valid if they are statically used by theVkPipeline
bound to the pipeline bind point used by this command - A valid pipeline must be bound to the pipeline bind point used by this command
- If the
VkPipeline
object bound to the pipeline bind point used by this command requires any dynamic state, that state must have been set forcommandBuffer
- If the
VkPipeline
object bound to the pipeline bind point used by this command accesses aVkSampler
object that uses unnormalized coordinates, that sampler must not be used to sample from anyVkImage
with aVkImageView
of the typeIMAGE_VIEW_TYPE_3D
,IMAGE_VIEW_TYPE_CUBE
,IMAGE_VIEW_TYPE_1D_ARRAY
,IMAGE_VIEW_TYPE_2D_ARRAY
orIMAGE_VIEW_TYPE_CUBE_ARRAY
, in any shader stage - If the
VkPipeline
object bound to the pipeline bind point used by this command accesses aVkSampler
object that uses unnormalized coordinates, that sampler must not be used with any of the SPIR-VOpImageSample*
orOpImageSparseSample*
instructions withImplicitLod
,Dref
orProj
in their name, in any shader stage - If the
VkPipeline
object bound to the pipeline bind point used by this command accesses aVkSampler
object that uses unnormalized coordinates, that sampler must not be used with any of the SPIR-VOpImageSample*
orOpImageSparseSample*
instructions that includes a LOD bias or any offset values, in any shader stage - If the robust buffer access feature is not enabled, and if the
VkPipeline
object bound to the pipeline bind point used by this command accesses a uniform buffer, it must not access values outside of the range of the buffer as specified in the descriptor set bound to the same pipeline bind point - If the robust buffer access feature is not enabled, and if the
VkPipeline
object bound to the pipeline bind point used by this command accesses a storage buffer, it must not access values outside of the range of the buffer as specified in the descriptor set bound to the same pipeline bind point - If
commandBuffer
is an unprotected command buffer, any resource accessed by theVkPipeline
object bound to the pipeline bind point used by this command must not be a protected resource - The current render pass must be compatible with the
renderPass
member of theVkGraphicsPipelineCreateInfo
structure specified when creating theVkPipeline
bound toPIPELINE_BIND_POINT_GRAPHICS
. - The subpass index of the current render pass must be equal to the
subpass
member of theVkGraphicsPipelineCreateInfo
structure specified when creating theVkPipeline
bound toPIPELINE_BIND_POINT_GRAPHICS
. - Every input attachment used by the current subpass must be bound to the pipeline via a descriptor set
- Image subresources used as attachments in the current render pass must not be accessed in any way other than as an attachment by this command.
- If the draw is recorded in a render pass instance with multiview enabled, the maximum instance index must be less than or equal to
VkPhysicalDeviceMultiviewProperties
::maxMultiviewInstanceIndex
. - If the bound graphics pipeline was created with
VkPipelineSampleLocationsStateCreateInfoEXT
::sampleLocationsEnable
set toTRUE
and the current subpass has a depth/stencil attachment, then that attachment must have been created with theIMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT
bit set - All vertex input bindings accessed via vertex input variables declared in the vertex shader entry point’s interface must have valid buffers bound
- For a given vertex buffer binding, any attribute data fetched must be entirely contained within the corresponding vertex buffer binding, as described in Vertex Input Description
VkPhysicalDeviceTransformFeedbackFeaturesEXT
::transformFeedback
must be enabled- The implementation must support
VkPhysicalDeviceTransformFeedbackPropertiesEXT
::transformFeedbackDraw
vertexStride
must be greater than 0 and less than or equal toVkPhysicalDeviceLimits
::maxTransformFeedbackBufferDataStride
counterBuffer
must have been created with theBUFFER_USAGE_INDIRECT_BUFFER_BIT
bit setcommandBuffer
must not be a protected command buffer
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handlecounterBuffer
must be a validVkBuffer
handlecommandBuffer
must be in the recording state- The
VkCommandPool
thatcommandBuffer
was allocated from must support graphics operations - This command must only be called inside of a render pass instance
- Both of
commandBuffer
, andcounterBuffer
must have been created, allocated, or retrieved from the sameVkDevice
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized - Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Properties
Command Buffer Levels Render Pass Scope Supported Queue Types Pipeline Type Primary Secondary Inside Graphics Graphics - Parameters:
commandBuffer
- the command buffer into which the command is recorded.instanceCount
- the number of instances to draw.firstInstance
- the instance ID of the first instance to draw.counterBuffer
- the buffer handle from where the byte count is read.counterBufferOffset
- the offset into the buffer used to read the byte count, which is used to calculate the vertex count for this draw call.counterOffset
- subtracted from the byte count read from thecounterBuffer
at thecounterBufferOffset
vertexStride
- the stride in bytes between each element of the vertex data that is used to calculate the vertex count from the counter value. This value is typically the same value that was used in the graphics pipeline state when the transform feedback was captured as theXfbStride
.
- If a
-
vkCmdBindTransformFeedbackBuffersEXT
public static void vkCmdBindTransformFeedbackBuffersEXT(VkCommandBuffer commandBuffer, int firstBinding, long[] pBuffers, long[] pOffsets, @Nullable long[] pSizes)
Array version of:CmdBindTransformFeedbackBuffersEXT
-
vkCmdBeginTransformFeedbackEXT
public static void vkCmdBeginTransformFeedbackEXT(VkCommandBuffer commandBuffer, int firstCounterBuffer, @Nullable long[] pCounterBuffers, @Nullable long[] pCounterBufferOffsets)
Array version of:CmdBeginTransformFeedbackEXT
-
vkCmdEndTransformFeedbackEXT
public static void vkCmdEndTransformFeedbackEXT(VkCommandBuffer commandBuffer, int firstCounterBuffer, @Nullable long[] pCounterBuffers, @Nullable long[] pCounterBufferOffsets)
Array version of:CmdEndTransformFeedbackEXT
-
-