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);

Parameters

  • commandBuffer is the command buffer into which the command is recorded.

  • firstBinding is the index of the first transform feedback binding whose state is updated by the command.

  • bindingCount is the number of transform feedback bindings whose state is updated by the command.

  • pBuffers is a pointer to an array of buffer handles.

  • pOffsets is a pointer to an array of buffer offsets.

  • pSizes is an optional array of buffer sizes, specifying the maximum number of bytes to capture to the corresponding transform feedback buffer. If pSizes is NULL, or the value of the pSizes array element is VK_WHOLE_SIZE, then the maximum bytes captured will be the size of the corresponding buffer minus the buffer offset.

Description

The values taken from elements i of pBuffers, pOffsets and pSizes replace the current state for the transform feedback binding firstBinding + i, for i in [0, bindingCount). The transform feedback binding is updated to start at the offset indicated by pOffsets[i] from the start of the buffer pBuffers[i].

Valid Usage
  • VkPhysicalDeviceTransformFeedbackFeaturesEXT::transformFeedback must be enabled

  • firstBinding must be less than VkPhysicalDeviceTransformFeedbackPropertiesEXT::maxTransformFeedbackBuffers

  • The sum of firstBinding and bindingCount must be less than or equal to VkPhysicalDeviceTransformFeedbackPropertiesEXT::maxTransformFeedbackBuffers

  • All elements of pOffsets must be less than the size of the corresponding element in pBuffers

  • All elements of pOffsets must be a multiple of 4

  • All elements of pBuffers must have been created with the VK_BUFFER_USAGE_TRANSFORM_FEEDBACK_BUFFER_BIT_EXT flag

  • If the optional pSize array is specified, each element of pSizes must either be VK_WHOLE_SIZE, or be less than or equal to VkPhysicalDeviceTransformFeedbackPropertiesEXT::maxTransformFeedbackBufferSize

  • All elements of pSizes must be less than or equal to the size of the corresponding buffer in pBuffers

  • All elements of pOffsets plus pSizes, where the pSizes, element is not VK_WHOLE_SIZE, must be less than or equal to the size of the corresponding element in pBuffers

  • Each element of pBuffers that is non-sparse must be bound completely and contiguously to a single VkDeviceMemory object

  • Transform feedback must not be active when the vkCmdBindTransformFeedbackBuffersEXT command is recorded

Valid Usage (Implicit)
  • commandBuffer must be a valid VkCommandBuffer handle

  • pBuffers must be a valid pointer to an array of bindingCount valid VkBuffer handles

  • pOffsets must be a valid pointer to an array of bindingCount VkDeviceSize values

  • If pSizes is not NULL, pSizes must be a valid pointer to an array of bindingCount VkDeviceSize values

  • commandBuffer must be in the recording state

  • The VkCommandPool that commandBuffer was allocated from must support graphics operations

  • If pSizes is not NULL, bindingCount must be greater than 0

  • Both of commandBuffer, and the elements of pBuffers must have been created, allocated, or retrieved from the same VkDevice

Host Synchronization
  • Host access to commandBuffer must be externally synchronized

  • Host access to the VkCommandPool that commandBuffer was allocated from must be externally synchronized

Command Properties
Command Buffer Levels Render Pass Scope Supported Queue Types Pipeline Type

Primary
Secondary

Both

Graphics

See Also

VkBuffer, VkCommandBuffer, VkDeviceSize

Document Notes

For more information, see the Vulkan Specification

This page is extracted from the Vulkan Specification. Fixes and changes should be made to the Specification, not directly.

Copyright (c) 2014-2019 Khronos Group. This work is licensed under a Creative Commons Attribution 4.0 International License.