15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci EXT_transform_feedback 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ciName Strings 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ci GL_EXT_transform_feedback 85bd8deadSopenharmony_ci 95bd8deadSopenharmony_ciContributors 105bd8deadSopenharmony_ci 115bd8deadSopenharmony_ci Nick Carter 125bd8deadSopenharmony_ci Charlie Lao 135bd8deadSopenharmony_ci Jeremy Sandmel 145bd8deadSopenharmony_ci Cliff Woolley 155bd8deadSopenharmony_ci Alex Eddy 165bd8deadSopenharmony_ci 175bd8deadSopenharmony_ciContact 185bd8deadSopenharmony_ci 195bd8deadSopenharmony_ci Barthold Lichtenbelt (blichtenbelt 'at' nvidia.com) 205bd8deadSopenharmony_ci Pat Brown (pbrown 'at' nvidia.com) 215bd8deadSopenharmony_ci Eric Werness (ewerness 'at' nvidia.com) 225bd8deadSopenharmony_ci 235bd8deadSopenharmony_ciStatus 245bd8deadSopenharmony_ci 255bd8deadSopenharmony_ci Shipping. 265bd8deadSopenharmony_ci 275bd8deadSopenharmony_ciVersion 285bd8deadSopenharmony_ci 295bd8deadSopenharmony_ci Last Modified Date: 08/09/2013 305bd8deadSopenharmony_ci NVIDIA Revision: 8 315bd8deadSopenharmony_ci 325bd8deadSopenharmony_ciNumber 335bd8deadSopenharmony_ci 345bd8deadSopenharmony_ci 352 355bd8deadSopenharmony_ci 365bd8deadSopenharmony_ciDependencies 375bd8deadSopenharmony_ci 385bd8deadSopenharmony_ci The OpenGL Shading Language (GLSL) is required. OpenGL 2.0 or the 395bd8deadSopenharmony_ci ARB_shader_objects extension is required. 405bd8deadSopenharmony_ci 415bd8deadSopenharmony_ci EXT_geometry_shader4 trivially interacts with this extension. 425bd8deadSopenharmony_ci 435bd8deadSopenharmony_ci NV_transform_feedback interacts with this extension. 445bd8deadSopenharmony_ci 455bd8deadSopenharmony_ci This extension is written against the OpenGL 2.0 specification. 465bd8deadSopenharmony_ci 475bd8deadSopenharmony_ciOverview 485bd8deadSopenharmony_ci 495bd8deadSopenharmony_ci This extension provides a new mode to the GL, called transform feedback, 505bd8deadSopenharmony_ci which records selected vertex attributes for each primitive processed by 515bd8deadSopenharmony_ci the GL. The selected attributes are written into buffer objects, and can 525bd8deadSopenharmony_ci be written with each attribute in a separate buffer object or with all 535bd8deadSopenharmony_ci attributes interleaved into a single buffer object. If a geometry shader 545bd8deadSopenharmony_ci is active, the primitives recorded are those emitted by the geometry 555bd8deadSopenharmony_ci shader. Otherwise, transform feedback captures primitives whose vertices 565bd8deadSopenharmony_ci are transformed by a vertex shader. In either case, the primitives 575bd8deadSopenharmony_ci captured are those generated prior to clipping. Transform feedback mode 585bd8deadSopenharmony_ci captures the values of specified varying variables emitted from GLSL 595bd8deadSopenharmony_ci vertex or geometry shaders. 605bd8deadSopenharmony_ci 615bd8deadSopenharmony_ci The vertex data recorded in transform feedback mode is stored into buffer 625bd8deadSopenharmony_ci objects as an array of vertex attributes. The regular representation and 635bd8deadSopenharmony_ci the use of buffer objects allows the recorded data to be processed 645bd8deadSopenharmony_ci directly by the GL without requiring CPU intervention to copy data. In 655bd8deadSopenharmony_ci particular, transform feedback data can be used for vertex arrays (via 665bd8deadSopenharmony_ci vertex buffer objects), as the source for pixel data (via pixel buffer 675bd8deadSopenharmony_ci objects), as shader constant data (via the NV_parameter_buffer_object or 685bd8deadSopenharmony_ci EXT_bindable_uniform extensions), or via any other extension that makes 695bd8deadSopenharmony_ci use of buffer objects. 705bd8deadSopenharmony_ci 715bd8deadSopenharmony_ci This extension introduces new query object support to allow transform 725bd8deadSopenharmony_ci feedback mode to operate asynchronously. Query objects allow applications 735bd8deadSopenharmony_ci to determine when transform feedback results are complete, as well as the 745bd8deadSopenharmony_ci number of primitives processed and written back to buffer objects while in 755bd8deadSopenharmony_ci transform feedback mode. This extension also provides a new rasterizer 765bd8deadSopenharmony_ci discard enable, which allows applications to use transform feedback to 775bd8deadSopenharmony_ci capture vertex attributes without rendering anything. 785bd8deadSopenharmony_ci 795bd8deadSopenharmony_ciNew Procedures and Functions 805bd8deadSopenharmony_ci 815bd8deadSopenharmony_ci void BindBufferRangeEXT(enum target, uint index, uint buffer, 825bd8deadSopenharmony_ci intptr offset, sizeiptr size); 835bd8deadSopenharmony_ci void BindBufferOffsetEXT(enum target, uint index, uint buffer, 845bd8deadSopenharmony_ci intptr offset); 855bd8deadSopenharmony_ci void BindBufferBaseEXT(enum target, uint index, uint buffer); 865bd8deadSopenharmony_ci 875bd8deadSopenharmony_ci void BeginTransformFeedbackEXT(enum primitiveMode); 885bd8deadSopenharmony_ci void EndTransformFeedbackEXT(void); 895bd8deadSopenharmony_ci 905bd8deadSopenharmony_ci void TransformFeedbackVaryingsEXT(uint program, sizei count, 915bd8deadSopenharmony_ci const char * const *varyings, 925bd8deadSopenharmony_ci enum bufferMode); 935bd8deadSopenharmony_ci void GetTransformFeedbackVaryingEXT(uint program, uint index, 945bd8deadSopenharmony_ci sizei bufSize, sizei *length, 955bd8deadSopenharmony_ci sizei *size, enum *type, char *name); 965bd8deadSopenharmony_ci 975bd8deadSopenharmony_ci void GetIntegerIndexedvEXT(enum param, uint index, int *values); 985bd8deadSopenharmony_ci void GetBooleanIndexedvEXT(enum param, uint index, boolean *values); 995bd8deadSopenharmony_ci 1005bd8deadSopenharmony_ci (Note: These indexed query functions are provided in the EXT_draw_buffers2 1015bd8deadSopenharmony_ci extension. The boolean query is not useful for any queryable value in 1025bd8deadSopenharmony_ci this extension, but is supported for completeness and consistency with 1035bd8deadSopenharmony_ci base GL typed "Get" functions.) 1045bd8deadSopenharmony_ci 1055bd8deadSopenharmony_ciNew Tokens 1065bd8deadSopenharmony_ci 1075bd8deadSopenharmony_ci Accepted by the <target> parameters of BindBuffer, BufferData, 1085bd8deadSopenharmony_ci BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData, 1095bd8deadSopenharmony_ci GetBufferPointerv, BindBufferRangeEXT, BindBufferOffsetEXT and 1105bd8deadSopenharmony_ci BindBufferBaseEXT: 1115bd8deadSopenharmony_ci 1125bd8deadSopenharmony_ci TRANSFORM_FEEDBACK_BUFFER_EXT 0x8C8E 1135bd8deadSopenharmony_ci 1145bd8deadSopenharmony_ci Accepted by the <param> parameter of GetIntegerIndexedvEXT and 1155bd8deadSopenharmony_ci GetBooleanIndexedvEXT: 1165bd8deadSopenharmony_ci 1175bd8deadSopenharmony_ci TRANSFORM_FEEDBACK_BUFFER_START_EXT 0x8C84 1185bd8deadSopenharmony_ci TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT 0x8C85 1195bd8deadSopenharmony_ci 1205bd8deadSopenharmony_ci Accepted by the <param> parameter of GetIntegerIndexedvEXT and 1215bd8deadSopenharmony_ci GetBooleanIndexedvEXT, and by the <pname> parameter of GetBooleanv, 1225bd8deadSopenharmony_ci GetDoublev, GetIntegerv, and GetFloatv: 1235bd8deadSopenharmony_ci 1245bd8deadSopenharmony_ci TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT 0x8C8F 1255bd8deadSopenharmony_ci 1265bd8deadSopenharmony_ci Accepted by the <bufferMode> parameter of TransformFeedbackVaryingsEXT: 1275bd8deadSopenharmony_ci 1285bd8deadSopenharmony_ci INTERLEAVED_ATTRIBS_EXT 0x8C8C 1295bd8deadSopenharmony_ci SEPARATE_ATTRIBS_EXT 0x8C8D 1305bd8deadSopenharmony_ci 1315bd8deadSopenharmony_ci Accepted by the <target> parameter of BeginQuery, EndQuery, and 1325bd8deadSopenharmony_ci GetQueryiv: 1335bd8deadSopenharmony_ci 1345bd8deadSopenharmony_ci PRIMITIVES_GENERATED_EXT 0x8C87 1355bd8deadSopenharmony_ci TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT 0x8C88 1365bd8deadSopenharmony_ci 1375bd8deadSopenharmony_ci Accepted by the <cap> parameter of Enable, Disable, and IsEnabled, and by 1385bd8deadSopenharmony_ci the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and 1395bd8deadSopenharmony_ci GetDoublev: 1405bd8deadSopenharmony_ci 1415bd8deadSopenharmony_ci RASTERIZER_DISCARD_EXT 0x8C89 1425bd8deadSopenharmony_ci 1435bd8deadSopenharmony_ci Accepted by the <pname> parameter of GetBooleanv, GetDoublev, GetIntegerv, 1445bd8deadSopenharmony_ci and GetFloatv: 1455bd8deadSopenharmony_ci 1465bd8deadSopenharmony_ci MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT 0x8C8A 1475bd8deadSopenharmony_ci MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT 0x8C8B 1485bd8deadSopenharmony_ci MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT 0x8C80 1495bd8deadSopenharmony_ci 1505bd8deadSopenharmony_ci Accepted by the <pname> parameter of GetProgramiv: 1515bd8deadSopenharmony_ci 1525bd8deadSopenharmony_ci TRANSFORM_FEEDBACK_VARYINGS_EXT 0x8C83 1535bd8deadSopenharmony_ci TRANSFORM_FEEDBACK_BUFFER_MODE_EXT 0x8C7F 1545bd8deadSopenharmony_ci TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT 0x8C76 1555bd8deadSopenharmony_ci 1565bd8deadSopenharmony_ci 1575bd8deadSopenharmony_ciAdditions to Chapter 2 of the OpenGL 2.0 Specification (OpenGL 1585bd8deadSopenharmony_ciOperation) 1595bd8deadSopenharmony_ci 1605bd8deadSopenharmony_ci Insert three new sections between Sections 2.11, Coordinate Transforms and 1615bd8deadSopenharmony_ci 2.12, Clipping: 1625bd8deadSopenharmony_ci 1635bd8deadSopenharmony_ci (Move the "Asynchronous Queries" language out of Section 4.1.7. This 1645bd8deadSopenharmony_ci section doesn't really introduce any new functionality, other than 1655bd8deadSopenharmony_ci alluding to the transform feedback queries introduced below.) 1665bd8deadSopenharmony_ci 1675bd8deadSopenharmony_ci Section 2.X, Asynchronous Queries 1685bd8deadSopenharmony_ci 1695bd8deadSopenharmony_ci Asynchronous queries provide a mechanism to return information about the 1705bd8deadSopenharmony_ci processing of a sequence of GL commands. There are two query types 1715bd8deadSopenharmony_ci supported by the GL. Transform feedback queries (section 2.Y) returns 1725bd8deadSopenharmony_ci information on the number of vertices and primitives processed by the GL 1735bd8deadSopenharmony_ci and written to one or more buffer objects. Occlusion queries (section 1745bd8deadSopenharmony_ci 4.1.7.1) count the number of fragments or samples that pass the depth 1755bd8deadSopenharmony_ci test. 1765bd8deadSopenharmony_ci 1775bd8deadSopenharmony_ci The results of asynchronous queries are not returned by the GL immediately 1785bd8deadSopenharmony_ci after the completion of the last command in the set; subsequent commands 1795bd8deadSopenharmony_ci can be processed while the query results are not complete. When 1805bd8deadSopenharmony_ci available, the query results are stored in an associated query object. 1815bd8deadSopenharmony_ci The commands described in section 6.1.12 provide mechanisms to determine 1825bd8deadSopenharmony_ci when query results are available and return the actual results of the 1835bd8deadSopenharmony_ci query. The name space for query objects is the unsigned integers, with 1845bd8deadSopenharmony_ci zero reserved by the GL. 1855bd8deadSopenharmony_ci 1865bd8deadSopenharmony_ci Each type of query supported by the GL has an active query object name. If 1875bd8deadSopenharmony_ci the active query object name for a query type is non-zero, the GL is 1885bd8deadSopenharmony_ci currently tracking the information corresponding to that query type and 1895bd8deadSopenharmony_ci the query results will be written into the corresponding query object. If 1905bd8deadSopenharmony_ci the active query object for a query type name is zero, no such information 1915bd8deadSopenharmony_ci is being tracked. 1925bd8deadSopenharmony_ci 1935bd8deadSopenharmony_ci A query object is created by calling 1945bd8deadSopenharmony_ci 1955bd8deadSopenharmony_ci void BeginQuery(enum target, uint id); 1965bd8deadSopenharmony_ci 1975bd8deadSopenharmony_ci with an unused name <id>. <target> indicates the type of query to be 1985bd8deadSopenharmony_ci performed; valid values of <target> are defined in subsequent 1995bd8deadSopenharmony_ci sections. When a query object is created, the name <id> is marked as used 2005bd8deadSopenharmony_ci and associated with a new query object. 2015bd8deadSopenharmony_ci 2025bd8deadSopenharmony_ci BeginQuery sets the active query object name for the query type given by 2035bd8deadSopenharmony_ci <target> to <id>. If BeginQuery is called with an <id> of zero, if the 2045bd8deadSopenharmony_ci active query object name for <target> is non-zero, or if <id> is the 2055bd8deadSopenharmony_ci active query object name for any query type, the error INVALID OPERATION 2065bd8deadSopenharmony_ci is generated. 2075bd8deadSopenharmony_ci 2085bd8deadSopenharmony_ci The command 2095bd8deadSopenharmony_ci 2105bd8deadSopenharmony_ci void EndQuery(enum target); 2115bd8deadSopenharmony_ci 2125bd8deadSopenharmony_ci marks the end of the sequence of commands to be tracked for the query type 2135bd8deadSopenharmony_ci given by <target>. The active query object for <target> is updated to 2145bd8deadSopenharmony_ci indicate that query results are not available, and the active query object 2155bd8deadSopenharmony_ci name for <target> is reset to zero. When the commands issued prior to 2165bd8deadSopenharmony_ci EndQuery have completed and a final query result is available, the query 2175bd8deadSopenharmony_ci object, active when EndQuery is, called is updated by the GL. The query 2185bd8deadSopenharmony_ci object is updated to indicate that the query results are available and to 2195bd8deadSopenharmony_ci contain the query result. If the active query object name for <target> is 2205bd8deadSopenharmony_ci zero when EndQuery is called, the error INVALID_OPERATION is generated. 2215bd8deadSopenharmony_ci 2225bd8deadSopenharmony_ci The command 2235bd8deadSopenharmony_ci 2245bd8deadSopenharmony_ci void GenQueries(sizei n, uint *ids); 2255bd8deadSopenharmony_ci 2265bd8deadSopenharmony_ci returns <n> previously unused query object names in <ids>. These names are 2275bd8deadSopenharmony_ci marked as used, but no object is associated with them until the first time 2285bd8deadSopenharmony_ci they are used by BeginQuery. 2295bd8deadSopenharmony_ci 2305bd8deadSopenharmony_ci Query objects are deleted by calling 2315bd8deadSopenharmony_ci 2325bd8deadSopenharmony_ci void DeleteQueries(sizei n, const uint *ids); 2335bd8deadSopenharmony_ci 2345bd8deadSopenharmony_ci <ids> contains <n> names of query objects to be deleted. After a query 2355bd8deadSopenharmony_ci object is deleted, its name is again unused. Unused names in <ids> are 2365bd8deadSopenharmony_ci silently ignored. 2375bd8deadSopenharmony_ci 2385bd8deadSopenharmony_ci Calling either GenQueries or DeleteQueries while any query of any target 2395bd8deadSopenharmony_ci is active causes an INVALID_OPERATION error to be generated. 2405bd8deadSopenharmony_ci 2415bd8deadSopenharmony_ci Query objects contain two pieces of state: a single bit indicating 2425bd8deadSopenharmony_ci whether a query result is available, and an integer containing the query 2435bd8deadSopenharmony_ci result value. The number of bits used to represent the query result is 2445bd8deadSopenharmony_ci implementation-dependent. In the initial state of a query object, the 2455bd8deadSopenharmony_ci result is available and its value is zero. 2465bd8deadSopenharmony_ci 2475bd8deadSopenharmony_ci The necessary state for each query type is an unsigned integer holding the 2485bd8deadSopenharmony_ci active query object name (zero if no query object is active), and any 2495bd8deadSopenharmony_ci state necessary to keep the current results of an asynchronous query in 2505bd8deadSopenharmony_ci progress. 2515bd8deadSopenharmony_ci 2525bd8deadSopenharmony_ci Section 2.Y, Transform Feedback 2535bd8deadSopenharmony_ci 2545bd8deadSopenharmony_ci In transform feedback mode, attributes of the vertices of transformed 2555bd8deadSopenharmony_ci primitives processed by a vertex or geometry shader are written out to one 2565bd8deadSopenharmony_ci or more buffer objects. The vertices are fed back after vertex color 2575bd8deadSopenharmony_ci clamping, but before clipping. If a geometry shader is active, the 2585bd8deadSopenharmony_ci vertices recorded are those emitted from the geometry shader. The 2595bd8deadSopenharmony_ci transformed vertices may be optionally discarded after being stored into 2605bd8deadSopenharmony_ci one or more buffer objects, or they can be passed on down to the clipping 2615bd8deadSopenharmony_ci stage for further processing. The set of attributes captured is 2625bd8deadSopenharmony_ci determined when a program is linked. 2635bd8deadSopenharmony_ci 2645bd8deadSopenharmony_ci Transform feedback is started and finished by calling 2655bd8deadSopenharmony_ci 2665bd8deadSopenharmony_ci void BeginTransformFeedbackEXT(enum primitiveMode) 2675bd8deadSopenharmony_ci 2685bd8deadSopenharmony_ci and 2695bd8deadSopenharmony_ci 2705bd8deadSopenharmony_ci void EndTransformFeedbackEXT(void), 2715bd8deadSopenharmony_ci 2725bd8deadSopenharmony_ci respectively. Transform feedback is said to be active after a call to 2735bd8deadSopenharmony_ci BeginTransformFeedbackEXT and inactive after a call to 2745bd8deadSopenharmony_ci EndTransformFeedbackEXT. <primitiveMode> is one of TRIANGLES, LINES, or 2755bd8deadSopenharmony_ci POINTS, and specifies the output type of primitives that will be recorded 2765bd8deadSopenharmony_ci into the buffer objects bound for transform feedback (see 2775bd8deadSopenharmony_ci below). <primitiveMode> places a restriction on the primitive types that 2785bd8deadSopenharmony_ci may be rendered while transform feedback is active -- see table X.1. 2795bd8deadSopenharmony_ci 2805bd8deadSopenharmony_ci Transform Feedback 2815bd8deadSopenharmony_ci primitiveMode allowed render primitive modes 2825bd8deadSopenharmony_ci ---------------------- --------------------------------- 2835bd8deadSopenharmony_ci POINTS POINTS 2845bd8deadSopenharmony_ci LINES LINES, LINE_LOOP, and LINE_STRIP 2855bd8deadSopenharmony_ci TRIANGLES TRIANGLES, TRIANGLE_STRIP, 2865bd8deadSopenharmony_ci TRIANGLE_FAN, QUADS, QUAD_STRIP, 2875bd8deadSopenharmony_ci and POLYGON 2885bd8deadSopenharmony_ci 2895bd8deadSopenharmony_ci Table X.1 Legal combinations between the transform feedback primitive 2905bd8deadSopenharmony_ci mode, as passed to BeginTransformFeedbackEXT and the current primitive 2915bd8deadSopenharmony_ci mode. 2925bd8deadSopenharmony_ci 2935bd8deadSopenharmony_ci Transform feedback commands must be paired; the error INVALID_OPERATION is 2945bd8deadSopenharmony_ci generated by BeginTransformFeedbackEXT if transform feedback is active, 2955bd8deadSopenharmony_ci and by EndTransformFeedbackEXT if transform feedback is inactive. 2965bd8deadSopenharmony_ci 2975bd8deadSopenharmony_ci Transform feedback mode captures the values of varying variables written 2985bd8deadSopenharmony_ci by an active vertex or geometry shader. The error INVALID_OPERATION is 2995bd8deadSopenharmony_ci generated by BeginTransformFeedbackEXT if no vertex or geometry shader is 3005bd8deadSopenharmony_ci not active. 3015bd8deadSopenharmony_ci 3025bd8deadSopenharmony_ci When transform feedback is active, all geometric primitives generated must 3035bd8deadSopenharmony_ci be compatible with the value of <primitiveMode> passed to 3045bd8deadSopenharmony_ci BeginTransformFeedbackEXT. The error INVALID_OPERATION is generated by 3055bd8deadSopenharmony_ci Begin or any operation that implicitly calls Begin (such as DrawElements) 3065bd8deadSopenharmony_ci if <mode> is not one of the allowed modes in Table X.1. If a geometry 3075bd8deadSopenharmony_ci shader is active, its output primtive type is used instead of the <mode> 3085bd8deadSopenharmony_ci parameter passed to Begin for the purposes of this error check. 3095bd8deadSopenharmony_ci 3105bd8deadSopenharmony_ci Buffer objects are made to be targets of transform feedback by calling one 3115bd8deadSopenharmony_ci of the commands 3125bd8deadSopenharmony_ci 3135bd8deadSopenharmony_ci void BindBufferRangeEXT(enum target, uint index, uint buffer, 3145bd8deadSopenharmony_ci intptr offset, sizeiptr size) 3155bd8deadSopenharmony_ci void BindBufferOffsetEXT(enum target, uint index, uint buffer, 3165bd8deadSopenharmony_ci intptr offset) 3175bd8deadSopenharmony_ci void BindBufferBaseEXT(enum target, uint index, uint buffer) 3185bd8deadSopenharmony_ci 3195bd8deadSopenharmony_ci with <target> set to TRANSFORM_FEEDBACK_BUFFER_EXT. There is an array of 3205bd8deadSopenharmony_ci buffer object binding points that are used while transform feedback is 3215bd8deadSopenharmony_ci active, plus a single general binding point that can be used by other 3225bd8deadSopenharmony_ci buffer object manipulation functions (e.g., BindBuffer, MapBuffer). All 3235bd8deadSopenharmony_ci three commands bind the buffer object named by <buffer> to the general 3245bd8deadSopenharmony_ci binding point, and additionally bind the buffer object to the binding 3255bd8deadSopenharmony_ci point in the array given by <index>. The error INVALID_VALUE is generated 3265bd8deadSopenharmony_ci if <index> is greater than or equal to the value of 3275bd8deadSopenharmony_ci MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT. 3285bd8deadSopenharmony_ci 3295bd8deadSopenharmony_ci For BindBufferRangeEXT, <offset> specifies a starting offset into the 3305bd8deadSopenharmony_ci buffer object <buffer> and <size> specifies the amount of data that can be 3315bd8deadSopenharmony_ci written to the buffer object while transform feedback mode is active. 3325bd8deadSopenharmony_ci Both <offset> and <size> are in basic machine units. The error 3335bd8deadSopenharmony_ci INVALID_VALUE is generated if the value of <size> is less than or equal to 3345bd8deadSopenharmony_ci zero, or if either <offset> or <size> are not word-aligned. Calling 3355bd8deadSopenharmony_ci BindBufferOffsetEXT is equivalent of calling BindBufferRangeEXT with 3365bd8deadSopenharmony_ci <size> = sizeof(buffer) - <offset>, and rounding <size> down so that it is 3375bd8deadSopenharmony_ci word-aligned. BindBufferBaseEXT is equivalent to calling 3385bd8deadSopenharmony_ci BindBufferOffsetEXT with an <offset> of 0. 3395bd8deadSopenharmony_ci 3405bd8deadSopenharmony_ci When an individual point, line, or triangle primitive reaches the 3415bd8deadSopenharmony_ci transform feedback stage while transform feedback is active, the values of 3425bd8deadSopenharmony_ci the specified varying variables of the vertex are appended to the buffer 3435bd8deadSopenharmony_ci objects bound to the transform feedback binding points. The attributes of 3445bd8deadSopenharmony_ci the first vertex received after BeginTransformFeedbackEXT are written at 3455bd8deadSopenharmony_ci the starting offsets of the bound buffer objects set by 3465bd8deadSopenharmony_ci BindBufferRangeEXT, and subsequent vertex attributes are appended to the 3475bd8deadSopenharmony_ci buffer object. When capturing line and triangle primitives, all 3485bd8deadSopenharmony_ci attributes of the first vertex are written first, followed by attributes 3495bd8deadSopenharmony_ci of the subsequent vertices. When writing varying variables that are 3505bd8deadSopenharmony_ci arrays, individual array elements are written in order. For 3515bd8deadSopenharmony_ci multi-component varying variables or varying array elements, the 3525bd8deadSopenharmony_ci individual components are written in order. The value for any attribute 3535bd8deadSopenharmony_ci specified to be streamed to a buffer object but not actually written by a 3545bd8deadSopenharmony_ci vertex or geometry shader is undefined. 3555bd8deadSopenharmony_ci 3565bd8deadSopenharmony_ci When quads and polygons are provided to transform feedback with a 3575bd8deadSopenharmony_ci primitive mode of TRIANGLES, they will be tessellated and recorded as 3585bd8deadSopenharmony_ci triangles (the order of tessellation within a primitive is undefined). 3595bd8deadSopenharmony_ci Individual lines or triangles of a strip or fan primitive will be 3605bd8deadSopenharmony_ci extracted and recorded separately. Incomplete primitives are not recorded. 3615bd8deadSopenharmony_ci 3625bd8deadSopenharmony_ci Transform feedback can operate in either INTERLEAVED_ATTRIBS_EXT or 3635bd8deadSopenharmony_ci SEPARATE_ATTRIBS_EXT mode. In INTERLEAVED_ATTRIBS_EXT mode, the values of 3645bd8deadSopenharmony_ci one or more varyings are written, interleaved, into the buffer object 3655bd8deadSopenharmony_ci bound to the first transform feedback binding point (index = 0). If more 3665bd8deadSopenharmony_ci than one varying variable is written, they will be recorded in the order 3675bd8deadSopenharmony_ci specified by TransformFeedbackVaryingsEXT (section 2.15.3). In 3685bd8deadSopenharmony_ci SEPARATE_ATTRIBS_EXT mode, the first varying variable specified by 3695bd8deadSopenharmony_ci TransformFeedbackVaryingsEXT is written to the first transform feedback 3705bd8deadSopenharmony_ci binding point; subsequent varying variables are written to the subsequent 3715bd8deadSopenharmony_ci transform feedback binding points. The total number of variables that may 3725bd8deadSopenharmony_ci be captured in separate mode is given by 3735bd8deadSopenharmony_ci MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT. 3745bd8deadSopenharmony_ci 3755bd8deadSopenharmony_ci If recording the vertices of a primitive to the buffer objects being used 3765bd8deadSopenharmony_ci for transform feedback purposes would result in either exceeding the 3775bd8deadSopenharmony_ci limits of any buffer object's size, or in exceeding the end position 3785bd8deadSopenharmony_ci <offset> + <size> - 1, as set by BindBufferRangeEXT, then no vertices of 3795bd8deadSopenharmony_ci that primitive are recorded in any buffer object, and the counter 3805bd8deadSopenharmony_ci corresponding to the asynchronous query target 3815bd8deadSopenharmony_ci TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT (see Section 2.Z) is not 3825bd8deadSopenharmony_ci incremented. 3835bd8deadSopenharmony_ci 3845bd8deadSopenharmony_ci In either separate or interleaved modes, all transform feedback binding 3855bd8deadSopenharmony_ci points that will be written to must have buffer objects bound when 3865bd8deadSopenharmony_ci BeginTransformFeedbackEXT is called. The error INVALID_OPERATION is 3875bd8deadSopenharmony_ci generated by BeginTransformFeedbackEXT if any binding point used in 3885bd8deadSopenharmony_ci transform feedback mode does not have a buffer object bound. In 3895bd8deadSopenharmony_ci interleaved mode, only the first buffer object binding point is ever 3905bd8deadSopenharmony_ci written to. The error INVALID_OPERATION is also generated by 3915bd8deadSopenharmony_ci BeginTransformFeedbackEXT if no binding points would be used, either 3925bd8deadSopenharmony_ci because no program object is active or because the active program object 3935bd8deadSopenharmony_ci has specified no varying variables to record. 3945bd8deadSopenharmony_ci 3955bd8deadSopenharmony_ci While transform feedback is active, the set of attached buffer objects and 3965bd8deadSopenharmony_ci the set of varying variables captured may not be changed. If transform 3975bd8deadSopenharmony_ci feedback is active, the error INVALID_OPERATION is generated by 3985bd8deadSopenharmony_ci UseProgram, by LinkProgram if <program> is the currently active program 3995bd8deadSopenharmony_ci object, and by BindBufferRangeEXT, BindBufferOffsetEXT, or 4005bd8deadSopenharmony_ci BindBufferBaseEXT if <target> is TRANSFORM_FEEDBACK_BUFFER_EXT. 4015bd8deadSopenharmony_ci 4025bd8deadSopenharmony_ci 4035bd8deadSopenharmony_ci Section 2.Z, Primitive Queries 4045bd8deadSopenharmony_ci 4055bd8deadSopenharmony_ci Primitive queries use query objects to track the number of primitives 4065bd8deadSopenharmony_ci generated by the GL and to track the number of primitives written to 4075bd8deadSopenharmony_ci transform feedback buffers. 4085bd8deadSopenharmony_ci 4095bd8deadSopenharmony_ci When BeginQuery is called with a <target> of PRIMITIVES_GENERATED_EXT, the 4105bd8deadSopenharmony_ci primitives-generated count maintained by the GL is set to zero. When the 4115bd8deadSopenharmony_ci generated primitive query is active, the primitives-generated count is 4125bd8deadSopenharmony_ci incremented every time a primitive reaches the Discarding Rasterization 4135bd8deadSopenharmony_ci stage (see Section 3.x) right before rasterization. This counter counts 4145bd8deadSopenharmony_ci the number of primitives emitted by a geometry shader, if active, possibly 4155bd8deadSopenharmony_ci further tessellated into separate primitives during the transform-feedback 4165bd8deadSopenharmony_ci stage, if active. 4175bd8deadSopenharmony_ci 4185bd8deadSopenharmony_ci When BeginQuery is called with a <target> of 4195bd8deadSopenharmony_ci TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT, the transform-feedback- 4205bd8deadSopenharmony_ci primitives-written count maintained by the GL is set to zero. When the 4215bd8deadSopenharmony_ci transform feedback primitive written query is active, the 4225bd8deadSopenharmony_ci transform-feedback-primitives-written count is incremented every time a 4235bd8deadSopenharmony_ci primitive is recorded into a buffer object. If transform feedback is not 4245bd8deadSopenharmony_ci active, this counter is not incremented. If the primitive does not fit in 4255bd8deadSopenharmony_ci the buffer object, the counter is not incremented. 4265bd8deadSopenharmony_ci 4275bd8deadSopenharmony_ci These two queries can be used together to determine if all primitives have 4285bd8deadSopenharmony_ci been written to the bound feedback buffers; if both queries are run 4295bd8deadSopenharmony_ci simultaneously and the query results are equal, all primitives have been 4305bd8deadSopenharmony_ci written to the buffer(s). If the number of primitives written is less than 4315bd8deadSopenharmony_ci the number of primitives generated, the buffer is full. 4325bd8deadSopenharmony_ci 4335bd8deadSopenharmony_ci 4345bd8deadSopenharmony_ci Modify Section 2.15.3 "Shader Variables", p. 75. 4355bd8deadSopenharmony_ci 4365bd8deadSopenharmony_ci Change the second sentence in the first paragraph on p. 84 as follows: 4375bd8deadSopenharmony_ci 4385bd8deadSopenharmony_ci . . . written by a vertex shader, read by a fragment shader, or used for 4395bd8deadSopenharmony_ci transform feedback will count against this limit. The transformed vertex 4405bd8deadSopenharmony_ci position (gl_Position) does not count against this limit. ... 4415bd8deadSopenharmony_ci 4425bd8deadSopenharmony_ci Add the following language to the end of section 2.15.3 (p.84): 4435bd8deadSopenharmony_ci 4445bd8deadSopenharmony_ci Each program object can specify one or more varying variables to be 4455bd8deadSopenharmony_ci recorded in transform feedback mode. This set is specified by the command 4465bd8deadSopenharmony_ci 4475bd8deadSopenharmony_ci void TransformFeedbackVaryingsEXT(uint program, sizei count, 4485bd8deadSopenharmony_ci const char * const *varyings, 4495bd8deadSopenharmony_ci enum bufferMode) 4505bd8deadSopenharmony_ci 4515bd8deadSopenharmony_ci <program> specifies the program object. <count> specifies the number of 4525bd8deadSopenharmony_ci varying variables used for transform feedback. <varyings> is an array of 4535bd8deadSopenharmony_ci <count> zero-terminated strings specifying the names of the varying 4545bd8deadSopenharmony_ci variables to use for transform feedback. The varying variables specified 4555bd8deadSopenharmony_ci in <varyings> can be either built-in varying variables (beginning with 4565bd8deadSopenharmony_ci "gl_") or user-defined ones. varying variables are written out in the 4575bd8deadSopenharmony_ci order they appear in the array <varyings>. <bufferMode> is either 4585bd8deadSopenharmony_ci INTERLEAVED_ATTRIBS_EXT or SEPARATE_ATTRIBS_EXT, and identifies the mode 4595bd8deadSopenharmony_ci used to capture the varying variables when transform feedback is active. 4605bd8deadSopenharmony_ci The error INVALID_VALUE is generated if <program> is not the name of a 4615bd8deadSopenharmony_ci program object, or if <bufferMode> is SEPARATE_ATTRIBS_EXT and <count> is 4625bd8deadSopenharmony_ci greater than the implement-dependent limit 4635bd8deadSopenharmony_ci MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT. 4645bd8deadSopenharmony_ci 4655bd8deadSopenharmony_ci The state set by TransformFeedbackVaryingsEXT has no effect on the 4665bd8deadSopenharmony_ci execution of the program until <program> is subsequently linked. When 4675bd8deadSopenharmony_ci LinkProgram is called, the program is linked so that the values of the 4685bd8deadSopenharmony_ci specified varying variables for the vertices of each primitive generated 4695bd8deadSopenharmony_ci by the GL are written to a single buffer object (if the buffer mode is 4705bd8deadSopenharmony_ci INTERLEAVED_ATTRIBS_EXT) or multiple buffer objects (if the buffer mode is 4715bd8deadSopenharmony_ci SEPARATE_ATTRIBS_EXT). A program will fail to link if: 4725bd8deadSopenharmony_ci 4735bd8deadSopenharmony_ci * the <count> specified by TransformFeedbackVaryingsEXT is non-zero, but 4745bd8deadSopenharmony_ci the program object has no vertex or geometry shader; 4755bd8deadSopenharmony_ci 4765bd8deadSopenharmony_ci * any variable name specified in the <varyings> array is not declared as 4775bd8deadSopenharmony_ci an output in the geometry shader (if present) or the vertex shader (if 4785bd8deadSopenharmony_ci no geometry shader is present); 4795bd8deadSopenharmony_ci 4805bd8deadSopenharmony_ci * any two entries in the <varyings> array specify the same varying 4815bd8deadSopenharmony_ci variable; 4825bd8deadSopenharmony_ci 4835bd8deadSopenharmony_ci * the total number of components to capture in any varying variable in 4845bd8deadSopenharmony_ci <varyings> is greater than the constant 4855bd8deadSopenharmony_ci MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT and the buffer mode is 4865bd8deadSopenharmony_ci SEPARATE_ATTRIBS_EXT; or 4875bd8deadSopenharmony_ci 4885bd8deadSopenharmony_ci * the total number of components to capture is greater than the constant 4895bd8deadSopenharmony_ci MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT and the buffer mode 4905bd8deadSopenharmony_ci is INTERLEAVED_ATTRIBS_EXT. 4915bd8deadSopenharmony_ci 4925bd8deadSopenharmony_ci To determine the set of varying variables in a linked program object that 4935bd8deadSopenharmony_ci will be captured in transform feedback mode, use the command: 4945bd8deadSopenharmony_ci 4955bd8deadSopenharmony_ci void GetTransformFeedbackVaryingEXT(uint program, uint index, 4965bd8deadSopenharmony_ci sizei bufSize, sizei *length, 4975bd8deadSopenharmony_ci sizei *size, enum *type, 4985bd8deadSopenharmony_ci char *name); 4995bd8deadSopenharmony_ci 5005bd8deadSopenharmony_ci This command provides information about the varying variable selected by 5015bd8deadSopenharmony_ci <index>. An <index> of 0 selects the first varying variable specified in 5025bd8deadSopenharmony_ci the <varyings> array of TransformFeedbackVaryingsEXT, and an <index> of 5035bd8deadSopenharmony_ci TRANSFORM_FEEDBACK_VARYINGS_EXT-1 selects the last such varying variable. 5045bd8deadSopenharmony_ci The value of TRANSFORM_FEEDBACK_VARYINGS_EXT can be queried with 5055bd8deadSopenharmony_ci GetProgramiv (see section 6.1.14). If <index> is greater than or equal to 5065bd8deadSopenharmony_ci TRANSFORM_FEEDBACK_VARYINGS_EXT, the error INVALID_VALUE is generated. 5075bd8deadSopenharmony_ci The parameter <program> is the name of a program object for which the 5085bd8deadSopenharmony_ci command LinkProgram has been issued in the past. If a new set of varying 5095bd8deadSopenharmony_ci variables is specified by TransformFeedbackVaryingsEXT after a program 5105bd8deadSopenharmony_ci object has been linked, the information returned by 5115bd8deadSopenharmony_ci GetTransformFeedbackVaryingEXT will not reflect those variables until the 5125bd8deadSopenharmony_ci program is re-linked. 5135bd8deadSopenharmony_ci 5145bd8deadSopenharmony_ci The name of the selected varying is returned as a null-terminated string 5155bd8deadSopenharmony_ci in <name>. The actual number of characters written into <name>, excluding 5165bd8deadSopenharmony_ci the null terminator, is returned in <length>. If <length> is NULL, no 5175bd8deadSopenharmony_ci length is returned. The maximum number of characters that may be written 5185bd8deadSopenharmony_ci into <name>, including the null terminator, is specified by <bufSize>. The 5195bd8deadSopenharmony_ci returned varying name can be the name of a user defined varying variable 5205bd8deadSopenharmony_ci or the name of a built- in varying (which begin with the prefix "gl_", see 5215bd8deadSopenharmony_ci the OpenGL Shading Language specification for a complete list). The length 5225bd8deadSopenharmony_ci of the longest varying name in program is given by 5235bd8deadSopenharmony_ci TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT, which can be queried with 5245bd8deadSopenharmony_ci GetProgramiv (see section 6.1.14). 5255bd8deadSopenharmony_ci 5265bd8deadSopenharmony_ci For the selected varying variable, its type is returned into <type>. The 5275bd8deadSopenharmony_ci size of the varying is returned into <size>. The value in <size> is in 5285bd8deadSopenharmony_ci units of the type returned in <type>. The type returned can be any of 5295bd8deadSopenharmony_ci FLOAT, FLOAT_VEC2, FLOAT_VEC3, FLOAT_VEC4, INT, INT_VEC2, INT_VEC3, 5305bd8deadSopenharmony_ci INT_VEC4, UNSIGNED_INT, UNSIGNED_INT_VEC2_EXT, UNSIGNED_INT_VEC3_EXT, 5315bd8deadSopenharmony_ci UNSIGNED_INT_VEC4_EXT, FLOAT_MAT2, FLOAT_MAT3, or FLOAT_MAT4. If an error 5325bd8deadSopenharmony_ci occurred, the return parameters <length>, <size>, <type> and <name> will 5335bd8deadSopenharmony_ci be unmodified. This command will return as much information about the 5345bd8deadSopenharmony_ci varying variables as possible. If no information is available, <length> 5355bd8deadSopenharmony_ci will be set to zero and <name> will be an empty string. This situation 5365bd8deadSopenharmony_ci could arise if GetTransformFeedbackVaryingEXT is called after a failed 5375bd8deadSopenharmony_ci link. 5385bd8deadSopenharmony_ci 5395bd8deadSopenharmony_ci 5405bd8deadSopenharmony_ciAdditions to Chapter 3 of the OpenGL 2.0 Specification (Rasterization) 5415bd8deadSopenharmony_ci 5425bd8deadSopenharmony_ci (Add new section 3.X, Discarding Rasterization) 5435bd8deadSopenharmony_ci 5445bd8deadSopenharmony_ci Primitives can be optionally discarded before rasterization by calling 5455bd8deadSopenharmony_ci Enable and Disable with RASTERIZER_DISCARD_EXT. When enabled, primitives 5465bd8deadSopenharmony_ci are discared right before the rasterization stage, but after the optional 5475bd8deadSopenharmony_ci transform feedback stage. When disabled, primitives are passed through to 5485bd8deadSopenharmony_ci the rasterization stage to be processed normally. RASTERIZER_DISCARD_EXT 5495bd8deadSopenharmony_ci applies to the DrawPixels, CopyPixels, Bitmap, Clear and Accum commands as 5505bd8deadSopenharmony_ci well. 5515bd8deadSopenharmony_ci 5525bd8deadSopenharmony_ci 5535bd8deadSopenharmony_ciAdditions to Chapter 4 of the OpenGL 2.0 Specification (Per-Fragment 5545bd8deadSopenharmony_ciOperations and the Frame Buffer) 5555bd8deadSopenharmony_ci 5565bd8deadSopenharmony_ci (Replace section 4.1.7, "Occlusion Queries", p. 204, with the following) 5575bd8deadSopenharmony_ci 5585bd8deadSopenharmony_ci Occlusion queries use query objects to track the number of fragments or 5595bd8deadSopenharmony_ci samples that pass the depth test. An occlusion query can be started and 5605bd8deadSopenharmony_ci finished by calling BeginQuery and EndQuery, respectively, with a <target> 5615bd8deadSopenharmony_ci of SAMPLES_PASSED. 5625bd8deadSopenharmony_ci 5635bd8deadSopenharmony_ci When an occlusion query starts, the samples-passed count maintained by the 5645bd8deadSopenharmony_ci GL is set to zero. When an occlusion query is active, the samples-passed 5655bd8deadSopenharmony_ci count is incremented for each fragment that passes the depth test. If the 5665bd8deadSopenharmony_ci value of SAMPLE BUFFERS is 0, then the samples- passed count is 5675bd8deadSopenharmony_ci incremented by 1 for each fragment. If the value of SAMPLE BUFFERS is 1, 5685bd8deadSopenharmony_ci then the samples-passed count is incremented by the number of samples 5695bd8deadSopenharmony_ci whose coverage bit is set. However, implementations, at their discretion, 5705bd8deadSopenharmony_ci may instead increase the samples-passed count by the value of SAMPLES if 5715bd8deadSopenharmony_ci any sample in the fragment is covered. When an occlusion query finishes 5725bd8deadSopenharmony_ci and all fragments generated by the commands issued prior to EndQuery have 5735bd8deadSopenharmony_ci been generated, the samples-passed count is written to the corresponding 5745bd8deadSopenharmony_ci query object as the query result value, and the query result for that 5755bd8deadSopenharmony_ci object is marked as available. 5765bd8deadSopenharmony_ci 5775bd8deadSopenharmony_ci If the samples-passed count overflows, (i.e., exceeds the value 2^n - 1, 5785bd8deadSopenharmony_ci where n is the number of bits in the samples-passed count), its value 5795bd8deadSopenharmony_ci becomes undefined. It is recommended, but not required, that 5805bd8deadSopenharmony_ci implementations handle this overflow case by saturating at 2^n - 1 and 5815bd8deadSopenharmony_ci incrementing no further. 5825bd8deadSopenharmony_ci 5835bd8deadSopenharmony_ci 5845bd8deadSopenharmony_ciAdditions to Chapter 5 of the OpenGL 2.0 Specification (Special Functions) 5855bd8deadSopenharmony_ci 5865bd8deadSopenharmony_ci (Add to section 5.4, Display Lists p. 237) 5875bd8deadSopenharmony_ci 5885bd8deadSopenharmony_ci On p. 241, add the following to the list of vertex buffer object commands 5895bd8deadSopenharmony_ci not compiled into a display list: BindBufferRangeEXT, BindBufferOffsetEXT, 5905bd8deadSopenharmony_ci BindBufferBaseEXT, and TransformFeedbackVaryingsEXT. 5915bd8deadSopenharmony_ci 5925bd8deadSopenharmony_ci 5935bd8deadSopenharmony_ciAdditions to Chapter 6 of the OpenGL 2.0 Specification (State and State 5945bd8deadSopenharmony_ciRequests) 5955bd8deadSopenharmony_ci 5965bd8deadSopenharmony_ci Modify the second paragraph of section 6.1.1 (Simple Queries) p244 to read 5975bd8deadSopenharmony_ci as follows: 5985bd8deadSopenharmony_ci 5995bd8deadSopenharmony_ci ...<data> is a pointer to a scalar or array of the indicated type in which 6005bd8deadSopenharmony_ci to place the returned data. The commands 6015bd8deadSopenharmony_ci 6025bd8deadSopenharmony_ci void GetIntegerIndexedvEXT(enum param, uint index, int *values); 6035bd8deadSopenharmony_ci void GetBooleanIndexedvEXT(enum param, uint index, boolean *values); 6045bd8deadSopenharmony_ci 6055bd8deadSopenharmony_ci are used to query indexed state. <target> is the name of the indexed 6065bd8deadSopenharmony_ci state and <index> is the index of the particular element being queried. 6075bd8deadSopenharmony_ci <data> is a pointer to a scalar or array of the indicated type in which to 6085bd8deadSopenharmony_ci place the returned data. In addition ... 6095bd8deadSopenharmony_ci 6105bd8deadSopenharmony_ci (Replace Section 6.1.12, Occlusion Queries, p. 254) 6115bd8deadSopenharmony_ci 6125bd8deadSopenharmony_ci Section 6.1.12, Asynchronous Queries 6135bd8deadSopenharmony_ci 6145bd8deadSopenharmony_ci The command 6155bd8deadSopenharmony_ci 6165bd8deadSopenharmony_ci boolean IsQuery(uint id); 6175bd8deadSopenharmony_ci 6185bd8deadSopenharmony_ci returns TRUE if <id> is the name of a query object. If <id> is zero, or if 6195bd8deadSopenharmony_ci <id> is a non-zero value that is not the name of a query object, IsQuery 6205bd8deadSopenharmony_ci returns FALSE. 6215bd8deadSopenharmony_ci 6225bd8deadSopenharmony_ci Information about a query target can be queried with the command 6235bd8deadSopenharmony_ci 6245bd8deadSopenharmony_ci void GetQueryiv(enum target, enum pname, int *params); 6255bd8deadSopenharmony_ci 6265bd8deadSopenharmony_ci <target> identifies the query target and can be SAMPLES_PASSED for 6275bd8deadSopenharmony_ci occlusion queries or PRIMITIVES_GENERATED_EXT and 6285bd8deadSopenharmony_ci TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT for primitive queries. 6295bd8deadSopenharmony_ci 6305bd8deadSopenharmony_ci If <pname> is CURRENT_QUERY, the name of the currently active query for 6315bd8deadSopenharmony_ci <target>, or zero if no query is active, will be placed in <params>. 6325bd8deadSopenharmony_ci 6335bd8deadSopenharmony_ci If <pname> is QUERY_COUNTER_BITS, the implementation-dependent number of 6345bd8deadSopenharmony_ci bits used to hold the query result for <target> will be placed in 6355bd8deadSopenharmony_ci params. The number of query counter bits may be zero, in which case the 6365bd8deadSopenharmony_ci counter contains no useful information. 6375bd8deadSopenharmony_ci 6385bd8deadSopenharmony_ci For primitive queries (PRIMITIVES_GENERATED_EXT and 6395bd8deadSopenharmony_ci TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT) if the number of bits is 6405bd8deadSopenharmony_ci non-zero, the minimum number of bits allowed is 32. 6415bd8deadSopenharmony_ci 6425bd8deadSopenharmony_ci For occlusion queries (SAMPLES_PASSED), if the number of bits is non- 6435bd8deadSopenharmony_ci zero, the minimum number of bits allowed is a function of the 6445bd8deadSopenharmony_ci implementation's maximum viewport dimensions (MAX_VIEWPORT_DIMS). The 6455bd8deadSopenharmony_ci counter must be able to represent at least two overdraws for every pixel 6465bd8deadSopenharmony_ci in the viewport. The formula to compute the allowable minimum value (where 6475bd8deadSopenharmony_ci n is the minimum number of bits) is: 6485bd8deadSopenharmony_ci 6495bd8deadSopenharmony_ci n = min(32, ceil(log_2(maxViewportWidth * 6505bd8deadSopenharmony_ci maxViewportHeight * 2))). 6515bd8deadSopenharmony_ci 6525bd8deadSopenharmony_ci The state of a query object can be queried with the commands 6535bd8deadSopenharmony_ci 6545bd8deadSopenharmony_ci void GetQueryObjectiv(uint id, enum pname, int *params); 6555bd8deadSopenharmony_ci void GetQueryObjectuiv(uint id, enum pname, uint *params); 6565bd8deadSopenharmony_ci 6575bd8deadSopenharmony_ci If <id> is not the name of a query object, or if the query object named by 6585bd8deadSopenharmony_ci <id> is currently active, then an INVALID_OPERATION error is generated. 6595bd8deadSopenharmony_ci 6605bd8deadSopenharmony_ci If <pname> is QUERY_RESULT, then the query object's result value is 6615bd8deadSopenharmony_ci returned as a single integer in <params>. If the value is so large in 6625bd8deadSopenharmony_ci magnitude that it cannot be represented with the requested type, then the 6635bd8deadSopenharmony_ci nearest value representable using the requested type is returned. If the 6645bd8deadSopenharmony_ci number of query counter bits for any <target> is zero, then the result is 6655bd8deadSopenharmony_ci returned as a single integer with a value of 0. 6665bd8deadSopenharmony_ci 6675bd8deadSopenharmony_ci There may be an indeterminate delay before the above query returns. If 6685bd8deadSopenharmony_ci <pname> is QUERY_RESULT_AVAILABLE, FALSE is returned if such a delay would 6695bd8deadSopenharmony_ci be required, TRUE is returned otherwise. It must always be true that if 6705bd8deadSopenharmony_ci any query object returns a result available of TRUE, all queries of the 6715bd8deadSopenharmony_ci same type issued prior to that query must also return TRUE. 6725bd8deadSopenharmony_ci 6735bd8deadSopenharmony_ci Querying the state for any given query object forces the corresponding 6745bd8deadSopenharmony_ci query to complete within a finite amount of time. 6755bd8deadSopenharmony_ci 6765bd8deadSopenharmony_ci If multiple queries are issued using the same object name prior to calling 6775bd8deadSopenharmony_ci GetQueryObject[u]iv, the result and availability information returned will 6785bd8deadSopenharmony_ci always be from the last query issued. The results from any queries before 6795bd8deadSopenharmony_ci the last one will be lost if they are not retrieved before starting a new 6805bd8deadSopenharmony_ci query on the same <target> and <id>. 6815bd8deadSopenharmony_ci 6825bd8deadSopenharmony_ci 6835bd8deadSopenharmony_ci (Add to Section 6.1.13, Buffer Objects, p. 255) 6845bd8deadSopenharmony_ci 6855bd8deadSopenharmony_ci Add the following paragraph to the bottom of this section, p. 256. 6865bd8deadSopenharmony_ci 6875bd8deadSopenharmony_ci To query which buffer objects are bound to the array of transform feedback 6885bd8deadSopenharmony_ci binding points and will be used when transform feedback is active, call 6895bd8deadSopenharmony_ci GetIntegerIndexedvEXT() with <param> set to 6905bd8deadSopenharmony_ci TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT. <index> has to be in the range 0 6915bd8deadSopenharmony_ci to MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT - 1, otherwise the error 6925bd8deadSopenharmony_ci INVALID_VALUE is generated. The name of the buffer object bound to <index> 6935bd8deadSopenharmony_ci is returned in <values>. If no buffer object is bound for <index>, zero is 6945bd8deadSopenharmony_ci returned in <values>. 6955bd8deadSopenharmony_ci 6965bd8deadSopenharmony_ci To query the starting offset or size of the range of each buffer object 6975bd8deadSopenharmony_ci binding used for transform feedback, call GetIntegerIndexedvEXT() with 6985bd8deadSopenharmony_ci <param> set to TRANSFORM_FEEDBACK_BUFFER_START_EXT or 6995bd8deadSopenharmony_ci TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT respectively. The error INVALID_VALUE 7005bd8deadSopenharmony_ci is generated if <index> not in the range 0 to 7015bd8deadSopenharmony_ci MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT - 1. If the parameter 7025bd8deadSopenharmony_ci (starting offset or size) was not specified when the buffer object was 7035bd8deadSopenharmony_ci bound, or if no buffer object is bound to <index>, zero is returned. 7045bd8deadSopenharmony_ci 7055bd8deadSopenharmony_ci (add to Section 6.1.14, Shader and Program Queries, p. 256) 7065bd8deadSopenharmony_ci 7075bd8deadSopenharmony_ci Add the following paragraph to the bottom of page 257: 7085bd8deadSopenharmony_ci 7095bd8deadSopenharmony_ci If <pname> is TRANSFORM_FEEDBACK_BUFFER_MODE_EXT, the buffer mode, used 7105bd8deadSopenharmony_ci when transform feedback is active, is returned. It can be one of 7115bd8deadSopenharmony_ci SEPARATE_ATTRIBS_EXT or INTERLEAVED_ATTRIBS_EXT. If <pname> is 7125bd8deadSopenharmony_ci TRANSFORM_FEEDBACK_VARINGS_EXT, the number of varying variables to capture 7135bd8deadSopenharmony_ci in transform feedback mode for the program is returned. If <pname> is 7145bd8deadSopenharmony_ci TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH, the length of the longest varying 7155bd8deadSopenharmony_ci name specified to be used for transform feedback, including a null 7165bd8deadSopenharmony_ci terminator, is returned. If no varyings are used for transform feedback, 7175bd8deadSopenharmony_ci zero is returned. 7185bd8deadSopenharmony_ci 7195bd8deadSopenharmony_ciAdditions to Appendix A of the OpenGL 2.0 Specification (Invariance) 7205bd8deadSopenharmony_ci 7215bd8deadSopenharmony_ci None. 7225bd8deadSopenharmony_ci 7235bd8deadSopenharmony_ciAdditions to the AGL/GLX/WGL Specifications 7245bd8deadSopenharmony_ci 7255bd8deadSopenharmony_ci None. 7265bd8deadSopenharmony_ci 7275bd8deadSopenharmony_ciGLX Protocol 7285bd8deadSopenharmony_ci 7295bd8deadSopenharmony_ci UNDER DEVELOPMENT 7305bd8deadSopenharmony_ci 7315bd8deadSopenharmony_ciInteractions with NV_transform_feedback 7325bd8deadSopenharmony_ci 7335bd8deadSopenharmony_ci NV_transform_feedback is the initial version of this extension, which 7345bd8deadSopenharmony_ci includes three capabilities not provided here: 7355bd8deadSopenharmony_ci 7365bd8deadSopenharmony_ci * support for transform feedback with assembly vertex/geometry programs 7375bd8deadSopenharmony_ci and fixed-function vertex processing; 7385bd8deadSopenharmony_ci 7395bd8deadSopenharmony_ci * the ability to change the set of GLSL varying variables to capture in 7405bd8deadSopenharmony_ci transform feedback mode without re-linking; and 7415bd8deadSopenharmony_ci 7425bd8deadSopenharmony_ci * the "active varying" API that enumerates all varying variables in a 7435bd8deadSopenharmony_ci program object that are considered active. 7445bd8deadSopenharmony_ci 7455bd8deadSopenharmony_ci This extension provides one capability not provided by 7465bd8deadSopenharmony_ci NV_transform_feedback -- the ability and requirement to specify the set of 7475bd8deadSopenharmony_ci varying variables used for transform feedback prior to linking. 7485bd8deadSopenharmony_ci 7495bd8deadSopenharmony_ci If both extensions are supported, the following happens: 7505bd8deadSopenharmony_ci 7515bd8deadSopenharmony_ci * When a program is linked, the active varying state defined in the NV 7525bd8deadSopenharmony_ci extension is updated. For the purposes of this API, any variables 7535bd8deadSopenharmony_ci enabled for transform feedback via TransformFeedbackVaryingsEXT() are 7545bd8deadSopenharmony_ci considered active. 7555bd8deadSopenharmony_ci 7565bd8deadSopenharmony_ci * When a program is linked, the transform feedback configuration is 7575bd8deadSopenharmony_ci built from the state provided by TransformFeedbackVaryingsEXT() as in 7585bd8deadSopenharmony_ci the current extension. In terms of the NV extension, it is as though 7595bd8deadSopenharmony_ci the linker had queried the locations of each varying specified in 7605bd8deadSopenharmony_ci TransformFeedbackVaryingsEXT() and then called the 7615bd8deadSopenharmony_ci TransformFeedbackVaryingsNV() to update the transform feedback 7625bd8deadSopenharmony_ci configuration post-link. If no varying variables were specified by 7635bd8deadSopenharmony_ci TransformFeedbackVaryingsEXT(), the transform feedback configuration 7645bd8deadSopenharmony_ci is reset to an empty default state after linking, just as is always 7655bd8deadSopenharmony_ci the case when using the NV extension alone. 7665bd8deadSopenharmony_ci 7675bd8deadSopenharmony_ci * Calling TransformFeedbackVaryingsNV() after linking allows an 7685bd8deadSopenharmony_ci application to update the transform feedback state post-link. Any 7695bd8deadSopenharmony_ci transform feedback state set when a program is linked is replaced with 7705bd8deadSopenharmony_ci the state specified by TransformFeedbackVaryingsNV(). 7715bd8deadSopenharmony_ci 7725bd8deadSopenharmony_ci * Calling TransformFeedbackVaryingsEXT() after linking continues to have 7735bd8deadSopenharmony_ci no effect. 7745bd8deadSopenharmony_ci 7755bd8deadSopenharmony_ci * The EXT and NV versions of all functions defined in both extension, 7765bd8deadSopenharmony_ci other than TransformFeedbackVaryings*(), operate identically. 7775bd8deadSopenharmony_ci 7785bd8deadSopenharmony_ci * BeginTransformFeedbackEXT() does not require the use of a GLSL program 7795bd8deadSopenharmony_ci object if both extensions are supported. If no GLSL program object is 7805bd8deadSopenharmony_ci active, transform feedback is still enabled and captures the 7815bd8deadSopenharmony_ci attributes specified by TransformFeedbackAttribsNV(). 7825bd8deadSopenharmony_ci 7835bd8deadSopenharmony_ci 7845bd8deadSopenharmony_ciInteractions with EXT_timer_query 7855bd8deadSopenharmony_ci 7865bd8deadSopenharmony_ci EXT_timer_query is the first extension to generalize the BeginQuery and 7875bd8deadSopenharmony_ci EndQuery mechanism introduced by ARB_occlusion_query and OpenGL 1.5 to 7885bd8deadSopenharmony_ci cover an additional query type. This extension is the second. This 7895bd8deadSopenharmony_ci extension is written against the OpenGL 2.0 specification and uses most of 7905bd8deadSopenharmony_ci the modifications in the EXT_timer_query specification. If 7915bd8deadSopenharmony_ci EXT_timer_query is supported, timer queries need to be added as a third 7925bd8deadSopenharmony_ci query type. 7935bd8deadSopenharmony_ci 7945bd8deadSopenharmony_ci 7955bd8deadSopenharmony_ciDependencies on EXT_geometry_shader4 7965bd8deadSopenharmony_ci 7975bd8deadSopenharmony_ci If EXT_geometry_shader4 is not supported, delete all references to 7985bd8deadSopenharmony_ci geometry shaders. 7995bd8deadSopenharmony_ci 8005bd8deadSopenharmony_ci 8015bd8deadSopenharmony_ciErrors 8025bd8deadSopenharmony_ci 8035bd8deadSopenharmony_ci The error INVALID_OPERATION is generated by BeginQuery if called with an 8045bd8deadSopenharmony_ci <id> of zero, if the active query object name for <target> is non- zero, 8055bd8deadSopenharmony_ci or if <id> is the active query object name for any query type. 8065bd8deadSopenharmony_ci 8075bd8deadSopenharmony_ci The error INVALID_OPERATION is generated by EndQuery if the active query 8085bd8deadSopenharmony_ci object name for <target> is zero. 8095bd8deadSopenharmony_ci 8105bd8deadSopenharmony_ci The error INVALID_OPERATION is generated if Begin, or any command that 8115bd8deadSopenharmony_ci performs an explicit Begin, is called when: 8125bd8deadSopenharmony_ci 8135bd8deadSopenharmony_ci * a geometry shader is not active and <mode> does not match the allowed 8145bd8deadSopenharmony_ci begin modes for the current transform feedback state as given by table 8155bd8deadSopenharmony_ci X.1. 8165bd8deadSopenharmony_ci 8175bd8deadSopenharmony_ci * a geometry shader is active and the output primitive type of the 8185bd8deadSopenharmony_ci geometry shader does not match the allowed begin modes for the current 8195bd8deadSopenharmony_ci transform feedback state as given by table X.1. 8205bd8deadSopenharmony_ci 8215bd8deadSopenharmony_ci The error INVALID_OPERATION is generated by BeginTransformFeedbackEXT if 8225bd8deadSopenharmony_ci any transform feedback buffer object binding point used in transform 8235bd8deadSopenharmony_ci feedback mode does not have a buffer object bound. 8245bd8deadSopenharmony_ci 8255bd8deadSopenharmony_ci The error INVALID_OPERATION is also generated by BeginTransformFeedbackEXT 8265bd8deadSopenharmony_ci if no binding points would be used, either because no program object is 8275bd8deadSopenharmony_ci active or because the active program object has specified no varying 8285bd8deadSopenharmony_ci variables to record. 8295bd8deadSopenharmony_ci 8305bd8deadSopenharmony_ci If transform feedback is active, the error INVALID_OPERATION is generated 8315bd8deadSopenharmony_ci by BeginTransformFeedbackEXT; UseProgram; LinkProgram if called on the 8325bd8deadSopenharmony_ci currently in use program object; and BindBufferRangeEXT, 8335bd8deadSopenharmony_ci BindBufferOffsetEXT, or BindBufferBaseEXT if <target> is 8345bd8deadSopenharmony_ci TRANSFORM_FEEDBACK_BUFFER_EXT. 8355bd8deadSopenharmony_ci 8365bd8deadSopenharmony_ci If transform feedback is inactive, the error INVALID_OPERATION is 8375bd8deadSopenharmony_ci generated by EndTransformFeedbackEXT. 8385bd8deadSopenharmony_ci 8395bd8deadSopenharmony_ci The error INVALID_VALUE is generated by BindBufferRangeEXT, 8405bd8deadSopenharmony_ci BindBufferOffsetEXT, or BindBufferBaseEXT if <index> is greater or equal 8415bd8deadSopenharmony_ci than MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT. 8425bd8deadSopenharmony_ci 8435bd8deadSopenharmony_ci The error INVALID_VALUE is generated by BindBufferRangeEXT if the value of 8445bd8deadSopenharmony_ci <size> is less than or equal to zero, or not word-aligned. 8455bd8deadSopenharmony_ci 8465bd8deadSopenharmony_ci The error INVALID_VALUE is generated by BindBufferRangeEXT or 8475bd8deadSopenharmony_ci BindBufferOffsetEXT if <offset> is not word-aligned. 8485bd8deadSopenharmony_ci 8495bd8deadSopenharmony_ci The error INVALID_VALUE is generated by TransformFeedbackVaryingsEXT 8505bd8deadSopenharmony_ci commands if <program> is not the name of a program object, or if 8515bd8deadSopenharmony_ci <bufferMode> is SEPARATE_ATTRIBS_EXT and <count> is greater than 8525bd8deadSopenharmony_ci MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT. 8535bd8deadSopenharmony_ci 8545bd8deadSopenharmony_ci The error INVALID_VALUE is generated by GetTransformFeedbackVaryingEXT if 8555bd8deadSopenharmony_ci <index> is greater than or equal to the value of 8565bd8deadSopenharmony_ci TRANSFORM_FEEDBACK_VARYINGS_EXT. 8575bd8deadSopenharmony_ci 8585bd8deadSopenharmony_ci The error INVALID_VALUE is generated by GetIntegerIndexedvEXT() or 8595bd8deadSopenharmony_ci GetBooleanIndexedvEXT() with <param> set to 8605bd8deadSopenharmony_ci TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT if <index> is greater than or equal 8615bd8deadSopenharmony_ci to MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT. 8625bd8deadSopenharmony_ci 8635bd8deadSopenharmony_ci 8645bd8deadSopenharmony_ciNew State 8655bd8deadSopenharmony_ci 8665bd8deadSopenharmony_ci (Add a new table: Table 6.X, Transform Feedback State) 8675bd8deadSopenharmony_ci 8685bd8deadSopenharmony_ci Get Value Type Get Command Init. Value Description Sec Attrib 8695bd8deadSopenharmony_ci ------------------ ------ -------------- ------------ ------------------------- ----- ------ 8705bd8deadSopenharmony_ci TRANSFORM_FEEDBACK_ Z+ GetIntegerv 0 Buffer object bound to 6.1.13 - 8715bd8deadSopenharmony_ci BUFFER_BINDING_EXT generic bind point for 8725bd8deadSopenharmony_ci transform feedback. 8735bd8deadSopenharmony_ci TRANSFORM_FEEDBACK_ nxZ+ GetInteger- 0 Buffer object bound to 6.1.13 - 8745bd8deadSopenharmony_ci BUFFER_BINDING_EXT IndexedvEXT each transform feedback 8755bd8deadSopenharmony_ci attribute stream. 8765bd8deadSopenharmony_ci TRANSFORM_FEEDBACK_ nxZ+ GetInteger- 0 Start offset of binding 6.1.13 - 8775bd8deadSopenharmony_ci BUFFER_START_EXT IndexedvEXT range for each transform 8785bd8deadSopenharmony_ci feedback attrib. stream 8795bd8deadSopenharmony_ci TRANSFORM_FEEDBACK_ nxZ+ GetInteger- 0 Size of binding range 6.1.13 - 8805bd8deadSopenharmony_ci BUFFER_SIZE_EXT IndexedvEXT for each transform 8815bd8deadSopenharmony_ci feedback attrib. stream 8825bd8deadSopenharmony_ci 8835bd8deadSopenharmony_ci (Modify Table 6.37, p 298, updating the query object state to cover 8845bd8deadSopenharmony_ci transform feedback.) 8855bd8deadSopenharmony_ci 8865bd8deadSopenharmony_ci Get Value Type Get Command Init. Value Description Sec Attribute 8875bd8deadSopenharmony_ci ---------------- ---- ---------------- ----------- ------------------------- ----- --------- 8885bd8deadSopenharmony_ci CURRENT_QUERY 3xZ+ GetQueryiv 0 Active query object name 2.X - 8895bd8deadSopenharmony_ci (occlusion, timer, xform 8905bd8deadSopenharmony_ci feedback) 8915bd8deadSopenharmony_ci 8925bd8deadSopenharmony_ci (Modify Table 6.29, p. 290, Program Object State. Add the following state.) 8935bd8deadSopenharmony_ci 8945bd8deadSopenharmony_ci Get Value Type Get Command Init. Value Description Sec Attribute 8955bd8deadSopenharmony_ci ---------------- ---- ------------ ----------- ------------------------- ----- --------- 8965bd8deadSopenharmony_ci TRANSFORM_FEEDBACK_ Z2 GetProgramiv INTERLEAVED_ Transform feedback mode 6.1.14 - 8975bd8deadSopenharmony_ci BUFFER_MODE_EXT ATTRIBS_EXT for the program 8985bd8deadSopenharmony_ci TRANSFORM_FEEDBACK_ Z+ GetProgramiv 0 Number of varyings to 6.1.14 - 8995bd8deadSopenharmony_ci VARYINGS_EXT stream to buffer object(s) 9005bd8deadSopenharmony_ci TRANSFORM_FEEDBACK_ Z+ GetProgramiv 0 Maximum transform feedback 6.1.14 - 9015bd8deadSopenharmony_ci VARYING_MAX_ varying name length 9025bd8deadSopenharmony_ci LENGTH_EXT 9035bd8deadSopenharmony_ci - Z+ GetTransform- - Size of each transform 2.15.3 - 9045bd8deadSopenharmony_ci Feedback- feedback varying variable 9055bd8deadSopenharmony_ci VaryingEXT 9065bd8deadSopenharmony_ci - Z+ GetTransform- - Type of each transform 2.15.3 - 9075bd8deadSopenharmony_ci Feedback- feedback varying variable 9085bd8deadSopenharmony_ci VaryingEXT 9095bd8deadSopenharmony_ci - 0+x- GetTransform- - Name of each transform 2.15.3 - 9105bd8deadSopenharmony_ci char Feedback- feedback varying variable 9115bd8deadSopenharmony_ci VaryingEXT 9125bd8deadSopenharmony_ci 9135bd8deadSopenharmony_ci (Add new Table, Query Object State. Note: There is nothing transform 9145bd8deadSopenharmony_ci feedback-specific here; this table should be in the core specification.) 9155bd8deadSopenharmony_ci 9165bd8deadSopenharmony_ci Get Value Type Get Command Init. Value Description Sec Attribute 9175bd8deadSopenharmony_ci ---------------- ---- ------------ ----------- ------------------------- ------ --------- 9185bd8deadSopenharmony_ci QUERY_RESULT Z+ GetQuery- 0 Query object result 6.1.12 - 9195bd8deadSopenharmony_ci Objectiv (query type-dependent) 9205bd8deadSopenharmony_ci QUERY_RESULT_ Z+ GetQuery- TRUE Is the query object 6.1.12 - 9215bd8deadSopenharmony_ci AVAILABLE Objectiv result available? 9225bd8deadSopenharmony_ci 9235bd8deadSopenharmony_ci 9245bd8deadSopenharmony_ciNew Implementation Dependent State 9255bd8deadSopenharmony_ci 9265bd8deadSopenharmony_ci (Modify Table 6.34, p. 295. Update the query object state to cover 9275bd8deadSopenharmony_ci transform feedback.) 9285bd8deadSopenharmony_ci 9295bd8deadSopenharmony_ci Get Value Type Get Command Minimum Value Description Sec Attribute 9305bd8deadSopenharmony_ci -------------------- ---- ----------- ------------- -------------------------- ------ --------- 9315bd8deadSopenharmony_ci QUERY_COUNTER_BITS 2xZ+ GetQueryiv see 6.1.12 Asynchronous query counter 6.1.12 - 9325bd8deadSopenharmony_ci bits (occlusion, timer, 9335bd8deadSopenharmony_ci tranform feedback queries) 9345bd8deadSopenharmony_ci 9355bd8deadSopenharmony_ci (Add a new table, Table 6.X. Transform Feedback State.) 9365bd8deadSopenharmony_ci 9375bd8deadSopenharmony_ci NOTE: In the "GetValue" columns below, MXFB stands for 9385bd8deadSopenharmony_ci "MAX_TRANSFORM_FEEDBACK". 9395bd8deadSopenharmony_ci 9405bd8deadSopenharmony_ci Get Value Type Get Command Minimum Value Description Sec Attribute 9415bd8deadSopenharmony_ci -------------------- ---- ----------- ------------- -------------------------- ------ --------- 9425bd8deadSopenharmony_ci MXFB_INTERLEAVED_ Z+ GetIntegerv 64 Max number of components to 2.Y - 9435bd8deadSopenharmony_ci COMPONENTS_EXT write to a single buffer in 9445bd8deadSopenharmony_ci interleaved mode 9455bd8deadSopenharmony_ci MXFB_SEPARATE_ Z+ GetIntegerv 4 Max number of separate 2.Y - 9465bd8deadSopenharmony_ci ATTRIBS_EXT attributes or vayings that 9475bd8deadSopenharmony_ci can be captured in transform 9485bd8deadSopenharmony_ci feedback 9495bd8deadSopenharmony_ci MXFB_SEPARATE_ Z+ GetIntegerv 4 Max number of components 2.Y - 9505bd8deadSopenharmony_ci COMPONENTS_EXT per attribute or varying 9515bd8deadSopenharmony_ci in separate mode 9525bd8deadSopenharmony_ci 9535bd8deadSopenharmony_ciIssues 9545bd8deadSopenharmony_ci 9555bd8deadSopenharmony_ci 1. How does transform feedback differ from core GL feedback? 9565bd8deadSopenharmony_ci 9575bd8deadSopenharmony_ci * Transform feedback writes vertex data to buffer objects, which allows 9585bd8deadSopenharmony_ci the data returned to be used directly by vertex pulling. GL feedback 9595bd8deadSopenharmony_ci mode writes vertex data to a buffer in system memory. 9605bd8deadSopenharmony_ci 9615bd8deadSopenharmony_ci * Transform feedback is done after transformation, but prior to 9625bd8deadSopenharmony_ci clipping. The primitives returned contain the original transformed 9635bd8deadSopenharmony_ci vertices produced by vertex or geometry program execution, and does 9645bd8deadSopenharmony_ci not contain any primitives inserted by clipping. 9655bd8deadSopenharmony_ci 9665bd8deadSopenharmony_ci * Transform feedback supports only a single basic output primitive type 9675bd8deadSopenharmony_ci (points, lines, or triangles), while core GL feedback mode supports 9685bd8deadSopenharmony_ci all primitive types. Since only one primitive type is supported, the 9695bd8deadSopenharmony_ci data returned does not contain tokens describing each primitive being 9705bd8deadSopenharmony_ci fed back. Primitive tokens make the data returned by GL feedback mode 9715bd8deadSopenharmony_ci irregular and unsuitable for vertex pulling. 9725bd8deadSopenharmony_ci 9735bd8deadSopenharmony_ci 2. What should this extension be called, and how does it differ from 9745bd8deadSopenharmony_ci previous extensions? 9755bd8deadSopenharmony_ci 9765bd8deadSopenharmony_ci RESOLVED: The current name is "EXT_transform_feedback", playing off the 9775bd8deadSopenharmony_ci fact that it is transformed primitives that are handled and the 9785bd8deadSopenharmony_ci similarities to GL feedback mode. 9795bd8deadSopenharmony_ci 9805bd8deadSopenharmony_ci This extension is new version of the shipping NV_transform_feedback 9815bd8deadSopenharmony_ci extension with some capabilities removed to ease multi-vendor adoption. 9825bd8deadSopenharmony_ci See the "Interactions with NV_transform_feedback" section for more 9835bd8deadSopenharmony_ci information on the functional differences. 9845bd8deadSopenharmony_ci 9855bd8deadSopenharmony_ci 3. What happens if you bind a buffer for transform feedback that is 9865bd8deadSopenharmony_ci currently bound for other purposes? Should we somehow detect this case 9875bd8deadSopenharmony_ci and produce an error? 9885bd8deadSopenharmony_ci 9895bd8deadSopenharmony_ci !!! NBC I feel strongly that we should follow the precedent for 9905bd8deadSopenharmony_ci Map/Unmap. The reason that MapBuffer and UnmapBuffer are a precedent 9915bd8deadSopenharmony_ci here is because while a buffer object is in the mapped state, no GL 9925bd8deadSopenharmony_ci commands are allowed to operate on the buffer object's data. So by 9935bd8deadSopenharmony_ci analogy, while a buffer is being used for transform feedback, no other 9945bd8deadSopenharmony_ci GL commands should be allowed to operate on the buffer object's data. 9955bd8deadSopenharmony_ci This includes initiating any rendering which would cause the GL to 9965bd8deadSopenharmony_ci source data from an active transform feedback buffer object. 9975bd8deadSopenharmony_ci 9985bd8deadSopenharmony_ci UNRESOLVED 9995bd8deadSopenharmony_ci 10005bd8deadSopenharmony_ci 4. Should this extension include any new buffer object binding targets, or 10015bd8deadSopenharmony_ci should it overload ARRAY_BUFFER, or should we skip the binding target 10025bd8deadSopenharmony_ci altogether in favor of a buffer object name accepted directly by the 10035bd8deadSopenharmony_ci new GL commands? 10045bd8deadSopenharmony_ci 10055bd8deadSopenharmony_ci RESOLVED: There are new binding points for XFB along with a new API 10065bd8deadSopenharmony_ci (BindBufferBase etc) to set the internal binding points. A new binding 10075bd8deadSopenharmony_ci point, TRANSFORM_FEEDBACK_BUFFER_EXT is also introduced. 10085bd8deadSopenharmony_ci 10095bd8deadSopenharmony_ci 5. Previous buffer object extensions provided a way to have existing GL 10105bd8deadSopenharmony_ci commands reference a buffer object instead of a user-supplied buffer. 10115bd8deadSopenharmony_ci Should the new commands introduced here allow referencing a 10125bd8deadSopenharmony_ci user-supplied buffer in addition to a buffer object? 10135bd8deadSopenharmony_ci 10145bd8deadSopenharmony_ci RESOLVED: No. A program can get the contents of the feedback buffer back 10155bd8deadSopenharmony_ci to the CPU using MapBuffer and GetBufferSubData. 10165bd8deadSopenharmony_ci 10175bd8deadSopenharmony_ci 6. Is BeginTransformFeedback really necessary? Could the query just 10185bd8deadSopenharmony_ci initiate the transform feedback mode? 10195bd8deadSopenharmony_ci 10205bd8deadSopenharmony_ci RESOLUTION: Using BeginTransformFeedback and EndTransformFeedback gives 10215bd8deadSopenharmony_ci a clean place to spec all of the transform-feedback-specific issues 10225bd8deadSopenharmony_ci without cluttering up the query language. Also, the queries don't have 10235bd8deadSopenharmony_ci to be done at the same time as beginning and ending the feedback 10245bd8deadSopenharmony_ci process. 10255bd8deadSopenharmony_ci 10265bd8deadSopenharmony_ci 7. What usage enums should be provided to glBufferData for use in 10275bd8deadSopenharmony_ci conjunction with transform feedback? 10285bd8deadSopenharmony_ci 10295bd8deadSopenharmony_ci RESOLVED: STREAM_COPY or STREAM_READ are expected to be the most common 10305bd8deadSopenharmony_ci usages. If a buffer object is being written by the GL through transform 10315bd8deadSopenharmony_ci feedback, and the contents of the buffer object are subsequently being 10325bd8deadSopenharmony_ci consumed by the GL (e.g. by being used as a vertex buffer object), then 10335bd8deadSopenharmony_ci this is a *_COPY usage. If the buffer object is being written by the GL 10345bd8deadSopenharmony_ci through transform feedback, but is being consumed by the application 10355bd8deadSopenharmony_ci (e.g. being mapped for read), this is a *_READ usage. The temporal 10365bd8deadSopenharmony_ci (STREAM, STATIC, or DYNAMIC) component of the usage enum is determined 10375bd8deadSopenharmony_ci by the ratio between how often the contents of the buffer object are 10385bd8deadSopenharmony_ci modified and how often operations that source data from the buffer 10395bd8deadSopenharmony_ci object occur. 10405bd8deadSopenharmony_ci 10415bd8deadSopenharmony_ci 8. What should the behavior be when a buffer object is the active target 10425bd8deadSopenharmony_ci of transform feedback, and it is deleted via DeleteBuffers? 10435bd8deadSopenharmony_ci 10445bd8deadSopenharmony_ci RESOLVED: Deletion is deferred until the EndTransformFeedback if 10455bd8deadSopenharmony_ci transform feedback is active. 10465bd8deadSopenharmony_ci 10475bd8deadSopenharmony_ci 9. Should we allow more buffers to be bound than are used? 10485bd8deadSopenharmony_ci 10495bd8deadSopenharmony_ci RESOLVED: Yes. The extra buffers are not in the way and can stay bound. 10505bd8deadSopenharmony_ci 10515bd8deadSopenharmony_ci 10. Should we allow feedback to buffer lists with holes (i.e. 0 and 2 10525bd8deadSopenharmony_ci bound)? 10535bd8deadSopenharmony_ci 10545bd8deadSopenharmony_ci RESOLVED: No. This makes for an ugly API with the potential for bugs, 10555bd8deadSopenharmony_ci without any real benefit. The application can as well bind all buffers 10565bd8deadSopenharmony_ci needed to incremented indices. It is an invalid operation to not have a 10575bd8deadSopenharmony_ci buffer bound where one is required. 10585bd8deadSopenharmony_ci 10595bd8deadSopenharmony_ci 11. Why only one feedback primitive mode per feedback invocation? 10605bd8deadSopenharmony_ci 10615bd8deadSopenharmony_ci RESOLVED: Having primitive tokens breaks up the stream and makes it less 10625bd8deadSopenharmony_ci amenable to being read back in as a vertex buffer. Also, mixing multiple 10635bd8deadSopenharmony_ci primitive types makes the counting of primitives less clear for the 10645bd8deadSopenharmony_ci application. 10655bd8deadSopenharmony_ci 10665bd8deadSopenharmony_ci 12. Is RasterPos fed back? 10675bd8deadSopenharmony_ci 10685bd8deadSopenharmony_ci RESOLVED: No. 10695bd8deadSopenharmony_ci 10705bd8deadSopenharmony_ci 13. Is DrawPixels/CopyPixels/Bitmap fed back? 10715bd8deadSopenharmony_ci 10725bd8deadSopenharmony_ci RESOLVED: No. Rasterization occurs as normal, but there is no 10735bd8deadSopenharmony_ci output to the feedback buffer. This is consistent with taking a 10745bd8deadSopenharmony_ci tap out of the pipe before clipping. 10755bd8deadSopenharmony_ci 10765bd8deadSopenharmony_ci 14. Why do we need new BindBuffer* functions? 10775bd8deadSopenharmony_ci 10785bd8deadSopenharmony_ci RESOLVED: All previous buffer object extensions have been retrofits of 10795bd8deadSopenharmony_ci existing pointer-based APIs. New extensions built assuming buffer 10805bd8deadSopenharmony_ci objects don't have that history, so need a new API. The functionality of 10815bd8deadSopenharmony_ci these new functions combines the functionality of BindBuffer, to set the 10825bd8deadSopenharmony_ci external bind point used by calls like MapBuffer and BufferSubData, with 10835bd8deadSopenharmony_ci the functionality to set an internal bind point like VertexAttribPointer 10845bd8deadSopenharmony_ci does. 10855bd8deadSopenharmony_ci 10865bd8deadSopenharmony_ci 15. How do the transform feedback indices, passed to the BindBuffer* 10875bd8deadSopenharmony_ci commands, work with multiple bindings? 10885bd8deadSopenharmony_ci 10895bd8deadSopenharmony_ci RESOLVED: The same way that they work with vertex arrays. There is one 10905bd8deadSopenharmony_ci external bind point, TRANSFORM_FEEDBACK_BUFFER_EXT. There are n 10915bd8deadSopenharmony_ci internal bind points, selected with the <index> parameter to the 10925bd8deadSopenharmony_ci BindBuffer* commands, where n is some implementation dependent limit. 10935bd8deadSopenharmony_ci The BindBuffer* commands take the buffer passed and bind it to the 10945bd8deadSopenharmony_ci external bind point, as well as to the selected internal bind point. 10955bd8deadSopenharmony_ci 10965bd8deadSopenharmony_ci For example: 10975bd8deadSopenharmony_ci 10985bd8deadSopenharmony_ci BindBufferOffsetEXT(TRANSFORM_FEEDBACK_BUFFER_EXT, 0, 1, 12); 10995bd8deadSopenharmony_ci // XFB index 0 points at buffer 1 with offset 12 11005bd8deadSopenharmony_ci 11015bd8deadSopenharmony_ci BindBuffer(TRANSFORM_FEEDBACK_BUFFER_EXT, 2); 11025bd8deadSopenharmony_ci // Buffer 2 is now bound to the external bind point. XFB index 0 still 11035bd8deadSopenharmony_ci // points at buffer 1 11045bd8deadSopenharmony_ci 11055bd8deadSopenharmony_ci MapBuffer(TRANSFORM_FEEDBACK_BUFFER_EXT, ...); 11065bd8deadSopenharmony_ci // Maps buffer 2 11075bd8deadSopenharmony_ci 11085bd8deadSopenharmony_ci 16. How are quads/quadstrips/polygons tesselated into triangles? 11095bd8deadSopenharmony_ci 11105bd8deadSopenharmony_ci RESOLVED: In an implementation-dependent manner. OpenGL doesn't define 11115bd8deadSopenharmony_ci quads or polygons in terms of triangles, so there is no one correct way 11125bd8deadSopenharmony_ci to do it, and different gpus may implement the behavior differently. A 11135bd8deadSopenharmony_ci quad may be split into two triangles in several different ways, and an 11145bd8deadSopenharmony_ci application may not rely on this behavior. 11155bd8deadSopenharmony_ci 11165bd8deadSopenharmony_ci 17. How does this extension interact with display lists? 11175bd8deadSopenharmony_ci 11185bd8deadSopenharmony_ci RESOLVED: Just like the VBO extension, none of the BindBuffer* commands 11195bd8deadSopenharmony_ci are compiled into a display list. 11205bd8deadSopenharmony_ci 11215bd8deadSopenharmony_ci 18. Does polygon mode state affect the logic that determines if the 11225bd8deadSopenharmony_ci transform feed back primitive mode and the render mode states are 11235bd8deadSopenharmony_ci valid at the start of transform feedback mode? 11245bd8deadSopenharmony_ci 11255bd8deadSopenharmony_ci RESOLVED: PolygonMode has no influence on the BeginTransFormFeedback 11265bd8deadSopenharmony_ci primitiveMode check since it is performed later in the pipeline. 11275bd8deadSopenharmony_ci 11285bd8deadSopenharmony_ci 19. What to do with incomplete primitives? 11295bd8deadSopenharmony_ci 11305bd8deadSopenharmony_ci RESOLVED: If there is no room to store one or more vertices of a 11315bd8deadSopenharmony_ci primitive in a buffer object, none of the vertices in that primitive are 11325bd8deadSopenharmony_ci written to the buffer. If a partial primitive enters transform feedback 11335bd8deadSopenharmony_ci (i.e. only two vertices sent in triangles mode), none of the vertices in 11345bd8deadSopenharmony_ci that primitive are written to the buffer object. 11355bd8deadSopenharmony_ci 11365bd8deadSopenharmony_ci 20. Why does TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT have a 11375bd8deadSopenharmony_ci TRANSFORM_FEEDBACK prefix but PRIMITIVES_GENERATED_EXT doesn't? 11385bd8deadSopenharmony_ci 11395bd8deadSopenharmony_ci RESOLVED: The number of primitives generated is independent of any 11405bd8deadSopenharmony_ci feedback that is active. The number of primitives that are written is 11415bd8deadSopenharmony_ci only valid for transform feedback - another extension could conceivably 11425bd8deadSopenharmony_ci have a different way of writing out primitives that would require a 11435bd8deadSopenharmony_ci similar but distinct token. 11445bd8deadSopenharmony_ci 11455bd8deadSopenharmony_ci 25. Are primitives sent down the pipeline after transform feedback, or 11465bd8deadSopenharmony_ci discarded? 11475bd8deadSopenharmony_ci 11485bd8deadSopenharmony_ci RESOLVED: Primitives can be optionally discarded before rasterization by 11495bd8deadSopenharmony_ci calling Enable and Disable with RASTERIZER_DISCARD_EXT. When enabled, 11505bd8deadSopenharmony_ci primitives are discarded after vertex attributes are recorded into the 11515bd8deadSopenharmony_ci buffer objects bound to transform feedback. When disabled, primitives 11525bd8deadSopenharmony_ci are passed through to the rasterization stage to be clipped and 11535bd8deadSopenharmony_ci rasterized normally. All rasterization operations are discarded, not 11545bd8deadSopenharmony_ci just those that are fed back into the buffer. 11555bd8deadSopenharmony_ci 11565bd8deadSopenharmony_ci This applies to DrawPixels, CopyPixels, Bitmap, Clear, Accum as well. 11575bd8deadSopenharmony_ci 11585bd8deadSopenharmony_ci 26. If a varying is declared as an array, is the whole array streamed out? 11595bd8deadSopenharmony_ci 11605bd8deadSopenharmony_ci RESOLVED: No, the application has to specify which elements of an array 11615bd8deadSopenharmony_ci it wants to stream out. Implementations might not be able to stream out 11625bd8deadSopenharmony_ci a large number of components to a single buffer object. If that is the 11635bd8deadSopenharmony_ci case, the application can stream each element of an array to a different 11645bd8deadSopenharmony_ci buffer object in TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS mode. 11655bd8deadSopenharmony_ci 11665bd8deadSopenharmony_ci 27. Is it possible to capture attributes when using the fixed-function 11675bd8deadSopenharmony_ci pipeline? 11685bd8deadSopenharmony_ci 11695bd8deadSopenharmony_ci RESOLVED: Not in this extension, which requires the use of a GLSL 11705bd8deadSopenharmony_ci vertex or geometry shader. The NV_transform_feedback extension does 11715bd8deadSopenharmony_ci provide this capability. 11725bd8deadSopenharmony_ci 11735bd8deadSopenharmony_ci 28. Should we provide queries to determine the set of varying variables to 11745bd8deadSopenharmony_ci be captured for a program object in transform feedback mode -- i.e., 11755bd8deadSopenharmony_ci the values in the array of strings <varyings> given to 11765bd8deadSopenharmony_ci TransformFeedbackVaryingsEXT? 11775bd8deadSopenharmony_ci 11785bd8deadSopenharmony_ci RESOLVED: Yes; the command GetTransformFeedbackVaryingEXT is provided 11795bd8deadSopenharmony_ci to query the name, size, and type of each varying captured for a linked 11805bd8deadSopenharmony_ci program object in transform feedback mode. 11815bd8deadSopenharmony_ci 11825bd8deadSopenharmony_ci Transform feedback-related queries operate only on a linked program 11835bd8deadSopenharmony_ci object. There is no API available to query transform feedback varying 11845bd8deadSopenharmony_ci state set by TransformFeedbackVaryingsEXT until a program is linked. 11855bd8deadSopenharmony_ci 11865bd8deadSopenharmony_ci 29. What happens if a variable is specified in the array of names passed 11875bd8deadSopenharmony_ci to TransformFeedbackVaryingsEXT, but not needed by the fragment 11885bd8deadSopenharmony_ci shader? The linker may normally eliminate such variables. 11895bd8deadSopenharmony_ci 11905bd8deadSopenharmony_ci RESOLVED: Varying variables specified by TransformFeedbackVaryingsEXT 11915bd8deadSopenharmony_ci are always considered active and count against the total limit on the 11925bd8deadSopenharmony_ci number of active varying components, regardless of the needs of the 11935bd8deadSopenharmony_ci fragment shader. If such a program object is executed with transform 11945bd8deadSopenharmony_ci feedback active, the values of these variables are computed by the 11955bd8deadSopenharmony_ci vertex or geometry shader and stored in the appropriate buffer object. 11965bd8deadSopenharmony_ci If transform feedback is inactive, the values of such varyings may be 11975bd8deadSopenharmony_ci calculated even though they are only needed for transform feedback. 11985bd8deadSopenharmony_ci 11995bd8deadSopenharmony_ci 12005bd8deadSopenharmony_ciRevision History 12015bd8deadSopenharmony_ci 12025bd8deadSopenharmony_ci Rev. Date Author Changes 12035bd8deadSopenharmony_ci ---- -------- -------- --------------------------------------------- 12045bd8deadSopenharmony_ci 8 08/09/13 pbrown Remove extra <varyings> parameter in 12055bd8deadSopenharmony_ci TransformFeedbackVaryingsEXT. 12065bd8deadSopenharmony_ci 12075bd8deadSopenharmony_ci 7 07/01/13 Jon Leech Change type of TransformFeedbackVaryingsEXT 12085bd8deadSopenharmony_ci parameter from 'const char **varyings' to 12095bd8deadSopenharmony_ci 'const char * const *varyings' (Bug 10231). 12105bd8deadSopenharmony_ci 12115bd8deadSopenharmony_ci 6 01/27/11 Jon Leech Change return value for start/size queries 12125bd8deadSopenharmony_ci when no buffer bound from -1 to zero, to 12135bd8deadSopenharmony_ci match state tables (Bug 7318). 12145bd8deadSopenharmony_ci 12155bd8deadSopenharmony_ci 5 02/28/08 pbrown Merged in edits from Apple. Update status to 12165bd8deadSopenharmony_ci shipping. Moved per-object query results into 12175bd8deadSopenharmony_ci a separate table. 12185bd8deadSopenharmony_ci 12195bd8deadSopenharmony_ci 4 02/20/08 pbrown Fix incorrect minimum for MAX_TRANSFORM_ 12205bd8deadSopenharmony_ci FEEDBACK_SEPARATE_COMPONENTS_EXT. Should be 12215bd8deadSopenharmony_ci 4, not 16. 12225bd8deadSopenharmony_ci 12235bd8deadSopenharmony_ci 3 12/13/07 pbrown Clean up a number of places where "NV" 12245bd8deadSopenharmony_ci suffixes were incorrectly carried over from 12255bd8deadSopenharmony_ci the NV_transform_feedback spec. 12265bd8deadSopenharmony_ci 12275bd8deadSopenharmony_ci 2 08/28/07 pbrown Document that BeginTransformFeedbackEXT 12285bd8deadSopenharmony_ci results in an error if no program object is 12295bd8deadSopenharmony_ci active or if the active program isn't 12305bd8deadSopenharmony_ci capturing any varyings. 12315bd8deadSopenharmony_ci 12325bd8deadSopenharmony_ci 1 11/30/06 pbrown Created an initial EXT_transform_feedback 12335bd8deadSopenharmony_ci spec by forking off the existing 12345bd8deadSopenharmony_ci NV_transform_feedback spec. 1235