1// Copyright 2018-2021 The Khronos Group Inc. 2// 3// SPDX-License-Identifier: CC-BY-4.0 4 5include::{generated}/meta/{refprefix}VK_EXT_transform_feedback.txt[] 6 7=== Other Extension Metadata 8 9*Last Modified Date*:: 10 2018-10-09 11*Contributors*:: 12 - Baldur Karlsson, Valve 13 - Boris Zanin, Mobica 14 - Daniel Rakos, AMD 15 - Donald Scorgie, Imagination 16 - Henri Verbeet, CodeWeavers 17 - Jan-Harald Fredriksen, Arm 18 - Jason Ekstrand, Intel 19 - Jeff Bolz, NVIDIA 20 - Jesse Barker, Unity 21 - Jesse Hall, Google 22 - Pierre-Loup Griffais, Valve 23 - Philip Rebohle, DXVK 24 - Ruihao Zhang, Qualcomm 25 - Samuel Pitoiset, Valve 26 - Slawomir Grajewski, Intel 27 - Stu Smith, Imagination Technologies 28 29=== Description 30 31This extension adds transform feedback to the Vulkan API by exposing the 32SPIR-V code:TransformFeedback and code:GeometryStreams capabilities to 33capture vertex, tessellation or geometry shader outputs to one or more 34buffers. 35It adds API functionality to bind transform feedback buffers to capture the 36primitives emitted by the graphics pipeline from SPIR-V outputs decorated 37for transform feedback. 38The transform feedback capture can be paused and resumed by way of storing 39and retrieving a byte counter. 40The captured data can be drawn again where the vertex count is derived from 41the byte counter without CPU intervention. 42If the implementation is capable, a vertex stream other than zero can be 43rasterized. 44 45All these features are designed to match the full capabilities of OpenGL 46core transform feedback functionality and beyond. 47Many of the features are optional to allow base OpenGL ES GPUs to also 48implement this extension. 49 50The primary purpose of the functionality exposed by this extension is to 51support translation layers from other 3D APIs. 52This functionality is not considered forward looking, and is not expected to 53be promoted to a KHR extension or to core Vulkan. 54Unless this is needed for translation, it is recommended that developers use 55alternative techniques of using the GPU to process and capture vertex data. 56 57include::{generated}/interfaces/VK_EXT_transform_feedback.txt[] 58 59=== Issues 60 611) Should we include pause/resume functionality? 62 63*RESOLVED*: Yes, this is needed to ease layering other APIs which have this 64functionality. 65To pause use fname:vkCmdEndTransformFeedbackEXT and provide valid buffer 66handles in the pname:pCounterBuffers array and offsets in the 67pname:pCounterBufferOffsets array for the implementation to save the resume 68points. 69Then to resume use fname:vkCmdBeginTransformFeedbackEXT with the previous 70pname:pCounterBuffers and pname:pCounterBufferOffsets values. 71Between the pause and resume there needs to be a memory barrier for the 72counter buffers with a source access of 73ename:VK_ACCESS_TRANSFORM_FEEDBACK_COUNTER_WRITE_BIT_EXT at pipeline stage 74ename:VK_PIPELINE_STAGE_TRANSFORM_FEEDBACK_BIT_EXT to a destination access 75of ename:VK_ACCESS_TRANSFORM_FEEDBACK_COUNTER_READ_BIT_EXT at pipeline stage 76ename:VK_PIPELINE_STAGE_TRANSFORM_FEEDBACK_BIT_EXT. 77 782) How does this interact with multiview? 79 80*RESOLVED*: Transform feedback cannot be made active in a render pass with 81multiview enabled. 82 833) How should queries be done? 84 85*RESOLVED*: There is a new query type 86ename:VK_QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT. 87A query pool created with this type will capture 2 integers - 88numPrimitivesWritten and numPrimitivesNeeded - for the specified vertex 89stream output from the last 90<<pipeline-graphics-subsets-pre-rasterization,pre-rasterization shader 91stage>>. 92The vertex stream output queried is zero by default, but can be specified 93with the new fname:vkCmdBeginQueryIndexedEXT and 94fname:vkCmdEndQueryIndexedEXT commands. 95 96=== Version History 97 98 * Revision 1, 2018-10-09 (Piers Daniell) 99 - Internal revisions 100