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