2 * Mesa 3-D graphics library
5 * Copyright (C) 1999-2004 Brian Paul 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 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
21 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 #define PRE_LOOPBACK( FUNC )
32 #include "main/dispatch.h"
34 static void GLAPIENTRY
TAG(ArrayElement
)( GLint i
)
36 PRE_LOOPBACK( ArrayElement
);
37 CALL_ArrayElement(GET_DISPATCH(), ( i
));
40 static void GLAPIENTRY
TAG(Color3f
)( GLfloat r
, GLfloat g
, GLfloat b
)
42 PRE_LOOPBACK( Color3f
);
43 CALL_Color3f(GET_DISPATCH(), ( r
, g
, b
));
46 static void GLAPIENTRY
TAG(Color3fv
)( const GLfloat
*v
)
48 PRE_LOOPBACK( Color3fv
);
49 CALL_Color3fv(GET_DISPATCH(), ( v
));
52 static void GLAPIENTRY
TAG(Color4f
)( GLfloat r
, GLfloat g
, GLfloat b
, GLfloat a
)
54 PRE_LOOPBACK( Color4f
);
55 CALL_Color4f(GET_DISPATCH(), ( r
, g
, b
, a
));
58 static void GLAPIENTRY
TAG(Color4fv
)( const GLfloat
*v
)
60 PRE_LOOPBACK( Color4fv
);
61 CALL_Color4fv(GET_DISPATCH(), ( v
));
64 static void GLAPIENTRY
TAG(EdgeFlag
)( GLboolean e
)
66 PRE_LOOPBACK( EdgeFlag
);
67 CALL_EdgeFlag(GET_DISPATCH(), ( e
));
70 static void GLAPIENTRY
TAG(EvalCoord1f
)( GLfloat s
)
72 PRE_LOOPBACK( EvalCoord1f
);
73 CALL_EvalCoord1f(GET_DISPATCH(), ( s
));
76 static void GLAPIENTRY
TAG(EvalCoord1fv
)( const GLfloat
*v
)
78 PRE_LOOPBACK( EvalCoord1fv
);
79 CALL_EvalCoord1fv(GET_DISPATCH(), ( v
));
82 static void GLAPIENTRY
TAG(EvalCoord2f
)( GLfloat s
, GLfloat t
)
84 PRE_LOOPBACK( EvalCoord2f
);
85 CALL_EvalCoord2f(GET_DISPATCH(), ( s
, t
));
88 static void GLAPIENTRY
TAG(EvalCoord2fv
)( const GLfloat
*v
)
90 PRE_LOOPBACK( EvalCoord2fv
);
91 CALL_EvalCoord2fv(GET_DISPATCH(), ( v
));
94 static void GLAPIENTRY
TAG(EvalPoint1
)( GLint i
)
96 PRE_LOOPBACK( EvalPoint1
);
97 CALL_EvalPoint1(GET_DISPATCH(), ( i
));
100 static void GLAPIENTRY
TAG(EvalPoint2
)( GLint i
, GLint j
)
102 PRE_LOOPBACK( EvalPoint2
);
103 CALL_EvalPoint2(GET_DISPATCH(), ( i
, j
));
106 static void GLAPIENTRY
TAG(FogCoordfEXT
)( GLfloat f
)
108 PRE_LOOPBACK( FogCoordfEXT
);
109 CALL_FogCoordfEXT(GET_DISPATCH(), ( f
));
112 static void GLAPIENTRY
TAG(FogCoordfvEXT
)( const GLfloat
*v
)
114 PRE_LOOPBACK( FogCoordfvEXT
);
115 CALL_FogCoordfvEXT(GET_DISPATCH(), ( v
));
118 static void GLAPIENTRY
TAG(Indexf
)( GLfloat f
)
120 PRE_LOOPBACK( Indexf
);
121 CALL_Indexf(GET_DISPATCH(), ( f
));
124 static void GLAPIENTRY
TAG(Indexfv
)( const GLfloat
*v
)
126 PRE_LOOPBACK( Indexfv
);
127 CALL_Indexfv(GET_DISPATCH(), ( v
));
130 static void GLAPIENTRY
TAG(Materialfv
)( GLenum face
, GLenum pname
, const GLfloat
*v
)
132 PRE_LOOPBACK( Materialfv
);
133 CALL_Materialfv(GET_DISPATCH(), ( face
, pname
, v
));
136 static void GLAPIENTRY
TAG(MultiTexCoord1fARB
)( GLenum target
, GLfloat a
)
138 PRE_LOOPBACK( MultiTexCoord1fARB
);
139 CALL_MultiTexCoord1fARB(GET_DISPATCH(), ( target
, a
));
142 static void GLAPIENTRY
TAG(MultiTexCoord1fvARB
)( GLenum target
, const GLfloat
*tc
)
144 PRE_LOOPBACK( MultiTexCoord1fvARB
);
145 CALL_MultiTexCoord1fvARB(GET_DISPATCH(), ( target
, tc
));
148 static void GLAPIENTRY
TAG(MultiTexCoord2fARB
)( GLenum target
, GLfloat s
, GLfloat t
)
150 PRE_LOOPBACK( MultiTexCoord2fARB
);
151 CALL_MultiTexCoord2fARB(GET_DISPATCH(), ( target
, s
, t
));
154 static void GLAPIENTRY
TAG(MultiTexCoord2fvARB
)( GLenum target
, const GLfloat
*tc
)
156 PRE_LOOPBACK( MultiTexCoord2fvARB
);
157 CALL_MultiTexCoord2fvARB(GET_DISPATCH(), ( target
, tc
));
160 static void GLAPIENTRY
TAG(MultiTexCoord3fARB
)( GLenum target
, GLfloat s
,
161 GLfloat t
, GLfloat r
)
163 PRE_LOOPBACK( MultiTexCoord3fARB
);
164 CALL_MultiTexCoord3fARB(GET_DISPATCH(), ( target
, s
, t
, r
));
167 static void GLAPIENTRY
TAG(MultiTexCoord3fvARB
)( GLenum target
, const GLfloat
*tc
)
169 PRE_LOOPBACK( MultiTexCoord3fvARB
);
170 CALL_MultiTexCoord3fvARB(GET_DISPATCH(), ( target
, tc
));
173 static void GLAPIENTRY
TAG(MultiTexCoord4fARB
)( GLenum target
, GLfloat s
,
174 GLfloat t
, GLfloat r
, GLfloat q
)
176 PRE_LOOPBACK( MultiTexCoord4fARB
);
177 CALL_MultiTexCoord4fARB(GET_DISPATCH(), ( target
, s
, t
, r
, q
));
180 static void GLAPIENTRY
TAG(MultiTexCoord4fvARB
)( GLenum target
, const GLfloat
*tc
)
182 PRE_LOOPBACK( MultiTexCoord4fvARB
);
183 CALL_MultiTexCoord4fvARB(GET_DISPATCH(), ( target
, tc
));
186 static void GLAPIENTRY
TAG(Normal3f
)( GLfloat x
, GLfloat y
, GLfloat z
)
188 PRE_LOOPBACK( Normal3f
);
189 CALL_Normal3f(GET_DISPATCH(), ( x
, y
, z
));
192 static void GLAPIENTRY
TAG(Normal3fv
)( const GLfloat
*v
)
194 PRE_LOOPBACK( Normal3fv
);
195 CALL_Normal3fv(GET_DISPATCH(), ( v
));
198 static void GLAPIENTRY
TAG(SecondaryColor3fEXT
)( GLfloat r
, GLfloat g
, GLfloat b
)
200 PRE_LOOPBACK( SecondaryColor3fEXT
);
201 CALL_SecondaryColor3fEXT(GET_DISPATCH(), ( r
, g
, b
));
204 static void GLAPIENTRY
TAG(SecondaryColor3fvEXT
)( const GLfloat
*v
)
206 PRE_LOOPBACK( SecondaryColor3fvEXT
);
207 CALL_SecondaryColor3fvEXT(GET_DISPATCH(), ( v
));
210 static void GLAPIENTRY
TAG(TexCoord1f
)( GLfloat s
)
212 PRE_LOOPBACK( TexCoord1f
);
213 CALL_TexCoord1f(GET_DISPATCH(), ( s
));
216 static void GLAPIENTRY
TAG(TexCoord1fv
)( const GLfloat
*tc
)
218 PRE_LOOPBACK( TexCoord1fv
);
219 CALL_TexCoord1fv(GET_DISPATCH(), ( tc
));
222 static void GLAPIENTRY
TAG(TexCoord2f
)( GLfloat s
, GLfloat t
)
224 PRE_LOOPBACK( TexCoord2f
);
225 CALL_TexCoord2f(GET_DISPATCH(), ( s
, t
));
228 static void GLAPIENTRY
TAG(TexCoord2fv
)( const GLfloat
*tc
)
230 PRE_LOOPBACK( TexCoord2fv
);
231 CALL_TexCoord2fv(GET_DISPATCH(), ( tc
));
234 static void GLAPIENTRY
TAG(TexCoord3f
)( GLfloat s
, GLfloat t
, GLfloat r
)
236 PRE_LOOPBACK( TexCoord3f
);
237 CALL_TexCoord3f(GET_DISPATCH(), ( s
, t
, r
));
240 static void GLAPIENTRY
TAG(TexCoord3fv
)( const GLfloat
*tc
)
242 PRE_LOOPBACK( TexCoord3fv
);
243 CALL_TexCoord3fv(GET_DISPATCH(), ( tc
));
246 static void GLAPIENTRY
TAG(TexCoord4f
)( GLfloat s
, GLfloat t
, GLfloat r
, GLfloat q
)
248 PRE_LOOPBACK( TexCoord4f
);
249 CALL_TexCoord4f(GET_DISPATCH(), ( s
, t
, r
, q
));
252 static void GLAPIENTRY
TAG(TexCoord4fv
)( const GLfloat
*tc
)
254 PRE_LOOPBACK( TexCoord4fv
);
255 CALL_TexCoord4fv(GET_DISPATCH(), ( tc
));
258 static void GLAPIENTRY
TAG(Vertex2f
)( GLfloat x
, GLfloat y
)
260 PRE_LOOPBACK( Vertex2f
);
261 CALL_Vertex2f(GET_DISPATCH(), ( x
, y
));
264 static void GLAPIENTRY
TAG(Vertex2fv
)( const GLfloat
*v
)
266 PRE_LOOPBACK( Vertex2fv
);
267 CALL_Vertex2fv(GET_DISPATCH(), ( v
));
270 static void GLAPIENTRY
TAG(Vertex3f
)( GLfloat x
, GLfloat y
, GLfloat z
)
272 PRE_LOOPBACK( Vertex3f
);
273 CALL_Vertex3f(GET_DISPATCH(), ( x
, y
, z
));
276 static void GLAPIENTRY
TAG(Vertex3fv
)( const GLfloat
*v
)
278 PRE_LOOPBACK( Vertex3fv
);
279 CALL_Vertex3fv(GET_DISPATCH(), ( v
));
282 static void GLAPIENTRY
TAG(Vertex4f
)( GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
284 PRE_LOOPBACK( Vertex4f
);
285 CALL_Vertex4f(GET_DISPATCH(), ( x
, y
, z
, w
));
288 static void GLAPIENTRY
TAG(Vertex4fv
)( const GLfloat
*v
)
290 PRE_LOOPBACK( Vertex4fv
);
291 CALL_Vertex4fv(GET_DISPATCH(), ( v
));
294 static void GLAPIENTRY
TAG(CallList
)( GLuint i
)
296 PRE_LOOPBACK( CallList
);
297 CALL_CallList(GET_DISPATCH(), ( i
));
300 static void GLAPIENTRY
TAG(CallLists
)( GLsizei sz
, GLenum type
, const GLvoid
*v
)
302 PRE_LOOPBACK( CallLists
);
303 CALL_CallLists(GET_DISPATCH(), ( sz
, type
, v
));
306 static void GLAPIENTRY
TAG(Begin
)( GLenum mode
)
308 PRE_LOOPBACK( Begin
);
309 CALL_Begin(GET_DISPATCH(), ( mode
));
312 static void GLAPIENTRY
TAG(End
)( void )
315 CALL_End(GET_DISPATCH(), ());
318 static void GLAPIENTRY
TAG(Rectf
)( GLfloat x1
, GLfloat y1
, GLfloat x2
, GLfloat y2
)
320 PRE_LOOPBACK( Rectf
);
321 CALL_Rectf(GET_DISPATCH(), ( x1
, y1
, x2
, y2
));
324 static void GLAPIENTRY
TAG(DrawArrays
)( GLenum mode
, GLint start
, GLsizei count
)
326 PRE_LOOPBACK( DrawArrays
);
327 CALL_DrawArrays(GET_DISPATCH(), ( mode
, start
, count
));
330 static void GLAPIENTRY
TAG(DrawElements
)( GLenum mode
, GLsizei count
, GLenum type
,
331 const GLvoid
*indices
)
333 PRE_LOOPBACK( DrawElements
);
334 CALL_DrawElements(GET_DISPATCH(), ( mode
, count
, type
, indices
));
337 static void GLAPIENTRY
TAG(MultiDrawElementsEXT
)( GLenum mode
,
338 const GLsizei
*count
,
340 const GLvoid
**indices
,
343 PRE_LOOPBACK( MultiDrawElementsEXT
);
344 CALL_MultiDrawElementsEXT(GET_DISPATCH(), ( mode
, count
, type
, indices
,
348 static void GLAPIENTRY
TAG(DrawRangeElements
)( GLenum mode
, GLuint start
,
349 GLuint end
, GLsizei count
,
350 GLenum type
, const GLvoid
*indices
)
352 PRE_LOOPBACK( DrawRangeElements
);
353 CALL_DrawRangeElements(GET_DISPATCH(), ( mode
, start
, end
, count
, type
, indices
));
356 static void GLAPIENTRY
TAG(DrawElementsBaseVertex
)( GLenum mode
,
359 const GLvoid
*indices
,
362 PRE_LOOPBACK( DrawElementsBaseVertex
);
363 CALL_DrawElementsBaseVertex(GET_DISPATCH(), ( mode
, count
, type
,
364 indices
, basevertex
));
367 static void GLAPIENTRY
TAG(DrawRangeElementsBaseVertex
)( GLenum mode
,
372 const GLvoid
*indices
,
375 PRE_LOOPBACK( DrawRangeElementsBaseVertex
);
376 CALL_DrawRangeElementsBaseVertex(GET_DISPATCH(), ( mode
, start
, end
,
377 count
, type
, indices
,
381 static void GLAPIENTRY
TAG(MultiDrawElementsBaseVertex
)( GLenum mode
,
382 const GLsizei
*count
,
384 const GLvoid
**indices
,
386 const GLint
*basevertex
)
388 PRE_LOOPBACK( MultiDrawElementsBaseVertex
);
389 CALL_MultiDrawElementsBaseVertex(GET_DISPATCH(), ( mode
, count
, type
,
391 primcount
, basevertex
));
394 static void GLAPIENTRY
395 TAG(DrawArraysInstanced
)(GLenum mode
, GLint first
,
396 GLsizei count
, GLsizei primcount
)
398 PRE_LOOPBACK( DrawArraysInstanced
);
399 CALL_DrawArraysInstanced(GET_DISPATCH(), (mode
, first
, count
, primcount
));
402 static void GLAPIENTRY
403 TAG(DrawElementsInstanced
)(GLenum mode
, GLsizei count
,
404 GLenum type
, const GLvoid
*indices
,
407 PRE_LOOPBACK( DrawElementsInstanced
);
408 CALL_DrawElementsInstanced(GET_DISPATCH(),
409 (mode
, count
, type
, indices
, primcount
));
413 static void GLAPIENTRY
TAG(EvalMesh1
)( GLenum mode
, GLint i1
, GLint i2
)
415 PRE_LOOPBACK( EvalMesh1
);
416 CALL_EvalMesh1(GET_DISPATCH(), ( mode
, i1
, i2
));
419 static void GLAPIENTRY
TAG(EvalMesh2
)( GLenum mode
, GLint i1
, GLint i2
,
422 PRE_LOOPBACK( EvalMesh2
);
423 CALL_EvalMesh2(GET_DISPATCH(), ( mode
, i1
, i2
, j1
, j2
));
426 static void GLAPIENTRY
TAG(VertexAttrib1fNV
)( GLuint index
, GLfloat x
)
428 PRE_LOOPBACK( VertexAttrib1fNV
);
429 CALL_VertexAttrib1fNV(GET_DISPATCH(), ( index
, x
));
432 static void GLAPIENTRY
TAG(VertexAttrib1fvNV
)( GLuint index
, const GLfloat
*v
)
434 PRE_LOOPBACK( VertexAttrib1fvNV
);
435 CALL_VertexAttrib1fvNV(GET_DISPATCH(), ( index
, v
));
438 static void GLAPIENTRY
TAG(VertexAttrib2fNV
)( GLuint index
, GLfloat x
, GLfloat y
)
440 PRE_LOOPBACK( VertexAttrib2fNV
);
441 CALL_VertexAttrib2fNV(GET_DISPATCH(), ( index
, x
, y
));
444 static void GLAPIENTRY
TAG(VertexAttrib2fvNV
)( GLuint index
, const GLfloat
*v
)
446 PRE_LOOPBACK( VertexAttrib2fvNV
);
447 CALL_VertexAttrib2fvNV(GET_DISPATCH(), ( index
, v
));
450 static void GLAPIENTRY
TAG(VertexAttrib3fNV
)( GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
452 PRE_LOOPBACK( VertexAttrib3fNV
);
453 CALL_VertexAttrib3fNV(GET_DISPATCH(), ( index
, x
, y
, z
));
456 static void GLAPIENTRY
TAG(VertexAttrib3fvNV
)( GLuint index
, const GLfloat
*v
)
458 PRE_LOOPBACK( VertexAttrib3fvNV
);
459 CALL_VertexAttrib3fvNV(GET_DISPATCH(), ( index
, v
));
462 static void GLAPIENTRY
TAG(VertexAttrib4fNV
)( GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
464 PRE_LOOPBACK( VertexAttrib4fNV
);
465 CALL_VertexAttrib4fNV(GET_DISPATCH(), ( index
, x
, y
, z
, w
));
468 static void GLAPIENTRY
TAG(VertexAttrib4fvNV
)( GLuint index
, const GLfloat
*v
)
470 PRE_LOOPBACK( VertexAttrib4fvNV
);
471 CALL_VertexAttrib4fvNV(GET_DISPATCH(), ( index
, v
));
475 static void GLAPIENTRY
TAG(VertexAttrib1fARB
)( GLuint index
, GLfloat x
)
477 PRE_LOOPBACK( VertexAttrib1fARB
);
478 CALL_VertexAttrib1fARB(GET_DISPATCH(), ( index
, x
));
481 static void GLAPIENTRY
TAG(VertexAttrib1fvARB
)( GLuint index
, const GLfloat
*v
)
483 PRE_LOOPBACK( VertexAttrib1fvARB
);
484 CALL_VertexAttrib1fvARB(GET_DISPATCH(), ( index
, v
));
487 static void GLAPIENTRY
TAG(VertexAttrib2fARB
)( GLuint index
, GLfloat x
, GLfloat y
)
489 PRE_LOOPBACK( VertexAttrib2fARB
);
490 CALL_VertexAttrib2fARB(GET_DISPATCH(), ( index
, x
, y
));
493 static void GLAPIENTRY
TAG(VertexAttrib2fvARB
)( GLuint index
, const GLfloat
*v
)
495 PRE_LOOPBACK( VertexAttrib2fvARB
);
496 CALL_VertexAttrib2fvARB(GET_DISPATCH(), ( index
, v
));
499 static void GLAPIENTRY
TAG(VertexAttrib3fARB
)( GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
501 PRE_LOOPBACK( VertexAttrib3fARB
);
502 CALL_VertexAttrib3fARB(GET_DISPATCH(), ( index
, x
, y
, z
));
505 static void GLAPIENTRY
TAG(VertexAttrib3fvARB
)( GLuint index
, const GLfloat
*v
)
507 PRE_LOOPBACK( VertexAttrib3fvARB
);
508 CALL_VertexAttrib3fvARB(GET_DISPATCH(), ( index
, v
));
511 static void GLAPIENTRY
TAG(VertexAttrib4fARB
)( GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
513 PRE_LOOPBACK( VertexAttrib4fARB
);
514 CALL_VertexAttrib4fARB(GET_DISPATCH(), ( index
, x
, y
, z
, w
));
517 static void GLAPIENTRY
TAG(VertexAttrib4fvARB
)( GLuint index
, const GLfloat
*v
)
519 PRE_LOOPBACK( VertexAttrib4fvARB
);
520 CALL_VertexAttrib4fvARB(GET_DISPATCH(), ( index
, v
));
524 static GLvertexformat
TAG(vtxfmt
) = {
542 TAG(MultiTexCoord1fARB
),
543 TAG(MultiTexCoord1fvARB
),
544 TAG(MultiTexCoord2fARB
),
545 TAG(MultiTexCoord2fvARB
),
546 TAG(MultiTexCoord3fARB
),
547 TAG(MultiTexCoord3fvARB
),
548 TAG(MultiTexCoord4fARB
),
549 TAG(MultiTexCoord4fvARB
),
552 TAG(SecondaryColor3fEXT
),
553 TAG(SecondaryColor3fvEXT
),
572 TAG(VertexAttrib1fNV
),
573 TAG(VertexAttrib1fvNV
),
574 TAG(VertexAttrib2fNV
),
575 TAG(VertexAttrib2fvNV
),
576 TAG(VertexAttrib3fNV
),
577 TAG(VertexAttrib3fvNV
),
578 TAG(VertexAttrib4fNV
),
579 TAG(VertexAttrib4fvNV
),
580 TAG(VertexAttrib1fARB
),
581 TAG(VertexAttrib1fvARB
),
582 TAG(VertexAttrib2fARB
),
583 TAG(VertexAttrib2fvARB
),
584 TAG(VertexAttrib3fARB
),
585 TAG(VertexAttrib3fvARB
),
586 TAG(VertexAttrib4fARB
),
587 TAG(VertexAttrib4fvARB
),
591 TAG(DrawRangeElements
),
592 TAG(MultiDrawElementsEXT
),
593 TAG(DrawElementsBaseVertex
),
594 TAG(DrawRangeElementsBaseVertex
),
595 TAG(MultiDrawElementsBaseVertex
),
596 TAG(DrawArraysInstanced
),
597 TAG(DrawElementsInstanced
),