Class EXTTransformFeedback


  • public class EXTTransformFeedback
    extends java.lang.Object
    This extension adds transform feedback to the Vulkan API by exposing the SPIR-V TransformFeedback and GeometryStreams 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.

    VK_EXT_transform_feedback
    Name String
    VK_EXT_transform_feedback
    Extension Type
    Device extension
    Registered Extension Number
    29
    Revision
    1
    Extension and Version Dependencies
    Special Uses
    Contact
    Other Extension Metadata
    Last Modified Date
    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
    • Method Detail

      • nvkCmdBindTransformFeedbackBuffersEXT

        public static void nvkCmdBindTransformFeedbackBuffersEXT​(org.lwjgl.vulkan.VkCommandBuffer commandBuffer,
                                                                 int firstBinding,
                                                                 int bindingCount,
                                                                 long pBuffers,
                                                                 long pOffsets,
                                                                 long pSizes)
        Parameters:
        bindingCount - the number of transform feedback bindings whose state is updated by the command.
      • vkCmdBindTransformFeedbackBuffersEXT

        public static void vkCmdBindTransformFeedbackBuffersEXT​(org.lwjgl.vulkan.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 drawing 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 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 BUFFER_USAGE_TRANSFORM_FEEDBACK_BUFFER_BIT_EXT flag
        • If the optional pSize array is specified, each element of pSizes must either be WHOLE_SIZE, or be less than or equal to VkPhysicalDeviceTransformFeedbackPropertiesEXT::maxTransformFeedbackBufferSize
        • All elements of pSizes must be either WHOLE_SIZE, or 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 WHOLE_SIZE, must be less than or equal to the size of the corresponding buffer 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
        • commandBuffer must be in the recording state
        • The VkCommandPool that commandBuffer was allocated from must support graphics operations
        • 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 LevelsRender Pass ScopeSupported Queue Types
        Primary SecondaryBothGraphics
        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 - NULL or a pointer to an array of VkDeviceSize 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 WHOLE_SIZE, then the maximum number of bytes captured will be the size of the corresponding buffer minus the buffer offset.
      • nvkCmdBeginTransformFeedbackEXT

        public static void nvkCmdBeginTransformFeedbackEXT​(org.lwjgl.vulkan.VkCommandBuffer commandBuffer,
                                                           int firstCounterBuffer,
                                                           int counterBufferCount,
                                                           long pCounterBuffers,
                                                           long pCounterBufferOffsets)
        Unsafe version of: CmdBeginTransformFeedbackEXT
        Parameters:
        counterBufferCount - the size of the pCounterBuffers and pCounterBufferOffsets arrays.
      • vkCmdBeginTransformFeedbackEXT

        public static void vkCmdBeginTransformFeedbackEXT​(org.lwjgl.vulkan.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. Any XfbBuffer emitted that does not output to an active transform feedback buffer will not be captured.

        Valid Usage
        Valid Usage (Implicit)
        • commandBuffer must be a valid VkCommandBuffer handle
        • If counterBufferCount is not 0, and pCounterBufferOffsets is not NULL, pCounterBufferOffsets must be a valid pointer to an array of counterBufferCount VkDeviceSize values
        • commandBuffer must be in the recording state
        • The VkCommandPool that commandBuffer 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 of pCounterBuffers that are valid handles of non-ignored parameters 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 LevelsRender Pass ScopeSupported Queue Types
        Primary SecondaryInsideGraphics
        Parameters:
        commandBuffer - the command buffer into which the command is recorded.
        firstCounterBuffer - the index of the first transform feedback buffer corresponding to pCounterBuffers[0] and pCounterBufferOffsets[0].
        pCounterBuffers - NULL or a pointer to an array of VkBuffer handles to counter buffers. Each buffer contains 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 using CmdEndTransformFeedbackEXT it can be used to resume transform feedback from the previous location. If pCounterBuffers is NULL, then transform feedback will start capturing vertex data to byte offset zero in all bound transform feedback buffers. For each element of pCounterBuffers that is NULL_HANDLE, transform feedback will start capturing vertex data to byte zero in the corresponding bound transform feedback buffer.
        pCounterBufferOffsets - NULL or a pointer to an array of VkDeviceSize values specifying offsets within each of the pCounterBuffers 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. If pCounterBufferOffsets is NULL, then it is assumed the offsets are zero.
      • nvkCmdEndTransformFeedbackEXT

        public static void nvkCmdEndTransformFeedbackEXT​(org.lwjgl.vulkan.VkCommandBuffer commandBuffer,
                                                         int firstCounterBuffer,
                                                         int counterBufferCount,
                                                         long pCounterBuffers,
                                                         long pCounterBufferOffsets)
        Unsafe version of: CmdEndTransformFeedbackEXT
        Parameters:
        counterBufferCount - the size of the pCounterBuffers and pCounterBufferOffsets arrays.
      • vkCmdEndTransformFeedbackEXT

        public static void vkCmdEndTransformFeedbackEXT​(org.lwjgl.vulkan.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
        Valid Usage (Implicit)
        • commandBuffer must be a valid VkCommandBuffer handle
        • If counterBufferCount is not 0, and pCounterBufferOffsets is not NULL, pCounterBufferOffsets must be a valid pointer to an array of counterBufferCount VkDeviceSize values
        • commandBuffer must be in the recording state
        • The VkCommandPool that commandBuffer 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 of pCounterBuffers that are valid handles of non-ignored parameters 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 LevelsRender Pass ScopeSupported Queue Types
        Primary SecondaryInsideGraphics
        Parameters:
        commandBuffer - the command buffer into which the command is recorded.
        firstCounterBuffer - the index of the first transform feedback buffer corresponding to pCounterBuffers[0] and pCounterBufferOffsets[0].
        pCounterBuffers - NULL or a pointer to an array of VkBuffer handles to counter buffers. The counter buffers are 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 subsequent CmdBeginTransformFeedbackEXT call to resume transform feedback capture from this position. It can also be used by CmdDrawIndirectByteCountEXT to determine the vertex count of the draw call.
        pCounterBufferOffsets - NULL or a pointer to an array of VkDeviceSize values specifying offsets within each of the pCounterBuffers 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. If pCounterBufferOffsets is NULL, then it is assumed the offsets are zero.
      • vkCmdEndQueryIndexedEXT

        public static void vkCmdEndQueryIndexedEXT​(org.lwjgl.vulkan.VkCommandBuffer commandBuffer,
                                                   long queryPool,
                                                   int query,
                                                   int index)
        Ends a query.
        C Specification

        To end an indexed query after the set of desired drawing or dispatching commands is recorded, call:

        
         void vkCmdEndQueryIndexedEXT(
             VkCommandBuffer                             commandBuffer,
             VkQueryPool                                 queryPool,
             uint32_t                                    query,
             uint32_t                                    index);
        Description

        The vkCmdEndQueryIndexedEXT command operates the same as the CmdEndQuery command, except that it also accepts a query type specific index parameter.

        Valid Usage
        Valid Usage (Implicit)
        • commandBuffer must be a valid VkCommandBuffer handle
        • queryPool must be a valid VkQueryPool handle
        • commandBuffer must be in the recording state
        • The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations
        • Both of commandBuffer, and queryPool 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 LevelsRender Pass ScopeSupported Queue Types
        Primary SecondaryBothGraphics 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.
      • vkCmdBindTransformFeedbackBuffersEXT

        public static void vkCmdBindTransformFeedbackBuffersEXT​(org.lwjgl.vulkan.VkCommandBuffer commandBuffer,
                                                                int firstBinding,
                                                                long[] pBuffers,
                                                                long[] pOffsets,
                                                                @Nullable
                                                                long[] pSizes)
      • vkCmdBeginTransformFeedbackEXT

        public static void vkCmdBeginTransformFeedbackEXT​(org.lwjgl.vulkan.VkCommandBuffer commandBuffer,
                                                          int firstCounterBuffer,
                                                          @Nullable
                                                          long[] pCounterBuffers,
                                                          @Nullable
                                                          long[] pCounterBufferOffsets)
      • vkCmdEndTransformFeedbackEXT

        public static void vkCmdEndTransformFeedbackEXT​(org.lwjgl.vulkan.VkCommandBuffer commandBuffer,
                                                        int firstCounterBuffer,
                                                        @Nullable
                                                        long[] pCounterBuffers,
                                                        @Nullable
                                                        long[] pCounterBufferOffsets)
        Array version of: CmdEndTransformFeedbackEXT