4 * \author Keith Whitwell <keithw@vmware.com>
8 * Mesa 3-D graphics library
10 * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
12 * Permission is hereby granted, free of charge, to any person obtaining a
13 * copy of this software and associated documentation files (the "Software"),
14 * to deal in the Software without restriction, including without limitation
15 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
16 * and/or sell copies of the Software, and to permit persons to whom the
17 * Software is furnished to do so, subject to the following conditions:
19 * The above copyright notice and this permission notice shall be included
20 * in all copies or substantial portions of the Software.
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
23 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
25 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
28 * OTHER DEALINGS IN THE SOFTWARE.
34 #include "api_loopback.h"
36 #include "glapi/glapi.h"
37 #include "main/dispatch.h"
38 #include "main/context.h"
40 /* KW: A set of functions to convert unusual Color/Normal/Vertex/etc
41 * calls to a smaller set of driver-provided formats. Currently just
42 * go back to dispatch to find these (eg. call glNormal3f directly),
45 * The driver must supply all of the remaining entry points, which are
46 * listed in dd.h. The easiest way for a driver to do this is to
47 * install the supplied software t&l module.
49 #define COLORF(r,g,b,a) CALL_Color4f(GET_DISPATCH(), (r,g,b,a))
50 #define VERTEX2(x,y) CALL_Vertex2f(GET_DISPATCH(), (x,y))
51 #define VERTEX3(x,y,z) CALL_Vertex3f(GET_DISPATCH(), (x,y,z))
52 #define VERTEX4(x,y,z,w) CALL_Vertex4f(GET_DISPATCH(), (x,y,z,w))
53 #define NORMAL(x,y,z) CALL_Normal3f(GET_DISPATCH(), (x,y,z))
54 #define TEXCOORD1(s) CALL_TexCoord1f(GET_DISPATCH(), (s))
55 #define TEXCOORD2(s,t) CALL_TexCoord2f(GET_DISPATCH(), (s,t))
56 #define TEXCOORD3(s,t,u) CALL_TexCoord3f(GET_DISPATCH(), (s,t,u))
57 #define TEXCOORD4(s,t,u,v) CALL_TexCoord4f(GET_DISPATCH(), (s,t,u,v))
58 #define INDEX(c) CALL_Indexf(GET_DISPATCH(), (c))
59 #define MULTI_TEXCOORD1(z,s) CALL_MultiTexCoord1fARB(GET_DISPATCH(), (z,s))
60 #define MULTI_TEXCOORD2(z,s,t) CALL_MultiTexCoord2fARB(GET_DISPATCH(), (z,s,t))
61 #define MULTI_TEXCOORD3(z,s,t,u) CALL_MultiTexCoord3fARB(GET_DISPATCH(), (z,s,t,u))
62 #define MULTI_TEXCOORD4(z,s,t,u,v) CALL_MultiTexCoord4fARB(GET_DISPATCH(), (z,s,t,u,v))
63 #define EVALCOORD1(x) CALL_EvalCoord1f(GET_DISPATCH(), (x))
64 #define EVALCOORD2(x,y) CALL_EvalCoord2f(GET_DISPATCH(), (x,y))
65 #define MATERIALFV(a,b,c) CALL_Materialfv(GET_DISPATCH(), (a,b,c))
66 #define RECTF(a,b,c,d) CALL_Rectf(GET_DISPATCH(), (a,b,c,d))
68 #define FOGCOORDF(x) CALL_FogCoordfEXT(GET_DISPATCH(), (x))
69 #define SECONDARYCOLORF(a,b,c) CALL_SecondaryColor3fEXT(GET_DISPATCH(), (a,b,c))
71 #define ATTRIB1NV(index,x) CALL_VertexAttrib1fNV(GET_DISPATCH(), (index,x))
72 #define ATTRIB2NV(index,x,y) CALL_VertexAttrib2fNV(GET_DISPATCH(), (index,x,y))
73 #define ATTRIB3NV(index,x,y,z) CALL_VertexAttrib3fNV(GET_DISPATCH(), (index,x,y,z))
74 #define ATTRIB4NV(index,x,y,z,w) CALL_VertexAttrib4fNV(GET_DISPATCH(), (index,x,y,z,w))
76 #define ATTRIB1ARB(index,x) CALL_VertexAttrib1fARB(GET_DISPATCH(), (index,x))
77 #define ATTRIB2ARB(index,x,y) CALL_VertexAttrib2fARB(GET_DISPATCH(), (index,x,y))
78 #define ATTRIB3ARB(index,x,y,z) CALL_VertexAttrib3fARB(GET_DISPATCH(), (index,x,y,z))
79 #define ATTRIB4ARB(index,x,y,z,w) CALL_VertexAttrib4fARB(GET_DISPATCH(), (index,x,y,z,w))
81 #define ATTRIBI_1I(index,x) CALL_VertexAttribI1iEXT(GET_DISPATCH(), (index,x))
82 #define ATTRIBI_1UI(index,x) CALL_VertexAttribI1uiEXT(GET_DISPATCH(), (index,x))
83 #define ATTRIBI_4I(index,x,y,z,w) CALL_VertexAttribI4iEXT(GET_DISPATCH(), (index,x,y,z,w))
85 #define ATTRIBI_4UI(index,x,y,z,w) CALL_VertexAttribI4uiEXT(GET_DISPATCH(), (index,x,y,z,w))
87 #define ATTRIB1_D(index,x) CALL_VertexAttribL1d(GET_DISPATCH(), (index,x))
88 #define ATTRIB2_D(index,x,y) CALL_VertexAttribL2d(GET_DISPATCH(), (index,x,y))
89 #define ATTRIB3_D(index,x,y,z) CALL_VertexAttribL3d(GET_DISPATCH(), (index,x,y,z))
90 #define ATTRIB4_D(index,x,y,z,w) CALL_VertexAttribL4d(GET_DISPATCH(), (index,x,y,z,w))
92 #define ATTRIB1_UI64(index, x) CALL_VertexAttribL1ui64ARB(GET_DISPATCH(), (index, x))
95 _mesa_Color3b( GLbyte red
, GLbyte green
, GLbyte blue
)
97 COLORF( BYTE_TO_FLOAT(red
),
104 _mesa_Color3d( GLdouble red
, GLdouble green
, GLdouble blue
)
106 COLORF( (GLfloat
) red
, (GLfloat
) green
, (GLfloat
) blue
, 1.0 );
110 _mesa_Color3i( GLint red
, GLint green
, GLint blue
)
112 COLORF( INT_TO_FLOAT(red
), INT_TO_FLOAT(green
),
113 INT_TO_FLOAT(blue
), 1.0);
117 _mesa_Color3s( GLshort red
, GLshort green
, GLshort blue
)
119 COLORF( SHORT_TO_FLOAT(red
), SHORT_TO_FLOAT(green
),
120 SHORT_TO_FLOAT(blue
), 1.0);
124 _mesa_Color3ui( GLuint red
, GLuint green
, GLuint blue
)
126 COLORF( UINT_TO_FLOAT(red
), UINT_TO_FLOAT(green
),
127 UINT_TO_FLOAT(blue
), 1.0 );
131 _mesa_Color3us( GLushort red
, GLushort green
, GLushort blue
)
133 COLORF( USHORT_TO_FLOAT(red
), USHORT_TO_FLOAT(green
),
134 USHORT_TO_FLOAT(blue
), 1.0 );
138 _mesa_Color3ub( GLubyte red
, GLubyte green
, GLubyte blue
)
140 COLORF( UBYTE_TO_FLOAT(red
), UBYTE_TO_FLOAT(green
),
141 UBYTE_TO_FLOAT(blue
), 1.0 );
146 _mesa_Color3bv( const GLbyte
*v
)
148 COLORF( BYTE_TO_FLOAT(v
[0]), BYTE_TO_FLOAT(v
[1]),
149 BYTE_TO_FLOAT(v
[2]), 1.0 );
153 _mesa_Color3dv( const GLdouble
*v
)
155 COLORF( (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0 );
159 _mesa_Color3iv( const GLint
*v
)
161 COLORF( INT_TO_FLOAT(v
[0]), INT_TO_FLOAT(v
[1]),
162 INT_TO_FLOAT(v
[2]), 1.0 );
166 _mesa_Color3sv( const GLshort
*v
)
168 COLORF( SHORT_TO_FLOAT(v
[0]), SHORT_TO_FLOAT(v
[1]),
169 SHORT_TO_FLOAT(v
[2]), 1.0 );
173 _mesa_Color3uiv( const GLuint
*v
)
175 COLORF( UINT_TO_FLOAT(v
[0]), UINT_TO_FLOAT(v
[1]),
176 UINT_TO_FLOAT(v
[2]), 1.0 );
180 _mesa_Color3usv( const GLushort
*v
)
182 COLORF( USHORT_TO_FLOAT(v
[0]), USHORT_TO_FLOAT(v
[1]),
183 USHORT_TO_FLOAT(v
[2]), 1.0 );
187 _mesa_Color3ubv( const GLubyte
*v
)
189 COLORF( UBYTE_TO_FLOAT(v
[0]), UBYTE_TO_FLOAT(v
[1]),
190 UBYTE_TO_FLOAT(v
[2]), 1.0 );
195 _mesa_Color4b( GLbyte red
, GLbyte green
, GLbyte blue
,
198 COLORF( BYTE_TO_FLOAT(red
), BYTE_TO_FLOAT(green
),
199 BYTE_TO_FLOAT(blue
), BYTE_TO_FLOAT(alpha
) );
203 _mesa_Color4d( GLdouble red
, GLdouble green
, GLdouble blue
,
206 COLORF( (GLfloat
) red
, (GLfloat
) green
, (GLfloat
) blue
, (GLfloat
) alpha
);
210 _mesa_Color4i( GLint red
, GLint green
, GLint blue
, GLint alpha
)
212 COLORF( INT_TO_FLOAT(red
), INT_TO_FLOAT(green
),
213 INT_TO_FLOAT(blue
), INT_TO_FLOAT(alpha
) );
217 _mesa_Color4s( GLshort red
, GLshort green
, GLshort blue
,
220 COLORF( SHORT_TO_FLOAT(red
), SHORT_TO_FLOAT(green
),
221 SHORT_TO_FLOAT(blue
), SHORT_TO_FLOAT(alpha
) );
225 _mesa_Color4ui( GLuint red
, GLuint green
, GLuint blue
, GLuint alpha
)
227 COLORF( UINT_TO_FLOAT(red
), UINT_TO_FLOAT(green
),
228 UINT_TO_FLOAT(blue
), UINT_TO_FLOAT(alpha
) );
232 _mesa_Color4us( GLushort red
, GLushort green
, GLushort blue
, GLushort alpha
)
234 COLORF( USHORT_TO_FLOAT(red
), USHORT_TO_FLOAT(green
),
235 USHORT_TO_FLOAT(blue
), USHORT_TO_FLOAT(alpha
) );
239 _mesa_Color4ub( GLubyte red
, GLubyte green
, GLubyte blue
, GLubyte alpha
)
241 COLORF( UBYTE_TO_FLOAT(red
), UBYTE_TO_FLOAT(green
),
242 UBYTE_TO_FLOAT(blue
), UBYTE_TO_FLOAT(alpha
) );
247 _mesa_Color4iv( const GLint
*v
)
249 COLORF( INT_TO_FLOAT(v
[0]), INT_TO_FLOAT(v
[1]),
250 INT_TO_FLOAT(v
[2]), INT_TO_FLOAT(v
[3]) );
255 _mesa_Color4bv( const GLbyte
*v
)
257 COLORF( BYTE_TO_FLOAT(v
[0]), BYTE_TO_FLOAT(v
[1]),
258 BYTE_TO_FLOAT(v
[2]), BYTE_TO_FLOAT(v
[3]) );
262 _mesa_Color4dv( const GLdouble
*v
)
264 COLORF( (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], (GLfloat
) v
[3] );
269 _mesa_Color4sv( const GLshort
*v
)
271 COLORF( SHORT_TO_FLOAT(v
[0]), SHORT_TO_FLOAT(v
[1]),
272 SHORT_TO_FLOAT(v
[2]), SHORT_TO_FLOAT(v
[3]) );
277 _mesa_Color4uiv( const GLuint
*v
)
279 COLORF( UINT_TO_FLOAT(v
[0]), UINT_TO_FLOAT(v
[1]),
280 UINT_TO_FLOAT(v
[2]), UINT_TO_FLOAT(v
[3]) );
284 _mesa_Color4usv( const GLushort
*v
)
286 COLORF( USHORT_TO_FLOAT(v
[0]), USHORT_TO_FLOAT(v
[1]),
287 USHORT_TO_FLOAT(v
[2]), USHORT_TO_FLOAT(v
[3]) );
291 _mesa_Color4ubv( const GLubyte
*v
)
293 COLORF( UBYTE_TO_FLOAT(v
[0]), UBYTE_TO_FLOAT(v
[1]),
294 UBYTE_TO_FLOAT(v
[2]), UBYTE_TO_FLOAT(v
[3]) );
299 _mesa_FogCoordd( GLdouble d
)
301 FOGCOORDF( (GLfloat
) d
);
305 _mesa_FogCoorddv( const GLdouble
*v
)
307 FOGCOORDF( (GLfloat
) *v
);
312 _mesa_Indexd( GLdouble c
)
314 INDEX( (GLfloat
) c
);
318 _mesa_Indexi( GLint c
)
320 INDEX( (GLfloat
) c
);
324 _mesa_Indexs( GLshort c
)
326 INDEX( (GLfloat
) c
);
330 _mesa_Indexub( GLubyte c
)
332 INDEX( (GLfloat
) c
);
336 _mesa_Indexdv( const GLdouble
*c
)
338 INDEX( (GLfloat
) *c
);
342 _mesa_Indexiv( const GLint
*c
)
344 INDEX( (GLfloat
) *c
);
348 _mesa_Indexsv( const GLshort
*c
)
350 INDEX( (GLfloat
) *c
);
354 _mesa_Indexubv( const GLubyte
*c
)
356 INDEX( (GLfloat
) *c
);
361 _mesa_EdgeFlagv(const GLboolean
*flag
)
363 CALL_EdgeFlag(GET_DISPATCH(), (*flag
));
368 _mesa_Normal3b( GLbyte nx
, GLbyte ny
, GLbyte nz
)
370 NORMAL( BYTE_TO_FLOAT(nx
), BYTE_TO_FLOAT(ny
), BYTE_TO_FLOAT(nz
) );
374 _mesa_Normal3d( GLdouble nx
, GLdouble ny
, GLdouble nz
)
376 NORMAL((GLfloat
) nx
, (GLfloat
) ny
, (GLfloat
) nz
);
380 _mesa_Normal3i( GLint nx
, GLint ny
, GLint nz
)
382 NORMAL( INT_TO_FLOAT(nx
), INT_TO_FLOAT(ny
), INT_TO_FLOAT(nz
) );
386 _mesa_Normal3s( GLshort nx
, GLshort ny
, GLshort nz
)
388 NORMAL( SHORT_TO_FLOAT(nx
), SHORT_TO_FLOAT(ny
), SHORT_TO_FLOAT(nz
) );
392 _mesa_Normal3bv( const GLbyte
*v
)
394 NORMAL( BYTE_TO_FLOAT(v
[0]), BYTE_TO_FLOAT(v
[1]), BYTE_TO_FLOAT(v
[2]) );
398 _mesa_Normal3dv( const GLdouble
*v
)
400 NORMAL( (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2] );
404 _mesa_Normal3iv( const GLint
*v
)
406 NORMAL( INT_TO_FLOAT(v
[0]), INT_TO_FLOAT(v
[1]), INT_TO_FLOAT(v
[2]) );
410 _mesa_Normal3sv( const GLshort
*v
)
412 NORMAL( SHORT_TO_FLOAT(v
[0]), SHORT_TO_FLOAT(v
[1]), SHORT_TO_FLOAT(v
[2]) );
416 _mesa_TexCoord1d( GLdouble s
)
418 TEXCOORD1((GLfloat
) s
);
422 _mesa_TexCoord1i( GLint s
)
424 TEXCOORD1((GLfloat
) s
);
428 _mesa_TexCoord1s( GLshort s
)
430 TEXCOORD1((GLfloat
) s
);
434 _mesa_TexCoord2d( GLdouble s
, GLdouble t
)
436 TEXCOORD2((GLfloat
) s
,(GLfloat
) t
);
440 _mesa_TexCoord2s( GLshort s
, GLshort t
)
442 TEXCOORD2((GLfloat
) s
,(GLfloat
) t
);
446 _mesa_TexCoord2i( GLint s
, GLint t
)
448 TEXCOORD2((GLfloat
) s
,(GLfloat
) t
);
452 _mesa_TexCoord3d( GLdouble s
, GLdouble t
, GLdouble r
)
454 TEXCOORD3((GLfloat
) s
,(GLfloat
) t
,(GLfloat
) r
);
458 _mesa_TexCoord3i( GLint s
, GLint t
, GLint r
)
460 TEXCOORD3((GLfloat
) s
,(GLfloat
) t
,(GLfloat
) r
);
464 _mesa_TexCoord3s( GLshort s
, GLshort t
, GLshort r
)
466 TEXCOORD3((GLfloat
) s
,(GLfloat
) t
,(GLfloat
) r
);
470 _mesa_TexCoord4d( GLdouble s
, GLdouble t
, GLdouble r
, GLdouble q
)
472 TEXCOORD4((GLfloat
) s
,(GLfloat
) t
,(GLfloat
) r
,(GLfloat
) q
);
476 _mesa_TexCoord4i( GLint s
, GLint t
, GLint r
, GLint q
)
478 TEXCOORD4((GLfloat
) s
,(GLfloat
) t
,(GLfloat
) r
,(GLfloat
) q
);
482 _mesa_TexCoord4s( GLshort s
, GLshort t
, GLshort r
, GLshort q
)
484 TEXCOORD4((GLfloat
) s
,(GLfloat
) t
,(GLfloat
) r
,(GLfloat
) q
);
488 _mesa_TexCoord1dv( const GLdouble
*v
)
490 TEXCOORD1((GLfloat
) v
[0]);
494 _mesa_TexCoord1iv( const GLint
*v
)
496 TEXCOORD1((GLfloat
) v
[0]);
500 _mesa_TexCoord1sv( const GLshort
*v
)
502 TEXCOORD1((GLfloat
) v
[0]);
506 _mesa_TexCoord2dv( const GLdouble
*v
)
508 TEXCOORD2((GLfloat
) v
[0],(GLfloat
) v
[1]);
512 _mesa_TexCoord2iv( const GLint
*v
)
514 TEXCOORD2((GLfloat
) v
[0],(GLfloat
) v
[1]);
518 _mesa_TexCoord2sv( const GLshort
*v
)
520 TEXCOORD2((GLfloat
) v
[0],(GLfloat
) v
[1]);
524 _mesa_TexCoord3dv( const GLdouble
*v
)
526 TEXCOORD3((GLfloat
) v
[0],(GLfloat
) v
[1],(GLfloat
) v
[2]);
530 _mesa_TexCoord3iv( const GLint
*v
)
532 TEXCOORD3((GLfloat
) v
[0],(GLfloat
) v
[1],(GLfloat
) v
[2]);
536 _mesa_TexCoord3sv( const GLshort
*v
)
538 TEXCOORD3((GLfloat
) v
[0],(GLfloat
) v
[1],(GLfloat
) v
[2]);
542 _mesa_TexCoord4dv( const GLdouble
*v
)
544 TEXCOORD4((GLfloat
) v
[0],(GLfloat
) v
[1],(GLfloat
) v
[2],(GLfloat
) v
[3]);
548 _mesa_TexCoord4iv( const GLint
*v
)
550 TEXCOORD4((GLfloat
) v
[0],(GLfloat
) v
[1],(GLfloat
) v
[2],(GLfloat
) v
[3]);
554 _mesa_TexCoord4sv( const GLshort
*v
)
556 TEXCOORD4((GLfloat
) v
[0],(GLfloat
) v
[1],(GLfloat
) v
[2],(GLfloat
) v
[3]);
560 _mesa_Vertex2d( GLdouble x
, GLdouble y
)
562 VERTEX2( (GLfloat
) x
, (GLfloat
) y
);
566 _mesa_Vertex2i( GLint x
, GLint y
)
568 VERTEX2( (GLfloat
) x
, (GLfloat
) y
);
572 _mesa_Vertex2s( GLshort x
, GLshort y
)
574 VERTEX2( (GLfloat
) x
, (GLfloat
) y
);
578 _mesa_Vertex3d( GLdouble x
, GLdouble y
, GLdouble z
)
580 VERTEX3( (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
584 _mesa_Vertex3i( GLint x
, GLint y
, GLint z
)
586 VERTEX3( (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
590 _mesa_Vertex3s( GLshort x
, GLshort y
, GLshort z
)
592 VERTEX3( (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
596 _mesa_Vertex4d( GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
598 VERTEX4( (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
602 _mesa_Vertex4i( GLint x
, GLint y
, GLint z
, GLint w
)
604 VERTEX4( (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
608 _mesa_Vertex4s( GLshort x
, GLshort y
, GLshort z
, GLshort w
)
610 VERTEX4( (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
614 _mesa_Vertex2dv( const GLdouble
*v
)
616 VERTEX2( (GLfloat
) v
[0], (GLfloat
) v
[1] );
620 _mesa_Vertex2iv( const GLint
*v
)
622 VERTEX2( (GLfloat
) v
[0], (GLfloat
) v
[1] );
626 _mesa_Vertex2sv( const GLshort
*v
)
628 VERTEX2( (GLfloat
) v
[0], (GLfloat
) v
[1] );
632 _mesa_Vertex3dv( const GLdouble
*v
)
635 VERTEX2( (GLfloat
) v
[0], (GLfloat
) v
[1] );
637 VERTEX3( (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2] );
641 _mesa_Vertex3iv( const GLint
*v
)
643 VERTEX3( (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2] );
647 _mesa_Vertex3sv( const GLshort
*v
)
649 VERTEX3( (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2] );
653 _mesa_Vertex4dv( const GLdouble
*v
)
655 VERTEX4( (GLfloat
) v
[0], (GLfloat
) v
[1],
656 (GLfloat
) v
[2], (GLfloat
) v
[3] );
660 _mesa_Vertex4iv( const GLint
*v
)
662 VERTEX4( (GLfloat
) v
[0], (GLfloat
) v
[1],
663 (GLfloat
) v
[2], (GLfloat
) v
[3] );
667 _mesa_Vertex4sv( const GLshort
*v
)
669 VERTEX4( (GLfloat
) v
[0], (GLfloat
) v
[1],
670 (GLfloat
) v
[2], (GLfloat
) v
[3] );
674 _mesa_MultiTexCoord1d(GLenum target
, GLdouble s
)
676 MULTI_TEXCOORD1( target
, (GLfloat
) s
);
680 _mesa_MultiTexCoord1dv(GLenum target
, const GLdouble
*v
)
682 MULTI_TEXCOORD1( target
, (GLfloat
) v
[0] );
686 _mesa_MultiTexCoord1i(GLenum target
, GLint s
)
688 MULTI_TEXCOORD1( target
, (GLfloat
) s
);
692 _mesa_MultiTexCoord1iv(GLenum target
, const GLint
*v
)
694 MULTI_TEXCOORD1( target
, (GLfloat
) v
[0] );
698 _mesa_MultiTexCoord1s(GLenum target
, GLshort s
)
700 MULTI_TEXCOORD1( target
, (GLfloat
) s
);
704 _mesa_MultiTexCoord1sv(GLenum target
, const GLshort
*v
)
706 MULTI_TEXCOORD1( target
, (GLfloat
) v
[0] );
710 _mesa_MultiTexCoord2d(GLenum target
, GLdouble s
, GLdouble t
)
712 MULTI_TEXCOORD2( target
, (GLfloat
) s
, (GLfloat
) t
);
716 _mesa_MultiTexCoord2dv(GLenum target
, const GLdouble
*v
)
718 MULTI_TEXCOORD2( target
, (GLfloat
) v
[0], (GLfloat
) v
[1] );
722 _mesa_MultiTexCoord2i(GLenum target
, GLint s
, GLint t
)
724 MULTI_TEXCOORD2( target
, (GLfloat
) s
, (GLfloat
) t
);
728 _mesa_MultiTexCoord2iv(GLenum target
, const GLint
*v
)
730 MULTI_TEXCOORD2( target
, (GLfloat
) v
[0], (GLfloat
) v
[1] );
734 _mesa_MultiTexCoord2s(GLenum target
, GLshort s
, GLshort t
)
736 MULTI_TEXCOORD2( target
, (GLfloat
) s
, (GLfloat
) t
);
740 _mesa_MultiTexCoord2sv(GLenum target
, const GLshort
*v
)
742 MULTI_TEXCOORD2( target
, (GLfloat
) v
[0], (GLfloat
) v
[1] );
746 _mesa_MultiTexCoord3d(GLenum target
, GLdouble s
, GLdouble t
, GLdouble r
)
748 MULTI_TEXCOORD3( target
, (GLfloat
) s
, (GLfloat
) t
, (GLfloat
) r
);
752 _mesa_MultiTexCoord3dv(GLenum target
, const GLdouble
*v
)
754 MULTI_TEXCOORD3( target
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2] );
758 _mesa_MultiTexCoord3i(GLenum target
, GLint s
, GLint t
, GLint r
)
760 MULTI_TEXCOORD3( target
, (GLfloat
) s
, (GLfloat
) t
, (GLfloat
) r
);
764 _mesa_MultiTexCoord3iv(GLenum target
, const GLint
*v
)
766 MULTI_TEXCOORD3( target
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2] );
770 _mesa_MultiTexCoord3s(GLenum target
, GLshort s
, GLshort t
, GLshort r
)
772 MULTI_TEXCOORD3( target
, (GLfloat
) s
, (GLfloat
) t
, (GLfloat
) r
);
776 _mesa_MultiTexCoord3sv(GLenum target
, const GLshort
*v
)
778 MULTI_TEXCOORD3( target
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2] );
782 _mesa_MultiTexCoord4d(GLenum target
, GLdouble s
, GLdouble t
, GLdouble r
, GLdouble q
)
784 MULTI_TEXCOORD4( target
, (GLfloat
) s
, (GLfloat
) t
,
785 (GLfloat
) r
, (GLfloat
) q
);
789 _mesa_MultiTexCoord4dv(GLenum target
, const GLdouble
*v
)
791 MULTI_TEXCOORD4( target
, (GLfloat
) v
[0], (GLfloat
) v
[1],
792 (GLfloat
) v
[2], (GLfloat
) v
[3] );
796 _mesa_MultiTexCoord4i(GLenum target
, GLint s
, GLint t
, GLint r
, GLint q
)
798 MULTI_TEXCOORD4( target
, (GLfloat
) s
, (GLfloat
) t
,
799 (GLfloat
) r
, (GLfloat
) q
);
803 _mesa_MultiTexCoord4iv(GLenum target
, const GLint
*v
)
805 MULTI_TEXCOORD4( target
, (GLfloat
) v
[0], (GLfloat
) v
[1],
806 (GLfloat
) v
[2], (GLfloat
) v
[3] );
810 _mesa_MultiTexCoord4s(GLenum target
, GLshort s
, GLshort t
, GLshort r
, GLshort q
)
812 MULTI_TEXCOORD4( target
, (GLfloat
) s
, (GLfloat
) t
,
813 (GLfloat
) r
, (GLfloat
) q
);
817 _mesa_MultiTexCoord4sv(GLenum target
, const GLshort
*v
)
819 MULTI_TEXCOORD4( target
, (GLfloat
) v
[0], (GLfloat
) v
[1],
820 (GLfloat
) v
[2], (GLfloat
) v
[3] );
824 _mesa_EvalCoord2dv( const GLdouble
*u
)
826 EVALCOORD2( (GLfloat
) u
[0], (GLfloat
) u
[1] );
830 _mesa_EvalCoord2fv( const GLfloat
*u
)
832 EVALCOORD2( u
[0], u
[1] );
836 _mesa_EvalCoord2d( GLdouble u
, GLdouble v
)
838 EVALCOORD2( (GLfloat
) u
, (GLfloat
) v
);
842 _mesa_EvalCoord1dv( const GLdouble
*u
)
844 EVALCOORD1( (GLfloat
) *u
);
848 _mesa_EvalCoord1fv( const GLfloat
*u
)
850 EVALCOORD1( (GLfloat
) *u
);
854 _mesa_EvalCoord1d( GLdouble u
)
856 EVALCOORD1( (GLfloat
) u
);
860 _mesa_Materialf( GLenum face
, GLenum pname
, GLfloat param
)
864 MATERIALFV( face
, pname
, fparam
);
868 _mesa_Materiali(GLenum face
, GLenum pname
, GLint param
)
871 p
[0] = (GLfloat
) param
;
872 MATERIALFV(face
, pname
, p
);
876 _mesa_Materialiv(GLenum face
, GLenum pname
, const GLint
*params
)
884 case GL_AMBIENT_AND_DIFFUSE
:
885 fparam
[0] = INT_TO_FLOAT( params
[0] );
886 fparam
[1] = INT_TO_FLOAT( params
[1] );
887 fparam
[2] = INT_TO_FLOAT( params
[2] );
888 fparam
[3] = INT_TO_FLOAT( params
[3] );
891 fparam
[0] = (GLfloat
) params
[0];
893 case GL_COLOR_INDEXES
:
894 fparam
[0] = (GLfloat
) params
[0];
895 fparam
[1] = (GLfloat
) params
[1];
896 fparam
[2] = (GLfloat
) params
[2];
901 MATERIALFV(face
, pname
, fparam
);
906 _mesa_Rectd(GLdouble x1
, GLdouble y1
, GLdouble x2
, GLdouble y2
)
908 RECTF((GLfloat
) x1
, (GLfloat
) y1
, (GLfloat
) x2
, (GLfloat
) y2
);
912 _mesa_Rectdv(const GLdouble
*v1
, const GLdouble
*v2
)
914 RECTF((GLfloat
) v1
[0], (GLfloat
) v1
[1], (GLfloat
) v2
[0], (GLfloat
) v2
[1]);
918 _mesa_Rectfv(const GLfloat
*v1
, const GLfloat
*v2
)
920 RECTF(v1
[0], v1
[1], v2
[0], v2
[1]);
924 _mesa_Recti(GLint x1
, GLint y1
, GLint x2
, GLint y2
)
926 RECTF((GLfloat
) x1
, (GLfloat
) y1
, (GLfloat
) x2
, (GLfloat
) y2
);
930 _mesa_Rectiv(const GLint
*v1
, const GLint
*v2
)
932 RECTF((GLfloat
) v1
[0], (GLfloat
) v1
[1], (GLfloat
) v2
[0], (GLfloat
) v2
[1]);
936 _mesa_Rects(GLshort x1
, GLshort y1
, GLshort x2
, GLshort y2
)
938 RECTF((GLfloat
) x1
, (GLfloat
) y1
, (GLfloat
) x2
, (GLfloat
) y2
);
942 _mesa_Rectsv(const GLshort
*v1
, const GLshort
*v2
)
944 RECTF((GLfloat
) v1
[0], (GLfloat
) v1
[1], (GLfloat
) v2
[0], (GLfloat
) v2
[1]);
948 _mesa_SecondaryColor3b( GLbyte red
, GLbyte green
, GLbyte blue
)
950 SECONDARYCOLORF( BYTE_TO_FLOAT(red
),
951 BYTE_TO_FLOAT(green
),
952 BYTE_TO_FLOAT(blue
) );
956 _mesa_SecondaryColor3d( GLdouble red
, GLdouble green
, GLdouble blue
)
958 SECONDARYCOLORF( (GLfloat
) red
, (GLfloat
) green
, (GLfloat
) blue
);
962 _mesa_SecondaryColor3i( GLint red
, GLint green
, GLint blue
)
964 SECONDARYCOLORF( INT_TO_FLOAT(red
),
970 _mesa_SecondaryColor3s( GLshort red
, GLshort green
, GLshort blue
)
972 SECONDARYCOLORF(SHORT_TO_FLOAT(red
),
973 SHORT_TO_FLOAT(green
),
974 SHORT_TO_FLOAT(blue
));
978 _mesa_SecondaryColor3ui( GLuint red
, GLuint green
, GLuint blue
)
980 SECONDARYCOLORF(UINT_TO_FLOAT(red
),
981 UINT_TO_FLOAT(green
),
982 UINT_TO_FLOAT(blue
));
986 _mesa_SecondaryColor3us( GLushort red
, GLushort green
, GLushort blue
)
988 SECONDARYCOLORF(USHORT_TO_FLOAT(red
),
989 USHORT_TO_FLOAT(green
),
990 USHORT_TO_FLOAT(blue
));
994 _mesa_SecondaryColor3ub( GLubyte red
, GLubyte green
, GLubyte blue
)
996 SECONDARYCOLORF(UBYTE_TO_FLOAT(red
),
997 UBYTE_TO_FLOAT(green
),
998 UBYTE_TO_FLOAT(blue
));
1002 _mesa_SecondaryColor3bv( const GLbyte
*v
)
1004 SECONDARYCOLORF(BYTE_TO_FLOAT(v
[0]),
1005 BYTE_TO_FLOAT(v
[1]),
1006 BYTE_TO_FLOAT(v
[2]));
1010 _mesa_SecondaryColor3dv( const GLdouble
*v
)
1012 SECONDARYCOLORF( (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2] );
1015 _mesa_SecondaryColor3iv( const GLint
*v
)
1017 SECONDARYCOLORF(INT_TO_FLOAT(v
[0]),
1019 INT_TO_FLOAT(v
[2]));
1023 _mesa_SecondaryColor3sv( const GLshort
*v
)
1025 SECONDARYCOLORF(SHORT_TO_FLOAT(v
[0]),
1026 SHORT_TO_FLOAT(v
[1]),
1027 SHORT_TO_FLOAT(v
[2]));
1031 _mesa_SecondaryColor3uiv( const GLuint
*v
)
1033 SECONDARYCOLORF(UINT_TO_FLOAT(v
[0]),
1034 UINT_TO_FLOAT(v
[1]),
1035 UINT_TO_FLOAT(v
[2]));
1039 _mesa_SecondaryColor3usv( const GLushort
*v
)
1041 SECONDARYCOLORF(USHORT_TO_FLOAT(v
[0]),
1042 USHORT_TO_FLOAT(v
[1]),
1043 USHORT_TO_FLOAT(v
[2]));
1047 _mesa_SecondaryColor3ubv( const GLubyte
*v
)
1049 SECONDARYCOLORF(UBYTE_TO_FLOAT(v
[0]),
1050 UBYTE_TO_FLOAT(v
[1]),
1051 UBYTE_TO_FLOAT(v
[2]));
1056 * GL_NV_vertex_program:
1057 * Always loop-back to one of the VertexAttrib[1234]f[v]NV functions.
1058 * Note that attribute indexes DO alias conventional vertex attributes.
1062 _mesa_VertexAttrib1sNV(GLuint index
, GLshort x
)
1064 ATTRIB1NV(index
, (GLfloat
) x
);
1068 _mesa_VertexAttrib1dNV(GLuint index
, GLdouble x
)
1070 ATTRIB1NV(index
, (GLfloat
) x
);
1074 _mesa_VertexAttrib2sNV(GLuint index
, GLshort x
, GLshort y
)
1076 ATTRIB2NV(index
, (GLfloat
) x
, y
);
1080 _mesa_VertexAttrib2dNV(GLuint index
, GLdouble x
, GLdouble y
)
1082 ATTRIB2NV(index
, (GLfloat
) x
, (GLfloat
) y
);
1086 _mesa_VertexAttrib3sNV(GLuint index
, GLshort x
, GLshort y
, GLshort z
)
1088 ATTRIB3NV(index
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
1092 _mesa_VertexAttrib3dNV(GLuint index
, GLdouble x
, GLdouble y
, GLdouble z
)
1094 ATTRIB4NV(index
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
1098 _mesa_VertexAttrib4sNV(GLuint index
, GLshort x
, GLshort y
, GLshort z
, GLshort w
)
1100 ATTRIB4NV(index
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
1104 _mesa_VertexAttrib4dNV(GLuint index
, GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
1106 ATTRIB4NV(index
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
1110 _mesa_VertexAttrib4ubNV(GLuint index
, GLubyte x
, GLubyte y
, GLubyte z
, GLubyte w
)
1112 ATTRIB4NV(index
, UBYTE_TO_FLOAT(x
), UBYTE_TO_FLOAT(y
),
1113 UBYTE_TO_FLOAT(z
), UBYTE_TO_FLOAT(w
));
1117 _mesa_VertexAttrib1svNV(GLuint index
, const GLshort
*v
)
1119 ATTRIB1NV(index
, (GLfloat
) v
[0]);
1123 _mesa_VertexAttrib1dvNV(GLuint index
, const GLdouble
*v
)
1125 ATTRIB1NV(index
, (GLfloat
) v
[0]);
1129 _mesa_VertexAttrib2svNV(GLuint index
, const GLshort
*v
)
1131 ATTRIB2NV(index
, (GLfloat
) v
[0], (GLfloat
) v
[1]);
1135 _mesa_VertexAttrib2dvNV(GLuint index
, const GLdouble
*v
)
1137 ATTRIB2NV(index
, (GLfloat
) v
[0], (GLfloat
) v
[1]);
1141 _mesa_VertexAttrib3svNV(GLuint index
, const GLshort
*v
)
1143 ATTRIB3NV(index
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2]);
1147 _mesa_VertexAttrib3dvNV(GLuint index
, const GLdouble
*v
)
1149 ATTRIB3NV(index
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2]);
1153 _mesa_VertexAttrib4svNV(GLuint index
, const GLshort
*v
)
1155 ATTRIB4NV(index
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2],
1160 _mesa_VertexAttrib4dvNV(GLuint index
, const GLdouble
*v
)
1162 ATTRIB4NV(index
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], (GLfloat
) v
[3]);
1166 _mesa_VertexAttrib4ubvNV(GLuint index
, const GLubyte
*v
)
1168 ATTRIB4NV(index
, UBYTE_TO_FLOAT(v
[0]), UBYTE_TO_FLOAT(v
[1]),
1169 UBYTE_TO_FLOAT(v
[2]), UBYTE_TO_FLOAT(v
[3]));
1174 _mesa_VertexAttribs1svNV(GLuint index
, GLsizei n
, const GLshort
*v
)
1177 for (i
= n
- 1; i
>= 0; i
--)
1178 _mesa_VertexAttrib1svNV(index
+ i
, v
+ i
);
1182 _mesa_VertexAttribs1fvNV(GLuint index
, GLsizei n
, const GLfloat
*v
)
1185 for (i
= n
- 1; i
>= 0; i
--)
1186 ATTRIB1NV(index
+ i
, v
[i
]);
1190 _mesa_VertexAttribs1dvNV(GLuint index
, GLsizei n
, const GLdouble
*v
)
1193 for (i
= n
- 1; i
>= 0; i
--)
1194 _mesa_VertexAttrib1dvNV(index
+ i
, v
+ i
);
1198 _mesa_VertexAttribs2svNV(GLuint index
, GLsizei n
, const GLshort
*v
)
1201 for (i
= n
- 1; i
>= 0; i
--)
1202 _mesa_VertexAttrib2svNV(index
+ i
, v
+ 2 * i
);
1206 _mesa_VertexAttribs2fvNV(GLuint index
, GLsizei n
, const GLfloat
*v
)
1209 for (i
= n
- 1; i
>= 0; i
--)
1210 ATTRIB2NV(index
+ i
, v
[2 * i
], v
[2 * i
+ 1]);
1214 _mesa_VertexAttribs2dvNV(GLuint index
, GLsizei n
, const GLdouble
*v
)
1217 for (i
= n
- 1; i
>= 0; i
--)
1218 _mesa_VertexAttrib2dvNV(index
+ i
, v
+ 2 * i
);
1222 _mesa_VertexAttribs3svNV(GLuint index
, GLsizei n
, const GLshort
*v
)
1225 for (i
= n
- 1; i
>= 0; i
--)
1226 _mesa_VertexAttrib3svNV(index
+ i
, v
+ 3 * i
);
1230 _mesa_VertexAttribs3fvNV(GLuint index
, GLsizei n
, const GLfloat
*v
)
1233 for (i
= n
- 1; i
>= 0; i
--)
1234 ATTRIB3NV(index
+ i
, v
[3 * i
], v
[3 * i
+ 1], v
[3 * i
+ 2]);
1238 _mesa_VertexAttribs3dvNV(GLuint index
, GLsizei n
, const GLdouble
*v
)
1241 for (i
= n
- 1; i
>= 0; i
--)
1242 _mesa_VertexAttrib3dvNV(index
+ i
, v
+ 3 * i
);
1246 _mesa_VertexAttribs4svNV(GLuint index
, GLsizei n
, const GLshort
*v
)
1249 for (i
= n
- 1; i
>= 0; i
--)
1250 _mesa_VertexAttrib4svNV(index
+ i
, v
+ 4 * i
);
1254 _mesa_VertexAttribs4fvNV(GLuint index
, GLsizei n
, const GLfloat
*v
)
1257 for (i
= n
- 1; i
>= 0; i
--)
1258 ATTRIB4NV(index
+ i
, v
[4 * i
], v
[4 * i
+ 1], v
[4 * i
+ 2], v
[4 * i
+ 3]);
1262 _mesa_VertexAttribs4dvNV(GLuint index
, GLsizei n
, const GLdouble
*v
)
1265 for (i
= n
- 1; i
>= 0; i
--)
1266 _mesa_VertexAttrib4dvNV(index
+ i
, v
+ 4 * i
);
1270 _mesa_VertexAttribs4ubvNV(GLuint index
, GLsizei n
, const GLubyte
*v
)
1273 for (i
= n
- 1; i
>= 0; i
--)
1274 _mesa_VertexAttrib4ubvNV(index
+ i
, v
+ 4 * i
);
1279 * GL_ARB_vertex_program
1280 * Always loop-back to one of the VertexAttrib[1234]f[v]ARB functions.
1281 * Note that attribute indexes do NOT alias conventional attributes.
1285 _mesa_VertexAttrib1s(GLuint index
, GLshort x
)
1287 ATTRIB1ARB(index
, (GLfloat
) x
);
1291 _mesa_VertexAttrib1d(GLuint index
, GLdouble x
)
1293 ATTRIB1ARB(index
, (GLfloat
) x
);
1297 _mesa_VertexAttrib2s(GLuint index
, GLshort x
, GLshort y
)
1299 ATTRIB2ARB(index
, (GLfloat
) x
, y
);
1303 _mesa_VertexAttrib2d(GLuint index
, GLdouble x
, GLdouble y
)
1305 ATTRIB2ARB(index
, (GLfloat
) x
, (GLfloat
) y
);
1309 _mesa_VertexAttrib3s(GLuint index
, GLshort x
, GLshort y
, GLshort z
)
1311 ATTRIB3ARB(index
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
1315 _mesa_VertexAttrib3d(GLuint index
, GLdouble x
, GLdouble y
, GLdouble z
)
1317 ATTRIB4ARB(index
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
1321 _mesa_VertexAttrib4s(GLuint index
, GLshort x
, GLshort y
, GLshort z
, GLshort w
)
1323 ATTRIB4ARB(index
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
1327 _mesa_VertexAttrib4d(GLuint index
, GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
1329 ATTRIB4ARB(index
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
1333 _mesa_VertexAttrib1sv(GLuint index
, const GLshort
*v
)
1335 ATTRIB1ARB(index
, (GLfloat
) v
[0]);
1339 _mesa_VertexAttrib1dv(GLuint index
, const GLdouble
*v
)
1341 ATTRIB1ARB(index
, (GLfloat
) v
[0]);
1345 _mesa_VertexAttrib2sv(GLuint index
, const GLshort
*v
)
1347 ATTRIB2ARB(index
, (GLfloat
) v
[0], (GLfloat
) v
[1]);
1351 _mesa_VertexAttrib2dv(GLuint index
, const GLdouble
*v
)
1353 ATTRIB2ARB(index
, (GLfloat
) v
[0], (GLfloat
) v
[1]);
1357 _mesa_VertexAttrib3sv(GLuint index
, const GLshort
*v
)
1359 ATTRIB3ARB(index
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2]);
1363 _mesa_VertexAttrib3dv(GLuint index
, const GLdouble
*v
)
1365 ATTRIB3ARB(index
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2]);
1369 _mesa_VertexAttrib4sv(GLuint index
, const GLshort
*v
)
1371 ATTRIB4ARB(index
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2],
1376 _mesa_VertexAttrib4dv(GLuint index
, const GLdouble
*v
)
1378 ATTRIB4ARB(index
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], (GLfloat
) v
[3]);
1382 _mesa_VertexAttrib4bv(GLuint index
, const GLbyte
* v
)
1384 ATTRIB4ARB(index
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], (GLfloat
) v
[3]);
1388 _mesa_VertexAttrib4iv(GLuint index
, const GLint
* v
)
1390 ATTRIB4ARB(index
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], (GLfloat
) v
[3]);
1394 _mesa_VertexAttrib4ubv(GLuint index
, const GLubyte
* v
)
1396 ATTRIB4ARB(index
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], (GLfloat
) v
[3]);
1400 _mesa_VertexAttrib4usv(GLuint index
, const GLushort
* v
)
1402 ATTRIB4ARB(index
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], (GLfloat
) v
[3]);
1406 _mesa_VertexAttrib4uiv(GLuint index
, const GLuint
* v
)
1408 ATTRIB4ARB(index
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], (GLfloat
) v
[3]);
1412 _mesa_VertexAttrib4Nbv(GLuint index
, const GLbyte
* v
)
1414 ATTRIB4ARB(index
, BYTE_TO_FLOAT(v
[0]), BYTE_TO_FLOAT(v
[1]),
1415 BYTE_TO_FLOAT(v
[2]), BYTE_TO_FLOAT(v
[3]));
1419 _mesa_VertexAttrib4Nsv(GLuint index
, const GLshort
* v
)
1421 ATTRIB4ARB(index
, SHORT_TO_FLOAT(v
[0]), SHORT_TO_FLOAT(v
[1]),
1422 SHORT_TO_FLOAT(v
[2]), SHORT_TO_FLOAT(v
[3]));
1426 _mesa_VertexAttrib4Niv(GLuint index
, const GLint
* v
)
1428 ATTRIB4ARB(index
, INT_TO_FLOAT(v
[0]), INT_TO_FLOAT(v
[1]),
1429 INT_TO_FLOAT(v
[2]), INT_TO_FLOAT(v
[3]));
1433 _mesa_VertexAttrib4Nub(GLuint index
, GLubyte x
, GLubyte y
, GLubyte z
, GLubyte w
)
1435 ATTRIB4ARB(index
, UBYTE_TO_FLOAT(x
), UBYTE_TO_FLOAT(y
),
1436 UBYTE_TO_FLOAT(z
), UBYTE_TO_FLOAT(w
));
1440 _mesa_VertexAttrib4Nubv(GLuint index
, const GLubyte
* v
)
1442 ATTRIB4ARB(index
, UBYTE_TO_FLOAT(v
[0]), UBYTE_TO_FLOAT(v
[1]),
1443 UBYTE_TO_FLOAT(v
[2]), UBYTE_TO_FLOAT(v
[3]));
1447 _mesa_VertexAttrib4Nusv(GLuint index
, const GLushort
* v
)
1449 ATTRIB4ARB(index
, USHORT_TO_FLOAT(v
[0]), USHORT_TO_FLOAT(v
[1]),
1450 USHORT_TO_FLOAT(v
[2]), USHORT_TO_FLOAT(v
[3]));
1454 _mesa_VertexAttrib4Nuiv(GLuint index
, const GLuint
* v
)
1456 ATTRIB4ARB(index
, UINT_TO_FLOAT(v
[0]), UINT_TO_FLOAT(v
[1]),
1457 UINT_TO_FLOAT(v
[2]), UINT_TO_FLOAT(v
[3]));
1463 * GL_EXT_gpu_shader / GL 3.0 signed/unsigned integer-valued attributes.
1464 * Note that attribute indexes do NOT alias conventional attributes.
1468 _mesa_VertexAttribI1iv(GLuint index
, const GLint
*v
)
1470 ATTRIBI_1I(index
, v
[0]);
1474 _mesa_VertexAttribI1uiv(GLuint index
, const GLuint
*v
)
1476 ATTRIBI_1UI(index
, v
[0]);
1480 _mesa_VertexAttribI4bv(GLuint index
, const GLbyte
*v
)
1482 ATTRIBI_4I(index
, v
[0], v
[1], v
[2], v
[3]);
1486 _mesa_VertexAttribI4sv(GLuint index
, const GLshort
*v
)
1488 ATTRIBI_4I(index
, v
[0], v
[1], v
[2], v
[3]);
1492 _mesa_VertexAttribI4ubv(GLuint index
, const GLubyte
*v
)
1494 ATTRIBI_4UI(index
, v
[0], v
[1], v
[2], v
[3]);
1498 _mesa_VertexAttribI4usv(GLuint index
, const GLushort
*v
)
1500 ATTRIBI_4UI(index
, v
[0], v
[1], v
[2], v
[3]);
1504 _mesa_VertexAttribL1d(GLuint index
, GLdouble x
)
1506 ATTRIB1_D(index
, x
);
1510 _mesa_VertexAttribL2d(GLuint index
, GLdouble x
, GLdouble y
)
1512 ATTRIB2_D(index
, x
, y
);
1516 _mesa_VertexAttribL3d(GLuint index
, GLdouble x
, GLdouble y
, GLdouble z
)
1518 ATTRIB3_D(index
, x
, y
, z
);
1522 _mesa_VertexAttribL4d(GLuint index
, GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
1524 ATTRIB4_D(index
, x
, y
, z
, w
);
1528 _mesa_VertexAttribL1dv(GLuint index
, const GLdouble
*v
)
1530 ATTRIB1_D(index
, v
[0]);
1534 _mesa_VertexAttribL1ui64ARB(GLuint index
, GLuint64EXT x
)
1536 ATTRIB1_UI64(index
, x
);
1540 _mesa_VertexAttribL1ui64vARB(GLuint index
, const GLuint64EXT
*v
)
1542 ATTRIB1_UI64(index
, v
[0]);
1546 _mesa_VertexAttribL2dv(GLuint index
, const GLdouble
*v
)
1548 ATTRIB2_D(index
, v
[0], v
[1]);
1552 _mesa_VertexAttribL3dv(GLuint index
, const GLdouble
*v
)
1554 ATTRIB3_D(index
, v
[0], v
[1], v
[2]);
1558 _mesa_VertexAttribL4dv(GLuint index
, const GLdouble
*v
)
1560 ATTRIB4_D(index
, v
[0], v
[1], v
[2], v
[3]);
1564 * This code never registers handlers for any of the entry points
1565 * listed in vtxfmt.h.
1568 _mesa_loopback_init_api_table(const struct gl_context
*ctx
,
1569 struct _glapi_table
*dest
)
1571 if (ctx
->API
!= API_OPENGL_CORE
&& ctx
->API
!= API_OPENGLES2
) {
1572 SET_Color4ub(dest
, _mesa_Color4ub
);
1573 SET_Materialf(dest
, _mesa_Materialf
);
1575 if (ctx
->API
== API_OPENGL_COMPAT
) {
1576 SET_Color3b(dest
, _mesa_Color3b
);
1577 SET_Color3d(dest
, _mesa_Color3d
);
1578 SET_Color3i(dest
, _mesa_Color3i
);
1579 SET_Color3s(dest
, _mesa_Color3s
);
1580 SET_Color3ui(dest
, _mesa_Color3ui
);
1581 SET_Color3us(dest
, _mesa_Color3us
);
1582 SET_Color3ub(dest
, _mesa_Color3ub
);
1583 SET_Color4b(dest
, _mesa_Color4b
);
1584 SET_Color4d(dest
, _mesa_Color4d
);
1585 SET_Color4i(dest
, _mesa_Color4i
);
1586 SET_Color4s(dest
, _mesa_Color4s
);
1587 SET_Color4ui(dest
, _mesa_Color4ui
);
1588 SET_Color4us(dest
, _mesa_Color4us
);
1589 SET_Color3bv(dest
, _mesa_Color3bv
);
1590 SET_Color3dv(dest
, _mesa_Color3dv
);
1591 SET_Color3iv(dest
, _mesa_Color3iv
);
1592 SET_Color3sv(dest
, _mesa_Color3sv
);
1593 SET_Color3uiv(dest
, _mesa_Color3uiv
);
1594 SET_Color3usv(dest
, _mesa_Color3usv
);
1595 SET_Color3ubv(dest
, _mesa_Color3ubv
);
1596 SET_Color4bv(dest
, _mesa_Color4bv
);
1597 SET_Color4dv(dest
, _mesa_Color4dv
);
1598 SET_Color4iv(dest
, _mesa_Color4iv
);
1599 SET_Color4sv(dest
, _mesa_Color4sv
);
1600 SET_Color4uiv(dest
, _mesa_Color4uiv
);
1601 SET_Color4usv(dest
, _mesa_Color4usv
);
1602 SET_Color4ubv(dest
, _mesa_Color4ubv
);
1604 SET_SecondaryColor3b(dest
, _mesa_SecondaryColor3b
);
1605 SET_SecondaryColor3d(dest
, _mesa_SecondaryColor3d
);
1606 SET_SecondaryColor3i(dest
, _mesa_SecondaryColor3i
);
1607 SET_SecondaryColor3s(dest
, _mesa_SecondaryColor3s
);
1608 SET_SecondaryColor3ui(dest
, _mesa_SecondaryColor3ui
);
1609 SET_SecondaryColor3us(dest
, _mesa_SecondaryColor3us
);
1610 SET_SecondaryColor3ub(dest
, _mesa_SecondaryColor3ub
);
1611 SET_SecondaryColor3bv(dest
, _mesa_SecondaryColor3bv
);
1612 SET_SecondaryColor3dv(dest
, _mesa_SecondaryColor3dv
);
1613 SET_SecondaryColor3iv(dest
, _mesa_SecondaryColor3iv
);
1614 SET_SecondaryColor3sv(dest
, _mesa_SecondaryColor3sv
);
1615 SET_SecondaryColor3uiv(dest
, _mesa_SecondaryColor3uiv
);
1616 SET_SecondaryColor3usv(dest
, _mesa_SecondaryColor3usv
);
1617 SET_SecondaryColor3ubv(dest
, _mesa_SecondaryColor3ubv
);
1619 SET_EdgeFlagv(dest
, _mesa_EdgeFlagv
);
1621 SET_Indexd(dest
, _mesa_Indexd
);
1622 SET_Indexi(dest
, _mesa_Indexi
);
1623 SET_Indexs(dest
, _mesa_Indexs
);
1624 SET_Indexub(dest
, _mesa_Indexub
);
1625 SET_Indexdv(dest
, _mesa_Indexdv
);
1626 SET_Indexiv(dest
, _mesa_Indexiv
);
1627 SET_Indexsv(dest
, _mesa_Indexsv
);
1628 SET_Indexubv(dest
, _mesa_Indexubv
);
1629 SET_Normal3b(dest
, _mesa_Normal3b
);
1630 SET_Normal3d(dest
, _mesa_Normal3d
);
1631 SET_Normal3i(dest
, _mesa_Normal3i
);
1632 SET_Normal3s(dest
, _mesa_Normal3s
);
1633 SET_Normal3bv(dest
, _mesa_Normal3bv
);
1634 SET_Normal3dv(dest
, _mesa_Normal3dv
);
1635 SET_Normal3iv(dest
, _mesa_Normal3iv
);
1636 SET_Normal3sv(dest
, _mesa_Normal3sv
);
1637 SET_TexCoord1d(dest
, _mesa_TexCoord1d
);
1638 SET_TexCoord1i(dest
, _mesa_TexCoord1i
);
1639 SET_TexCoord1s(dest
, _mesa_TexCoord1s
);
1640 SET_TexCoord2d(dest
, _mesa_TexCoord2d
);
1641 SET_TexCoord2s(dest
, _mesa_TexCoord2s
);
1642 SET_TexCoord2i(dest
, _mesa_TexCoord2i
);
1643 SET_TexCoord3d(dest
, _mesa_TexCoord3d
);
1644 SET_TexCoord3i(dest
, _mesa_TexCoord3i
);
1645 SET_TexCoord3s(dest
, _mesa_TexCoord3s
);
1646 SET_TexCoord4d(dest
, _mesa_TexCoord4d
);
1647 SET_TexCoord4i(dest
, _mesa_TexCoord4i
);
1648 SET_TexCoord4s(dest
, _mesa_TexCoord4s
);
1649 SET_TexCoord1dv(dest
, _mesa_TexCoord1dv
);
1650 SET_TexCoord1iv(dest
, _mesa_TexCoord1iv
);
1651 SET_TexCoord1sv(dest
, _mesa_TexCoord1sv
);
1652 SET_TexCoord2dv(dest
, _mesa_TexCoord2dv
);
1653 SET_TexCoord2iv(dest
, _mesa_TexCoord2iv
);
1654 SET_TexCoord2sv(dest
, _mesa_TexCoord2sv
);
1655 SET_TexCoord3dv(dest
, _mesa_TexCoord3dv
);
1656 SET_TexCoord3iv(dest
, _mesa_TexCoord3iv
);
1657 SET_TexCoord3sv(dest
, _mesa_TexCoord3sv
);
1658 SET_TexCoord4dv(dest
, _mesa_TexCoord4dv
);
1659 SET_TexCoord4iv(dest
, _mesa_TexCoord4iv
);
1660 SET_TexCoord4sv(dest
, _mesa_TexCoord4sv
);
1661 SET_Vertex2d(dest
, _mesa_Vertex2d
);
1662 SET_Vertex2i(dest
, _mesa_Vertex2i
);
1663 SET_Vertex2s(dest
, _mesa_Vertex2s
);
1664 SET_Vertex3d(dest
, _mesa_Vertex3d
);
1665 SET_Vertex3i(dest
, _mesa_Vertex3i
);
1666 SET_Vertex3s(dest
, _mesa_Vertex3s
);
1667 SET_Vertex4d(dest
, _mesa_Vertex4d
);
1668 SET_Vertex4i(dest
, _mesa_Vertex4i
);
1669 SET_Vertex4s(dest
, _mesa_Vertex4s
);
1670 SET_Vertex2dv(dest
, _mesa_Vertex2dv
);
1671 SET_Vertex2iv(dest
, _mesa_Vertex2iv
);
1672 SET_Vertex2sv(dest
, _mesa_Vertex2sv
);
1673 SET_Vertex3dv(dest
, _mesa_Vertex3dv
);
1674 SET_Vertex3iv(dest
, _mesa_Vertex3iv
);
1675 SET_Vertex3sv(dest
, _mesa_Vertex3sv
);
1676 SET_Vertex4dv(dest
, _mesa_Vertex4dv
);
1677 SET_Vertex4iv(dest
, _mesa_Vertex4iv
);
1678 SET_Vertex4sv(dest
, _mesa_Vertex4sv
);
1679 SET_MultiTexCoord1d(dest
, _mesa_MultiTexCoord1d
);
1680 SET_MultiTexCoord1dv(dest
, _mesa_MultiTexCoord1dv
);
1681 SET_MultiTexCoord1i(dest
, _mesa_MultiTexCoord1i
);
1682 SET_MultiTexCoord1iv(dest
, _mesa_MultiTexCoord1iv
);
1683 SET_MultiTexCoord1s(dest
, _mesa_MultiTexCoord1s
);
1684 SET_MultiTexCoord1sv(dest
, _mesa_MultiTexCoord1sv
);
1685 SET_MultiTexCoord2d(dest
, _mesa_MultiTexCoord2d
);
1686 SET_MultiTexCoord2dv(dest
, _mesa_MultiTexCoord2dv
);
1687 SET_MultiTexCoord2i(dest
, _mesa_MultiTexCoord2i
);
1688 SET_MultiTexCoord2iv(dest
, _mesa_MultiTexCoord2iv
);
1689 SET_MultiTexCoord2s(dest
, _mesa_MultiTexCoord2s
);
1690 SET_MultiTexCoord2sv(dest
, _mesa_MultiTexCoord2sv
);
1691 SET_MultiTexCoord3d(dest
, _mesa_MultiTexCoord3d
);
1692 SET_MultiTexCoord3dv(dest
, _mesa_MultiTexCoord3dv
);
1693 SET_MultiTexCoord3i(dest
, _mesa_MultiTexCoord3i
);
1694 SET_MultiTexCoord3iv(dest
, _mesa_MultiTexCoord3iv
);
1695 SET_MultiTexCoord3s(dest
, _mesa_MultiTexCoord3s
);
1696 SET_MultiTexCoord3sv(dest
, _mesa_MultiTexCoord3sv
);
1697 SET_MultiTexCoord4d(dest
, _mesa_MultiTexCoord4d
);
1698 SET_MultiTexCoord4dv(dest
, _mesa_MultiTexCoord4dv
);
1699 SET_MultiTexCoord4i(dest
, _mesa_MultiTexCoord4i
);
1700 SET_MultiTexCoord4iv(dest
, _mesa_MultiTexCoord4iv
);
1701 SET_MultiTexCoord4s(dest
, _mesa_MultiTexCoord4s
);
1702 SET_MultiTexCoord4sv(dest
, _mesa_MultiTexCoord4sv
);
1703 SET_EvalCoord2dv(dest
, _mesa_EvalCoord2dv
);
1704 SET_EvalCoord2fv(dest
, _mesa_EvalCoord2fv
);
1705 SET_EvalCoord2d(dest
, _mesa_EvalCoord2d
);
1706 SET_EvalCoord1dv(dest
, _mesa_EvalCoord1dv
);
1707 SET_EvalCoord1fv(dest
, _mesa_EvalCoord1fv
);
1708 SET_EvalCoord1d(dest
, _mesa_EvalCoord1d
);
1709 SET_Materiali(dest
, _mesa_Materiali
);
1710 SET_Materialiv(dest
, _mesa_Materialiv
);
1711 SET_Rectd(dest
, _mesa_Rectd
);
1712 SET_Rectdv(dest
, _mesa_Rectdv
);
1713 SET_Rectfv(dest
, _mesa_Rectfv
);
1714 SET_Recti(dest
, _mesa_Recti
);
1715 SET_Rectiv(dest
, _mesa_Rectiv
);
1716 SET_Rects(dest
, _mesa_Rects
);
1717 SET_Rectsv(dest
, _mesa_Rectsv
);
1718 SET_FogCoordd(dest
, _mesa_FogCoordd
);
1719 SET_FogCoorddv(dest
, _mesa_FogCoorddv
);
1722 if (ctx
->API
== API_OPENGL_COMPAT
) {
1723 SET_VertexAttrib1sNV(dest
, _mesa_VertexAttrib1sNV
);
1724 SET_VertexAttrib1dNV(dest
, _mesa_VertexAttrib1dNV
);
1725 SET_VertexAttrib2sNV(dest
, _mesa_VertexAttrib2sNV
);
1726 SET_VertexAttrib2dNV(dest
, _mesa_VertexAttrib2dNV
);
1727 SET_VertexAttrib3sNV(dest
, _mesa_VertexAttrib3sNV
);
1728 SET_VertexAttrib3dNV(dest
, _mesa_VertexAttrib3dNV
);
1729 SET_VertexAttrib4sNV(dest
, _mesa_VertexAttrib4sNV
);
1730 SET_VertexAttrib4dNV(dest
, _mesa_VertexAttrib4dNV
);
1731 SET_VertexAttrib4ubNV(dest
, _mesa_VertexAttrib4ubNV
);
1732 SET_VertexAttrib1svNV(dest
, _mesa_VertexAttrib1svNV
);
1733 SET_VertexAttrib1dvNV(dest
, _mesa_VertexAttrib1dvNV
);
1734 SET_VertexAttrib2svNV(dest
, _mesa_VertexAttrib2svNV
);
1735 SET_VertexAttrib2dvNV(dest
, _mesa_VertexAttrib2dvNV
);
1736 SET_VertexAttrib3svNV(dest
, _mesa_VertexAttrib3svNV
);
1737 SET_VertexAttrib3dvNV(dest
, _mesa_VertexAttrib3dvNV
);
1738 SET_VertexAttrib4svNV(dest
, _mesa_VertexAttrib4svNV
);
1739 SET_VertexAttrib4dvNV(dest
, _mesa_VertexAttrib4dvNV
);
1740 SET_VertexAttrib4ubvNV(dest
, _mesa_VertexAttrib4ubvNV
);
1741 SET_VertexAttribs1svNV(dest
, _mesa_VertexAttribs1svNV
);
1742 SET_VertexAttribs1fvNV(dest
, _mesa_VertexAttribs1fvNV
);
1743 SET_VertexAttribs1dvNV(dest
, _mesa_VertexAttribs1dvNV
);
1744 SET_VertexAttribs2svNV(dest
, _mesa_VertexAttribs2svNV
);
1745 SET_VertexAttribs2fvNV(dest
, _mesa_VertexAttribs2fvNV
);
1746 SET_VertexAttribs2dvNV(dest
, _mesa_VertexAttribs2dvNV
);
1747 SET_VertexAttribs3svNV(dest
, _mesa_VertexAttribs3svNV
);
1748 SET_VertexAttribs3fvNV(dest
, _mesa_VertexAttribs3fvNV
);
1749 SET_VertexAttribs3dvNV(dest
, _mesa_VertexAttribs3dvNV
);
1750 SET_VertexAttribs4svNV(dest
, _mesa_VertexAttribs4svNV
);
1751 SET_VertexAttribs4fvNV(dest
, _mesa_VertexAttribs4fvNV
);
1752 SET_VertexAttribs4dvNV(dest
, _mesa_VertexAttribs4dvNV
);
1753 SET_VertexAttribs4ubvNV(dest
, _mesa_VertexAttribs4ubvNV
);
1756 if (_mesa_is_desktop_gl(ctx
)) {
1757 SET_VertexAttrib1s(dest
, _mesa_VertexAttrib1s
);
1758 SET_VertexAttrib1d(dest
, _mesa_VertexAttrib1d
);
1759 SET_VertexAttrib2s(dest
, _mesa_VertexAttrib2s
);
1760 SET_VertexAttrib2d(dest
, _mesa_VertexAttrib2d
);
1761 SET_VertexAttrib3s(dest
, _mesa_VertexAttrib3s
);
1762 SET_VertexAttrib3d(dest
, _mesa_VertexAttrib3d
);
1763 SET_VertexAttrib4s(dest
, _mesa_VertexAttrib4s
);
1764 SET_VertexAttrib4d(dest
, _mesa_VertexAttrib4d
);
1765 SET_VertexAttrib1sv(dest
, _mesa_VertexAttrib1sv
);
1766 SET_VertexAttrib1dv(dest
, _mesa_VertexAttrib1dv
);
1767 SET_VertexAttrib2sv(dest
, _mesa_VertexAttrib2sv
);
1768 SET_VertexAttrib2dv(dest
, _mesa_VertexAttrib2dv
);
1769 SET_VertexAttrib3sv(dest
, _mesa_VertexAttrib3sv
);
1770 SET_VertexAttrib3dv(dest
, _mesa_VertexAttrib3dv
);
1771 SET_VertexAttrib4sv(dest
, _mesa_VertexAttrib4sv
);
1772 SET_VertexAttrib4dv(dest
, _mesa_VertexAttrib4dv
);
1773 SET_VertexAttrib4Nub(dest
, _mesa_VertexAttrib4Nub
);
1774 SET_VertexAttrib4Nubv(dest
, _mesa_VertexAttrib4Nubv
);
1775 SET_VertexAttrib4bv(dest
, _mesa_VertexAttrib4bv
);
1776 SET_VertexAttrib4iv(dest
, _mesa_VertexAttrib4iv
);
1777 SET_VertexAttrib4ubv(dest
, _mesa_VertexAttrib4ubv
);
1778 SET_VertexAttrib4usv(dest
, _mesa_VertexAttrib4usv
);
1779 SET_VertexAttrib4uiv(dest
, _mesa_VertexAttrib4uiv
);
1780 SET_VertexAttrib4Nbv(dest
, _mesa_VertexAttrib4Nbv
);
1781 SET_VertexAttrib4Nsv(dest
, _mesa_VertexAttrib4Nsv
);
1782 SET_VertexAttrib4Nusv(dest
, _mesa_VertexAttrib4Nusv
);
1783 SET_VertexAttrib4Niv(dest
, _mesa_VertexAttrib4Niv
);
1784 SET_VertexAttrib4Nuiv(dest
, _mesa_VertexAttrib4Nuiv
);
1786 /* GL_EXT_gpu_shader4, GL 3.0 */
1787 SET_VertexAttribI1iv(dest
, _mesa_VertexAttribI1iv
);
1788 SET_VertexAttribI1uiv(dest
, _mesa_VertexAttribI1uiv
);
1789 SET_VertexAttribI4bv(dest
, _mesa_VertexAttribI4bv
);
1790 SET_VertexAttribI4sv(dest
, _mesa_VertexAttribI4sv
);
1791 SET_VertexAttribI4ubv(dest
, _mesa_VertexAttribI4ubv
);
1792 SET_VertexAttribI4usv(dest
, _mesa_VertexAttribI4usv
);