2 * Mesa 3-D graphics library
4 * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
5 * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"),
9 * to deal in the Software without restriction, including without limitation
10 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 * and/or sell copies of the Software, and to permit persons to whom the
12 * Software is furnished to do so, subject to the following conditions:
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23 * OTHER DEALINGS IN THE SOFTWARE.
33 struct gl_client_array
;
38 * Compute the index of the last array element that can be safely accessed in
39 * a vertex array. We can really only do this when the array lives in a VBO.
40 * The array->_MaxElement field will be updated.
41 * Later in glDrawArrays/Elements/etc we can do some bounds checking.
44 _mesa_update_array_max_element(struct gl_client_array
*array
)
46 assert(array
->Enabled
);
48 if (array
->BufferObj
->Name
) {
49 GLsizeiptrARB offset
= (GLsizeiptrARB
) array
->Ptr
;
50 GLsizeiptrARB bufSize
= (GLsizeiptrARB
) array
->BufferObj
->Size
;
52 if (offset
< bufSize
) {
53 array
->_MaxElement
= (bufSize
- offset
+ array
->StrideB
54 - array
->_ElementSize
) / array
->StrideB
;
57 array
->_MaxElement
= 0;
61 /* user-space array, no idea how big it is */
62 array
->_MaxElement
= 2 * 1000 * 1000 * 1000; /* just a big number */
67 extern void GLAPIENTRY
68 _mesa_VertexPointer(GLint size
, GLenum type
, GLsizei stride
,
71 extern void GLAPIENTRY
72 _mesa_UnlockArraysEXT( void );
74 extern void GLAPIENTRY
75 _mesa_LockArraysEXT(GLint first
, GLsizei count
);
78 extern void GLAPIENTRY
79 _mesa_NormalPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
);
82 extern void GLAPIENTRY
83 _mesa_ColorPointer(GLint size
, GLenum type
, GLsizei stride
, const GLvoid
*ptr
);
86 extern void GLAPIENTRY
87 _mesa_IndexPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
);
90 extern void GLAPIENTRY
91 _mesa_TexCoordPointer(GLint size
, GLenum type
, GLsizei stride
,
95 extern void GLAPIENTRY
96 _mesa_EdgeFlagPointer(GLsizei stride
, const GLvoid
*ptr
);
99 extern void GLAPIENTRY
100 _mesa_VertexPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
101 GLsizei count
, const GLvoid
*ptr
);
104 extern void GLAPIENTRY
105 _mesa_NormalPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
109 extern void GLAPIENTRY
110 _mesa_ColorPointerEXT(GLint size
, GLenum type
, GLsizei stride
, GLsizei count
,
114 extern void GLAPIENTRY
115 _mesa_IndexPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
119 extern void GLAPIENTRY
120 _mesa_TexCoordPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
121 GLsizei count
, const GLvoid
*ptr
);
124 extern void GLAPIENTRY
125 _mesa_EdgeFlagPointerEXT(GLsizei stride
, GLsizei count
, const GLboolean
*ptr
);
128 extern void GLAPIENTRY
129 _mesa_FogCoordPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
);
132 extern void GLAPIENTRY
133 _mesa_SecondaryColorPointer(GLint size
, GLenum type
,
134 GLsizei stride
, const GLvoid
*ptr
);
137 extern void GLAPIENTRY
138 _mesa_PointSizePointerOES(GLenum type
, GLsizei stride
, const GLvoid
*ptr
);
141 extern void GLAPIENTRY
142 _mesa_VertexAttribPointer(GLuint index
, GLint size
, GLenum type
,
143 GLboolean normalized
, GLsizei stride
,
144 const GLvoid
*pointer
);
147 _mesa_VertexAttribIPointer(GLuint index
, GLint size
, GLenum type
,
148 GLsizei stride
, const GLvoid
*ptr
);
151 extern void GLAPIENTRY
152 _mesa_EnableVertexAttribArray(GLuint index
);
155 extern void GLAPIENTRY
156 _mesa_DisableVertexAttribArray(GLuint index
);
159 extern void GLAPIENTRY
160 _mesa_GetVertexAttribdv(GLuint index
, GLenum pname
, GLdouble
*params
);
163 extern void GLAPIENTRY
164 _mesa_GetVertexAttribfv(GLuint index
, GLenum pname
, GLfloat
*params
);
167 extern void GLAPIENTRY
168 _mesa_GetVertexAttribiv(GLuint index
, GLenum pname
, GLint
*params
);
171 extern void GLAPIENTRY
172 _mesa_GetVertexAttribIiv(GLuint index
, GLenum pname
, GLint
*params
);
175 extern void GLAPIENTRY
176 _mesa_GetVertexAttribIuiv(GLuint index
, GLenum pname
, GLuint
*params
);
179 extern void GLAPIENTRY
180 _mesa_GetVertexAttribPointerv(GLuint index
, GLenum pname
, GLvoid
**pointer
);
183 extern void GLAPIENTRY
184 _mesa_InterleavedArrays(GLenum format
, GLsizei stride
, const GLvoid
*pointer
);
187 extern void GLAPIENTRY
188 _mesa_MultiDrawArrays( GLenum mode
, const GLint
*first
,
189 const GLsizei
*count
, GLsizei primcount
);
191 extern void GLAPIENTRY
192 _mesa_MultiDrawElementsEXT( GLenum mode
, const GLsizei
*count
, GLenum type
,
193 const GLvoid
**indices
, GLsizei primcount
);
195 extern void GLAPIENTRY
196 _mesa_MultiDrawElementsBaseVertex( GLenum mode
,
197 const GLsizei
*count
, GLenum type
,
198 const GLvoid
**indices
, GLsizei primcount
,
199 const GLint
*basevertex
);
201 extern void GLAPIENTRY
202 _mesa_MultiModeDrawArraysIBM( const GLenum
* mode
, const GLint
* first
,
203 const GLsizei
* count
,
204 GLsizei primcount
, GLint modestride
);
207 extern void GLAPIENTRY
208 _mesa_MultiModeDrawElementsIBM( const GLenum
* mode
, const GLsizei
* count
,
209 GLenum type
, const GLvoid
* const * indices
,
210 GLsizei primcount
, GLint modestride
);
212 extern void GLAPIENTRY
213 _mesa_LockArraysEXT(GLint first
, GLsizei count
);
215 extern void GLAPIENTRY
216 _mesa_UnlockArraysEXT( void );
219 extern void GLAPIENTRY
220 _mesa_DrawArrays(GLenum mode
, GLint first
, GLsizei count
);
222 extern void GLAPIENTRY
223 _mesa_DrawElements(GLenum mode
, GLsizei count
, GLenum type
,
224 const GLvoid
*indices
);
226 extern void GLAPIENTRY
227 _mesa_DrawRangeElements(GLenum mode
, GLuint start
, GLuint end
, GLsizei count
,
228 GLenum type
, const GLvoid
*indices
);
230 extern void GLAPIENTRY
231 _mesa_DrawElementsBaseVertex(GLenum mode
, GLsizei count
, GLenum type
,
232 const GLvoid
*indices
, GLint basevertex
);
234 extern void GLAPIENTRY
235 _mesa_DrawRangeElementsBaseVertex(GLenum mode
, GLuint start
, GLuint end
,
236 GLsizei count
, GLenum type
,
237 const GLvoid
*indices
,
240 extern void GLAPIENTRY
241 _mesa_DrawTransformFeedback(GLenum mode
, GLuint name
);
243 extern void GLAPIENTRY
244 _mesa_PrimitiveRestartIndex(GLuint index
);
247 extern void GLAPIENTRY
248 _mesa_VertexAttribDivisor(GLuint index
, GLuint divisor
);
251 _mesa_primitive_restart_index(const struct gl_context
*ctx
, GLenum ib_type
);
254 _mesa_copy_client_array(struct gl_context
*ctx
,
255 struct gl_client_array
*dst
,
256 struct gl_client_array
*src
);
260 _mesa_print_arrays(struct gl_context
*ctx
);
263 _mesa_init_varray( struct gl_context
* ctx
);
266 _mesa_free_varray_data(struct gl_context
*ctx
);