4 * \author Keith Whitwell <keith@tungstengraphics.com>
8 * Mesa 3-D graphics library
11 * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
13 * Permission is hereby granted, free of charge, to any person obtaining a
14 * copy of this software and associated documentation files (the "Software"),
15 * to deal in the Software without restriction, including without limitation
16 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
17 * and/or sell copies of the Software, and to permit persons to whom the
18 * Software is furnished to do so, subject to the following conditions:
20 * The above copyright notice and this permission notice shall be included
21 * in all copies or substantial portions of the Software.
23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
27 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
28 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
29 * OTHER DEALINGS IN THE SOFTWARE.
35 #include "api_loopback.h"
37 #include "glapi/glapi.h"
38 #include "glapi/glthread.h"
39 #include "main/dispatch.h"
40 #include "main/context.h"
42 /* KW: A set of functions to convert unusual Color/Normal/Vertex/etc
43 * calls to a smaller set of driver-provided formats. Currently just
44 * go back to dispatch to find these (eg. call glNormal3f directly),
47 * The driver must supply all of the remaining entry points, which are
48 * listed in dd.h. The easiest way for a driver to do this is to
49 * install the supplied software t&l module.
51 #define COLORF(r,g,b,a) CALL_Color4f(GET_DISPATCH(), (r,g,b,a))
52 #define VERTEX2(x,y) CALL_Vertex2f(GET_DISPATCH(), (x,y))
53 #define VERTEX3(x,y,z) CALL_Vertex3f(GET_DISPATCH(), (x,y,z))
54 #define VERTEX4(x,y,z,w) CALL_Vertex4f(GET_DISPATCH(), (x,y,z,w))
55 #define NORMAL(x,y,z) CALL_Normal3f(GET_DISPATCH(), (x,y,z))
56 #define TEXCOORD1(s) CALL_TexCoord1f(GET_DISPATCH(), (s))
57 #define TEXCOORD2(s,t) CALL_TexCoord2f(GET_DISPATCH(), (s,t))
58 #define TEXCOORD3(s,t,u) CALL_TexCoord3f(GET_DISPATCH(), (s,t,u))
59 #define TEXCOORD4(s,t,u,v) CALL_TexCoord4f(GET_DISPATCH(), (s,t,u,v))
60 #define INDEX(c) CALL_Indexf(GET_DISPATCH(), (c))
61 #define MULTI_TEXCOORD1(z,s) CALL_MultiTexCoord1fARB(GET_DISPATCH(), (z,s))
62 #define MULTI_TEXCOORD2(z,s,t) CALL_MultiTexCoord2fARB(GET_DISPATCH(), (z,s,t))
63 #define MULTI_TEXCOORD3(z,s,t,u) CALL_MultiTexCoord3fARB(GET_DISPATCH(), (z,s,t,u))
64 #define MULTI_TEXCOORD4(z,s,t,u,v) CALL_MultiTexCoord4fARB(GET_DISPATCH(), (z,s,t,u,v))
65 #define EVALCOORD1(x) CALL_EvalCoord1f(GET_DISPATCH(), (x))
66 #define EVALCOORD2(x,y) CALL_EvalCoord2f(GET_DISPATCH(), (x,y))
67 #define MATERIALFV(a,b,c) CALL_Materialfv(GET_DISPATCH(), (a,b,c))
68 #define RECTF(a,b,c,d) CALL_Rectf(GET_DISPATCH(), (a,b,c,d))
70 #define FOGCOORDF(x) CALL_FogCoordfEXT(GET_DISPATCH(), (x))
71 #define SECONDARYCOLORF(a,b,c) CALL_SecondaryColor3fEXT(GET_DISPATCH(), (a,b,c))
73 #define ATTRIB1NV(index,x) CALL_VertexAttrib1fNV(GET_DISPATCH(), (index,x))
74 #define ATTRIB2NV(index,x,y) CALL_VertexAttrib2fNV(GET_DISPATCH(), (index,x,y))
75 #define ATTRIB3NV(index,x,y,z) CALL_VertexAttrib3fNV(GET_DISPATCH(), (index,x,y,z))
76 #define ATTRIB4NV(index,x,y,z,w) CALL_VertexAttrib4fNV(GET_DISPATCH(), (index,x,y,z,w))
78 #define ATTRIB1ARB(index,x) CALL_VertexAttrib1fARB(GET_DISPATCH(), (index,x))
79 #define ATTRIB2ARB(index,x,y) CALL_VertexAttrib2fARB(GET_DISPATCH(), (index,x,y))
80 #define ATTRIB3ARB(index,x,y,z) CALL_VertexAttrib3fARB(GET_DISPATCH(), (index,x,y,z))
81 #define ATTRIB4ARB(index,x,y,z,w) CALL_VertexAttrib4fARB(GET_DISPATCH(), (index,x,y,z,w))
83 #define ATTRIBI_1I(index,x) CALL_VertexAttribI1iEXT(GET_DISPATCH(), (index,x))
84 #define ATTRIBI_1UI(index,x) CALL_VertexAttribI1uiEXT(GET_DISPATCH(), (index,x))
85 #define ATTRIBI_4I(index,x,y,z,w) CALL_VertexAttribI4iEXT(GET_DISPATCH(), (index,x,y,z,w))
87 #define ATTRIBI_4UI(index,x,y,z,w) CALL_VertexAttribI4uiEXT(GET_DISPATCH(), (index,x,y,z,w))
91 _mesa_Color3b( GLbyte red
, GLbyte green
, GLbyte blue
)
93 COLORF( BYTE_TO_FLOAT(red
),
100 _mesa_Color3d( GLdouble red
, GLdouble green
, GLdouble blue
)
102 COLORF( (GLfloat
) red
, (GLfloat
) green
, (GLfloat
) blue
, 1.0 );
106 _mesa_Color3i( GLint red
, GLint green
, GLint blue
)
108 COLORF( INT_TO_FLOAT(red
), INT_TO_FLOAT(green
),
109 INT_TO_FLOAT(blue
), 1.0);
113 _mesa_Color3s( GLshort red
, GLshort green
, GLshort blue
)
115 COLORF( SHORT_TO_FLOAT(red
), SHORT_TO_FLOAT(green
),
116 SHORT_TO_FLOAT(blue
), 1.0);
120 _mesa_Color3ui( GLuint red
, GLuint green
, GLuint blue
)
122 COLORF( UINT_TO_FLOAT(red
), UINT_TO_FLOAT(green
),
123 UINT_TO_FLOAT(blue
), 1.0 );
127 _mesa_Color3us( GLushort red
, GLushort green
, GLushort blue
)
129 COLORF( USHORT_TO_FLOAT(red
), USHORT_TO_FLOAT(green
),
130 USHORT_TO_FLOAT(blue
), 1.0 );
134 _mesa_Color3ub( GLubyte red
, GLubyte green
, GLubyte blue
)
136 COLORF( UBYTE_TO_FLOAT(red
), UBYTE_TO_FLOAT(green
),
137 UBYTE_TO_FLOAT(blue
), 1.0 );
142 _mesa_Color3bv( const GLbyte
*v
)
144 COLORF( BYTE_TO_FLOAT(v
[0]), BYTE_TO_FLOAT(v
[1]),
145 BYTE_TO_FLOAT(v
[2]), 1.0 );
149 _mesa_Color3dv( const GLdouble
*v
)
151 COLORF( (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0 );
155 _mesa_Color3iv( const GLint
*v
)
157 COLORF( INT_TO_FLOAT(v
[0]), INT_TO_FLOAT(v
[1]),
158 INT_TO_FLOAT(v
[2]), 1.0 );
162 _mesa_Color3sv( const GLshort
*v
)
164 COLORF( SHORT_TO_FLOAT(v
[0]), SHORT_TO_FLOAT(v
[1]),
165 SHORT_TO_FLOAT(v
[2]), 1.0 );
169 _mesa_Color3uiv( const GLuint
*v
)
171 COLORF( UINT_TO_FLOAT(v
[0]), UINT_TO_FLOAT(v
[1]),
172 UINT_TO_FLOAT(v
[2]), 1.0 );
176 _mesa_Color3usv( const GLushort
*v
)
178 COLORF( USHORT_TO_FLOAT(v
[0]), USHORT_TO_FLOAT(v
[1]),
179 USHORT_TO_FLOAT(v
[2]), 1.0 );
183 _mesa_Color3ubv( const GLubyte
*v
)
185 COLORF( UBYTE_TO_FLOAT(v
[0]), UBYTE_TO_FLOAT(v
[1]),
186 UBYTE_TO_FLOAT(v
[2]), 1.0 );
191 _mesa_Color4b( GLbyte red
, GLbyte green
, GLbyte blue
,
194 COLORF( BYTE_TO_FLOAT(red
), BYTE_TO_FLOAT(green
),
195 BYTE_TO_FLOAT(blue
), BYTE_TO_FLOAT(alpha
) );
199 _mesa_Color4d( GLdouble red
, GLdouble green
, GLdouble blue
,
202 COLORF( (GLfloat
) red
, (GLfloat
) green
, (GLfloat
) blue
, (GLfloat
) alpha
);
206 _mesa_Color4i( GLint red
, GLint green
, GLint blue
, GLint alpha
)
208 COLORF( INT_TO_FLOAT(red
), INT_TO_FLOAT(green
),
209 INT_TO_FLOAT(blue
), INT_TO_FLOAT(alpha
) );
213 _mesa_Color4s( GLshort red
, GLshort green
, GLshort blue
,
216 COLORF( SHORT_TO_FLOAT(red
), SHORT_TO_FLOAT(green
),
217 SHORT_TO_FLOAT(blue
), SHORT_TO_FLOAT(alpha
) );
221 _mesa_Color4ui( GLuint red
, GLuint green
, GLuint blue
, GLuint alpha
)
223 COLORF( UINT_TO_FLOAT(red
), UINT_TO_FLOAT(green
),
224 UINT_TO_FLOAT(blue
), UINT_TO_FLOAT(alpha
) );
228 _mesa_Color4us( GLushort red
, GLushort green
, GLushort blue
, GLushort alpha
)
230 COLORF( USHORT_TO_FLOAT(red
), USHORT_TO_FLOAT(green
),
231 USHORT_TO_FLOAT(blue
), USHORT_TO_FLOAT(alpha
) );
235 _mesa_Color4ub( GLubyte red
, GLubyte green
, GLubyte blue
, GLubyte alpha
)
237 COLORF( UBYTE_TO_FLOAT(red
), UBYTE_TO_FLOAT(green
),
238 UBYTE_TO_FLOAT(blue
), UBYTE_TO_FLOAT(alpha
) );
243 _mesa_Color4iv( const GLint
*v
)
245 COLORF( INT_TO_FLOAT(v
[0]), INT_TO_FLOAT(v
[1]),
246 INT_TO_FLOAT(v
[2]), INT_TO_FLOAT(v
[3]) );
251 _mesa_Color4bv( const GLbyte
*v
)
253 COLORF( BYTE_TO_FLOAT(v
[0]), BYTE_TO_FLOAT(v
[1]),
254 BYTE_TO_FLOAT(v
[2]), BYTE_TO_FLOAT(v
[3]) );
258 _mesa_Color4dv( const GLdouble
*v
)
260 COLORF( (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], (GLfloat
) v
[3] );
265 _mesa_Color4sv( const GLshort
*v
)
267 COLORF( SHORT_TO_FLOAT(v
[0]), SHORT_TO_FLOAT(v
[1]),
268 SHORT_TO_FLOAT(v
[2]), SHORT_TO_FLOAT(v
[3]) );
273 _mesa_Color4uiv( const GLuint
*v
)
275 COLORF( UINT_TO_FLOAT(v
[0]), UINT_TO_FLOAT(v
[1]),
276 UINT_TO_FLOAT(v
[2]), UINT_TO_FLOAT(v
[3]) );
280 _mesa_Color4usv( const GLushort
*v
)
282 COLORF( USHORT_TO_FLOAT(v
[0]), USHORT_TO_FLOAT(v
[1]),
283 USHORT_TO_FLOAT(v
[2]), USHORT_TO_FLOAT(v
[3]) );
287 _mesa_Color4ubv( const GLubyte
*v
)
289 COLORF( UBYTE_TO_FLOAT(v
[0]), UBYTE_TO_FLOAT(v
[1]),
290 UBYTE_TO_FLOAT(v
[2]), UBYTE_TO_FLOAT(v
[3]) );
295 _mesa_FogCoordd( GLdouble d
)
297 FOGCOORDF( (GLfloat
) d
);
301 _mesa_FogCoorddv( const GLdouble
*v
)
303 FOGCOORDF( (GLfloat
) *v
);
308 _mesa_Indexd( GLdouble c
)
310 INDEX( (GLfloat
) c
);
314 _mesa_Indexi( GLint c
)
316 INDEX( (GLfloat
) c
);
320 _mesa_Indexs( GLshort c
)
322 INDEX( (GLfloat
) c
);
326 _mesa_Indexub( GLubyte c
)
328 INDEX( (GLfloat
) c
);
332 _mesa_Indexdv( const GLdouble
*c
)
334 INDEX( (GLfloat
) *c
);
338 _mesa_Indexiv( const GLint
*c
)
340 INDEX( (GLfloat
) *c
);
344 _mesa_Indexsv( const GLshort
*c
)
346 INDEX( (GLfloat
) *c
);
350 _mesa_Indexubv( const GLubyte
*c
)
352 INDEX( (GLfloat
) *c
);
357 _mesa_EdgeFlagv(const GLboolean
*flag
)
359 CALL_EdgeFlag(GET_DISPATCH(), (*flag
));
364 _mesa_Normal3b( GLbyte nx
, GLbyte ny
, GLbyte nz
)
366 NORMAL( BYTE_TO_FLOAT(nx
), BYTE_TO_FLOAT(ny
), BYTE_TO_FLOAT(nz
) );
370 _mesa_Normal3d( GLdouble nx
, GLdouble ny
, GLdouble nz
)
372 NORMAL((GLfloat
) nx
, (GLfloat
) ny
, (GLfloat
) nz
);
376 _mesa_Normal3i( GLint nx
, GLint ny
, GLint nz
)
378 NORMAL( INT_TO_FLOAT(nx
), INT_TO_FLOAT(ny
), INT_TO_FLOAT(nz
) );
382 _mesa_Normal3s( GLshort nx
, GLshort ny
, GLshort nz
)
384 NORMAL( SHORT_TO_FLOAT(nx
), SHORT_TO_FLOAT(ny
), SHORT_TO_FLOAT(nz
) );
388 _mesa_Normal3bv( const GLbyte
*v
)
390 NORMAL( BYTE_TO_FLOAT(v
[0]), BYTE_TO_FLOAT(v
[1]), BYTE_TO_FLOAT(v
[2]) );
394 _mesa_Normal3dv( const GLdouble
*v
)
396 NORMAL( (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2] );
400 _mesa_Normal3iv( const GLint
*v
)
402 NORMAL( INT_TO_FLOAT(v
[0]), INT_TO_FLOAT(v
[1]), INT_TO_FLOAT(v
[2]) );
406 _mesa_Normal3sv( const GLshort
*v
)
408 NORMAL( SHORT_TO_FLOAT(v
[0]), SHORT_TO_FLOAT(v
[1]), SHORT_TO_FLOAT(v
[2]) );
412 _mesa_TexCoord1d( GLdouble s
)
414 TEXCOORD1((GLfloat
) s
);
418 _mesa_TexCoord1i( GLint s
)
420 TEXCOORD1((GLfloat
) s
);
424 _mesa_TexCoord1s( GLshort s
)
426 TEXCOORD1((GLfloat
) s
);
430 _mesa_TexCoord2d( GLdouble s
, GLdouble t
)
432 TEXCOORD2((GLfloat
) s
,(GLfloat
) t
);
436 _mesa_TexCoord2s( GLshort s
, GLshort t
)
438 TEXCOORD2((GLfloat
) s
,(GLfloat
) t
);
442 _mesa_TexCoord2i( GLint s
, GLint t
)
444 TEXCOORD2((GLfloat
) s
,(GLfloat
) t
);
448 _mesa_TexCoord3d( GLdouble s
, GLdouble t
, GLdouble r
)
450 TEXCOORD3((GLfloat
) s
,(GLfloat
) t
,(GLfloat
) r
);
454 _mesa_TexCoord3i( GLint s
, GLint t
, GLint r
)
456 TEXCOORD3((GLfloat
) s
,(GLfloat
) t
,(GLfloat
) r
);
460 _mesa_TexCoord3s( GLshort s
, GLshort t
, GLshort r
)
462 TEXCOORD3((GLfloat
) s
,(GLfloat
) t
,(GLfloat
) r
);
466 _mesa_TexCoord4d( GLdouble s
, GLdouble t
, GLdouble r
, GLdouble q
)
468 TEXCOORD4((GLfloat
) s
,(GLfloat
) t
,(GLfloat
) r
,(GLfloat
) q
);
472 _mesa_TexCoord4i( GLint s
, GLint t
, GLint r
, GLint q
)
474 TEXCOORD4((GLfloat
) s
,(GLfloat
) t
,(GLfloat
) r
,(GLfloat
) q
);
478 _mesa_TexCoord4s( GLshort s
, GLshort t
, GLshort r
, GLshort q
)
480 TEXCOORD4((GLfloat
) s
,(GLfloat
) t
,(GLfloat
) r
,(GLfloat
) q
);
484 _mesa_TexCoord1dv( const GLdouble
*v
)
486 TEXCOORD1((GLfloat
) v
[0]);
490 _mesa_TexCoord1iv( const GLint
*v
)
492 TEXCOORD1((GLfloat
) v
[0]);
496 _mesa_TexCoord1sv( const GLshort
*v
)
498 TEXCOORD1((GLfloat
) v
[0]);
502 _mesa_TexCoord2dv( const GLdouble
*v
)
504 TEXCOORD2((GLfloat
) v
[0],(GLfloat
) v
[1]);
508 _mesa_TexCoord2iv( const GLint
*v
)
510 TEXCOORD2((GLfloat
) v
[0],(GLfloat
) v
[1]);
514 _mesa_TexCoord2sv( const GLshort
*v
)
516 TEXCOORD2((GLfloat
) v
[0],(GLfloat
) v
[1]);
520 _mesa_TexCoord3dv( const GLdouble
*v
)
522 TEXCOORD3((GLfloat
) v
[0],(GLfloat
) v
[1],(GLfloat
) v
[2]);
526 _mesa_TexCoord3iv( const GLint
*v
)
528 TEXCOORD3((GLfloat
) v
[0],(GLfloat
) v
[1],(GLfloat
) v
[2]);
532 _mesa_TexCoord3sv( const GLshort
*v
)
534 TEXCOORD3((GLfloat
) v
[0],(GLfloat
) v
[1],(GLfloat
) v
[2]);
538 _mesa_TexCoord4dv( const GLdouble
*v
)
540 TEXCOORD4((GLfloat
) v
[0],(GLfloat
) v
[1],(GLfloat
) v
[2],(GLfloat
) v
[3]);
544 _mesa_TexCoord4iv( const GLint
*v
)
546 TEXCOORD4((GLfloat
) v
[0],(GLfloat
) v
[1],(GLfloat
) v
[2],(GLfloat
) v
[3]);
550 _mesa_TexCoord4sv( const GLshort
*v
)
552 TEXCOORD4((GLfloat
) v
[0],(GLfloat
) v
[1],(GLfloat
) v
[2],(GLfloat
) v
[3]);
556 _mesa_Vertex2d( GLdouble x
, GLdouble y
)
558 VERTEX2( (GLfloat
) x
, (GLfloat
) y
);
562 _mesa_Vertex2i( GLint x
, GLint y
)
564 VERTEX2( (GLfloat
) x
, (GLfloat
) y
);
568 _mesa_Vertex2s( GLshort x
, GLshort y
)
570 VERTEX2( (GLfloat
) x
, (GLfloat
) y
);
574 _mesa_Vertex3d( GLdouble x
, GLdouble y
, GLdouble z
)
576 VERTEX3( (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
580 _mesa_Vertex3i( GLint x
, GLint y
, GLint z
)
582 VERTEX3( (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
586 _mesa_Vertex3s( GLshort x
, GLshort y
, GLshort z
)
588 VERTEX3( (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
592 _mesa_Vertex4d( GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
594 VERTEX4( (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
598 _mesa_Vertex4i( GLint x
, GLint y
, GLint z
, GLint w
)
600 VERTEX4( (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
604 _mesa_Vertex4s( GLshort x
, GLshort y
, GLshort z
, GLshort w
)
606 VERTEX4( (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
610 _mesa_Vertex2dv( const GLdouble
*v
)
612 VERTEX2( (GLfloat
) v
[0], (GLfloat
) v
[1] );
616 _mesa_Vertex2iv( const GLint
*v
)
618 VERTEX2( (GLfloat
) v
[0], (GLfloat
) v
[1] );
622 _mesa_Vertex2sv( const GLshort
*v
)
624 VERTEX2( (GLfloat
) v
[0], (GLfloat
) v
[1] );
628 _mesa_Vertex3dv( const GLdouble
*v
)
630 VERTEX3( (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2] );
634 _mesa_Vertex3iv( const GLint
*v
)
636 VERTEX3( (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2] );
640 _mesa_Vertex3sv( const GLshort
*v
)
642 VERTEX3( (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2] );
646 _mesa_Vertex4dv( const GLdouble
*v
)
648 VERTEX4( (GLfloat
) v
[0], (GLfloat
) v
[1],
649 (GLfloat
) v
[2], (GLfloat
) v
[3] );
653 _mesa_Vertex4iv( const GLint
*v
)
655 VERTEX4( (GLfloat
) v
[0], (GLfloat
) v
[1],
656 (GLfloat
) v
[2], (GLfloat
) v
[3] );
660 _mesa_Vertex4sv( const GLshort
*v
)
662 VERTEX4( (GLfloat
) v
[0], (GLfloat
) v
[1],
663 (GLfloat
) v
[2], (GLfloat
) v
[3] );
667 _mesa_MultiTexCoord1d(GLenum target
, GLdouble s
)
669 MULTI_TEXCOORD1( target
, (GLfloat
) s
);
673 _mesa_MultiTexCoord1dv(GLenum target
, const GLdouble
*v
)
675 MULTI_TEXCOORD1( target
, (GLfloat
) v
[0] );
679 _mesa_MultiTexCoord1i(GLenum target
, GLint s
)
681 MULTI_TEXCOORD1( target
, (GLfloat
) s
);
685 _mesa_MultiTexCoord1iv(GLenum target
, const GLint
*v
)
687 MULTI_TEXCOORD1( target
, (GLfloat
) v
[0] );
691 _mesa_MultiTexCoord1s(GLenum target
, GLshort s
)
693 MULTI_TEXCOORD1( target
, (GLfloat
) s
);
697 _mesa_MultiTexCoord1sv(GLenum target
, const GLshort
*v
)
699 MULTI_TEXCOORD1( target
, (GLfloat
) v
[0] );
703 _mesa_MultiTexCoord2d(GLenum target
, GLdouble s
, GLdouble t
)
705 MULTI_TEXCOORD2( target
, (GLfloat
) s
, (GLfloat
) t
);
709 _mesa_MultiTexCoord2dv(GLenum target
, const GLdouble
*v
)
711 MULTI_TEXCOORD2( target
, (GLfloat
) v
[0], (GLfloat
) v
[1] );
715 _mesa_MultiTexCoord2i(GLenum target
, GLint s
, GLint t
)
717 MULTI_TEXCOORD2( target
, (GLfloat
) s
, (GLfloat
) t
);
721 _mesa_MultiTexCoord2iv(GLenum target
, const GLint
*v
)
723 MULTI_TEXCOORD2( target
, (GLfloat
) v
[0], (GLfloat
) v
[1] );
727 _mesa_MultiTexCoord2s(GLenum target
, GLshort s
, GLshort t
)
729 MULTI_TEXCOORD2( target
, (GLfloat
) s
, (GLfloat
) t
);
733 _mesa_MultiTexCoord2sv(GLenum target
, const GLshort
*v
)
735 MULTI_TEXCOORD2( target
, (GLfloat
) v
[0], (GLfloat
) v
[1] );
739 _mesa_MultiTexCoord3d(GLenum target
, GLdouble s
, GLdouble t
, GLdouble r
)
741 MULTI_TEXCOORD3( target
, (GLfloat
) s
, (GLfloat
) t
, (GLfloat
) r
);
745 _mesa_MultiTexCoord3dv(GLenum target
, const GLdouble
*v
)
747 MULTI_TEXCOORD3( target
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2] );
751 _mesa_MultiTexCoord3i(GLenum target
, GLint s
, GLint t
, GLint r
)
753 MULTI_TEXCOORD3( target
, (GLfloat
) s
, (GLfloat
) t
, (GLfloat
) r
);
757 _mesa_MultiTexCoord3iv(GLenum target
, const GLint
*v
)
759 MULTI_TEXCOORD3( target
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2] );
763 _mesa_MultiTexCoord3s(GLenum target
, GLshort s
, GLshort t
, GLshort r
)
765 MULTI_TEXCOORD3( target
, (GLfloat
) s
, (GLfloat
) t
, (GLfloat
) r
);
769 _mesa_MultiTexCoord3sv(GLenum target
, const GLshort
*v
)
771 MULTI_TEXCOORD3( target
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2] );
775 _mesa_MultiTexCoord4d(GLenum target
, GLdouble s
, GLdouble t
, GLdouble r
, GLdouble q
)
777 MULTI_TEXCOORD4( target
, (GLfloat
) s
, (GLfloat
) t
,
778 (GLfloat
) r
, (GLfloat
) q
);
782 _mesa_MultiTexCoord4dv(GLenum target
, const GLdouble
*v
)
784 MULTI_TEXCOORD4( target
, (GLfloat
) v
[0], (GLfloat
) v
[1],
785 (GLfloat
) v
[2], (GLfloat
) v
[3] );
789 _mesa_MultiTexCoord4i(GLenum target
, GLint s
, GLint t
, GLint r
, GLint q
)
791 MULTI_TEXCOORD4( target
, (GLfloat
) s
, (GLfloat
) t
,
792 (GLfloat
) r
, (GLfloat
) q
);
796 _mesa_MultiTexCoord4iv(GLenum target
, const GLint
*v
)
798 MULTI_TEXCOORD4( target
, (GLfloat
) v
[0], (GLfloat
) v
[1],
799 (GLfloat
) v
[2], (GLfloat
) v
[3] );
803 _mesa_MultiTexCoord4s(GLenum target
, GLshort s
, GLshort t
, GLshort r
, GLshort q
)
805 MULTI_TEXCOORD4( target
, (GLfloat
) s
, (GLfloat
) t
,
806 (GLfloat
) r
, (GLfloat
) q
);
810 _mesa_MultiTexCoord4sv(GLenum target
, const GLshort
*v
)
812 MULTI_TEXCOORD4( target
, (GLfloat
) v
[0], (GLfloat
) v
[1],
813 (GLfloat
) v
[2], (GLfloat
) v
[3] );
817 _mesa_EvalCoord2dv( const GLdouble
*u
)
819 EVALCOORD2( (GLfloat
) u
[0], (GLfloat
) u
[1] );
823 _mesa_EvalCoord2fv( const GLfloat
*u
)
825 EVALCOORD2( u
[0], u
[1] );
829 _mesa_EvalCoord2d( GLdouble u
, GLdouble v
)
831 EVALCOORD2( (GLfloat
) u
, (GLfloat
) v
);
835 _mesa_EvalCoord1dv( const GLdouble
*u
)
837 EVALCOORD1( (GLfloat
) *u
);
841 _mesa_EvalCoord1fv( const GLfloat
*u
)
843 EVALCOORD1( (GLfloat
) *u
);
847 _mesa_EvalCoord1d( GLdouble u
)
849 EVALCOORD1( (GLfloat
) u
);
853 _mesa_Materialf( GLenum face
, GLenum pname
, GLfloat param
)
857 MATERIALFV( face
, pname
, fparam
);
861 _mesa_Materiali(GLenum face
, GLenum pname
, GLint param
)
863 GLfloat p
= (GLfloat
) param
;
864 MATERIALFV(face
, pname
, &p
);
868 _mesa_Materialiv(GLenum face
, GLenum pname
, const GLint
*params
)
876 case GL_AMBIENT_AND_DIFFUSE
:
877 fparam
[0] = INT_TO_FLOAT( params
[0] );
878 fparam
[1] = INT_TO_FLOAT( params
[1] );
879 fparam
[2] = INT_TO_FLOAT( params
[2] );
880 fparam
[3] = INT_TO_FLOAT( params
[3] );
883 fparam
[0] = (GLfloat
) params
[0];
885 case GL_COLOR_INDEXES
:
886 fparam
[0] = (GLfloat
) params
[0];
887 fparam
[1] = (GLfloat
) params
[1];
888 fparam
[2] = (GLfloat
) params
[2];
893 MATERIALFV(face
, pname
, fparam
);
898 _mesa_Rectd(GLdouble x1
, GLdouble y1
, GLdouble x2
, GLdouble y2
)
900 RECTF((GLfloat
) x1
, (GLfloat
) y1
, (GLfloat
) x2
, (GLfloat
) y2
);
904 _mesa_Rectdv(const GLdouble
*v1
, const GLdouble
*v2
)
906 RECTF((GLfloat
) v1
[0], (GLfloat
) v1
[1], (GLfloat
) v2
[0], (GLfloat
) v2
[1]);
910 _mesa_Rectfv(const GLfloat
*v1
, const GLfloat
*v2
)
912 RECTF(v1
[0], v1
[1], v2
[0], v2
[1]);
916 _mesa_Recti(GLint x1
, GLint y1
, GLint x2
, GLint y2
)
918 RECTF((GLfloat
) x1
, (GLfloat
) y1
, (GLfloat
) x2
, (GLfloat
) y2
);
922 _mesa_Rectiv(const GLint
*v1
, const GLint
*v2
)
924 RECTF((GLfloat
) v1
[0], (GLfloat
) v1
[1], (GLfloat
) v2
[0], (GLfloat
) v2
[1]);
928 _mesa_Rects(GLshort x1
, GLshort y1
, GLshort x2
, GLshort y2
)
930 RECTF((GLfloat
) x1
, (GLfloat
) y1
, (GLfloat
) x2
, (GLfloat
) y2
);
934 _mesa_Rectsv(const GLshort
*v1
, const GLshort
*v2
)
936 RECTF((GLfloat
) v1
[0], (GLfloat
) v1
[1], (GLfloat
) v2
[0], (GLfloat
) v2
[1]);
940 _mesa_SecondaryColor3b( GLbyte red
, GLbyte green
, GLbyte blue
)
942 SECONDARYCOLORF( BYTE_TO_FLOAT(red
),
943 BYTE_TO_FLOAT(green
),
944 BYTE_TO_FLOAT(blue
) );
948 _mesa_SecondaryColor3d( GLdouble red
, GLdouble green
, GLdouble blue
)
950 SECONDARYCOLORF( (GLfloat
) red
, (GLfloat
) green
, (GLfloat
) blue
);
954 _mesa_SecondaryColor3i( GLint red
, GLint green
, GLint blue
)
956 SECONDARYCOLORF( INT_TO_FLOAT(red
),
962 _mesa_SecondaryColor3s( GLshort red
, GLshort green
, GLshort blue
)
964 SECONDARYCOLORF(SHORT_TO_FLOAT(red
),
965 SHORT_TO_FLOAT(green
),
966 SHORT_TO_FLOAT(blue
));
970 _mesa_SecondaryColor3ui( GLuint red
, GLuint green
, GLuint blue
)
972 SECONDARYCOLORF(UINT_TO_FLOAT(red
),
973 UINT_TO_FLOAT(green
),
974 UINT_TO_FLOAT(blue
));
978 _mesa_SecondaryColor3us( GLushort red
, GLushort green
, GLushort blue
)
980 SECONDARYCOLORF(USHORT_TO_FLOAT(red
),
981 USHORT_TO_FLOAT(green
),
982 USHORT_TO_FLOAT(blue
));
986 _mesa_SecondaryColor3ub( GLubyte red
, GLubyte green
, GLubyte blue
)
988 SECONDARYCOLORF(UBYTE_TO_FLOAT(red
),
989 UBYTE_TO_FLOAT(green
),
990 UBYTE_TO_FLOAT(blue
));
994 _mesa_SecondaryColor3bv( const GLbyte
*v
)
996 SECONDARYCOLORF(BYTE_TO_FLOAT(v
[0]),
998 BYTE_TO_FLOAT(v
[2]));
1002 _mesa_SecondaryColor3dv( const GLdouble
*v
)
1004 SECONDARYCOLORF( (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2] );
1007 _mesa_SecondaryColor3iv( const GLint
*v
)
1009 SECONDARYCOLORF(INT_TO_FLOAT(v
[0]),
1011 INT_TO_FLOAT(v
[2]));
1015 _mesa_SecondaryColor3sv( const GLshort
*v
)
1017 SECONDARYCOLORF(SHORT_TO_FLOAT(v
[0]),
1018 SHORT_TO_FLOAT(v
[1]),
1019 SHORT_TO_FLOAT(v
[2]));
1023 _mesa_SecondaryColor3uiv( const GLuint
*v
)
1025 SECONDARYCOLORF(UINT_TO_FLOAT(v
[0]),
1026 UINT_TO_FLOAT(v
[1]),
1027 UINT_TO_FLOAT(v
[2]));
1031 _mesa_SecondaryColor3usv( const GLushort
*v
)
1033 SECONDARYCOLORF(USHORT_TO_FLOAT(v
[0]),
1034 USHORT_TO_FLOAT(v
[1]),
1035 USHORT_TO_FLOAT(v
[2]));
1039 _mesa_SecondaryColor3ubv( const GLubyte
*v
)
1041 SECONDARYCOLORF(UBYTE_TO_FLOAT(v
[0]),
1042 UBYTE_TO_FLOAT(v
[1]),
1043 UBYTE_TO_FLOAT(v
[2]));
1048 * GL_NV_vertex_program:
1049 * Always loop-back to one of the VertexAttrib[1234]f[v]NV functions.
1050 * Note that attribute indexes DO alias conventional vertex attributes.
1054 _mesa_VertexAttrib1sNV(GLuint index
, GLshort x
)
1056 ATTRIB1NV(index
, (GLfloat
) x
);
1060 _mesa_VertexAttrib1dNV(GLuint index
, GLdouble x
)
1062 ATTRIB1NV(index
, (GLfloat
) x
);
1066 _mesa_VertexAttrib2sNV(GLuint index
, GLshort x
, GLshort y
)
1068 ATTRIB2NV(index
, (GLfloat
) x
, y
);
1072 _mesa_VertexAttrib2dNV(GLuint index
, GLdouble x
, GLdouble y
)
1074 ATTRIB2NV(index
, (GLfloat
) x
, (GLfloat
) y
);
1078 _mesa_VertexAttrib3sNV(GLuint index
, GLshort x
, GLshort y
, GLshort z
)
1080 ATTRIB3NV(index
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
1084 _mesa_VertexAttrib3dNV(GLuint index
, GLdouble x
, GLdouble y
, GLdouble z
)
1086 ATTRIB4NV(index
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
1090 _mesa_VertexAttrib4sNV(GLuint index
, GLshort x
, GLshort y
, GLshort z
, GLshort w
)
1092 ATTRIB4NV(index
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
1096 _mesa_VertexAttrib4dNV(GLuint index
, GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
1098 ATTRIB4NV(index
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
1102 _mesa_VertexAttrib4ubNV(GLuint index
, GLubyte x
, GLubyte y
, GLubyte z
, GLubyte w
)
1104 ATTRIB4NV(index
, UBYTE_TO_FLOAT(x
), UBYTE_TO_FLOAT(y
),
1105 UBYTE_TO_FLOAT(z
), UBYTE_TO_FLOAT(w
));
1109 _mesa_VertexAttrib1svNV(GLuint index
, const GLshort
*v
)
1111 ATTRIB1NV(index
, (GLfloat
) v
[0]);
1115 _mesa_VertexAttrib1dvNV(GLuint index
, const GLdouble
*v
)
1117 ATTRIB1NV(index
, (GLfloat
) v
[0]);
1121 _mesa_VertexAttrib2svNV(GLuint index
, const GLshort
*v
)
1123 ATTRIB2NV(index
, (GLfloat
) v
[0], (GLfloat
) v
[1]);
1127 _mesa_VertexAttrib2dvNV(GLuint index
, const GLdouble
*v
)
1129 ATTRIB2NV(index
, (GLfloat
) v
[0], (GLfloat
) v
[1]);
1133 _mesa_VertexAttrib3svNV(GLuint index
, const GLshort
*v
)
1135 ATTRIB3NV(index
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2]);
1139 _mesa_VertexAttrib3dvNV(GLuint index
, const GLdouble
*v
)
1141 ATTRIB3NV(index
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2]);
1145 _mesa_VertexAttrib4svNV(GLuint index
, const GLshort
*v
)
1147 ATTRIB4NV(index
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2],
1152 _mesa_VertexAttrib4dvNV(GLuint index
, const GLdouble
*v
)
1154 ATTRIB4NV(index
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], (GLfloat
) v
[3]);
1158 _mesa_VertexAttrib4ubvNV(GLuint index
, const GLubyte
*v
)
1160 ATTRIB4NV(index
, UBYTE_TO_FLOAT(v
[0]), UBYTE_TO_FLOAT(v
[1]),
1161 UBYTE_TO_FLOAT(v
[2]), UBYTE_TO_FLOAT(v
[3]));
1166 _mesa_VertexAttribs1svNV(GLuint index
, GLsizei n
, const GLshort
*v
)
1169 for (i
= n
- 1; i
>= 0; i
--)
1170 _mesa_VertexAttrib1svNV(index
+ i
, v
+ i
);
1174 _mesa_VertexAttribs1fvNV(GLuint index
, GLsizei n
, const GLfloat
*v
)
1177 for (i
= n
- 1; i
>= 0; i
--)
1178 ATTRIB1NV(index
+ i
, v
[i
]);
1182 _mesa_VertexAttribs1dvNV(GLuint index
, GLsizei n
, const GLdouble
*v
)
1185 for (i
= n
- 1; i
>= 0; i
--)
1186 _mesa_VertexAttrib1dvNV(index
+ i
, v
+ i
);
1190 _mesa_VertexAttribs2svNV(GLuint index
, GLsizei n
, const GLshort
*v
)
1193 for (i
= n
- 1; i
>= 0; i
--)
1194 _mesa_VertexAttrib2svNV(index
+ i
, v
+ 2 * i
);
1198 _mesa_VertexAttribs2fvNV(GLuint index
, GLsizei n
, const GLfloat
*v
)
1201 for (i
= n
- 1; i
>= 0; i
--)
1202 ATTRIB2NV(index
+ i
, v
[2 * i
], v
[2 * i
+ 1]);
1206 _mesa_VertexAttribs2dvNV(GLuint index
, GLsizei n
, const GLdouble
*v
)
1209 for (i
= n
- 1; i
>= 0; i
--)
1210 _mesa_VertexAttrib2dvNV(index
+ i
, v
+ 2 * i
);
1214 _mesa_VertexAttribs3svNV(GLuint index
, GLsizei n
, const GLshort
*v
)
1217 for (i
= n
- 1; i
>= 0; i
--)
1218 _mesa_VertexAttrib3svNV(index
+ i
, v
+ 3 * i
);
1222 _mesa_VertexAttribs3fvNV(GLuint index
, GLsizei n
, const GLfloat
*v
)
1225 for (i
= n
- 1; i
>= 0; i
--)
1226 ATTRIB3NV(index
+ i
, v
[3 * i
], v
[3 * i
+ 1], v
[3 * i
+ 2]);
1230 _mesa_VertexAttribs3dvNV(GLuint index
, GLsizei n
, const GLdouble
*v
)
1233 for (i
= n
- 1; i
>= 0; i
--)
1234 _mesa_VertexAttrib3dvNV(index
+ i
, v
+ 3 * i
);
1238 _mesa_VertexAttribs4svNV(GLuint index
, GLsizei n
, const GLshort
*v
)
1241 for (i
= n
- 1; i
>= 0; i
--)
1242 _mesa_VertexAttrib4svNV(index
+ i
, v
+ 4 * i
);
1246 _mesa_VertexAttribs4fvNV(GLuint index
, GLsizei n
, const GLfloat
*v
)
1249 for (i
= n
- 1; i
>= 0; i
--)
1250 ATTRIB4NV(index
+ i
, v
[4 * i
], v
[4 * i
+ 1], v
[4 * i
+ 2], v
[4 * i
+ 3]);
1254 _mesa_VertexAttribs4dvNV(GLuint index
, GLsizei n
, const GLdouble
*v
)
1257 for (i
= n
- 1; i
>= 0; i
--)
1258 _mesa_VertexAttrib4dvNV(index
+ i
, v
+ 4 * i
);
1262 _mesa_VertexAttribs4ubvNV(GLuint index
, GLsizei n
, const GLubyte
*v
)
1265 for (i
= n
- 1; i
>= 0; i
--)
1266 _mesa_VertexAttrib4ubvNV(index
+ i
, v
+ 4 * i
);
1271 * GL_ARB_vertex_program
1272 * Always loop-back to one of the VertexAttrib[1234]f[v]ARB functions.
1273 * Note that attribute indexes do NOT alias conventional attributes.
1277 _mesa_VertexAttrib1s(GLuint index
, GLshort x
)
1279 ATTRIB1ARB(index
, (GLfloat
) x
);
1283 _mesa_VertexAttrib1d(GLuint index
, GLdouble x
)
1285 ATTRIB1ARB(index
, (GLfloat
) x
);
1289 _mesa_VertexAttrib2s(GLuint index
, GLshort x
, GLshort y
)
1291 ATTRIB2ARB(index
, (GLfloat
) x
, y
);
1295 _mesa_VertexAttrib2d(GLuint index
, GLdouble x
, GLdouble y
)
1297 ATTRIB2ARB(index
, (GLfloat
) x
, (GLfloat
) y
);
1301 _mesa_VertexAttrib3s(GLuint index
, GLshort x
, GLshort y
, GLshort z
)
1303 ATTRIB3ARB(index
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
1307 _mesa_VertexAttrib3d(GLuint index
, GLdouble x
, GLdouble y
, GLdouble z
)
1309 ATTRIB4ARB(index
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
1313 _mesa_VertexAttrib4s(GLuint index
, GLshort x
, GLshort y
, GLshort z
, GLshort w
)
1315 ATTRIB4ARB(index
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
1319 _mesa_VertexAttrib4d(GLuint index
, GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
1321 ATTRIB4ARB(index
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
1325 _mesa_VertexAttrib1sv(GLuint index
, const GLshort
*v
)
1327 ATTRIB1ARB(index
, (GLfloat
) v
[0]);
1331 _mesa_VertexAttrib1dv(GLuint index
, const GLdouble
*v
)
1333 ATTRIB1ARB(index
, (GLfloat
) v
[0]);
1337 _mesa_VertexAttrib2sv(GLuint index
, const GLshort
*v
)
1339 ATTRIB2ARB(index
, (GLfloat
) v
[0], (GLfloat
) v
[1]);
1343 _mesa_VertexAttrib2dv(GLuint index
, const GLdouble
*v
)
1345 ATTRIB2ARB(index
, (GLfloat
) v
[0], (GLfloat
) v
[1]);
1349 _mesa_VertexAttrib3sv(GLuint index
, const GLshort
*v
)
1351 ATTRIB3ARB(index
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2]);
1355 _mesa_VertexAttrib3dv(GLuint index
, const GLdouble
*v
)
1357 ATTRIB3ARB(index
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2]);
1361 _mesa_VertexAttrib4sv(GLuint index
, const GLshort
*v
)
1363 ATTRIB4ARB(index
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2],
1368 _mesa_VertexAttrib4dv(GLuint index
, const GLdouble
*v
)
1370 ATTRIB4ARB(index
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], (GLfloat
) v
[3]);
1374 _mesa_VertexAttrib4bv(GLuint index
, const GLbyte
* v
)
1376 ATTRIB4ARB(index
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], (GLfloat
) v
[3]);
1380 _mesa_VertexAttrib4iv(GLuint index
, const GLint
* v
)
1382 ATTRIB4ARB(index
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], (GLfloat
) v
[3]);
1386 _mesa_VertexAttrib4ubv(GLuint index
, const GLubyte
* v
)
1388 ATTRIB4ARB(index
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], (GLfloat
) v
[3]);
1392 _mesa_VertexAttrib4usv(GLuint index
, const GLushort
* v
)
1394 ATTRIB4ARB(index
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], (GLfloat
) v
[3]);
1398 _mesa_VertexAttrib4uiv(GLuint index
, const GLuint
* v
)
1400 ATTRIB4ARB(index
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], (GLfloat
) v
[3]);
1404 _mesa_VertexAttrib4Nbv(GLuint index
, const GLbyte
* v
)
1406 ATTRIB4ARB(index
, BYTE_TO_FLOAT(v
[0]), BYTE_TO_FLOAT(v
[1]),
1407 BYTE_TO_FLOAT(v
[2]), BYTE_TO_FLOAT(v
[3]));
1411 _mesa_VertexAttrib4Nsv(GLuint index
, const GLshort
* v
)
1413 ATTRIB4ARB(index
, SHORT_TO_FLOAT(v
[0]), SHORT_TO_FLOAT(v
[1]),
1414 SHORT_TO_FLOAT(v
[2]), SHORT_TO_FLOAT(v
[3]));
1418 _mesa_VertexAttrib4Niv(GLuint index
, const GLint
* v
)
1420 ATTRIB4ARB(index
, INT_TO_FLOAT(v
[0]), INT_TO_FLOAT(v
[1]),
1421 INT_TO_FLOAT(v
[2]), INT_TO_FLOAT(v
[3]));
1425 _mesa_VertexAttrib4Nub(GLuint index
, GLubyte x
, GLubyte y
, GLubyte z
, GLubyte w
)
1427 ATTRIB4ARB(index
, UBYTE_TO_FLOAT(x
), UBYTE_TO_FLOAT(y
),
1428 UBYTE_TO_FLOAT(z
), UBYTE_TO_FLOAT(w
));
1432 _mesa_VertexAttrib4Nubv(GLuint index
, const GLubyte
* v
)
1434 ATTRIB4ARB(index
, UBYTE_TO_FLOAT(v
[0]), UBYTE_TO_FLOAT(v
[1]),
1435 UBYTE_TO_FLOAT(v
[2]), UBYTE_TO_FLOAT(v
[3]));
1439 _mesa_VertexAttrib4Nusv(GLuint index
, const GLushort
* v
)
1441 ATTRIB4ARB(index
, USHORT_TO_FLOAT(v
[0]), USHORT_TO_FLOAT(v
[1]),
1442 USHORT_TO_FLOAT(v
[2]), USHORT_TO_FLOAT(v
[3]));
1446 _mesa_VertexAttrib4Nuiv(GLuint index
, const GLuint
* v
)
1448 ATTRIB4ARB(index
, UINT_TO_FLOAT(v
[0]), UINT_TO_FLOAT(v
[1]),
1449 UINT_TO_FLOAT(v
[2]), UINT_TO_FLOAT(v
[3]));
1455 * GL_EXT_gpu_shader / GL 3.0 signed/unsigned integer-valued attributes.
1456 * Note that attribute indexes do NOT alias conventional attributes.
1460 _mesa_VertexAttribI1iv(GLuint index
, const GLint
*v
)
1462 ATTRIBI_1I(index
, v
[0]);
1466 _mesa_VertexAttribI1uiv(GLuint index
, const GLuint
*v
)
1468 ATTRIBI_1UI(index
, v
[0]);
1472 _mesa_VertexAttribI4bv(GLuint index
, const GLbyte
*v
)
1474 ATTRIBI_4I(index
, v
[0], v
[1], v
[2], v
[3]);
1478 _mesa_VertexAttribI4sv(GLuint index
, const GLshort
*v
)
1480 ATTRIBI_4I(index
, v
[0], v
[1], v
[2], v
[3]);
1484 _mesa_VertexAttribI4ubv(GLuint index
, const GLubyte
*v
)
1486 ATTRIBI_4UI(index
, v
[0], v
[1], v
[2], v
[3]);
1490 _mesa_VertexAttribI4usv(GLuint index
, const GLushort
*v
)
1492 ATTRIBI_4UI(index
, v
[0], v
[1], v
[2], v
[3]);
1499 * This code never registers handlers for any of the entry points
1500 * listed in vtxfmt.h.
1503 _mesa_loopback_init_api_table(const struct gl_context
*ctx
,
1504 struct _glapi_table
*dest
)
1506 if (ctx
->API
!= API_OPENGL_CORE
&& ctx
->API
!= API_OPENGLES2
) {
1507 SET_Color4ub(dest
, _mesa_Color4ub
);
1508 SET_Materialf(dest
, _mesa_Materialf
);
1510 if (ctx
->API
== API_OPENGL_COMPAT
) {
1511 SET_Color3b(dest
, _mesa_Color3b
);
1512 SET_Color3d(dest
, _mesa_Color3d
);
1513 SET_Color3i(dest
, _mesa_Color3i
);
1514 SET_Color3s(dest
, _mesa_Color3s
);
1515 SET_Color3ui(dest
, _mesa_Color3ui
);
1516 SET_Color3us(dest
, _mesa_Color3us
);
1517 SET_Color3ub(dest
, _mesa_Color3ub
);
1518 SET_Color4b(dest
, _mesa_Color4b
);
1519 SET_Color4d(dest
, _mesa_Color4d
);
1520 SET_Color4i(dest
, _mesa_Color4i
);
1521 SET_Color4s(dest
, _mesa_Color4s
);
1522 SET_Color4ui(dest
, _mesa_Color4ui
);
1523 SET_Color4us(dest
, _mesa_Color4us
);
1524 SET_Color3bv(dest
, _mesa_Color3bv
);
1525 SET_Color3dv(dest
, _mesa_Color3dv
);
1526 SET_Color3iv(dest
, _mesa_Color3iv
);
1527 SET_Color3sv(dest
, _mesa_Color3sv
);
1528 SET_Color3uiv(dest
, _mesa_Color3uiv
);
1529 SET_Color3usv(dest
, _mesa_Color3usv
);
1530 SET_Color3ubv(dest
, _mesa_Color3ubv
);
1531 SET_Color4bv(dest
, _mesa_Color4bv
);
1532 SET_Color4dv(dest
, _mesa_Color4dv
);
1533 SET_Color4iv(dest
, _mesa_Color4iv
);
1534 SET_Color4sv(dest
, _mesa_Color4sv
);
1535 SET_Color4uiv(dest
, _mesa_Color4uiv
);
1536 SET_Color4usv(dest
, _mesa_Color4usv
);
1537 SET_Color4ubv(dest
, _mesa_Color4ubv
);
1539 SET_SecondaryColor3b(dest
, _mesa_SecondaryColor3b
);
1540 SET_SecondaryColor3d(dest
, _mesa_SecondaryColor3d
);
1541 SET_SecondaryColor3i(dest
, _mesa_SecondaryColor3i
);
1542 SET_SecondaryColor3s(dest
, _mesa_SecondaryColor3s
);
1543 SET_SecondaryColor3ui(dest
, _mesa_SecondaryColor3ui
);
1544 SET_SecondaryColor3us(dest
, _mesa_SecondaryColor3us
);
1545 SET_SecondaryColor3ub(dest
, _mesa_SecondaryColor3ub
);
1546 SET_SecondaryColor3bv(dest
, _mesa_SecondaryColor3bv
);
1547 SET_SecondaryColor3dv(dest
, _mesa_SecondaryColor3dv
);
1548 SET_SecondaryColor3iv(dest
, _mesa_SecondaryColor3iv
);
1549 SET_SecondaryColor3sv(dest
, _mesa_SecondaryColor3sv
);
1550 SET_SecondaryColor3uiv(dest
, _mesa_SecondaryColor3uiv
);
1551 SET_SecondaryColor3usv(dest
, _mesa_SecondaryColor3usv
);
1552 SET_SecondaryColor3ubv(dest
, _mesa_SecondaryColor3ubv
);
1554 SET_EdgeFlagv(dest
, _mesa_EdgeFlagv
);
1556 SET_Indexd(dest
, _mesa_Indexd
);
1557 SET_Indexi(dest
, _mesa_Indexi
);
1558 SET_Indexs(dest
, _mesa_Indexs
);
1559 SET_Indexub(dest
, _mesa_Indexub
);
1560 SET_Indexdv(dest
, _mesa_Indexdv
);
1561 SET_Indexiv(dest
, _mesa_Indexiv
);
1562 SET_Indexsv(dest
, _mesa_Indexsv
);
1563 SET_Indexubv(dest
, _mesa_Indexubv
);
1564 SET_Normal3b(dest
, _mesa_Normal3b
);
1565 SET_Normal3d(dest
, _mesa_Normal3d
);
1566 SET_Normal3i(dest
, _mesa_Normal3i
);
1567 SET_Normal3s(dest
, _mesa_Normal3s
);
1568 SET_Normal3bv(dest
, _mesa_Normal3bv
);
1569 SET_Normal3dv(dest
, _mesa_Normal3dv
);
1570 SET_Normal3iv(dest
, _mesa_Normal3iv
);
1571 SET_Normal3sv(dest
, _mesa_Normal3sv
);
1572 SET_TexCoord1d(dest
, _mesa_TexCoord1d
);
1573 SET_TexCoord1i(dest
, _mesa_TexCoord1i
);
1574 SET_TexCoord1s(dest
, _mesa_TexCoord1s
);
1575 SET_TexCoord2d(dest
, _mesa_TexCoord2d
);
1576 SET_TexCoord2s(dest
, _mesa_TexCoord2s
);
1577 SET_TexCoord2i(dest
, _mesa_TexCoord2i
);
1578 SET_TexCoord3d(dest
, _mesa_TexCoord3d
);
1579 SET_TexCoord3i(dest
, _mesa_TexCoord3i
);
1580 SET_TexCoord3s(dest
, _mesa_TexCoord3s
);
1581 SET_TexCoord4d(dest
, _mesa_TexCoord4d
);
1582 SET_TexCoord4i(dest
, _mesa_TexCoord4i
);
1583 SET_TexCoord4s(dest
, _mesa_TexCoord4s
);
1584 SET_TexCoord1dv(dest
, _mesa_TexCoord1dv
);
1585 SET_TexCoord1iv(dest
, _mesa_TexCoord1iv
);
1586 SET_TexCoord1sv(dest
, _mesa_TexCoord1sv
);
1587 SET_TexCoord2dv(dest
, _mesa_TexCoord2dv
);
1588 SET_TexCoord2iv(dest
, _mesa_TexCoord2iv
);
1589 SET_TexCoord2sv(dest
, _mesa_TexCoord2sv
);
1590 SET_TexCoord3dv(dest
, _mesa_TexCoord3dv
);
1591 SET_TexCoord3iv(dest
, _mesa_TexCoord3iv
);
1592 SET_TexCoord3sv(dest
, _mesa_TexCoord3sv
);
1593 SET_TexCoord4dv(dest
, _mesa_TexCoord4dv
);
1594 SET_TexCoord4iv(dest
, _mesa_TexCoord4iv
);
1595 SET_TexCoord4sv(dest
, _mesa_TexCoord4sv
);
1596 SET_Vertex2d(dest
, _mesa_Vertex2d
);
1597 SET_Vertex2i(dest
, _mesa_Vertex2i
);
1598 SET_Vertex2s(dest
, _mesa_Vertex2s
);
1599 SET_Vertex3d(dest
, _mesa_Vertex3d
);
1600 SET_Vertex3i(dest
, _mesa_Vertex3i
);
1601 SET_Vertex3s(dest
, _mesa_Vertex3s
);
1602 SET_Vertex4d(dest
, _mesa_Vertex4d
);
1603 SET_Vertex4i(dest
, _mesa_Vertex4i
);
1604 SET_Vertex4s(dest
, _mesa_Vertex4s
);
1605 SET_Vertex2dv(dest
, _mesa_Vertex2dv
);
1606 SET_Vertex2iv(dest
, _mesa_Vertex2iv
);
1607 SET_Vertex2sv(dest
, _mesa_Vertex2sv
);
1608 SET_Vertex3dv(dest
, _mesa_Vertex3dv
);
1609 SET_Vertex3iv(dest
, _mesa_Vertex3iv
);
1610 SET_Vertex3sv(dest
, _mesa_Vertex3sv
);
1611 SET_Vertex4dv(dest
, _mesa_Vertex4dv
);
1612 SET_Vertex4iv(dest
, _mesa_Vertex4iv
);
1613 SET_Vertex4sv(dest
, _mesa_Vertex4sv
);
1614 SET_MultiTexCoord1d(dest
, _mesa_MultiTexCoord1d
);
1615 SET_MultiTexCoord1dv(dest
, _mesa_MultiTexCoord1dv
);
1616 SET_MultiTexCoord1i(dest
, _mesa_MultiTexCoord1i
);
1617 SET_MultiTexCoord1iv(dest
, _mesa_MultiTexCoord1iv
);
1618 SET_MultiTexCoord1s(dest
, _mesa_MultiTexCoord1s
);
1619 SET_MultiTexCoord1sv(dest
, _mesa_MultiTexCoord1sv
);
1620 SET_MultiTexCoord2d(dest
, _mesa_MultiTexCoord2d
);
1621 SET_MultiTexCoord2dv(dest
, _mesa_MultiTexCoord2dv
);
1622 SET_MultiTexCoord2i(dest
, _mesa_MultiTexCoord2i
);
1623 SET_MultiTexCoord2iv(dest
, _mesa_MultiTexCoord2iv
);
1624 SET_MultiTexCoord2s(dest
, _mesa_MultiTexCoord2s
);
1625 SET_MultiTexCoord2sv(dest
, _mesa_MultiTexCoord2sv
);
1626 SET_MultiTexCoord3d(dest
, _mesa_MultiTexCoord3d
);
1627 SET_MultiTexCoord3dv(dest
, _mesa_MultiTexCoord3dv
);
1628 SET_MultiTexCoord3i(dest
, _mesa_MultiTexCoord3i
);
1629 SET_MultiTexCoord3iv(dest
, _mesa_MultiTexCoord3iv
);
1630 SET_MultiTexCoord3s(dest
, _mesa_MultiTexCoord3s
);
1631 SET_MultiTexCoord3sv(dest
, _mesa_MultiTexCoord3sv
);
1632 SET_MultiTexCoord4d(dest
, _mesa_MultiTexCoord4d
);
1633 SET_MultiTexCoord4dv(dest
, _mesa_MultiTexCoord4dv
);
1634 SET_MultiTexCoord4i(dest
, _mesa_MultiTexCoord4i
);
1635 SET_MultiTexCoord4iv(dest
, _mesa_MultiTexCoord4iv
);
1636 SET_MultiTexCoord4s(dest
, _mesa_MultiTexCoord4s
);
1637 SET_MultiTexCoord4sv(dest
, _mesa_MultiTexCoord4sv
);
1638 SET_EvalCoord2dv(dest
, _mesa_EvalCoord2dv
);
1639 SET_EvalCoord2fv(dest
, _mesa_EvalCoord2fv
);
1640 SET_EvalCoord2d(dest
, _mesa_EvalCoord2d
);
1641 SET_EvalCoord1dv(dest
, _mesa_EvalCoord1dv
);
1642 SET_EvalCoord1fv(dest
, _mesa_EvalCoord1fv
);
1643 SET_EvalCoord1d(dest
, _mesa_EvalCoord1d
);
1644 SET_Materiali(dest
, _mesa_Materiali
);
1645 SET_Materialiv(dest
, _mesa_Materialiv
);
1646 SET_Rectd(dest
, _mesa_Rectd
);
1647 SET_Rectdv(dest
, _mesa_Rectdv
);
1648 SET_Rectfv(dest
, _mesa_Rectfv
);
1649 SET_Recti(dest
, _mesa_Recti
);
1650 SET_Rectiv(dest
, _mesa_Rectiv
);
1651 SET_Rects(dest
, _mesa_Rects
);
1652 SET_Rectsv(dest
, _mesa_Rectsv
);
1653 SET_FogCoordd(dest
, _mesa_FogCoordd
);
1654 SET_FogCoorddv(dest
, _mesa_FogCoorddv
);
1657 if (ctx
->API
== API_OPENGL_COMPAT
) {
1658 SET_VertexAttrib1sNV(dest
, _mesa_VertexAttrib1sNV
);
1659 SET_VertexAttrib1dNV(dest
, _mesa_VertexAttrib1dNV
);
1660 SET_VertexAttrib2sNV(dest
, _mesa_VertexAttrib2sNV
);
1661 SET_VertexAttrib2dNV(dest
, _mesa_VertexAttrib2dNV
);
1662 SET_VertexAttrib3sNV(dest
, _mesa_VertexAttrib3sNV
);
1663 SET_VertexAttrib3dNV(dest
, _mesa_VertexAttrib3dNV
);
1664 SET_VertexAttrib4sNV(dest
, _mesa_VertexAttrib4sNV
);
1665 SET_VertexAttrib4dNV(dest
, _mesa_VertexAttrib4dNV
);
1666 SET_VertexAttrib4ubNV(dest
, _mesa_VertexAttrib4ubNV
);
1667 SET_VertexAttrib1svNV(dest
, _mesa_VertexAttrib1svNV
);
1668 SET_VertexAttrib1dvNV(dest
, _mesa_VertexAttrib1dvNV
);
1669 SET_VertexAttrib2svNV(dest
, _mesa_VertexAttrib2svNV
);
1670 SET_VertexAttrib2dvNV(dest
, _mesa_VertexAttrib2dvNV
);
1671 SET_VertexAttrib3svNV(dest
, _mesa_VertexAttrib3svNV
);
1672 SET_VertexAttrib3dvNV(dest
, _mesa_VertexAttrib3dvNV
);
1673 SET_VertexAttrib4svNV(dest
, _mesa_VertexAttrib4svNV
);
1674 SET_VertexAttrib4dvNV(dest
, _mesa_VertexAttrib4dvNV
);
1675 SET_VertexAttrib4ubvNV(dest
, _mesa_VertexAttrib4ubvNV
);
1676 SET_VertexAttribs1svNV(dest
, _mesa_VertexAttribs1svNV
);
1677 SET_VertexAttribs1fvNV(dest
, _mesa_VertexAttribs1fvNV
);
1678 SET_VertexAttribs1dvNV(dest
, _mesa_VertexAttribs1dvNV
);
1679 SET_VertexAttribs2svNV(dest
, _mesa_VertexAttribs2svNV
);
1680 SET_VertexAttribs2fvNV(dest
, _mesa_VertexAttribs2fvNV
);
1681 SET_VertexAttribs2dvNV(dest
, _mesa_VertexAttribs2dvNV
);
1682 SET_VertexAttribs3svNV(dest
, _mesa_VertexAttribs3svNV
);
1683 SET_VertexAttribs3fvNV(dest
, _mesa_VertexAttribs3fvNV
);
1684 SET_VertexAttribs3dvNV(dest
, _mesa_VertexAttribs3dvNV
);
1685 SET_VertexAttribs4svNV(dest
, _mesa_VertexAttribs4svNV
);
1686 SET_VertexAttribs4fvNV(dest
, _mesa_VertexAttribs4fvNV
);
1687 SET_VertexAttribs4dvNV(dest
, _mesa_VertexAttribs4dvNV
);
1688 SET_VertexAttribs4ubvNV(dest
, _mesa_VertexAttribs4ubvNV
);
1691 if (_mesa_is_desktop_gl(ctx
)) {
1692 SET_VertexAttrib1s(dest
, _mesa_VertexAttrib1s
);
1693 SET_VertexAttrib1d(dest
, _mesa_VertexAttrib1d
);
1694 SET_VertexAttrib2s(dest
, _mesa_VertexAttrib2s
);
1695 SET_VertexAttrib2d(dest
, _mesa_VertexAttrib2d
);
1696 SET_VertexAttrib3s(dest
, _mesa_VertexAttrib3s
);
1697 SET_VertexAttrib3d(dest
, _mesa_VertexAttrib3d
);
1698 SET_VertexAttrib4s(dest
, _mesa_VertexAttrib4s
);
1699 SET_VertexAttrib4d(dest
, _mesa_VertexAttrib4d
);
1700 SET_VertexAttrib1sv(dest
, _mesa_VertexAttrib1sv
);
1701 SET_VertexAttrib1dv(dest
, _mesa_VertexAttrib1dv
);
1702 SET_VertexAttrib2sv(dest
, _mesa_VertexAttrib2sv
);
1703 SET_VertexAttrib2dv(dest
, _mesa_VertexAttrib2dv
);
1704 SET_VertexAttrib3sv(dest
, _mesa_VertexAttrib3sv
);
1705 SET_VertexAttrib3dv(dest
, _mesa_VertexAttrib3dv
);
1706 SET_VertexAttrib4sv(dest
, _mesa_VertexAttrib4sv
);
1707 SET_VertexAttrib4dv(dest
, _mesa_VertexAttrib4dv
);
1708 SET_VertexAttrib4Nub(dest
, _mesa_VertexAttrib4Nub
);
1709 SET_VertexAttrib4Nubv(dest
, _mesa_VertexAttrib4Nubv
);
1710 SET_VertexAttrib4bv(dest
, _mesa_VertexAttrib4bv
);
1711 SET_VertexAttrib4iv(dest
, _mesa_VertexAttrib4iv
);
1712 SET_VertexAttrib4ubv(dest
, _mesa_VertexAttrib4ubv
);
1713 SET_VertexAttrib4usv(dest
, _mesa_VertexAttrib4usv
);
1714 SET_VertexAttrib4uiv(dest
, _mesa_VertexAttrib4uiv
);
1715 SET_VertexAttrib4Nbv(dest
, _mesa_VertexAttrib4Nbv
);
1716 SET_VertexAttrib4Nsv(dest
, _mesa_VertexAttrib4Nsv
);
1717 SET_VertexAttrib4Nusv(dest
, _mesa_VertexAttrib4Nusv
);
1718 SET_VertexAttrib4Niv(dest
, _mesa_VertexAttrib4Niv
);
1719 SET_VertexAttrib4Nuiv(dest
, _mesa_VertexAttrib4Nuiv
);
1721 /* GL_EXT_gpu_shader4, GL 3.0 */
1722 SET_VertexAttribI1iv(dest
, _mesa_VertexAttribI1iv
);
1723 SET_VertexAttribI1uiv(dest
, _mesa_VertexAttribI1uiv
);
1724 SET_VertexAttribI4bv(dest
, _mesa_VertexAttribI4bv
);
1725 SET_VertexAttribI4sv(dest
, _mesa_VertexAttribI4sv
);
1726 SET_VertexAttribI4ubv(dest
, _mesa_VertexAttribI4ubv
);
1727 SET_VertexAttribI4usv(dest
, _mesa_VertexAttribI4usv
);