1Name 2 3 ARB_transform_feedback_instanced 4 5Name Strings 6 7 GL_ARB_transform_feedback_instanced 8 9Contact 10 11 Graham Sellers, AMD (graham.sellers 'at' amd.com) 12 13Contributors 14 15 XXX 16 17Notice 18 19 Copyright (c) 2011-2013 The Khronos Group Inc. Copyright terms at 20 http://www.khronos.org/registry/speccopyright.html 21 22Specification Update Policy 23 24 Khronos-approved extension specifications are updated in response to 25 issues and bugs prioritized by the Khronos OpenGL Working Group. For 26 extensions which have been promoted to a core Specification, fixes will 27 first appear in the latest version of that core Specification, and will 28 eventually be backported to the extension document. This policy is 29 described in more detail at 30 https://www.khronos.org/registry/OpenGL/docs/update_policy.php 31 32Status 33 34 Complete. Approved by the ARB on 2011/06/20. 35 Approved by the Khronos Promoters on 2011/07/29. 36 37Version 38 39 Last Modified Date: December 15th, 2010 40 Revision: 2 41 42Number 43 44 ARB Extension #109 45 46Dependencies 47 48 OpenGL 4.0 or the ARB_transform_feedback2 extension is required. 49 50 OpenGL 3.1 or the ARB_draw_instanced extension is required. 51 52 This extension interacts with the ARB_transform_feedback3 extension. 53 54 This extension is written against the OpenGL 4.1 (Core Profile) specification. 55 56Overview 57 58 Multiple instances of geometry may be specified to the GL by calling 59 functions such as DrawArraysInstanced and DrawElementsInstanced. Further, 60 the results of a transform feedback operation may be returned to the GL 61 by calling DrawTransformFeedback, or DrawTransformFeedbackStream. However, 62 it is not presently possible to draw multiple instances of data 63 transform feedback without using a query and the resulting round trip from 64 server to client. 65 66 This extension adds functionality to draw multiple instances of the result 67 of a transform feedback operation. 68 69New Procedures and Functions 70 71 void DrawTransformFeedbackInstanced(enum mode, uint id, sizei primcount); 72 void DrawTransformFeedbackStreamInstanced(enum mode, uint id, uint stream, sizei primcount); 73 74New Tokens 75 76 None. 77 78Additions to Chapter 2 of the OpenGL 4.1 (Core Profile) Specification 79(OpenGL Operation) 80 81Modify Section 2.17.3, "Transform Feedback Draw Operations" 82 83 ... The number of vertices captured from each vertex stream during transform 84 feedback is stored in the corresponding transform feedback object and may 85 be used in conjunction with the commands 86 87 void DrawTransformFeedback(enum mode, uint id); 88 void DrawTransformFeedbackInstanced(enum mode, uint id, sizei primcount); 89 void DrawTransformFeedbackStream(enum mode, uint id, uint stream); 90 void DrawTransformFeedbackStreamInstanced(enum mode, uint id, uint stream, sizei primcount); 91 92 to replay the captured vertices. 93 94 DrawTransformFeedbackStreamInstanced is equivalent to calling 95 DrawArraysInstanced with <mode> as specified, <first> set to zero, <count> 96 set to the number of vertices captured from the vertex stream numbered 97 <stream> the last time transform was active on the transform feedback 98 object named <id>, and <primcount> as specified. The error INVALID_VALUE 99 is generated if <stream> is greater than or equal to the value of 100 MAX_VERTEX_STREAMS. Calling DrawTransformFeedbackInstanced is equivalent 101 to calling DrawTransformFeedbackStreamInstanced with <stream> set to zero. 102 Calling DrawTransformFeedbackStream is equivalent to calling 103 DrawTransformFeedbackStreamInstanced with <primcount> set to one. Finally, 104 calling DrawTransformFeedback is equivalent to calling 105 DrawTransformFeedbackStreamInstanced with <stream> set to zero and 106 <primcount> set to one. 107 108Additions to Chapter 3 of the OpenGL 4.1 (Core Profile) Specification 109(Rasterization) 110 111 None. 112 113Additions to Chapter 4 of the OpenGL 4.1 (Core Profile) Specification 114(Per-Fragment Operations and the Framebuffer) 115 116 None. 117 118Additions to Chapter 5 of the OpenGL 4.1 (Core Profile) Specification 119(Special Functions) 120 121 None. 122 123Additions to Chapter 6 of the OpenGL 4.1 (Core Profile) Specification 124(State and State Requests) 125 126 None. 127 128Errors 129 130 INVALID_ENUM is generated by DrawTransformFeedbackStreamInstanced if <mode> 131 is not an accepted value. 132 133 INVALID_VALUE is generated by DrawTransformFeedbackStreamInstanced if 134 <stream> is greater than or equal to the value of MAX_VERTEX_STREAMS. 135 136 INVALID_VALUE is generated by DrawTransformFeedbackStreamInstanced if 137 <id> is not the name of a transform feedback object. 138 139 INVALID_OPERATION is generated by DrawTransformFeedbackStreamInstanced if a 140 non-zero buffer object name is bound to an enabled array and the buffer 141 object's data store is currently mapped. 142 143 INVALID_OPERATION is generated by DrawTransformFeedbackStreamInstanced if a 144 geometry shader is active and mode is incompatible with the input primitive 145 type of the geometry shader in the currently installed program object. 146 147 INVALID_OPERATION is generated if by DrawTransformFeedbackStreamInstanced if 148 mode is PATCHES and no tessellation control shader is active. 149 150 INVALID_OPERATION is generated if by DrawTransformFeedbackStreamInstanced if 151 glEndTransformFeedback has never been called while the transform feedback 152 object named by id was bound. 153 154 Other errors generated by DrawElements, DrawArrays or other drawing commands 155 (for example, due to framebuffer incompleteness) may be generated by 156 DrawTransformFeedbackStreamInstanced. 157 158Dependencies on OpenGL 4.0 and GL_ARB_transform_feedback3 159 160 If the GL version is less than 4.0, and if GL_ARB_transform_feedback3 is 161 not supported, this extension only adds DrawTransformFeedbackInstanced 162 (not DrawTransformFeedbackStreamInstanced). In that case, remove all 163 references to DrawTransformFeedbackStreamInstanced and instead define 164 DrawTransformFeedback in terms of DrawTransformFeedbackInstanced. 165 166Issues 167 168 1) Do I need OpenGL 3.1, OpenGL 4.0 or ARB_transform_feedback3? 169 170 If you have ARB_draw_transform_feedback3 or OpenGL 4.0, you're good to go. 171 You need at least OpenGL 3.1 _with_ ARB_transform_feedback3. 172 173 2) Do we need a DrawTransformFeedbackStreamInstancedBaseInstance when both 174 this extension and ARB_base_instance are present? 175 176 Perhaps. That's a bit wordy. Not adding it for now. How about in 177 ARB_transform_feedback_instanced2? 178 179Revision History 180 181 Rev. Date Author Changes 182 ---- -------- -------- ----------------------------------------- 183 2 12/15/10 gsellers Address comments from bmerry (bug 6961) 184 1 09/23/10 gsellers Initial revision 185