15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci ARB_transform_feedback2 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ciName Strings 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ci GL_ARB_transform_feedback2 85bd8deadSopenharmony_ci 95bd8deadSopenharmony_ciContributors 105bd8deadSopenharmony_ci 115bd8deadSopenharmony_ci Eric Zolnowski 125bd8deadSopenharmony_ci 135bd8deadSopenharmony_ciContact 145bd8deadSopenharmony_ci 155bd8deadSopenharmony_ci Pat Brown, NVIDIA Corporation (pbrown 'at' nvidia.com) 165bd8deadSopenharmony_ci Eric Zolnowski, AMD (eric.zolnowski 'at' amd.com) 175bd8deadSopenharmony_ci 185bd8deadSopenharmony_ciNotice 195bd8deadSopenharmony_ci 205bd8deadSopenharmony_ci Copyright (c) 2010-2013 The Khronos Group Inc. Copyright terms at 215bd8deadSopenharmony_ci http://www.khronos.org/registry/speccopyright.html 225bd8deadSopenharmony_ci 235bd8deadSopenharmony_ciSpecification Update Policy 245bd8deadSopenharmony_ci 255bd8deadSopenharmony_ci Khronos-approved extension specifications are updated in response to 265bd8deadSopenharmony_ci issues and bugs prioritized by the Khronos OpenGL Working Group. For 275bd8deadSopenharmony_ci extensions which have been promoted to a core Specification, fixes will 285bd8deadSopenharmony_ci first appear in the latest version of that core Specification, and will 295bd8deadSopenharmony_ci eventually be backported to the extension document. This policy is 305bd8deadSopenharmony_ci described in more detail at 315bd8deadSopenharmony_ci https://www.khronos.org/registry/OpenGL/docs/update_policy.php 325bd8deadSopenharmony_ci 335bd8deadSopenharmony_ciStatus 345bd8deadSopenharmony_ci 355bd8deadSopenharmony_ci Complete. Approved by the ARB at the 2010/01/22 F2F meeting. 365bd8deadSopenharmony_ci Approved by the Khronos Board of Promoters on March 10, 2010. 375bd8deadSopenharmony_ci 385bd8deadSopenharmony_ciVersion 395bd8deadSopenharmony_ci 405bd8deadSopenharmony_ci Last Modified Date: 2012/06/28 415bd8deadSopenharmony_ci Author Revision: 7 425bd8deadSopenharmony_ci 435bd8deadSopenharmony_ciNumber 445bd8deadSopenharmony_ci 455bd8deadSopenharmony_ci ARB Extension #93 465bd8deadSopenharmony_ci 475bd8deadSopenharmony_ciDependencies 485bd8deadSopenharmony_ci 495bd8deadSopenharmony_ci The OpenGL Shading Language (GLSL) is required. OpenGL 2.0 or the 505bd8deadSopenharmony_ci ARB_shader_objects extension is required. 515bd8deadSopenharmony_ci 525bd8deadSopenharmony_ci NV_transform_feedback or EXT_transform_feedback is required. 535bd8deadSopenharmony_ci 545bd8deadSopenharmony_ci EXT_geometry_shader4 trivially interacts with this extension. 555bd8deadSopenharmony_ci 565bd8deadSopenharmony_ci This extension is written against the OpenGL 2.1 Specification. 575bd8deadSopenharmony_ci 585bd8deadSopenharmony_ci This extension is written against the EXT_transform_feedback extension 595bd8deadSopenharmony_ci specification. 605bd8deadSopenharmony_ci 615bd8deadSopenharmony_ciOverview 625bd8deadSopenharmony_ci 635bd8deadSopenharmony_ci The EXT_transform_feedback extension allows applications to capture 645bd8deadSopenharmony_ci primitives to one or more buffer objects when transformed by the GL. 655bd8deadSopenharmony_ci This extension provides a few additional capabilities to these extensions, 665bd8deadSopenharmony_ci making transform feedback mode more useful. 675bd8deadSopenharmony_ci 685bd8deadSopenharmony_ci First, it provides transform feedback objects which encapsulate transform 695bd8deadSopenharmony_ci feedback-related state, allowing applications to replace the entire 705bd8deadSopenharmony_ci transform feedback configuration in a single bind call. Second, it 715bd8deadSopenharmony_ci provides the ability to pause and resume transform feedback operations. 725bd8deadSopenharmony_ci When transform feedback is paused, applications may render without 735bd8deadSopenharmony_ci transform feedback or may use transform feedback with different state and 745bd8deadSopenharmony_ci a different transform feedback object. When transform feedback is 755bd8deadSopenharmony_ci resumed, additional primitives are captured and appended to previously 765bd8deadSopenharmony_ci captured primitives for the object. 775bd8deadSopenharmony_ci 785bd8deadSopenharmony_ci Additionally, this extension provides the ability to draw primitives 795bd8deadSopenharmony_ci captured in transform feedback mode without querying the captured 805bd8deadSopenharmony_ci primitive count. The command DrawTransformFeedback() is equivalent to 815bd8deadSopenharmony_ci glDrawArrays(<mode>, 0, <count>), where <count> is the number of vertices 825bd8deadSopenharmony_ci captured to buffer objects during the last transform feedback capture 835bd8deadSopenharmony_ci operation on the transform feedback object used. This draw operation only 845bd8deadSopenharmony_ci provides a vertex count -- it does not automatically set up vertex array 855bd8deadSopenharmony_ci state or vertex buffer object bindings, which must be done separately by 865bd8deadSopenharmony_ci the application. 875bd8deadSopenharmony_ci 885bd8deadSopenharmony_ciIP Status 895bd8deadSopenharmony_ci 905bd8deadSopenharmony_ci No known IP claims. 915bd8deadSopenharmony_ci 925bd8deadSopenharmony_ciNew Procedures and Functions 935bd8deadSopenharmony_ci 945bd8deadSopenharmony_ci void BindTransformFeedback(enum target, uint id); 955bd8deadSopenharmony_ci void DeleteTransformFeedbacks(sizei n, const uint *ids); 965bd8deadSopenharmony_ci void GenTransformFeedbacks(sizei n, uint *ids); 975bd8deadSopenharmony_ci boolean IsTransformFeedback(uint id); 985bd8deadSopenharmony_ci 995bd8deadSopenharmony_ci void PauseTransformFeedback(void); 1005bd8deadSopenharmony_ci void ResumeTransformFeedback(void); 1015bd8deadSopenharmony_ci 1025bd8deadSopenharmony_ci void DrawTransformFeedback(enum mode, uint id); 1035bd8deadSopenharmony_ci 1045bd8deadSopenharmony_ciNew Tokens 1055bd8deadSopenharmony_ci 1065bd8deadSopenharmony_ci Accepted by the <target> parameter of BindTransformFeedback: 1075bd8deadSopenharmony_ci 1085bd8deadSopenharmony_ci TRANSFORM_FEEDBACK 0x8E22 1095bd8deadSopenharmony_ci 1105bd8deadSopenharmony_ci Accepted by the <pname> parameter of GetBooleanv, GetDoublev, GetIntegerv, 1115bd8deadSopenharmony_ci and GetFloatv: 1125bd8deadSopenharmony_ci 1135bd8deadSopenharmony_ci TRANSFORM_FEEDBACK_BUFFER_PAUSED 0x8E23 1145bd8deadSopenharmony_ci TRANSFORM_FEEDBACK_BUFFER_ACTIVE 0x8E24 1155bd8deadSopenharmony_ci TRANSFORM_FEEDBACK_BINDING 0x8E25 1165bd8deadSopenharmony_ci 1175bd8deadSopenharmony_ciAdditions to Chapter 2 of the OpenGL 2.1 Specification (OpenGL Operation) 1185bd8deadSopenharmony_ci 1195bd8deadSopenharmony_ci (Replace the "Section 2.Y" introduced by the EXT_transform_feedback 1205bd8deadSopenharmony_ci specification.) 1215bd8deadSopenharmony_ci 1225bd8deadSopenharmony_ci In transform feedback mode, attributes of the vertices of transformed 1235bd8deadSopenharmony_ci primitives are written out to one or more buffer objects. The vertices are 1245bd8deadSopenharmony_ci fed back after vertex color clamping but before clipping. If a geometry 1255bd8deadSopenharmony_ci shader is active, the vertices recorded are those emitted from the geometry 1265bd8deadSopenharmony_ci shader. The transformed vertices may be optionally discarded after being 1275bd8deadSopenharmony_ci stored into one or more buffer objects, or they can be passed on down to 1285bd8deadSopenharmony_ci the clipping stage for further processing. 1295bd8deadSopenharmony_ci 1305bd8deadSopenharmony_ci 1315bd8deadSopenharmony_ci Section 2.Y.1, Transform Feedback Objects 1325bd8deadSopenharmony_ci 1335bd8deadSopenharmony_ci The set of buffer objects used to capture vertex attributes and related 1345bd8deadSopenharmony_ci state are stored in a transform feedback object. If a vertex or geometry 1355bd8deadSopenharmony_ci shader is active, the set of attributes captured in transform feedback 1365bd8deadSopenharmony_ci mode is determined using the state of the active program object; 1375bd8deadSopenharmony_ci otherwise, it is taken from the state of the currently bound transform 1385bd8deadSopenharmony_ci feedback object, as described below. The name space for transform 1395bd8deadSopenharmony_ci feedback objects is the unsigned integers. The name zero designates the 1405bd8deadSopenharmony_ci default transform feedback object. 1415bd8deadSopenharmony_ci 1425bd8deadSopenharmony_ci The command 1435bd8deadSopenharmony_ci 1445bd8deadSopenharmony_ci void GenTransformFeedbacks(sizei n, uint *ids) 1455bd8deadSopenharmony_ci 1465bd8deadSopenharmony_ci returns <n> previously unused transform feedback object names in <ids>. 1475bd8deadSopenharmony_ci These names are marked as used, for the purposes of 1485bd8deadSopenharmony_ci GenTransformFeedbacks only, but they acquire transform feedback state 1495bd8deadSopenharmony_ci only when they are first bound. 1505bd8deadSopenharmony_ci 1515bd8deadSopenharmony_ci Transform feedback objects are deleted by calling 1525bd8deadSopenharmony_ci 1535bd8deadSopenharmony_ci void DeleteTransformFeedbacks(sizei n, const uint *ids) 1545bd8deadSopenharmony_ci 1555bd8deadSopenharmony_ci <ids> contains <n> names of transform feedback objects to be deleted. 1565bd8deadSopenharmony_ci After a transform feedback object is deleted it has no contents, and its 1575bd8deadSopenharmony_ci name is again unused. Unused names in <ids> are silently ignored, as is 1585bd8deadSopenharmony_ci the value zero. The default transform feedback object cannot be 1595bd8deadSopenharmony_ci deleted. If an active transform feedback object is deleted its name 1605bd8deadSopenharmony_ci immediately becomes unused, but the underlying object is not deleted 1615bd8deadSopenharmony_ci until it is no longer active 1625bd8deadSopenharmony_ci [This should be cited with a reference to appendix D.3 of the 1635bd8deadSopenharmony_ci OpenGL 3.3 Specification, but this extension is instead written 1645bd8deadSopenharmony_ci against OpenGL 2.1] 1655bd8deadSopenharmony_ci 1665bd8deadSopenharmony_ci The error INVALID_OPERATION is generated by DeleteTransformFeedbacks 1675bd8deadSopenharmony_ci if the transform feedback operation for any object named by <ids> is 1685bd8deadSopenharmony_ci currently active. 1695bd8deadSopenharmony_ci 1705bd8deadSopenharmony_ci A transform feedback object is created by binding a name 1715bd8deadSopenharmony_ci returned by GenTransformFeedbacks with the command 1725bd8deadSopenharmony_ci 1735bd8deadSopenharmony_ci void BindTransformFeedback(enum target, uint id) 1745bd8deadSopenharmony_ci 1755bd8deadSopenharmony_ci <target> must be TRANSFORM_FEEDBACK and <id> is the transform 1765bd8deadSopenharmony_ci feedback object name. The resulting transform feedback object is a new 1775bd8deadSopenharmony_ci state vector, initialized to the default state values described in Table 1785bd8deadSopenharmony_ci 6.X. Additionally, the new object is bound to the GL state vector and 1795bd8deadSopenharmony_ci is used for subsequent transform feedback operations. 1805bd8deadSopenharmony_ci 1815bd8deadSopenharmony_ci BindTransformFeedback can also be used to bind an existing transform 1825bd8deadSopenharmony_ci feedback object to the GL state for subsequent use. If the bind is 1835bd8deadSopenharmony_ci successful, no change is made to the state of the newly bound transform 1845bd8deadSopenharmony_ci feedback object and any previous binding to <target> is broken. 1855bd8deadSopenharmony_ci 1865bd8deadSopenharmony_ci While a transform feedback buffer object is bound, GL operations on the 1875bd8deadSopenharmony_ci target to which it is bound affect the bound transform feedback object, 1885bd8deadSopenharmony_ci and queries of the target to which a transform feedback object is bound 1895bd8deadSopenharmony_ci return state from the bound object. When buffer objects are bound for 1905bd8deadSopenharmony_ci transform feedback, they are attached to the currently bound transform 1915bd8deadSopenharmony_ci feedback object. Buffer objects are used for transform feedback only if 1925bd8deadSopenharmony_ci they are attached to the currently bound transform feedback object. 1935bd8deadSopenharmony_ci 1945bd8deadSopenharmony_ci In the initial state, a default transform feedback object is bound and 1955bd8deadSopenharmony_ci treated as a transform feedback object with a name of zero. That object 1965bd8deadSopenharmony_ci is bound any time BindTransformFeedback() is called with <id> of zero. 1975bd8deadSopenharmony_ci 1985bd8deadSopenharmony_ci The error INVALID_OPERATION is generated by BindTransformFeedback if the 1995bd8deadSopenharmony_ci transform feedback operation is active on the currently bound transform 2005bd8deadSopenharmony_ci feedback object, and that operation is not paused (as described below). 2015bd8deadSopenharmony_ci 2025bd8deadSopenharmony_ci BindTransformFeedback fails and an INVALID_OPERATION error is 2035bd8deadSopenharmony_ci generated if <id> is not zero or a name returned from a previous 2045bd8deadSopenharmony_ci call to GenTransformFeedbacks, or if such a name has since been 2055bd8deadSopenharmony_ci deleted with DeleteTransformFeedbacks. 2065bd8deadSopenharmony_ci 2075bd8deadSopenharmony_ci 2085bd8deadSopenharmony_ci Section 2.Y.2, Transform Feedback Primitive Capture 2095bd8deadSopenharmony_ci 2105bd8deadSopenharmony_ci Transform feedback for the currently bound transform feedback object is 2115bd8deadSopenharmony_ci started and finished by calling 2125bd8deadSopenharmony_ci 2135bd8deadSopenharmony_ci void BeginTransformFeedback(enum primitiveMode) 2145bd8deadSopenharmony_ci 2155bd8deadSopenharmony_ci and 2165bd8deadSopenharmony_ci 2175bd8deadSopenharmony_ci void EndTransformFeedback(void), 2185bd8deadSopenharmony_ci 2195bd8deadSopenharmony_ci respectively. Transform feedback is said to be active after a call to 2205bd8deadSopenharmony_ci BeginTransformFeedback and inactive after a call to EndTransformFeedback. 2215bd8deadSopenharmony_ci <primitiveMode> is one of TRIANGLES, LINES, or POINTS, and specifies the 2225bd8deadSopenharmony_ci output type of primitives that will be recorded into the buffer objects 2235bd8deadSopenharmony_ci bound for transform feedback (see below). 2245bd8deadSopenharmony_ci 2255bd8deadSopenharmony_ci Transform feedback commands must be paired; the error INVALID_OPERATION is 2265bd8deadSopenharmony_ci generated by BeginTransformFeedback if transform feedback is active, and 2275bd8deadSopenharmony_ci by EndTransformFeedback if transform feedback is inactive. Transform 2285bd8deadSopenharmony_ci feedback is initially inactive. 2295bd8deadSopenharmony_ci 2305bd8deadSopenharmony_ci Transform feedback operations for the currently bound transform feedback 2315bd8deadSopenharmony_ci object may be paused and resumed by calling 2325bd8deadSopenharmony_ci 2335bd8deadSopenharmony_ci void PauseTransformFeedback(void) 2345bd8deadSopenharmony_ci 2355bd8deadSopenharmony_ci and 2365bd8deadSopenharmony_ci 2375bd8deadSopenharmony_ci void ResumeTransformFeedback(void), 2385bd8deadSopenharmony_ci 2395bd8deadSopenharmony_ci respectively. When transform feedback operations are paused, transform 2405bd8deadSopenharmony_ci feedback is still considered active and changing most transform feedback 2415bd8deadSopenharmony_ci state related to the object results in an error. However, a new transform 2425bd8deadSopenharmony_ci feedback object may be bound while transform feedback is paused. The 2435bd8deadSopenharmony_ci error INVALID_OPERATION is generated by PauseTransformFeedback if the 2445bd8deadSopenharmony_ci currently bound transform feedback is not active or is paused. The error 2455bd8deadSopenharmony_ci INVALID_OPERATION is generated by ResumeTransformFeedback if the 2465bd8deadSopenharmony_ci currently bound transform feedback is not active or is not paused. 2475bd8deadSopenharmony_ci 2485bd8deadSopenharmony_ci When transform feedback is active and not paused, all geometric primitives 2495bd8deadSopenharmony_ci generated must be compatible with the value of <primitiveMode> passed to 2505bd8deadSopenharmony_ci BeginTransformFeedback. The error INVALID_OPERATION is generated by Begin 2515bd8deadSopenharmony_ci or any operation that implicitly calls Begin (such as DrawElements) if 2525bd8deadSopenharmony_ci <mode> is not one of the allowed modes in Table X.1. If a geometry shader 2535bd8deadSopenharmony_ci is active, its output primitive type is used instead of the <mode> 2545bd8deadSopenharmony_ci parameter passed to Begin for the purposes of this error check. Any 2555bd8deadSopenharmony_ci primitive type may be used while transform feedback is paused. 2565bd8deadSopenharmony_ci 2575bd8deadSopenharmony_ci Transform Feedback 2585bd8deadSopenharmony_ci primitiveMode allowed render primitive modes 2595bd8deadSopenharmony_ci ---------------------- --------------------------------- 2605bd8deadSopenharmony_ci POINTS POINTS 2615bd8deadSopenharmony_ci LINES LINES, LINE_LOOP, and LINE_STRIP 2625bd8deadSopenharmony_ci TRIANGLES TRIANGLES, TRIANGLE_STRIP, 2635bd8deadSopenharmony_ci TRIANGLE_FAN, QUADS, QUAD_STRIP, 2645bd8deadSopenharmony_ci and POLYGON 2655bd8deadSopenharmony_ci 2665bd8deadSopenharmony_ci Table X.1 Legal combinations between the transform feedback primitive 2675bd8deadSopenharmony_ci mode, as passed to BeginTransformFeedback and the current primitive 2685bd8deadSopenharmony_ci mode. 2695bd8deadSopenharmony_ci 2705bd8deadSopenharmony_ci Transform feedback mode captures the values of varying variables written by an 2715bd8deadSopenharmony_ci active vertex or geometry shader. The error INVALID_OPERATION is 2725bd8deadSopenharmony_ci generated by BeginTransformFeedback if no vertex or geometry shader is 2735bd8deadSopenharmony_ci active. 2745bd8deadSopenharmony_ci 2755bd8deadSopenharmony_ci Buffer objects are made to be targets of transform feedback by calling one 2765bd8deadSopenharmony_ci of the commands 2775bd8deadSopenharmony_ci 2785bd8deadSopenharmony_ci void BindBufferRange(enum target, uint index, uint buffer, 2795bd8deadSopenharmony_ci intptr offset, sizeiptr size), 2805bd8deadSopenharmony_ci void BindBufferBase(enum target, uint index, uint buffer), 2815bd8deadSopenharmony_ci 2825bd8deadSopenharmony_ci with <target> set to TRANSFORM_FEEDBACK_BUFFER. There is an array of 2835bd8deadSopenharmony_ci buffer object binding points that are used while transform feedback is 2845bd8deadSopenharmony_ci active, plus a single general binding point that can be used by other 2855bd8deadSopenharmony_ci buffer object manipulation functions (e.g., BindBuffer, MapBuffer). All 2865bd8deadSopenharmony_ci three commands bind the buffer object named by <buffer> to the general 2875bd8deadSopenharmony_ci binding point, and additionally bind the buffer object to the binding 2885bd8deadSopenharmony_ci point in the array given by <index>. An INVALID_VALUE error is 2895bd8deadSopenharmony_ci generated if <index> is greater than or equal to the value of 2905bd8deadSopenharmony_ci MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS. 2915bd8deadSopenharmony_ci 2925bd8deadSopenharmony_ci For BindBufferRange, <offset> specifies a starting offset into the 2935bd8deadSopenharmony_ci buffer object <buffer> and <size> specifies the amount of data that can 2945bd8deadSopenharmony_ci be written to the buffer object while transform feedback mode is active. 2955bd8deadSopenharmony_ci Both <offset> and <size> are in basic machine units. An INVALID_VALUE 2965bd8deadSopenharmony_ci error is generated if <size> is less than or equal to zero, or if either 2975bd8deadSopenharmony_ci <offset> or <size> are not word-aligned. 2985bd8deadSopenharmony_ci 2995bd8deadSopenharmony_ci BindBufferBase binds the entire buffer, even when the size of the buffer 3005bd8deadSopenharmony_ci is changed after the binding is established. It is equivalent to calling 3015bd8deadSopenharmony_ci BindBufferRange with <offset> zero, while <size> is determined by the 3025bd8deadSopenharmony_ci size of the bound buffer at the time the binding is used. 3035bd8deadSopenharmony_ci 3045bd8deadSopenharmony_ci Regardless of the size specified with BindBufferRange, or indirectly 3055bd8deadSopenharmony_ci with BindBufferBase, the GL will never read or write beyond the end of a 3065bd8deadSopenharmony_ci bound buffer. This may result in visibly different behavior when a 3075bd8deadSopenharmony_ci buffer overflow would otherwise result, as described below. 3085bd8deadSopenharmony_ci 3095bd8deadSopenharmony_ci The set of buffer objects used by a transform feedback object may not 3105bd8deadSopenharmony_ci change while transform feedback is active. The error INVALID_OPERATION 3115bd8deadSopenharmony_ci is generated by BindBufferRange, BindBufferOffsetEXT, or BindBufferBase 3125bd8deadSopenharmony_ci if <target> is TRANSFORM_FEEDBACK_BUFFER and transform feedback is 3135bd8deadSopenharmony_ci currently active. 3145bd8deadSopenharmony_ci 3155bd8deadSopenharmony_ci When an individual point, line, or triangle primitive reaches the 3165bd8deadSopenharmony_ci transform feedback stage while transform feedback is active and not 3175bd8deadSopenharmony_ci paused, the values of the specified varying variables of each vertex are 3185bd8deadSopenharmony_ci appended to the buffer objects bound to the transform feedback binding 3195bd8deadSopenharmony_ci points. The attributes of the first vertex received after 3205bd8deadSopenharmony_ci BeginTransformFeedback are written at the starting offsets of the bound 3215bd8deadSopenharmony_ci buffer objects set by BindBufferRange, and subsequent vertex attributes 3225bd8deadSopenharmony_ci are appended to the buffer object. When capturing line and triangle 3235bd8deadSopenharmony_ci primitives, all attributes of the first vertex are written first, followed 3245bd8deadSopenharmony_ci by attributes of the subsequent vertices. When writing varying variables 3255bd8deadSopenharmony_ci that are arrays, individual array elements are written in order. For 3265bd8deadSopenharmony_ci multi-component varying variables, elements of varying arrays, or 3275bd8deadSopenharmony_ci transformed vertex attributes, the individual components are written in 3285bd8deadSopenharmony_ci order. The value for any attribute specified to be streamed to a buffer 3295bd8deadSopenharmony_ci object but not actually written by a vertex or geometry shader is 3305bd8deadSopenharmony_ci undefined. 3315bd8deadSopenharmony_ci 3325bd8deadSopenharmony_ci When transform feedback is paused, no vertices are recorded. When 3335bd8deadSopenharmony_ci transform feedback is resumed, subsequent vertices are appended to the 3345bd8deadSopenharmony_ci buffer objects bound immediately following the last vertex written while 3355bd8deadSopenharmony_ci transform feedback was paused. 3365bd8deadSopenharmony_ci 3375bd8deadSopenharmony_ci When quads and polygons are provided to transform feedback with a 3385bd8deadSopenharmony_ci primitive mode of TRIANGLES, they will be tessellated and recorded as 3395bd8deadSopenharmony_ci triangles (the order of tessellation within a primitive is undefined). 3405bd8deadSopenharmony_ci Individual lines or triangles of a strip or fan primitive will be 3415bd8deadSopenharmony_ci extracted and recorded separately. Incomplete primitives are not 3425bd8deadSopenharmony_ci recorded. 3435bd8deadSopenharmony_ci 3445bd8deadSopenharmony_ci Transform feedback can operate in either INTERLEAVED_ATTRIBS or 3455bd8deadSopenharmony_ci SEPARATE_ATTRIBS mode. In INTERLEAVED_ATTRIBS mode, the values of one or 3465bd8deadSopenharmony_ci more varyings or transformed vertex attributes are written interleaved, 3475bd8deadSopenharmony_ci into the buffer object bound to the first transform feedback binding point 3485bd8deadSopenharmony_ci (index = 0). If more than one varying variable is written, they will be 3495bd8deadSopenharmony_ci recorded in the order specified by TransformFeedbackVaryings 3505bd8deadSopenharmony_ci (EXT_transform_feedback specification, section 2.15.3). In 3515bd8deadSopenharmony_ci SEPARATE_ATTRIBS mode, the first varying variable or transformed vertex 3525bd8deadSopenharmony_ci attribute specified is written to the first transform feedback binding 3535bd8deadSopenharmony_ci point; subsequent varying variables are written to the subsequent 3545bd8deadSopenharmony_ci transform feedback binding points. The total number of variables or 3555bd8deadSopenharmony_ci transformed attributes that may be captured in SEPARATE_ATTRIBS mode is 3565bd8deadSopenharmony_ci given by MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS. 3575bd8deadSopenharmony_ci 3585bd8deadSopenharmony_ci If recording the vertices of a primitive to the buffer objects being used 3595bd8deadSopenharmony_ci for transform feedback purposes would result in either exceeding the 3605bd8deadSopenharmony_ci limits of any buffer object's size, or in exceeding the end position 3615bd8deadSopenharmony_ci <offset> + <size> - 1, as set by BindBufferRange, then no vertices of 3625bd8deadSopenharmony_ci that primitive are recorded in any buffer object, and the counter 3635bd8deadSopenharmony_ci corresponding to the asynchronous query target 3645bd8deadSopenharmony_ci TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN (see Section 2.Z) is not 3655bd8deadSopenharmony_ci incremented. 3665bd8deadSopenharmony_ci 3675bd8deadSopenharmony_ci In either separate or interleaved modes, all transform feedback binding 3685bd8deadSopenharmony_ci points that will be written to must have buffer objects bound when 3695bd8deadSopenharmony_ci BeginTransformFeedback is called. The error INVALID_OPERATION is 3705bd8deadSopenharmony_ci generated by BeginTransformFeedback if any binding point used in 3715bd8deadSopenharmony_ci transform feedback mode does not have a buffer object bound. In 3725bd8deadSopenharmony_ci interleaved mode, only the first buffer object binding point is ever 3735bd8deadSopenharmony_ci written to. 3745bd8deadSopenharmony_ci 3755bd8deadSopenharmony_ci (add error paragraph describing conditions where it is illegal to change 3765bd8deadSopenharmony_ci transform feedback-related state) 3775bd8deadSopenharmony_ci 3785bd8deadSopenharmony_ci When BeginTransformFeedback is called with an active program object 3795bd8deadSopenharmony_ci containing a vertex or geometry shader, the set of varying variables 3805bd8deadSopenharmony_ci captured during transform feedback is taken from the active program object 3815bd8deadSopenharmony_ci and may not be changed while transform feedback is active. That program 3825bd8deadSopenharmony_ci object must be active until the EndTransformFeedback is called, except 3835bd8deadSopenharmony_ci while the transform feedback object is paused. The error 3845bd8deadSopenharmony_ci INVALID_OPERATION is generated: 3855bd8deadSopenharmony_ci 3865bd8deadSopenharmony_ci * by TransformFeedbackVaryings if the current transform feedback 3875bd8deadSopenharmony_ci object is active, even if paused; 3885bd8deadSopenharmony_ci 3895bd8deadSopenharmony_ci * by UseProgram if the current transform feedback object is active and 3905bd8deadSopenharmony_ci not paused; 3915bd8deadSopenharmony_ci 3925bd8deadSopenharmony_ci * by LinkProgram if <program> is the name of a program being used by one 3935bd8deadSopenharmony_ci or more transform feedback objects, even if the objects are not 3945bd8deadSopenharmony_ci currently bound or are paused; or 3955bd8deadSopenharmony_ci 3965bd8deadSopenharmony_ci * by ResumeTransformFeedback if the program object being used by the 3975bd8deadSopenharmony_ci current transform feedback object is not active. 3985bd8deadSopenharmony_ci 3995bd8deadSopenharmony_ci 4005bd8deadSopenharmony_ci Section 2.Y.3, Transform Feedback Draw Operations 4015bd8deadSopenharmony_ci 4025bd8deadSopenharmony_ci When transform feedback is active, the values of varyings or transformed 4035bd8deadSopenharmony_ci vertex attributes are captured into the buffer objects attached to the 4045bd8deadSopenharmony_ci current transform feedback object. After transform feedback is complete, 4055bd8deadSopenharmony_ci subsequent rendering operations may use the contents of these buffer 4065bd8deadSopenharmony_ci objects (section 2.9). The number of vertices captured during transform 4075bd8deadSopenharmony_ci feedback is stored in the corresponding transform feedback object and may 4085bd8deadSopenharmony_ci be used in conjunction with the command 4095bd8deadSopenharmony_ci 4105bd8deadSopenharmony_ci void DrawTransformFeedback(enum mode, uint id) 4115bd8deadSopenharmony_ci 4125bd8deadSopenharmony_ci to replay the captured vertices. This command is equivalent to calling 4135bd8deadSopenharmony_ci DrawArrays with <mode> set to <mode>, <first> set to zero, and <count> set 4145bd8deadSopenharmony_ci to the number of vertices captured the last time transform feedback was 4155bd8deadSopenharmony_ci active on the transform feedback object named by <id>. The error 4165bd8deadSopenharmony_ci INVALID_VALUE is generated if <id> is not the name of a transform feedback 4175bd8deadSopenharmony_ci object. The error INVALID_OPERATION is generated if 4185bd8deadSopenharmony_ci EndTransformFeedback has never been called while the object named by <id> 4195bd8deadSopenharmony_ci was bound. No error is generated if the transform feedback object named 4205bd8deadSopenharmony_ci by <id> is active; the vertex count used for the rendering operation is 4215bd8deadSopenharmony_ci set by the previous EndTransformFeedback command. 4225bd8deadSopenharmony_ci 4235bd8deadSopenharmony_ci 4245bd8deadSopenharmony_ciAdditions to Chapter 3 of the OpenGL 2.1 Specification (Rasterization) 4255bd8deadSopenharmony_ci 4265bd8deadSopenharmony_ci None. 4275bd8deadSopenharmony_ci 4285bd8deadSopenharmony_ciAdditions to Chapter 4 of the OpenGL 2.1 Specification (Per-Fragment 4295bd8deadSopenharmony_ciOperations and the Frame Buffer) 4305bd8deadSopenharmony_ci 4315bd8deadSopenharmony_ci None. 4325bd8deadSopenharmony_ci 4335bd8deadSopenharmony_ciAdditions to Chapter 5 of the OpenGL 2.1 Specification (Special Functions) 4345bd8deadSopenharmony_ci 4355bd8deadSopenharmony_ci On p. 244, add a new set of commands to the list of commands not compiled 4365bd8deadSopenharmony_ci into a display list: 4375bd8deadSopenharmony_ci 4385bd8deadSopenharmony_ci Transform feedback objects: GenTransformFeedbacks, 4395bd8deadSopenharmony_ci DeleteTransformFeedbacks, 4405bd8deadSopenharmony_ci 4415bd8deadSopenharmony_ci (note: IsTransformFeedback is covered by the "Other queries" rule.) 4425bd8deadSopenharmony_ci 4435bd8deadSopenharmony_ciAdditions to Chapter 6 of the OpenGL 2.1 Specification (State and 4445bd8deadSopenharmony_ciState Requests) 4455bd8deadSopenharmony_ci 4465bd8deadSopenharmony_ci (Add to the "Transform Feedback" query section added by the 4475bd8deadSopenharmony_ci EXT_transform_feedback extension.) 4485bd8deadSopenharmony_ci 4495bd8deadSopenharmony_ci The command 4505bd8deadSopenharmony_ci 4515bd8deadSopenharmony_ci boolean IsTransformFeedback(uint id) 4525bd8deadSopenharmony_ci 4535bd8deadSopenharmony_ci returns TRUE if <id> is the name of a transform feedback object. If <id> 4545bd8deadSopenharmony_ci is a non-zero value that is not the name of a transform feedback object, 4555bd8deadSopenharmony_ci IsTransformFeedback() return FALSE. 4565bd8deadSopenharmony_ci 4575bd8deadSopenharmony_ciAdditions to Appendix A of the OpenGL 2.1 Specification (Invariance) 4585bd8deadSopenharmony_ci 4595bd8deadSopenharmony_ci None. 4605bd8deadSopenharmony_ci 4615bd8deadSopenharmony_ciAdditions to the AGL/GLX/WGL Specifications 4625bd8deadSopenharmony_ci 4635bd8deadSopenharmony_ci None. 4645bd8deadSopenharmony_ci 4655bd8deadSopenharmony_ciGLX Protocol 4665bd8deadSopenharmony_ci 4675bd8deadSopenharmony_ci TBD (Protocol support needs to be added for the new functions.) 4685bd8deadSopenharmony_ci 4695bd8deadSopenharmony_ciDependencies on NV_transform_feedback2 4705bd8deadSopenharmony_ci 4715bd8deadSopenharmony_ciDependencies on EXT_transform_feedback 4725bd8deadSopenharmony_ci 4735bd8deadSopenharmony_ci This language is written against the EXT_transform_feedback 4745bd8deadSopenharmony_ci specification. 4755bd8deadSopenharmony_ci 4765bd8deadSopenharmony_ciDependencies on EXT_geometry_shader4 4775bd8deadSopenharmony_ci 4785bd8deadSopenharmony_ci If EXT_geometry_shader4 is not supported, remove all references to 4795bd8deadSopenharmony_ci geometry shaders. 4805bd8deadSopenharmony_ci 4815bd8deadSopenharmony_ciErrors 4825bd8deadSopenharmony_ci 4835bd8deadSopenharmony_ci The error INVALID_OPERATION is generated by BindTransformFeedback if a 4845bd8deadSopenharmony_ci transform feedback operation is active on the currently bound transform 4855bd8deadSopenharmony_ci feedback object, and that operation is not paused (as described below). 4865bd8deadSopenharmony_ci 4875bd8deadSopenharmony_ci The error INVALID_OPERATION is generated by DeleteTransformFeedbacks if 4885bd8deadSopenharmony_ci the transform feedback operation for any object named by <ids> is 4895bd8deadSopenharmony_ci currently active. 4905bd8deadSopenharmony_ci 4915bd8deadSopenharmony_ci The error INVALID_OPERATION is generated by BeginTransformFeedback if 4925bd8deadSopenharmony_ci transform feedback is active. 4935bd8deadSopenharmony_ci 4945bd8deadSopenharmony_ci The error INVALID_OPERATION is generated by EndTransformFeedback if 4955bd8deadSopenharmony_ci transform feedback is inactive. 4965bd8deadSopenharmony_ci 4975bd8deadSopenharmony_ci The error INVALID_OPERATION is generated by PauseTransformFeedback if 4985bd8deadSopenharmony_ci the currently bound transform feedback is not active or is paused. 4995bd8deadSopenharmony_ci 5005bd8deadSopenharmony_ci The error INVALID_OPERATION is generated by ResumeTransformFeedback 5015bd8deadSopenharmony_ci if the currently bound transform feedback is not active or is not paused. 5025bd8deadSopenharmony_ci 5035bd8deadSopenharmony_ci The error INVALID_OPERATION is generated by Begin or any operation that 5045bd8deadSopenharmony_ci implicitly calls Begin (such as DrawElements) if transform feedback is 5055bd8deadSopenharmony_ci active and not paused and if <mode> is incompatible with the 5065bd8deadSopenharmony_ci <primitiveMode> parameter supplied to BeginTransformFeedback. 5075bd8deadSopenharmony_ci 5085bd8deadSopenharmony_ci The error INVALID_VALUE is generated by BindBufferRange, 5095bd8deadSopenharmony_ci BindBufferOffsetEXT, or BindBufferBase if <target> is 5105bd8deadSopenharmony_ci TRANSFORM_FEEDBACK_BUFFER and <index> is greater than or equal to the 5115bd8deadSopenharmony_ci value of MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS. 5125bd8deadSopenharmony_ci 5135bd8deadSopenharmony_ci The error INVALID_VALUE is generated by BindBufferRange if <size> is 5145bd8deadSopenharmony_ci less than or equal to zero or either <offset> or <size> are not 5155bd8deadSopenharmony_ci word-aligned. 5165bd8deadSopenharmony_ci 5175bd8deadSopenharmony_ci The error INVALID_VALUE is generated by BindBufferOffsetEXT if <offset> 5185bd8deadSopenharmony_ci is not word-aligned. 5195bd8deadSopenharmony_ci 5205bd8deadSopenharmony_ci The error INVALID_OPERATION is generated by BindBufferRange, 5215bd8deadSopenharmony_ci BindBufferOffsetEXT, or BindBufferBase if <target> is 5225bd8deadSopenharmony_ci TRANSFORM_FEEDBACK_BUFFER and transform feedback is currently active. 5235bd8deadSopenharmony_ci 5245bd8deadSopenharmony_ci The error INVALID_OPERATION is generated by BeginTransformFeedback if 5255bd8deadSopenharmony_ci any binding point used in transform feedback mode does not have a buffer 5265bd8deadSopenharmony_ci object bound. 5275bd8deadSopenharmony_ci 5285bd8deadSopenharmony_ci The error INVALID_OPERATION is generated by TransformFeedbackVaryings 5295bd8deadSopenharmony_ci if the current transform feedback object is active, even if paused. 5305bd8deadSopenharmony_ci 5315bd8deadSopenharmony_ci The error INVALID_OPERATION is generated by UseProgram if the current 5325bd8deadSopenharmony_ci transform feedback object is active and not paused. 5335bd8deadSopenharmony_ci 5345bd8deadSopenharmony_ci The error INVALID_OPERATION is generated by LinkProgram if <program> is 5355bd8deadSopenharmony_ci the name of a program being used by one or more transform feedback 5365bd8deadSopenharmony_ci objects, even if the objects are not currently bound or are paused. 5375bd8deadSopenharmony_ci 5385bd8deadSopenharmony_ci The error INVALID_OPERATION is generated by ResumeTransformFeedback if 5395bd8deadSopenharmony_ci the program object being used by the current transform feedback object is 5405bd8deadSopenharmony_ci not active. 5415bd8deadSopenharmony_ci 5425bd8deadSopenharmony_ci The error INVALID_VALUE is generated by DrawTransformFeedback if <id> 5435bd8deadSopenharmony_ci is not the name of a transform feedback object. 5445bd8deadSopenharmony_ci 5455bd8deadSopenharmony_ci The error INVALID_OPERATION is generated by DrawTransformFeedback if 5465bd8deadSopenharmony_ci EndTransformFeedback has never been called while the object named by 5475bd8deadSopenharmony_ci <id> was bound. 5485bd8deadSopenharmony_ci 5495bd8deadSopenharmony_ci 5505bd8deadSopenharmony_ciNew State 5515bd8deadSopenharmony_ci 5525bd8deadSopenharmony_ci (Add a new table: Table 6.X, Transform Feedback Object State) 5535bd8deadSopenharmony_ci 5545bd8deadSopenharmony_ci Get Value Type Get Command Init. Value Description Sec Attrib 5555bd8deadSopenharmony_ci ------------------ ------ -------------- ------------ ------------------------- ----- ------ 5565bd8deadSopenharmony_ci TRANSFORM_FEEDBACK_ Z+ GetIntegerv 0 Buffer object bound to 6.1.13 - 5575bd8deadSopenharmony_ci BUFFER_BINDING generic bind point for 5585bd8deadSopenharmony_ci transform feedback. 5595bd8deadSopenharmony_ci TRANSFORM_FEEDBACK_ nxZ+ GetIntegeri_v 0 Buffer object bound to 6.1.13 - 5605bd8deadSopenharmony_ci BUFFER_BINDING each transform feedback 5615bd8deadSopenharmony_ci attribute stream. 5625bd8deadSopenharmony_ci TRANSFORM_FEEDBACK_ nxZ+ GetIntegeri_v 0 Start offset of binding 6.1.13 - 5635bd8deadSopenharmony_ci BUFFER_START range for each transform 5645bd8deadSopenharmony_ci feedback attrib. stream 5655bd8deadSopenharmony_ci TRANSFORM_FEEDBACK_ nxZ+ GetIntegeri_v 0 Size of binding range 6.1.13 - 5665bd8deadSopenharmony_ci BUFFER_SIZE for each transform 5675bd8deadSopenharmony_ci TRANSFORM_FEEDBACK_ B GetBooleanv FALSE Is transform feedback 6.1.13 - 5685bd8deadSopenharmony_ci BUFFER_PAUSED paused on this object? 5695bd8deadSopenharmony_ci TRANSFORM_FEEDBACK_ B GetBooleanv FALSE Is transform feedback 6.1.13 - 5705bd8deadSopenharmony_ci BUFFER_ACTIVE active on this object? 5715bd8deadSopenharmony_ci 5725bd8deadSopenharmony_ci [[ Note: This table includes all transform feedback state provided by 5735bd8deadSopenharmony_ci EXT_transform_feedback, except for transform feedback-related state 5745bd8deadSopenharmony_ci belonging to query objects and GLSL program objects. The only other 5755bd8deadSopenharmony_ci transform feedback-related state not present in these objects is the 5765bd8deadSopenharmony_ci object binding (below) and implementation-dependent limits. ]] 5775bd8deadSopenharmony_ci 5785bd8deadSopenharmony_ci (Modify table 6.10: Transformation State, p. 275) 5795bd8deadSopenharmony_ci 5805bd8deadSopenharmony_ci Get Value Type Get Command Init. Value Description Sec Attrib 5815bd8deadSopenharmony_ci ------------------ ------ -------------- ------------ ------------------------- ----- ------ 5825bd8deadSopenharmony_ci TRANSFORM_FEEDBACK_ Z+ GetIntegerv 0 Object bound for transform 2.Y - 5835bd8deadSopenharmony_ci BINDING feedback operations 5845bd8deadSopenharmony_ci 5855bd8deadSopenharmony_ciNew Implementation Dependent State 5865bd8deadSopenharmony_ci 5875bd8deadSopenharmony_ci None. 5885bd8deadSopenharmony_ci 5895bd8deadSopenharmony_ciIssues 5905bd8deadSopenharmony_ci 5915bd8deadSopenharmony_ci 1. How should we provide the ability to automatically render primitives 5925bd8deadSopenharmony_ci captured in transform feedback mode? 5935bd8deadSopenharmony_ci 5945bd8deadSopenharmony_ci RESOLVED: Adding a new transform feedback state object provides 5955bd8deadSopenharmony_ci encapsulation for two useful operations: pause/resume and automatic 5965bd8deadSopenharmony_ci rendering. 5975bd8deadSopenharmony_ci 5985bd8deadSopenharmony_ci When applications pause and possibly switch to different transform 5995bd8deadSopenharmony_ci feedback state, it is necessary to save the state of the paused 6005bd8deadSopenharmony_ci transform feedback operation somewhere. The transform feedback object 6015bd8deadSopenharmony_ci provides a convenient entity to hold this saved state. The transform 6025bd8deadSopenharmony_ci feedback object is also a convenient place to store final counts for 6035bd8deadSopenharmony_ci use by actual drawing. 6045bd8deadSopenharmony_ci 6055bd8deadSopenharmony_ci Additionally, the transform feedback object is helpful in ensuring 6065bd8deadSopenharmony_ci that the transform feedback state used when resuming transform 6075bd8deadSopenharmony_ci feedback is the same as when it was paused without a complicated error 6085bd8deadSopenharmony_ci check. We simply disallow changing the state in an object while 6095bd8deadSopenharmony_ci transform feedback is active (even when paused), so the state can't 6105bd8deadSopenharmony_ci become inconsistent while paused. The same basic consistency rules 6115bd8deadSopenharmony_ci apply to transform feedback state stored separately in a GLSL program 6125bd8deadSopenharmony_ci object; you can't change them while transform feedback is active in 6135bd8deadSopenharmony_ci the original extensions, and this extension treats the paused state as 6145bd8deadSopenharmony_ci active for the purposes of these restrictions. 6155bd8deadSopenharmony_ci 6165bd8deadSopenharmony_ci Alternately, the in-progress transform feedback state (e.g., vertex 6175bd8deadSopenharmony_ci counts, pointers into buffer objects) could have been stored with the 6185bd8deadSopenharmony_ci buffer objects used to capture the primitives. 6195bd8deadSopenharmony_ci 6205bd8deadSopenharmony_ci 2. Are transform feedback objects shared between contexts? 6215bd8deadSopenharmony_ci 6225bd8deadSopenharmony_ci RESOLVED: No. The amount of state present in one of these objects is 6235bd8deadSopenharmony_ci fairly small -- there is not a lot of memory saved by avoiding 6245bd8deadSopenharmony_ci multiple copies through sharing. Additionally, sharing transform 6255bd8deadSopenharmony_ci feedback objects between contexts doesn't seem particularly useful -- 6265bd8deadSopenharmony_ci an object could only really be used by one context at a time and 6275bd8deadSopenharmony_ci explicit synchronization would be required to use the results of one 6285bd8deadSopenharmony_ci object. 6295bd8deadSopenharmony_ci 6305bd8deadSopenharmony_ci Note that this resolution is consistent with query objects, which is 6315bd8deadSopenharmony_ci the primary type of object used in the original transform feedback 6325bd8deadSopenharmony_ci specification. 6335bd8deadSopenharmony_ci 6345bd8deadSopenharmony_ci 3. How do the new transform feedback objects interact with GLSL program 6355bd8deadSopenharmony_ci objects? 6365bd8deadSopenharmony_ci 6375bd8deadSopenharmony_ci RESOLVED: The set of varyings captured during transform feedback and 6385bd8deadSopenharmony_ci the buffer mode (interleaved or separate) were assigned to the program 6395bd8deadSopenharmony_ci object in the original EXT_transform_feedback specification. That 6405bd8deadSopenharmony_ci seems sensible given that the varyings themselves belong to the 6415bd8deadSopenharmony_ci program object. 6425bd8deadSopenharmony_ci 6435bd8deadSopenharmony_ci In the original extension, implementations are forbidden to unbind or 6445bd8deadSopenharmony_ci relink a program object or reassign the set of varyings to capture 6455bd8deadSopenharmony_ci while transform feedback is active. The same basic restrictions apply 6465bd8deadSopenharmony_ci in this extension, except that than an application may unbind a 6475bd8deadSopenharmony_ci program object while transform feedback is paused. In order to resume 6485bd8deadSopenharmony_ci transform feedback, the same program object must be active. 6495bd8deadSopenharmony_ci Applications may not relink a program or reassign its captured 6505bd8deadSopenharmony_ci varyings while it is being actively used for capture in any transform 6515bd8deadSopenharmony_ci feedback object. 6525bd8deadSopenharmony_ci 6535bd8deadSopenharmony_ci The actual buffer objects bound in transform feedback mode were bound 6545bd8deadSopenharmony_ci to the context (not the program object) in the original transform 6555bd8deadSopenharmony_ci feedback extension. 6565bd8deadSopenharmony_ci 6575bd8deadSopenharmony_ci 4. Should we provide any behavior to "cancel" paused transform feedback 6585bd8deadSopenharmony_ci operations? If an application fails to assign the correct state 6595bd8deadSopenharmony_ci (e.g., GLSL program object), a resume operation may fail and the XFB 6605bd8deadSopenharmony_ci object might get stuck in a paused state indefinitely. 6615bd8deadSopenharmony_ci 6625bd8deadSopenharmony_ci RESOLVED: Yes. EndTransformFeedback is defined to cancel an active 6635bd8deadSopenharmony_ci transform feedback operation, even if it is currently paused. 6645bd8deadSopenharmony_ci 6655bd8deadSopenharmony_ci 5. Should buffer object bindings be encapsulated in the new transform 6665bd8deadSopenharmony_ci feedback object? 6675bd8deadSopenharmony_ci 6685bd8deadSopenharmony_ci RESOLVED: Yes. This allows applications the convenience of updating 6695bd8deadSopenharmony_ci all the transform feedback state in one call. Additionally, it 6705bd8deadSopenharmony_ci ensures that the set of buffer bindings remains consistent while 6715bd8deadSopenharmony_ci transform feedback is active -- even if we switch objects while 6725bd8deadSopenharmony_ci paused. 6735bd8deadSopenharmony_ci 6745bd8deadSopenharmony_ci 6. Should we be able to use two different sets of transform feedback 6755bd8deadSopenharmony_ci state (one for capture, a second for rendering - via 6765bd8deadSopenharmony_ci DrawTransformFeedback)? 6775bd8deadSopenharmony_ci 6785bd8deadSopenharmony_ci RESOLVED: Yes. We should support the ability to capture primitives 6795bd8deadSopenharmony_ci in transform feedback that are produced by DrawTransformFeedback. 6805bd8deadSopenharmony_ci Requiring that applications use the a single transform feedback object 6815bd8deadSopenharmony_ci for both operations (if even possible) seems inconvenient. As a 6825bd8deadSopenharmony_ci result, we provide the ability to use separate objects for capture and 6835bd8deadSopenharmony_ci rendering. 6845bd8deadSopenharmony_ci 6855bd8deadSopenharmony_ci 7. How should the second transform feedback object used for rendering be 6865bd8deadSopenharmony_ci provided to the GL? 6875bd8deadSopenharmony_ci 6885bd8deadSopenharmony_ci RESOLVED: The approach chosen by this extension is to have 6895bd8deadSopenharmony_ci DrawTransformFeedback() accept a transform feedback object ID. 6905bd8deadSopenharmony_ci 6915bd8deadSopenharmony_ci An alternate approach would have been to provide a second binding 6925bd8deadSopenharmony_ci point (TRANSFORM_FEEDBACK_RENDER?) whose bound object would be used 6935bd8deadSopenharmony_ci by any DrawTransformFeedback() call. 6945bd8deadSopenharmony_ci 6955bd8deadSopenharmony_ci 6965bd8deadSopenharmony_ci 8. Can a single transform feedback object be used for both capture and 6975bd8deadSopenharmony_ci drawing (via DrawTransformFeedback) at the same time? 6985bd8deadSopenharmony_ci 6995bd8deadSopenharmony_ci RESOLVED: Yes. 7005bd8deadSopenharmony_ci 7015bd8deadSopenharmony_ci DrawTransformFeedback is defined to use the vertex count established 7025bd8deadSopenharmony_ci when the previous transform feedback operation on that object 7035bd8deadSopenharmony_ci completes (by an EndTransformFeedback call). If transform feedback 7045bd8deadSopenharmony_ci is active for an object (paused or not), the accumulated vertex count 7055bd8deadSopenharmony_ci for the in-progress operation is never used by 7065bd8deadSopenharmony_ci DrawTransformFeedback. 7075bd8deadSopenharmony_ci 7085bd8deadSopenharmony_ci 9. Does DrawTransformFeedback() automatically use the buffer objects 7095bd8deadSopenharmony_ci from the previous transform feedback operation? If not, does it 7105bd8deadSopenharmony_ci require that applications set up and use only those buffer manually? 7115bd8deadSopenharmony_ci 7125bd8deadSopenharmony_ci RESOLVED: DrawTransformFeedback() couldn't automatically set up 7135bd8deadSopenharmony_ci buffer objects, even if we wanted to (which we don't). No mechanism 7145bd8deadSopenharmony_ci exists to automatically line up per-vertex outputs captured during 7155bd8deadSopenharmony_ci transform feedback against the inputs of a different vertex shader. 7165bd8deadSopenharmony_ci 7175bd8deadSopenharmony_ci Applications are thus required to manually set up their vertex arrays 7185bd8deadSopenharmony_ci appropriately prior to calling DrawTransformFeedback(). 7195bd8deadSopenharmony_ci Applications are not required to use any of the buffer objects 7205bd8deadSopenharmony_ci written to during the previous transform feedback operation, and are 7215bd8deadSopenharmony_ci allowed to use other buffer objects (OK) or vertex arrays not stored 7225bd8deadSopenharmony_ci in a buffer object at all (legal, but not recommended). The only 7235bd8deadSopenharmony_ci information the draw call uses from the previous transform feedback 7245bd8deadSopenharmony_ci operation is the total number of vertices captured. 7255bd8deadSopenharmony_ci 7265bd8deadSopenharmony_ci 10. Does DrawTransformFeedback() require that an application use the 7275bd8deadSopenharmony_ci same primitive type for drawing that was used during the previous 7285bd8deadSopenharmony_ci transform feedback operation? 7295bd8deadSopenharmony_ci 7305bd8deadSopenharmony_ci RESOLVED: No. We do expect that will be the common case, however. 7315bd8deadSopenharmony_ci 7325bd8deadSopenharmony_ci 11. What happens on if DrawTransformFeedback() uses a transform feedback 7335bd8deadSopenharmony_ci object whose last capture operation overflowed, and started dropping 7345bd8deadSopenharmony_ci primitives. 7355bd8deadSopenharmony_ci 7365bd8deadSopenharmony_ci RESOLVED: Any primitives discarded during a transform feedback 7375bd8deadSopenharmony_ci operation will not affect the vertex count extracted by 7385bd8deadSopenharmony_ci DrawTransformFeedback(), as though those primitives never existed. 7395bd8deadSopenharmony_ci 7405bd8deadSopenharmony_ci 12. How does the ability to pause/resume transform feedback interact with 7415bd8deadSopenharmony_ci the TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN query object? 7425bd8deadSopenharmony_ci 7435bd8deadSopenharmony_ci RESOLVED: There is no explicit interaction in this case. 7445bd8deadSopenharmony_ci 7455bd8deadSopenharmony_ci The transform feedback-related query objects and transform feedback 7465bd8deadSopenharmony_ci objects are completely independent. If multiple transform feedback 7475bd8deadSopenharmony_ci objects are used between BeginQuery() and EndQuery() calls, the query 7485bd8deadSopenharmony_ci result reflects the number of primitives written using *any* transform 7495bd8deadSopenharmony_ci feedback object. 7505bd8deadSopenharmony_ci 7515bd8deadSopenharmony_ci Note that the primitives written counter is never incremented when 7525bd8deadSopenharmony_ci transform feedback is paused, because no primitives will be written to 7535bd8deadSopenharmony_ci buffers while transform feedback is paused. 7545bd8deadSopenharmony_ci 7555bd8deadSopenharmony_ci 13. Should we provide a mechanism to query the number of vertices or 7565bd8deadSopenharmony_ci primitives recorded in the last transform feedback operation on an 7575bd8deadSopenharmony_ci object? If so, how? 7585bd8deadSopenharmony_ci 7595bd8deadSopenharmony_ci RESOLVED: No, not in this spec. The existing TRANSFORM_FEEDBACK_ 7605bd8deadSopenharmony_ci PRIMITIVES_WRITTEN queries can be used to obtain this information. 7615bd8deadSopenharmony_ci 7625bd8deadSopenharmony_ci 14. Can a buffer object be attached to more than one transform feedback 7635bd8deadSopenharmony_ci object at the same time? 7645bd8deadSopenharmony_ci 7655bd8deadSopenharmony_ci RESOLVED: Yes. Applications using transform feedback should avoid 7665bd8deadSopenharmony_ci cases where transform feedback operations can conflict, including: 7675bd8deadSopenharmony_ci 7685bd8deadSopenharmony_ci * using multiple threads that simultaneously write to overlapping 7695bd8deadSopenharmony_ci regions of a single buffer object; or 7705bd8deadSopenharmony_ci 7715bd8deadSopenharmony_ci * using one or multiple threads, where a portion of a buffer object 7725bd8deadSopenharmony_ci is written using one transform feedback object while another 7735bd8deadSopenharmony_ci transform feedback operation writing to an overlapping region of 7745bd8deadSopenharmony_ci the same buffer is paused. 7755bd8deadSopenharmony_ci 7765bd8deadSopenharmony_ci 15. When a transform feedback object is active and not paused, binding a 7775bd8deadSopenharmony_ci different transform feedback object without pausing is specified to 7785bd8deadSopenharmony_ci result in an INVALID_OPERATION error. Should we instead define the 7795bd8deadSopenharmony_ci bind to implicitly pause and resume as required? 7805bd8deadSopenharmony_ci 7815bd8deadSopenharmony_ci RESOLVED: No. While implicit pauses and resumes would be convenient, 7825bd8deadSopenharmony_ci they have interaction issues with the current transform feedback API. 7835bd8deadSopenharmony_ci 7845bd8deadSopenharmony_ci In particular, transform feedback forbids applications from changing 7855bd8deadSopenharmony_ci various pieces of relevant state (e.g., transform feedback buffer 7865bd8deadSopenharmony_ci bindings, active GLSL program object) during an active transform 7875bd8deadSopenharmony_ci feedback operation. The active GLSL program object may be changed 7885bd8deadSopenharmony_ci while transform feedback is paused, but it must be restored prior to 7895bd8deadSopenharmony_ci resuming. 7905bd8deadSopenharmony_ci 7915bd8deadSopenharmony_ci Consider two active transform feedback objects (A and B) using two 7925bd8deadSopenharmony_ci different program objects (C and D, respectively). With the current 7935bd8deadSopenharmony_ci API, you can switch back and forth as follows: 7945bd8deadSopenharmony_ci 7955bd8deadSopenharmony_ci // Perform first half of transform feedback for object A. 7965bd8deadSopenharmony_ci UseProgram(C); 7975bd8deadSopenharmony_ci BindTransformFeedback(TRANSFORM_FEEDBACK, A); 7985bd8deadSopenharmony_ci BeginTransformFeedback(...); 7995bd8deadSopenharmony_ci ... 8005bd8deadSopenharmony_ci PauseTransformFeedback(); 8015bd8deadSopenharmony_ci 8025bd8deadSopenharmony_ci // Perform first half of transform feedback for object B. 8035bd8deadSopenharmony_ci UseProgram(D); 8045bd8deadSopenharmony_ci BindTransformFeedback(TRANSFORM_FEEDBACK, B); 8055bd8deadSopenharmony_ci BeginTransformFeedback(...); 8065bd8deadSopenharmony_ci ... 8075bd8deadSopenharmony_ci PauseTransformFeedback(); 8085bd8deadSopenharmony_ci 8095bd8deadSopenharmony_ci // Perform second half of transform feedback for object A. 8105bd8deadSopenharmony_ci UseProgram(C); 8115bd8deadSopenharmony_ci BindTransformFeedback(TRANSFORM_FEEDBACK, A); 8125bd8deadSopenharmony_ci ResumeTransformFeedback(); 8135bd8deadSopenharmony_ci ... 8145bd8deadSopenharmony_ci EndTransformFeedback(); 8155bd8deadSopenharmony_ci 8165bd8deadSopenharmony_ci // Perform second half of transform feedback for object B. 8175bd8deadSopenharmony_ci UseProgram(D); 8185bd8deadSopenharmony_ci BindTransformFeedback(TRANSFORM_FEEDBACK, B); 8195bd8deadSopenharmony_ci ResumeTransformFeedback(); 8205bd8deadSopenharmony_ci ... 8215bd8deadSopenharmony_ci EndTransformFeedback(); 8225bd8deadSopenharmony_ci 8235bd8deadSopenharmony_ci Implicit pauses and resumes would allow applications to omit the 8245bd8deadSopenharmony_ci PauseTransformFeedback() and ResumeTransformFeedback() calls. The 8255bd8deadSopenharmony_ci problem with this approach is that it's not clear when to change 8265bd8deadSopenharmony_ci program objects. In the example above, the second call to 8275bd8deadSopenharmony_ci UseProgram(C) is legal because the bound transform feedback object (B) 8285bd8deadSopenharmony_ci is paused. If the pause call were removed in favor of implicit 8295bd8deadSopenharmony_ci pauses, that UseProgram(C) call would be illegal because there is an 8305bd8deadSopenharmony_ci active transform feedback object. Assume the UseProgram(C) call were 8315bd8deadSopenharmony_ci moved to be after the BindTransformFeedback(..., A) call on the next 8325bd8deadSopenharmony_ci line instead. In that case, the implicit resume on the bind call 8335bd8deadSopenharmony_ci would be the problem instead -- we'd be resuming a transform feedback 8345bd8deadSopenharmony_ci operation while the wrong program object (D) is active. 8355bd8deadSopenharmony_ci 8365bd8deadSopenharmony_ci 8375bd8deadSopenharmony_ciRevision History 8385bd8deadSopenharmony_ci 8395bd8deadSopenharmony_ci Rev. Date Author Changes 8405bd8deadSopenharmony_ci ---- -------- -------- ----------------------------------------- 8415bd8deadSopenharmony_ci 7 06/28/12 Jon Leech Remove INVALID_VALUE error for 8425bd8deadSopenharmony_ci BindBufferRange when specifying a range 8435bd8deadSopenharmony_ci beyond the current end of buffer. Define 8445bd8deadSopenharmony_ci BindBufferBase as specifying a range as 8455bd8deadSopenharmony_ci large as the actual buffer size at time of 8465bd8deadSopenharmony_ci use, and return zero when querying the 8475bd8deadSopenharmony_ci buffer size as a sentinel value for the 8485bd8deadSopenharmony_ci buffer size indicating this behavior. 8495bd8deadSopenharmony_ci Specify that the GL will never read from or 8505bd8deadSopenharmony_ci write to beyond the end of a bound buffer 8515bd8deadSopenharmony_ci (Bugs 7318 and 7329, matching OpenGL 4.2 8525bd8deadSopenharmony_ci core spec behavior). Reflow paragraphs that 8535bd8deadSopenharmony_ci were too wide. Replace references to 8545bd8deadSopenharmony_ci nonexistent BindBufferOffset command with 8555bd8deadSopenharmony_ci BindBufferOffsetEXT from 8565bd8deadSopenharmony_ci EXT_transform_feedback. 8575bd8deadSopenharmony_ci 8585bd8deadSopenharmony_ci 6 02/11/10 Jon Leech Specify delayed-deletion behavior for 8595bd8deadSopenharmony_ci active XFB objects (Bug 5768). 8605bd8deadSopenharmony_ci 8615bd8deadSopenharmony_ci 5 01/19/10 Jon Leech Reorder object management section to match 8625bd8deadSopenharmony_ci other types of objects and require Gen'ned 8635bd8deadSopenharmony_ci names be used for binding objects (Bug 5846). 8645bd8deadSopenharmony_ci 8655bd8deadSopenharmony_ci 4 12/07/09 jbolz Rename EXT->ARB. 8665bd8deadSopenharmony_ci 8675bd8deadSopenharmony_ci 3 10/12/09 ericz Removed some state that was part of 8685bd8deadSopenharmony_ci NV_transform_feedback and only applied to 8695bd8deadSopenharmony_ci fixed function. 8705bd8deadSopenharmony_ci 8715bd8deadSopenharmony_ci 2 09/10/09 ericz Updated issues that were previously UNRESOLVED, 8725bd8deadSopenharmony_ci based on the latest NV_transform_feedback2 8735bd8deadSopenharmony_ci spec. Allow EndTransformFeedbackEXT to be 8745bd8deadSopenharmony_ci called while transform feedback is paused. 8755bd8deadSopenharmony_ci 8765bd8deadSopenharmony_ci 1 06/13/09 ericz Created an initial EXT_transform_feedback2 8775bd8deadSopenharmony_ci spec by forking off the existing 8785bd8deadSopenharmony_ci NV_transform_feedback 2 spec. 879