Class EXTTransformFeedback
- java.lang.Object
-
- org.lwjgl.vulkan.EXTTransformFeedback
-
public class EXTTransformFeedback extends java.lang.ObjectThis extension adds transform feedback to the Vulkan API by exposing the SPIR-VTransformFeedbackandGeometryStreamscapabilities 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 intVK_ACCESS_TRANSFORM_FEEDBACK_COUNTER_READ_BIT_EXT
VK_ACCESS_TRANSFORM_FEEDBACK_COUNTER_WRITE_BIT_EXT
VK_ACCESS_TRANSFORM_FEEDBACK_WRITE_BIT_EXTExtendsVkAccessFlagBits.static intVK_BUFFER_USAGE_TRANSFORM_FEEDBACK_BUFFER_BIT_EXT
VK_BUFFER_USAGE_TRANSFORM_FEEDBACK_COUNTER_BUFFER_BIT_EXTExtendsVkBufferUsageFlagBits.static java.lang.StringVK_EXT_TRANSFORM_FEEDBACK_EXTENSION_NAMEThe extension name.static intVK_EXT_TRANSFORM_FEEDBACK_SPEC_VERSIONThe extension specification version.static intVK_PIPELINE_STAGE_TRANSFORM_FEEDBACK_BIT_EXTExtendsVkPipelineStageFlagBits.static intVK_QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXTExtendsVkQueryType.static intVK_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 voidnvkCmdBeginTransformFeedbackEXT(VkCommandBuffer commandBuffer, int firstCounterBuffer, int counterBufferCount, long pCounterBuffers, long pCounterBufferOffsets)Unsafe version of:CmdBeginTransformFeedbackEXTstatic voidnvkCmdBindTransformFeedbackBuffersEXT(VkCommandBuffer commandBuffer, int firstBinding, int bindingCount, long pBuffers, long pOffsets, long pSizes)Unsafe version of:CmdBindTransformFeedbackBuffersEXTstatic voidnvkCmdEndTransformFeedbackEXT(VkCommandBuffer commandBuffer, int firstCounterBuffer, int counterBufferCount, long pCounterBuffers, long pCounterBufferOffsets)Unsafe version of:CmdEndTransformFeedbackEXTstatic voidvkCmdBeginQueryIndexedEXT(VkCommandBuffer commandBuffer, long queryPool, int query, int flags, int index)Begin an indexed query.static voidvkCmdBeginTransformFeedbackEXT(VkCommandBuffer commandBuffer, int firstCounterBuffer, long[] pCounterBuffers, long[] pCounterBufferOffsets)Array version of:CmdBeginTransformFeedbackEXTstatic voidvkCmdBeginTransformFeedbackEXT(VkCommandBuffer commandBuffer, int firstCounterBuffer, java.nio.LongBuffer pCounterBuffers, java.nio.LongBuffer pCounterBufferOffsets)Make transform feedback active in the command buffer.static voidvkCmdBindTransformFeedbackBuffersEXT(VkCommandBuffer commandBuffer, int firstBinding, long[] pBuffers, long[] pOffsets, long[] pSizes)Array version of:CmdBindTransformFeedbackBuffersEXTstatic voidvkCmdBindTransformFeedbackBuffersEXT(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 voidvkCmdDrawIndirectByteCountEXT(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 voidvkCmdEndQueryIndexedEXT(VkCommandBuffer commandBuffer, long queryPool, int query, int index)Ends a query.static voidvkCmdEndTransformFeedbackEXT(VkCommandBuffer commandBuffer, int firstCounterBuffer, long[] pCounterBuffers, long[] pCounterBufferOffsets)Array version of:CmdEndTransformFeedbackEXTstatic voidvkCmdEndTransformFeedbackEXT(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
iofpBuffers,pOffsetsandpSizesreplace the current state for the transform feedback bindingfirstBinding + i, foriin[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::transformFeedbackmust be enabledfirstBindingmust be less thanVkPhysicalDeviceTransformFeedbackPropertiesEXT::maxTransformFeedbackBuffers- The sum of
firstBindingandbindingCountmust be less than or equal toVkPhysicalDeviceTransformFeedbackPropertiesEXT::maxTransformFeedbackBuffers - All elements of
pOffsetsmust be less than the size of the corresponding element inpBuffers - All elements of
pOffsetsmust be a multiple of 4 - All elements of
pBuffersmust have been created with theBUFFER_USAGE_TRANSFORM_FEEDBACK_BUFFER_BIT_EXTflag - If the optional
pSizearray is specified, each element ofpSizesmust either beWHOLE_SIZE, or be less than or equal toVkPhysicalDeviceTransformFeedbackPropertiesEXT::maxTransformFeedbackBufferSize - All elements of
pSizesmust be less than or equal to the size of the corresponding buffer inpBuffers - All elements of
pOffsetspluspSizes, where thepSizes, element is notWHOLE_SIZE, must be less than or equal to the size of the corresponding element inpBuffers - Each element of
pBuffersthat is non-sparse must be bound completely and contiguously to a singleVkDeviceMemoryobject - Transform feedback must not be active when the
vkCmdBindTransformFeedbackBuffersEXTcommand is recorded
Valid Usage (Implicit)
commandBuffermust be a validVkCommandBufferhandlepBuffersmust be a valid pointer to an array ofbindingCountvalidVkBufferhandlespOffsetsmust be a valid pointer to an array ofbindingCountVkDeviceSizevalues- If
pSizesis notNULL,pSizesmust be a valid pointer to an array ofbindingCountVkDeviceSizevalues commandBuffermust be in the recording state- The
VkCommandPoolthatcommandBufferwas allocated from must support graphics operations - If
pSizesis notNULL,bindingCountmust be greater than 0 - Both of
commandBuffer, and the elements ofpBuffersmust have been created, allocated, or retrieved from the sameVkDevice
Host Synchronization
- Host access to
commandBuffermust be externally synchronized - Host access to the
VkCommandPoolthatcommandBufferwas 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. IfpSizesisNULL, or the value of thepSizesarray 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 thepCounterBuffersandpCounterBufferOffsetsarrays.
-
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
XfbBufferin the bound graphics pipeline. AnyXfbBufferemitted that does not output to an active transform feedback buffer will not be captured.Valid Usage
VkPhysicalDeviceTransformFeedbackFeaturesEXT::transformFeedbackmust be enabled- Transform feedback must not be active
firstCounterBuffermust be less thanVkPhysicalDeviceTransformFeedbackPropertiesEXT::maxTransformFeedbackBuffers- The sum of
firstCounterBufferandcounterBufferCountmust be less than or equal toVkPhysicalDeviceTransformFeedbackPropertiesEXT::maxTransformFeedbackBuffers - If
counterBufferCountis not 0, andpCounterBuffersis notNULL,pCounterBuffersmust be a valid pointer to an array ofcounterBufferCountVkBufferhandles that are either valid orNULL_HANDLE - For each buffer handle in the array, if it is not
NULL_HANDLEit must reference a buffer large enough to hold 4 bytes at the corresponding offset from thepCounterBufferOffsetsarray - If
pCounterBufferisNULL, thenpCounterBufferOffsetsmust also beNULL - For each buffer handle in the
pCounterBuffersarray that is notNULL_HANDLEit must have been created with ausagevalue 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)
commandBuffermust be a validVkCommandBufferhandle- If
counterBufferCountis not 0, andpCounterBufferOffsetsis notNULL,pCounterBufferOffsetsmust be a valid pointer to an array ofcounterBufferCountVkDeviceSizevalues commandBuffermust be in the recording state- The
VkCommandPoolthatcommandBufferwas allocated from must support graphics operations - This command must only be called inside of a render pass instance
- Both of
commandBuffer, and the elements ofpCounterBuffersthat are valid handles must have been created, allocated, or retrieved from the sameVkDevice
Host Synchronization
- Host access to
commandBuffermust be externally synchronized - Host access to the
VkCommandPoolthatcommandBufferwas 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 usingCmdEndTransformFeedbackEXTit can be used to resume transform feedback from the previous location. IfpCounterBuffersisNULL, then transform feedback will start capturing vertex data to byte offset zero in all bound transform feedback buffers. For each element ofpCounterBuffersthat 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 thepCounterBufferswhere 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. IfpCounterBufferOffsetsisNULL, 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 thepCounterBuffersandpCounterBufferOffsetsarrays.
-
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::transformFeedbackmust be enabled- Transform feedback must be active
firstCounterBuffermust be less thanVkPhysicalDeviceTransformFeedbackPropertiesEXT::maxTransformFeedbackBuffers- The sum of
firstCounterBufferandcounterBufferCountmust be less than or equal toVkPhysicalDeviceTransformFeedbackPropertiesEXT::maxTransformFeedbackBuffers - If
counterBufferCountis not 0, andpCounterBuffersis notNULL,pCounterBuffersmust be a valid pointer to an array ofcounterBufferCountVkBufferhandles that are either valid orNULL_HANDLE - For each buffer handle in the array, if it is not
NULL_HANDLEit must reference a buffer large enough to hold 4 bytes at the corresponding offset from thepCounterBufferOffsetsarray - If
pCounterBufferisNULL, thenpCounterBufferOffsetsmust also beNULL - For each buffer handle in the
pCounterBuffersarray that is notNULL_HANDLEit must have been created with ausagevalue containingBUFFER_USAGE_TRANSFORM_FEEDBACK_COUNTER_BUFFER_BIT_EXT
Valid Usage (Implicit)
commandBuffermust be a validVkCommandBufferhandle- If
counterBufferCountis not 0, andpCounterBufferOffsetsis notNULL,pCounterBufferOffsetsmust be a valid pointer to an array ofcounterBufferCountVkDeviceSizevalues commandBuffermust be in the recording state- The
VkCommandPoolthatcommandBufferwas allocated from must support graphics operations - This command must only be called inside of a render pass instance
- Both of
commandBuffer, and the elements ofpCounterBuffersthat are valid handles must have been created, allocated, or retrieved from the sameVkDevice
Host Synchronization
- Host access to
commandBuffermust be externally synchronized - Host access to the
VkCommandPoolthatcommandBufferwas 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 subsequentCmdBeginTransformFeedbackEXTcall to resume transform feedback capture from this position. It can also be used byCmdDrawIndirectByteCountEXTto determine the vertex count of the draw call.pCounterBufferOffsets- an optional array of offsets within each of thepCounterBufferswhere 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. IfpCounterBufferOffsetsisNULL, 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
vkCmdBeginQueryIndexedEXTcommand operates the same as theCmdBeginQuerycommand, except that it also accepts a query type specificindexparameter.Valid Usage
queryPoolmust have been created with aqueryTypethat 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
queryTypeused to createqueryPoolwas notQUERY_TYPE_OCCLUSION,flagsmust not containQUERY_CONTROL_PRECISE_BIT querymust be less than the number of queries inqueryPool- If the
queryTypeused to createqueryPoolwasQUERY_TYPE_OCCLUSION, theVkCommandPoolthatcommandBufferwas allocated from must support graphics operations - If the
queryTypeused to createqueryPoolwasQUERY_TYPE_PIPELINE_STATISTICSand any of thepipelineStatisticsindicate graphics operations, theVkCommandPoolthatcommandBufferwas allocated from must support graphics operations - If the
queryTypeused to createqueryPoolwasQUERY_TYPE_PIPELINE_STATISTICSand any of thepipelineStatisticsindicate compute operations, theVkCommandPoolthatcommandBufferwas allocated from must support compute operations commandBuffermust not be a protected command buffer- If called within a render pass instance, the sum of
queryand 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
queryTypeused to createqueryPoolwasQUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXTtheVkCommandPoolthatcommandBufferwas allocated from must support graphics operations - If the
queryTypeused to createqueryPoolwasQUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXTtheindexparameter must be less thanVkPhysicalDeviceTransformFeedbackPropertiesEXT::maxTransformFeedbackStreams - If the
queryTypeused to createqueryPoolwas notQUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXTtheindexmust be zero - If the
queryTypeused to createqueryPoolwasQUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXTthenVkPhysicalDeviceTransformFeedbackPropertiesEXT::transformFeedbackQueriesmust be supported
Valid Usage (Implicit)
commandBuffermust be a validVkCommandBufferhandlequeryPoolmust be a validVkQueryPoolhandleflagsmust be a valid combination ofVkQueryControlFlagBitsvaluescommandBuffermust be in the recording state- The
VkCommandPoolthatcommandBufferwas allocated from must support graphics, or compute operations - Both of
commandBuffer, andqueryPoolmust have been created, allocated, or retrieved from the sameVkDevice
Host Synchronization
- Host access to
commandBuffermust be externally synchronized - Host access to the
VkCommandPoolthatcommandBufferwas 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 ofVkQueryControlFlagBitsspecifying 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_EXTthe 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
vkCmdEndQueryIndexedEXTcommand operates the same as theCmdEndQuerycommand, except that it also accepts a query type specificindexparameter.Valid Usage
- All queries used by the command must be active
querymust be less than the number of queries inqueryPoolcommandBuffermust not be a protected command buffer- If
vkCmdEndQueryIndexedEXTis called within a render pass instance, the sum ofqueryand 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
queryTypeused to createqueryPoolwasQUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXTtheindexparameter must be less thanVkPhysicalDeviceTransformFeedbackPropertiesEXT::maxTransformFeedbackStreams - If the
queryTypeused to createqueryPoolwas notQUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXTtheindexmust be zero - If the
queryTypeused to createqueryPoolwasQUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXTindexmust equal theindexused to begin the query
Valid Usage (Implicit)
commandBuffermust be a validVkCommandBufferhandlequeryPoolmust be a validVkQueryPoolhandlecommandBuffermust be in the recording state- The
VkCommandPoolthatcommandBufferwas allocated from must support graphics, or compute operations - Both of
commandBuffer, andqueryPoolmust have been created, allocated, or retrieved from the sameVkDevice
Host Synchronization
- Host access to
commandBuffermust be externally synchronized - Host access to the
VkCommandPoolthatcommandBufferwas 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
CmdDrawexcept thevertexCountis calculated based on the byte count read fromcounterBufferat offsetcounterBufferOffset. The assembled primitives execute the bound graphics pipeline.The effective
vertexCountis calculated as follows:const uint32_t * counterBufferPtr = (const uint8_t *)counterBuffer.address + counterBufferOffset; vertexCount = floor(max(0, (*counterBufferPtr - counterOffset)) / vertexStride);The effective
firstVertexis zero.Valid Usage
- If a
VkImageViewis sampled withFILTER_LINEARas a result of this command, then the image view’s format features must containFORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT - If a
VkImageViewis 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
VkImageViewis sampled withFILTER_CUBIC_EXTas a result of this command, then the image view’s format features must containFORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT - Any
VkImageViewbeing sampled withFILTER_CUBIC_EXTas a result of this command must have aVkImageViewTypeand format that supports cubic filtering, as specified byVkFilterCubicImageViewImageFormatPropertiesEXT::filterCubicreturned byvkGetPhysicalDeviceImageFormatProperties2 - Any
VkImageViewbeing sampled withFILTER_CUBIC_EXTwith a reduction mode of eitherSAMPLER_REDUCTION_MODE_MIN_EXTorSAMPLER_REDUCTION_MODE_MAX_EXTas a result of this command must have aVkImageViewTypeand format that supports cubic filtering together with minmax filtering, as specified byVkFilterCubicImageViewImageFormatPropertiesEXT::filterCubicMinmaxreturned byvkGetPhysicalDeviceImageFormatProperties2 - Any
VkImagecreated with aVkImageCreateInfo::flagscontainingIMAGE_CREATE_CORNER_SAMPLED_BIT_NVsampled as a result of this command must only be sampled using aVkSamplerAddressModeofSAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE. - For each set n that is statically used by the
VkPipelinebound 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 aVkPipelineLayoutthat is compatible for set n, with theVkPipelineLayoutused to create the currentVkPipeline, as described in Pipeline Layout Compatibility - For each push constant that is statically used by the
VkPipelinebound to the pipeline bind point used by this command, a push constant value must have been set for the same pipeline bind point, with aVkPipelineLayoutthat is compatible for push constants, with theVkPipelineLayoutused 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 theVkPipelinebound 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
VkPipelineobject bound to the pipeline bind point used by this command requires any dynamic state, that state must have been set forcommandBuffer - If the
VkPipelineobject bound to the pipeline bind point used by this command accesses aVkSamplerobject that uses unnormalized coordinates, that sampler must not be used to sample from anyVkImagewith aVkImageViewof the typeIMAGE_VIEW_TYPE_3D,IMAGE_VIEW_TYPE_CUBE,IMAGE_VIEW_TYPE_1D_ARRAY,IMAGE_VIEW_TYPE_2D_ARRAYorIMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage - If the
VkPipelineobject bound to the pipeline bind point used by this command accesses aVkSamplerobject that uses unnormalized coordinates, that sampler must not be used with any of the SPIR-VOpImageSample*orOpImageSparseSample*instructions withImplicitLod,DreforProjin their name, in any shader stage - If the
VkPipelineobject bound to the pipeline bind point used by this command accesses aVkSamplerobject 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
VkPipelineobject 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
VkPipelineobject 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
commandBufferis an unprotected command buffer, any resource accessed by theVkPipelineobject 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
renderPassmember of theVkGraphicsPipelineCreateInfostructure specified when creating theVkPipelinebound toPIPELINE_BIND_POINT_GRAPHICS. - The subpass index of the current render pass must be equal to the
subpassmember of theVkGraphicsPipelineCreateInfostructure specified when creating theVkPipelinebound 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::sampleLocationsEnableset toTRUEand the current subpass has a depth/stencil attachment, then that attachment must have been created with theIMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXTbit 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::transformFeedbackmust be enabled- The implementation must support
VkPhysicalDeviceTransformFeedbackPropertiesEXT::transformFeedbackDraw vertexStridemust be greater than 0 and less than or equal toVkPhysicalDeviceLimits::maxTransformFeedbackBufferDataStridecounterBuffermust have been created with theBUFFER_USAGE_INDIRECT_BUFFER_BITbit setcommandBuffermust not be a protected command buffer
Valid Usage (Implicit)
commandBuffermust be a validVkCommandBufferhandlecounterBuffermust be a validVkBufferhandlecommandBuffermust be in the recording state- The
VkCommandPoolthatcommandBufferwas allocated from must support graphics operations - This command must only be called inside of a render pass instance
- Both of
commandBuffer, andcounterBuffermust have been created, allocated, or retrieved from the sameVkDevice
Host Synchronization
- Host access to
commandBuffermust be externally synchronized - Host access to the
VkCommandPoolthatcommandBufferwas 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 thecounterBufferat thecounterBufferOffsetvertexStride- 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
-
-