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))
93 _mesa_Color3b( GLbyte red
, GLbyte green
, GLbyte blue
)
95 COLORF( BYTE_TO_FLOAT(red
),
102 _mesa_Color3d( GLdouble red
, GLdouble green
, GLdouble blue
)
104 COLORF( (GLfloat
) red
, (GLfloat
) green
, (GLfloat
) blue
, 1.0 );
108 _mesa_Color3i( GLint red
, GLint green
, GLint blue
)
110 COLORF( INT_TO_FLOAT(red
), INT_TO_FLOAT(green
),
111 INT_TO_FLOAT(blue
), 1.0);
115 _mesa_Color3s( GLshort red
, GLshort green
, GLshort blue
)
117 COLORF( SHORT_TO_FLOAT(red
), SHORT_TO_FLOAT(green
),
118 SHORT_TO_FLOAT(blue
), 1.0);
122 _mesa_Color3ui( GLuint red
, GLuint green
, GLuint blue
)
124 COLORF( UINT_TO_FLOAT(red
), UINT_TO_FLOAT(green
),
125 UINT_TO_FLOAT(blue
), 1.0 );
129 _mesa_Color3us( GLushort red
, GLushort green
, GLushort blue
)
131 COLORF( USHORT_TO_FLOAT(red
), USHORT_TO_FLOAT(green
),
132 USHORT_TO_FLOAT(blue
), 1.0 );
136 _mesa_Color3ub( GLubyte red
, GLubyte green
, GLubyte blue
)
138 COLORF( UBYTE_TO_FLOAT(red
), UBYTE_TO_FLOAT(green
),
139 UBYTE_TO_FLOAT(blue
), 1.0 );
144 _mesa_Color3bv( const GLbyte
*v
)
146 COLORF( BYTE_TO_FLOAT(v
[0]), BYTE_TO_FLOAT(v
[1]),
147 BYTE_TO_FLOAT(v
[2]), 1.0 );
151 _mesa_Color3dv( const GLdouble
*v
)
153 COLORF( (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0 );
157 _mesa_Color3iv( const GLint
*v
)
159 COLORF( INT_TO_FLOAT(v
[0]), INT_TO_FLOAT(v
[1]),
160 INT_TO_FLOAT(v
[2]), 1.0 );
164 _mesa_Color3sv( const GLshort
*v
)
166 COLORF( SHORT_TO_FLOAT(v
[0]), SHORT_TO_FLOAT(v
[1]),
167 SHORT_TO_FLOAT(v
[2]), 1.0 );
171 _mesa_Color3uiv( const GLuint
*v
)
173 COLORF( UINT_TO_FLOAT(v
[0]), UINT_TO_FLOAT(v
[1]),
174 UINT_TO_FLOAT(v
[2]), 1.0 );
178 _mesa_Color3usv( const GLushort
*v
)
180 COLORF( USHORT_TO_FLOAT(v
[0]), USHORT_TO_FLOAT(v
[1]),
181 USHORT_TO_FLOAT(v
[2]), 1.0 );
185 _mesa_Color3ubv( const GLubyte
*v
)
187 COLORF( UBYTE_TO_FLOAT(v
[0]), UBYTE_TO_FLOAT(v
[1]),
188 UBYTE_TO_FLOAT(v
[2]), 1.0 );
193 _mesa_Color4b( GLbyte red
, GLbyte green
, GLbyte blue
,
196 COLORF( BYTE_TO_FLOAT(red
), BYTE_TO_FLOAT(green
),
197 BYTE_TO_FLOAT(blue
), BYTE_TO_FLOAT(alpha
) );
201 _mesa_Color4d( GLdouble red
, GLdouble green
, GLdouble blue
,
204 COLORF( (GLfloat
) red
, (GLfloat
) green
, (GLfloat
) blue
, (GLfloat
) alpha
);
208 _mesa_Color4i( GLint red
, GLint green
, GLint blue
, GLint alpha
)
210 COLORF( INT_TO_FLOAT(red
), INT_TO_FLOAT(green
),
211 INT_TO_FLOAT(blue
), INT_TO_FLOAT(alpha
) );
215 _mesa_Color4s( GLshort red
, GLshort green
, GLshort blue
,
218 COLORF( SHORT_TO_FLOAT(red
), SHORT_TO_FLOAT(green
),
219 SHORT_TO_FLOAT(blue
), SHORT_TO_FLOAT(alpha
) );
223 _mesa_Color4ui( GLuint red
, GLuint green
, GLuint blue
, GLuint alpha
)
225 COLORF( UINT_TO_FLOAT(red
), UINT_TO_FLOAT(green
),
226 UINT_TO_FLOAT(blue
), UINT_TO_FLOAT(alpha
) );
230 _mesa_Color4us( GLushort red
, GLushort green
, GLushort blue
, GLushort alpha
)
232 COLORF( USHORT_TO_FLOAT(red
), USHORT_TO_FLOAT(green
),
233 USHORT_TO_FLOAT(blue
), USHORT_TO_FLOAT(alpha
) );
237 _mesa_Color4ub( GLubyte red
, GLubyte green
, GLubyte blue
, GLubyte alpha
)
239 COLORF( UBYTE_TO_FLOAT(red
), UBYTE_TO_FLOAT(green
),
240 UBYTE_TO_FLOAT(blue
), UBYTE_TO_FLOAT(alpha
) );
245 _mesa_Color4iv( const GLint
*v
)
247 COLORF( INT_TO_FLOAT(v
[0]), INT_TO_FLOAT(v
[1]),
248 INT_TO_FLOAT(v
[2]), INT_TO_FLOAT(v
[3]) );
253 _mesa_Color4bv( const GLbyte
*v
)
255 COLORF( BYTE_TO_FLOAT(v
[0]), BYTE_TO_FLOAT(v
[1]),
256 BYTE_TO_FLOAT(v
[2]), BYTE_TO_FLOAT(v
[3]) );
260 _mesa_Color4dv( const GLdouble
*v
)
262 COLORF( (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], (GLfloat
) v
[3] );
267 _mesa_Color4sv( const GLshort
*v
)
269 COLORF( SHORT_TO_FLOAT(v
[0]), SHORT_TO_FLOAT(v
[1]),
270 SHORT_TO_FLOAT(v
[2]), SHORT_TO_FLOAT(v
[3]) );
275 _mesa_Color4uiv( const GLuint
*v
)
277 COLORF( UINT_TO_FLOAT(v
[0]), UINT_TO_FLOAT(v
[1]),
278 UINT_TO_FLOAT(v
[2]), UINT_TO_FLOAT(v
[3]) );
282 _mesa_Color4usv( const GLushort
*v
)
284 COLORF( USHORT_TO_FLOAT(v
[0]), USHORT_TO_FLOAT(v
[1]),
285 USHORT_TO_FLOAT(v
[2]), USHORT_TO_FLOAT(v
[3]) );
289 _mesa_Color4ubv( const GLubyte
*v
)
291 COLORF( UBYTE_TO_FLOAT(v
[0]), UBYTE_TO_FLOAT(v
[1]),
292 UBYTE_TO_FLOAT(v
[2]), UBYTE_TO_FLOAT(v
[3]) );
297 _mesa_FogCoordd( GLdouble d
)
299 FOGCOORDF( (GLfloat
) d
);
303 _mesa_FogCoorddv( const GLdouble
*v
)
305 FOGCOORDF( (GLfloat
) *v
);
310 _mesa_Indexd( GLdouble c
)
312 INDEX( (GLfloat
) c
);
316 _mesa_Indexi( GLint c
)
318 INDEX( (GLfloat
) c
);
322 _mesa_Indexs( GLshort c
)
324 INDEX( (GLfloat
) c
);
328 _mesa_Indexub( GLubyte c
)
330 INDEX( (GLfloat
) c
);
334 _mesa_Indexdv( const GLdouble
*c
)
336 INDEX( (GLfloat
) *c
);
340 _mesa_Indexiv( const GLint
*c
)
342 INDEX( (GLfloat
) *c
);
346 _mesa_Indexsv( const GLshort
*c
)
348 INDEX( (GLfloat
) *c
);
352 _mesa_Indexubv( const GLubyte
*c
)
354 INDEX( (GLfloat
) *c
);
359 _mesa_EdgeFlagv(const GLboolean
*flag
)
361 CALL_EdgeFlag(GET_DISPATCH(), (*flag
));
366 _mesa_Normal3b( GLbyte nx
, GLbyte ny
, GLbyte nz
)
368 NORMAL( BYTE_TO_FLOAT(nx
), BYTE_TO_FLOAT(ny
), BYTE_TO_FLOAT(nz
) );
372 _mesa_Normal3d( GLdouble nx
, GLdouble ny
, GLdouble nz
)
374 NORMAL((GLfloat
) nx
, (GLfloat
) ny
, (GLfloat
) nz
);
378 _mesa_Normal3i( GLint nx
, GLint ny
, GLint nz
)
380 NORMAL( INT_TO_FLOAT(nx
), INT_TO_FLOAT(ny
), INT_TO_FLOAT(nz
) );
384 _mesa_Normal3s( GLshort nx
, GLshort ny
, GLshort nz
)
386 NORMAL( SHORT_TO_FLOAT(nx
), SHORT_TO_FLOAT(ny
), SHORT_TO_FLOAT(nz
) );
390 _mesa_Normal3bv( const GLbyte
*v
)
392 NORMAL( BYTE_TO_FLOAT(v
[0]), BYTE_TO_FLOAT(v
[1]), BYTE_TO_FLOAT(v
[2]) );
396 _mesa_Normal3dv( const GLdouble
*v
)
398 NORMAL( (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2] );
402 _mesa_Normal3iv( const GLint
*v
)
404 NORMAL( INT_TO_FLOAT(v
[0]), INT_TO_FLOAT(v
[1]), INT_TO_FLOAT(v
[2]) );
408 _mesa_Normal3sv( const GLshort
*v
)
410 NORMAL( SHORT_TO_FLOAT(v
[0]), SHORT_TO_FLOAT(v
[1]), SHORT_TO_FLOAT(v
[2]) );
414 _mesa_TexCoord1d( GLdouble s
)
416 TEXCOORD1((GLfloat
) s
);
420 _mesa_TexCoord1i( GLint s
)
422 TEXCOORD1((GLfloat
) s
);
426 _mesa_TexCoord1s( GLshort s
)
428 TEXCOORD1((GLfloat
) s
);
432 _mesa_TexCoord2d( GLdouble s
, GLdouble t
)
434 TEXCOORD2((GLfloat
) s
,(GLfloat
) t
);
438 _mesa_TexCoord2s( GLshort s
, GLshort t
)
440 TEXCOORD2((GLfloat
) s
,(GLfloat
) t
);
444 _mesa_TexCoord2i( GLint s
, GLint t
)
446 TEXCOORD2((GLfloat
) s
,(GLfloat
) t
);
450 _mesa_TexCoord3d( GLdouble s
, GLdouble t
, GLdouble r
)
452 TEXCOORD3((GLfloat
) s
,(GLfloat
) t
,(GLfloat
) r
);
456 _mesa_TexCoord3i( GLint s
, GLint t
, GLint r
)
458 TEXCOORD3((GLfloat
) s
,(GLfloat
) t
,(GLfloat
) r
);
462 _mesa_TexCoord3s( GLshort s
, GLshort t
, GLshort r
)
464 TEXCOORD3((GLfloat
) s
,(GLfloat
) t
,(GLfloat
) r
);
468 _mesa_TexCoord4d( GLdouble s
, GLdouble t
, GLdouble r
, GLdouble q
)
470 TEXCOORD4((GLfloat
) s
,(GLfloat
) t
,(GLfloat
) r
,(GLfloat
) q
);
474 _mesa_TexCoord4i( GLint s
, GLint t
, GLint r
, GLint q
)
476 TEXCOORD4((GLfloat
) s
,(GLfloat
) t
,(GLfloat
) r
,(GLfloat
) q
);
480 _mesa_TexCoord4s( GLshort s
, GLshort t
, GLshort r
, GLshort q
)
482 TEXCOORD4((GLfloat
) s
,(GLfloat
) t
,(GLfloat
) r
,(GLfloat
) q
);
486 _mesa_TexCoord1dv( const GLdouble
*v
)
488 TEXCOORD1((GLfloat
) v
[0]);
492 _mesa_TexCoord1iv( const GLint
*v
)
494 TEXCOORD1((GLfloat
) v
[0]);
498 _mesa_TexCoord1sv( const GLshort
*v
)
500 TEXCOORD1((GLfloat
) v
[0]);
504 _mesa_TexCoord2dv( const GLdouble
*v
)
506 TEXCOORD2((GLfloat
) v
[0],(GLfloat
) v
[1]);
510 _mesa_TexCoord2iv( const GLint
*v
)
512 TEXCOORD2((GLfloat
) v
[0],(GLfloat
) v
[1]);
516 _mesa_TexCoord2sv( const GLshort
*v
)
518 TEXCOORD2((GLfloat
) v
[0],(GLfloat
) v
[1]);
522 _mesa_TexCoord3dv( const GLdouble
*v
)
524 TEXCOORD3((GLfloat
) v
[0],(GLfloat
) v
[1],(GLfloat
) v
[2]);
528 _mesa_TexCoord3iv( const GLint
*v
)
530 TEXCOORD3((GLfloat
) v
[0],(GLfloat
) v
[1],(GLfloat
) v
[2]);
534 _mesa_TexCoord3sv( const GLshort
*v
)
536 TEXCOORD3((GLfloat
) v
[0],(GLfloat
) v
[1],(GLfloat
) v
[2]);
540 _mesa_TexCoord4dv( const GLdouble
*v
)
542 TEXCOORD4((GLfloat
) v
[0],(GLfloat
) v
[1],(GLfloat
) v
[2],(GLfloat
) v
[3]);
546 _mesa_TexCoord4iv( const GLint
*v
)
548 TEXCOORD4((GLfloat
) v
[0],(GLfloat
) v
[1],(GLfloat
) v
[2],(GLfloat
) v
[3]);
552 _mesa_TexCoord4sv( const GLshort
*v
)
554 TEXCOORD4((GLfloat
) v
[0],(GLfloat
) v
[1],(GLfloat
) v
[2],(GLfloat
) v
[3]);
558 _mesa_Vertex2d( GLdouble x
, GLdouble y
)
560 VERTEX2( (GLfloat
) x
, (GLfloat
) y
);
564 _mesa_Vertex2i( GLint x
, GLint y
)
566 VERTEX2( (GLfloat
) x
, (GLfloat
) y
);
570 _mesa_Vertex2s( GLshort x
, GLshort y
)
572 VERTEX2( (GLfloat
) x
, (GLfloat
) y
);
576 _mesa_Vertex3d( GLdouble x
, GLdouble y
, GLdouble z
)
578 VERTEX3( (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
582 _mesa_Vertex3i( GLint x
, GLint y
, GLint z
)
584 VERTEX3( (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
588 _mesa_Vertex3s( GLshort x
, GLshort y
, GLshort z
)
590 VERTEX3( (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
594 _mesa_Vertex4d( GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
596 VERTEX4( (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
600 _mesa_Vertex4i( GLint x
, GLint y
, GLint z
, GLint w
)
602 VERTEX4( (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
606 _mesa_Vertex4s( GLshort x
, GLshort y
, GLshort z
, GLshort w
)
608 VERTEX4( (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
612 _mesa_Vertex2dv( const GLdouble
*v
)
614 VERTEX2( (GLfloat
) v
[0], (GLfloat
) v
[1] );
618 _mesa_Vertex2iv( const GLint
*v
)
620 VERTEX2( (GLfloat
) v
[0], (GLfloat
) v
[1] );
624 _mesa_Vertex2sv( const GLshort
*v
)
626 VERTEX2( (GLfloat
) v
[0], (GLfloat
) v
[1] );
630 _mesa_Vertex3dv( const GLdouble
*v
)
632 VERTEX3( (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2] );
636 _mesa_Vertex3iv( const GLint
*v
)
638 VERTEX3( (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2] );
642 _mesa_Vertex3sv( const GLshort
*v
)
644 VERTEX3( (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2] );
648 _mesa_Vertex4dv( const GLdouble
*v
)
650 VERTEX4( (GLfloat
) v
[0], (GLfloat
) v
[1],
651 (GLfloat
) v
[2], (GLfloat
) v
[3] );
655 _mesa_Vertex4iv( const GLint
*v
)
657 VERTEX4( (GLfloat
) v
[0], (GLfloat
) v
[1],
658 (GLfloat
) v
[2], (GLfloat
) v
[3] );
662 _mesa_Vertex4sv( const GLshort
*v
)
664 VERTEX4( (GLfloat
) v
[0], (GLfloat
) v
[1],
665 (GLfloat
) v
[2], (GLfloat
) v
[3] );
669 _mesa_MultiTexCoord1d(GLenum target
, GLdouble s
)
671 MULTI_TEXCOORD1( target
, (GLfloat
) s
);
675 _mesa_MultiTexCoord1dv(GLenum target
, const GLdouble
*v
)
677 MULTI_TEXCOORD1( target
, (GLfloat
) v
[0] );
681 _mesa_MultiTexCoord1i(GLenum target
, GLint s
)
683 MULTI_TEXCOORD1( target
, (GLfloat
) s
);
687 _mesa_MultiTexCoord1iv(GLenum target
, const GLint
*v
)
689 MULTI_TEXCOORD1( target
, (GLfloat
) v
[0] );
693 _mesa_MultiTexCoord1s(GLenum target
, GLshort s
)
695 MULTI_TEXCOORD1( target
, (GLfloat
) s
);
699 _mesa_MultiTexCoord1sv(GLenum target
, const GLshort
*v
)
701 MULTI_TEXCOORD1( target
, (GLfloat
) v
[0] );
705 _mesa_MultiTexCoord2d(GLenum target
, GLdouble s
, GLdouble t
)
707 MULTI_TEXCOORD2( target
, (GLfloat
) s
, (GLfloat
) t
);
711 _mesa_MultiTexCoord2dv(GLenum target
, const GLdouble
*v
)
713 MULTI_TEXCOORD2( target
, (GLfloat
) v
[0], (GLfloat
) v
[1] );
717 _mesa_MultiTexCoord2i(GLenum target
, GLint s
, GLint t
)
719 MULTI_TEXCOORD2( target
, (GLfloat
) s
, (GLfloat
) t
);
723 _mesa_MultiTexCoord2iv(GLenum target
, const GLint
*v
)
725 MULTI_TEXCOORD2( target
, (GLfloat
) v
[0], (GLfloat
) v
[1] );
729 _mesa_MultiTexCoord2s(GLenum target
, GLshort s
, GLshort t
)
731 MULTI_TEXCOORD2( target
, (GLfloat
) s
, (GLfloat
) t
);
735 _mesa_MultiTexCoord2sv(GLenum target
, const GLshort
*v
)
737 MULTI_TEXCOORD2( target
, (GLfloat
) v
[0], (GLfloat
) v
[1] );
741 _mesa_MultiTexCoord3d(GLenum target
, GLdouble s
, GLdouble t
, GLdouble r
)
743 MULTI_TEXCOORD3( target
, (GLfloat
) s
, (GLfloat
) t
, (GLfloat
) r
);
747 _mesa_MultiTexCoord3dv(GLenum target
, const GLdouble
*v
)
749 MULTI_TEXCOORD3( target
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2] );
753 _mesa_MultiTexCoord3i(GLenum target
, GLint s
, GLint t
, GLint r
)
755 MULTI_TEXCOORD3( target
, (GLfloat
) s
, (GLfloat
) t
, (GLfloat
) r
);
759 _mesa_MultiTexCoord3iv(GLenum target
, const GLint
*v
)
761 MULTI_TEXCOORD3( target
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2] );
765 _mesa_MultiTexCoord3s(GLenum target
, GLshort s
, GLshort t
, GLshort r
)
767 MULTI_TEXCOORD3( target
, (GLfloat
) s
, (GLfloat
) t
, (GLfloat
) r
);
771 _mesa_MultiTexCoord3sv(GLenum target
, const GLshort
*v
)
773 MULTI_TEXCOORD3( target
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2] );
777 _mesa_MultiTexCoord4d(GLenum target
, GLdouble s
, GLdouble t
, GLdouble r
, GLdouble q
)
779 MULTI_TEXCOORD4( target
, (GLfloat
) s
, (GLfloat
) t
,
780 (GLfloat
) r
, (GLfloat
) q
);
784 _mesa_MultiTexCoord4dv(GLenum target
, const GLdouble
*v
)
786 MULTI_TEXCOORD4( target
, (GLfloat
) v
[0], (GLfloat
) v
[1],
787 (GLfloat
) v
[2], (GLfloat
) v
[3] );
791 _mesa_MultiTexCoord4i(GLenum target
, GLint s
, GLint t
, GLint r
, GLint q
)
793 MULTI_TEXCOORD4( target
, (GLfloat
) s
, (GLfloat
) t
,
794 (GLfloat
) r
, (GLfloat
) q
);
798 _mesa_MultiTexCoord4iv(GLenum target
, const GLint
*v
)
800 MULTI_TEXCOORD4( target
, (GLfloat
) v
[0], (GLfloat
) v
[1],
801 (GLfloat
) v
[2], (GLfloat
) v
[3] );
805 _mesa_MultiTexCoord4s(GLenum target
, GLshort s
, GLshort t
, GLshort r
, GLshort q
)
807 MULTI_TEXCOORD4( target
, (GLfloat
) s
, (GLfloat
) t
,
808 (GLfloat
) r
, (GLfloat
) q
);
812 _mesa_MultiTexCoord4sv(GLenum target
, const GLshort
*v
)
814 MULTI_TEXCOORD4( target
, (GLfloat
) v
[0], (GLfloat
) v
[1],
815 (GLfloat
) v
[2], (GLfloat
) v
[3] );
819 _mesa_EvalCoord2dv( const GLdouble
*u
)
821 EVALCOORD2( (GLfloat
) u
[0], (GLfloat
) u
[1] );
825 _mesa_EvalCoord2fv( const GLfloat
*u
)
827 EVALCOORD2( u
[0], u
[1] );
831 _mesa_EvalCoord2d( GLdouble u
, GLdouble v
)
833 EVALCOORD2( (GLfloat
) u
, (GLfloat
) v
);
837 _mesa_EvalCoord1dv( const GLdouble
*u
)
839 EVALCOORD1( (GLfloat
) *u
);
843 _mesa_EvalCoord1fv( const GLfloat
*u
)
845 EVALCOORD1( (GLfloat
) *u
);
849 _mesa_EvalCoord1d( GLdouble u
)
851 EVALCOORD1( (GLfloat
) u
);
855 _mesa_Materialf( GLenum face
, GLenum pname
, GLfloat param
)
859 MATERIALFV( face
, pname
, fparam
);
863 _mesa_Materiali(GLenum face
, GLenum pname
, GLint param
)
865 GLfloat p
= (GLfloat
) param
;
866 MATERIALFV(face
, pname
, &p
);
870 _mesa_Materialiv(GLenum face
, GLenum pname
, const GLint
*params
)
878 case GL_AMBIENT_AND_DIFFUSE
:
879 fparam
[0] = INT_TO_FLOAT( params
[0] );
880 fparam
[1] = INT_TO_FLOAT( params
[1] );
881 fparam
[2] = INT_TO_FLOAT( params
[2] );
882 fparam
[3] = INT_TO_FLOAT( params
[3] );
885 fparam
[0] = (GLfloat
) params
[0];
887 case GL_COLOR_INDEXES
:
888 fparam
[0] = (GLfloat
) params
[0];
889 fparam
[1] = (GLfloat
) params
[1];
890 fparam
[2] = (GLfloat
) params
[2];
895 MATERIALFV(face
, pname
, fparam
);
900 _mesa_Rectd(GLdouble x1
, GLdouble y1
, GLdouble x2
, GLdouble y2
)
902 RECTF((GLfloat
) x1
, (GLfloat
) y1
, (GLfloat
) x2
, (GLfloat
) y2
);
906 _mesa_Rectdv(const GLdouble
*v1
, const GLdouble
*v2
)
908 RECTF((GLfloat
) v1
[0], (GLfloat
) v1
[1], (GLfloat
) v2
[0], (GLfloat
) v2
[1]);
912 _mesa_Rectfv(const GLfloat
*v1
, const GLfloat
*v2
)
914 RECTF(v1
[0], v1
[1], v2
[0], v2
[1]);
918 _mesa_Recti(GLint x1
, GLint y1
, GLint x2
, GLint y2
)
920 RECTF((GLfloat
) x1
, (GLfloat
) y1
, (GLfloat
) x2
, (GLfloat
) y2
);
924 _mesa_Rectiv(const GLint
*v1
, const GLint
*v2
)
926 RECTF((GLfloat
) v1
[0], (GLfloat
) v1
[1], (GLfloat
) v2
[0], (GLfloat
) v2
[1]);
930 _mesa_Rects(GLshort x1
, GLshort y1
, GLshort x2
, GLshort y2
)
932 RECTF((GLfloat
) x1
, (GLfloat
) y1
, (GLfloat
) x2
, (GLfloat
) y2
);
936 _mesa_Rectsv(const GLshort
*v1
, const GLshort
*v2
)
938 RECTF((GLfloat
) v1
[0], (GLfloat
) v1
[1], (GLfloat
) v2
[0], (GLfloat
) v2
[1]);
942 _mesa_SecondaryColor3b( GLbyte red
, GLbyte green
, GLbyte blue
)
944 SECONDARYCOLORF( BYTE_TO_FLOAT(red
),
945 BYTE_TO_FLOAT(green
),
946 BYTE_TO_FLOAT(blue
) );
950 _mesa_SecondaryColor3d( GLdouble red
, GLdouble green
, GLdouble blue
)
952 SECONDARYCOLORF( (GLfloat
) red
, (GLfloat
) green
, (GLfloat
) blue
);
956 _mesa_SecondaryColor3i( GLint red
, GLint green
, GLint blue
)
958 SECONDARYCOLORF( INT_TO_FLOAT(red
),
964 _mesa_SecondaryColor3s( GLshort red
, GLshort green
, GLshort blue
)
966 SECONDARYCOLORF(SHORT_TO_FLOAT(red
),
967 SHORT_TO_FLOAT(green
),
968 SHORT_TO_FLOAT(blue
));
972 _mesa_SecondaryColor3ui( GLuint red
, GLuint green
, GLuint blue
)
974 SECONDARYCOLORF(UINT_TO_FLOAT(red
),
975 UINT_TO_FLOAT(green
),
976 UINT_TO_FLOAT(blue
));
980 _mesa_SecondaryColor3us( GLushort red
, GLushort green
, GLushort blue
)
982 SECONDARYCOLORF(USHORT_TO_FLOAT(red
),
983 USHORT_TO_FLOAT(green
),
984 USHORT_TO_FLOAT(blue
));
988 _mesa_SecondaryColor3ub( GLubyte red
, GLubyte green
, GLubyte blue
)
990 SECONDARYCOLORF(UBYTE_TO_FLOAT(red
),
991 UBYTE_TO_FLOAT(green
),
992 UBYTE_TO_FLOAT(blue
));
996 _mesa_SecondaryColor3bv( const GLbyte
*v
)
998 SECONDARYCOLORF(BYTE_TO_FLOAT(v
[0]),
1000 BYTE_TO_FLOAT(v
[2]));
1004 _mesa_SecondaryColor3dv( const GLdouble
*v
)
1006 SECONDARYCOLORF( (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2] );
1009 _mesa_SecondaryColor3iv( const GLint
*v
)
1011 SECONDARYCOLORF(INT_TO_FLOAT(v
[0]),
1013 INT_TO_FLOAT(v
[2]));
1017 _mesa_SecondaryColor3sv( const GLshort
*v
)
1019 SECONDARYCOLORF(SHORT_TO_FLOAT(v
[0]),
1020 SHORT_TO_FLOAT(v
[1]),
1021 SHORT_TO_FLOAT(v
[2]));
1025 _mesa_SecondaryColor3uiv( const GLuint
*v
)
1027 SECONDARYCOLORF(UINT_TO_FLOAT(v
[0]),
1028 UINT_TO_FLOAT(v
[1]),
1029 UINT_TO_FLOAT(v
[2]));
1033 _mesa_SecondaryColor3usv( const GLushort
*v
)
1035 SECONDARYCOLORF(USHORT_TO_FLOAT(v
[0]),
1036 USHORT_TO_FLOAT(v
[1]),
1037 USHORT_TO_FLOAT(v
[2]));
1041 _mesa_SecondaryColor3ubv( const GLubyte
*v
)
1043 SECONDARYCOLORF(UBYTE_TO_FLOAT(v
[0]),
1044 UBYTE_TO_FLOAT(v
[1]),
1045 UBYTE_TO_FLOAT(v
[2]));
1050 * GL_NV_vertex_program:
1051 * Always loop-back to one of the VertexAttrib[1234]f[v]NV functions.
1052 * Note that attribute indexes DO alias conventional vertex attributes.
1056 _mesa_VertexAttrib1sNV(GLuint index
, GLshort x
)
1058 ATTRIB1NV(index
, (GLfloat
) x
);
1062 _mesa_VertexAttrib1dNV(GLuint index
, GLdouble x
)
1064 ATTRIB1NV(index
, (GLfloat
) x
);
1068 _mesa_VertexAttrib2sNV(GLuint index
, GLshort x
, GLshort y
)
1070 ATTRIB2NV(index
, (GLfloat
) x
, y
);
1074 _mesa_VertexAttrib2dNV(GLuint index
, GLdouble x
, GLdouble y
)
1076 ATTRIB2NV(index
, (GLfloat
) x
, (GLfloat
) y
);
1080 _mesa_VertexAttrib3sNV(GLuint index
, GLshort x
, GLshort y
, GLshort z
)
1082 ATTRIB3NV(index
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
1086 _mesa_VertexAttrib3dNV(GLuint index
, GLdouble x
, GLdouble y
, GLdouble z
)
1088 ATTRIB4NV(index
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
1092 _mesa_VertexAttrib4sNV(GLuint index
, GLshort x
, GLshort y
, GLshort z
, GLshort w
)
1094 ATTRIB4NV(index
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
1098 _mesa_VertexAttrib4dNV(GLuint index
, GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
1100 ATTRIB4NV(index
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
1104 _mesa_VertexAttrib4ubNV(GLuint index
, GLubyte x
, GLubyte y
, GLubyte z
, GLubyte w
)
1106 ATTRIB4NV(index
, UBYTE_TO_FLOAT(x
), UBYTE_TO_FLOAT(y
),
1107 UBYTE_TO_FLOAT(z
), UBYTE_TO_FLOAT(w
));
1111 _mesa_VertexAttrib1svNV(GLuint index
, const GLshort
*v
)
1113 ATTRIB1NV(index
, (GLfloat
) v
[0]);
1117 _mesa_VertexAttrib1dvNV(GLuint index
, const GLdouble
*v
)
1119 ATTRIB1NV(index
, (GLfloat
) v
[0]);
1123 _mesa_VertexAttrib2svNV(GLuint index
, const GLshort
*v
)
1125 ATTRIB2NV(index
, (GLfloat
) v
[0], (GLfloat
) v
[1]);
1129 _mesa_VertexAttrib2dvNV(GLuint index
, const GLdouble
*v
)
1131 ATTRIB2NV(index
, (GLfloat
) v
[0], (GLfloat
) v
[1]);
1135 _mesa_VertexAttrib3svNV(GLuint index
, const GLshort
*v
)
1137 ATTRIB3NV(index
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2]);
1141 _mesa_VertexAttrib3dvNV(GLuint index
, const GLdouble
*v
)
1143 ATTRIB3NV(index
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2]);
1147 _mesa_VertexAttrib4svNV(GLuint index
, const GLshort
*v
)
1149 ATTRIB4NV(index
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2],
1154 _mesa_VertexAttrib4dvNV(GLuint index
, const GLdouble
*v
)
1156 ATTRIB4NV(index
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], (GLfloat
) v
[3]);
1160 _mesa_VertexAttrib4ubvNV(GLuint index
, const GLubyte
*v
)
1162 ATTRIB4NV(index
, UBYTE_TO_FLOAT(v
[0]), UBYTE_TO_FLOAT(v
[1]),
1163 UBYTE_TO_FLOAT(v
[2]), UBYTE_TO_FLOAT(v
[3]));
1168 _mesa_VertexAttribs1svNV(GLuint index
, GLsizei n
, const GLshort
*v
)
1171 for (i
= n
- 1; i
>= 0; i
--)
1172 _mesa_VertexAttrib1svNV(index
+ i
, v
+ i
);
1176 _mesa_VertexAttribs1fvNV(GLuint index
, GLsizei n
, const GLfloat
*v
)
1179 for (i
= n
- 1; i
>= 0; i
--)
1180 ATTRIB1NV(index
+ i
, v
[i
]);
1184 _mesa_VertexAttribs1dvNV(GLuint index
, GLsizei n
, const GLdouble
*v
)
1187 for (i
= n
- 1; i
>= 0; i
--)
1188 _mesa_VertexAttrib1dvNV(index
+ i
, v
+ i
);
1192 _mesa_VertexAttribs2svNV(GLuint index
, GLsizei n
, const GLshort
*v
)
1195 for (i
= n
- 1; i
>= 0; i
--)
1196 _mesa_VertexAttrib2svNV(index
+ i
, v
+ 2 * i
);
1200 _mesa_VertexAttribs2fvNV(GLuint index
, GLsizei n
, const GLfloat
*v
)
1203 for (i
= n
- 1; i
>= 0; i
--)
1204 ATTRIB2NV(index
+ i
, v
[2 * i
], v
[2 * i
+ 1]);
1208 _mesa_VertexAttribs2dvNV(GLuint index
, GLsizei n
, const GLdouble
*v
)
1211 for (i
= n
- 1; i
>= 0; i
--)
1212 _mesa_VertexAttrib2dvNV(index
+ i
, v
+ 2 * i
);
1216 _mesa_VertexAttribs3svNV(GLuint index
, GLsizei n
, const GLshort
*v
)
1219 for (i
= n
- 1; i
>= 0; i
--)
1220 _mesa_VertexAttrib3svNV(index
+ i
, v
+ 3 * i
);
1224 _mesa_VertexAttribs3fvNV(GLuint index
, GLsizei n
, const GLfloat
*v
)
1227 for (i
= n
- 1; i
>= 0; i
--)
1228 ATTRIB3NV(index
+ i
, v
[3 * i
], v
[3 * i
+ 1], v
[3 * i
+ 2]);
1232 _mesa_VertexAttribs3dvNV(GLuint index
, GLsizei n
, const GLdouble
*v
)
1235 for (i
= n
- 1; i
>= 0; i
--)
1236 _mesa_VertexAttrib3dvNV(index
+ i
, v
+ 3 * i
);
1240 _mesa_VertexAttribs4svNV(GLuint index
, GLsizei n
, const GLshort
*v
)
1243 for (i
= n
- 1; i
>= 0; i
--)
1244 _mesa_VertexAttrib4svNV(index
+ i
, v
+ 4 * i
);
1248 _mesa_VertexAttribs4fvNV(GLuint index
, GLsizei n
, const GLfloat
*v
)
1251 for (i
= n
- 1; i
>= 0; i
--)
1252 ATTRIB4NV(index
+ i
, v
[4 * i
], v
[4 * i
+ 1], v
[4 * i
+ 2], v
[4 * i
+ 3]);
1256 _mesa_VertexAttribs4dvNV(GLuint index
, GLsizei n
, const GLdouble
*v
)
1259 for (i
= n
- 1; i
>= 0; i
--)
1260 _mesa_VertexAttrib4dvNV(index
+ i
, v
+ 4 * i
);
1264 _mesa_VertexAttribs4ubvNV(GLuint index
, GLsizei n
, const GLubyte
*v
)
1267 for (i
= n
- 1; i
>= 0; i
--)
1268 _mesa_VertexAttrib4ubvNV(index
+ i
, v
+ 4 * i
);
1273 * GL_ARB_vertex_program
1274 * Always loop-back to one of the VertexAttrib[1234]f[v]ARB functions.
1275 * Note that attribute indexes do NOT alias conventional attributes.
1279 _mesa_VertexAttrib1s(GLuint index
, GLshort x
)
1281 ATTRIB1ARB(index
, (GLfloat
) x
);
1285 _mesa_VertexAttrib1d(GLuint index
, GLdouble x
)
1287 ATTRIB1ARB(index
, (GLfloat
) x
);
1291 _mesa_VertexAttrib2s(GLuint index
, GLshort x
, GLshort y
)
1293 ATTRIB2ARB(index
, (GLfloat
) x
, y
);
1297 _mesa_VertexAttrib2d(GLuint index
, GLdouble x
, GLdouble y
)
1299 ATTRIB2ARB(index
, (GLfloat
) x
, (GLfloat
) y
);
1303 _mesa_VertexAttrib3s(GLuint index
, GLshort x
, GLshort y
, GLshort z
)
1305 ATTRIB3ARB(index
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
1309 _mesa_VertexAttrib3d(GLuint index
, GLdouble x
, GLdouble y
, GLdouble z
)
1311 ATTRIB4ARB(index
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
1315 _mesa_VertexAttrib4s(GLuint index
, GLshort x
, GLshort y
, GLshort z
, GLshort w
)
1317 ATTRIB4ARB(index
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
1321 _mesa_VertexAttrib4d(GLuint index
, GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
1323 ATTRIB4ARB(index
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
1327 _mesa_VertexAttrib1sv(GLuint index
, const GLshort
*v
)
1329 ATTRIB1ARB(index
, (GLfloat
) v
[0]);
1333 _mesa_VertexAttrib1dv(GLuint index
, const GLdouble
*v
)
1335 ATTRIB1ARB(index
, (GLfloat
) v
[0]);
1339 _mesa_VertexAttrib2sv(GLuint index
, const GLshort
*v
)
1341 ATTRIB2ARB(index
, (GLfloat
) v
[0], (GLfloat
) v
[1]);
1345 _mesa_VertexAttrib2dv(GLuint index
, const GLdouble
*v
)
1347 ATTRIB2ARB(index
, (GLfloat
) v
[0], (GLfloat
) v
[1]);
1351 _mesa_VertexAttrib3sv(GLuint index
, const GLshort
*v
)
1353 ATTRIB3ARB(index
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2]);
1357 _mesa_VertexAttrib3dv(GLuint index
, const GLdouble
*v
)
1359 ATTRIB3ARB(index
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2]);
1363 _mesa_VertexAttrib4sv(GLuint index
, const GLshort
*v
)
1365 ATTRIB4ARB(index
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2],
1370 _mesa_VertexAttrib4dv(GLuint index
, const GLdouble
*v
)
1372 ATTRIB4ARB(index
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], (GLfloat
) v
[3]);
1376 _mesa_VertexAttrib4bv(GLuint index
, const GLbyte
* v
)
1378 ATTRIB4ARB(index
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], (GLfloat
) v
[3]);
1382 _mesa_VertexAttrib4iv(GLuint index
, const GLint
* v
)
1384 ATTRIB4ARB(index
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], (GLfloat
) v
[3]);
1388 _mesa_VertexAttrib4ubv(GLuint index
, const GLubyte
* v
)
1390 ATTRIB4ARB(index
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], (GLfloat
) v
[3]);
1394 _mesa_VertexAttrib4usv(GLuint index
, const GLushort
* v
)
1396 ATTRIB4ARB(index
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], (GLfloat
) v
[3]);
1400 _mesa_VertexAttrib4uiv(GLuint index
, const GLuint
* v
)
1402 ATTRIB4ARB(index
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], (GLfloat
) v
[3]);
1406 _mesa_VertexAttrib4Nbv(GLuint index
, const GLbyte
* v
)
1408 ATTRIB4ARB(index
, BYTE_TO_FLOAT(v
[0]), BYTE_TO_FLOAT(v
[1]),
1409 BYTE_TO_FLOAT(v
[2]), BYTE_TO_FLOAT(v
[3]));
1413 _mesa_VertexAttrib4Nsv(GLuint index
, const GLshort
* v
)
1415 ATTRIB4ARB(index
, SHORT_TO_FLOAT(v
[0]), SHORT_TO_FLOAT(v
[1]),
1416 SHORT_TO_FLOAT(v
[2]), SHORT_TO_FLOAT(v
[3]));
1420 _mesa_VertexAttrib4Niv(GLuint index
, const GLint
* v
)
1422 ATTRIB4ARB(index
, INT_TO_FLOAT(v
[0]), INT_TO_FLOAT(v
[1]),
1423 INT_TO_FLOAT(v
[2]), INT_TO_FLOAT(v
[3]));
1427 _mesa_VertexAttrib4Nub(GLuint index
, GLubyte x
, GLubyte y
, GLubyte z
, GLubyte w
)
1429 ATTRIB4ARB(index
, UBYTE_TO_FLOAT(x
), UBYTE_TO_FLOAT(y
),
1430 UBYTE_TO_FLOAT(z
), UBYTE_TO_FLOAT(w
));
1434 _mesa_VertexAttrib4Nubv(GLuint index
, const GLubyte
* v
)
1436 ATTRIB4ARB(index
, UBYTE_TO_FLOAT(v
[0]), UBYTE_TO_FLOAT(v
[1]),
1437 UBYTE_TO_FLOAT(v
[2]), UBYTE_TO_FLOAT(v
[3]));
1441 _mesa_VertexAttrib4Nusv(GLuint index
, const GLushort
* v
)
1443 ATTRIB4ARB(index
, USHORT_TO_FLOAT(v
[0]), USHORT_TO_FLOAT(v
[1]),
1444 USHORT_TO_FLOAT(v
[2]), USHORT_TO_FLOAT(v
[3]));
1448 _mesa_VertexAttrib4Nuiv(GLuint index
, const GLuint
* v
)
1450 ATTRIB4ARB(index
, UINT_TO_FLOAT(v
[0]), UINT_TO_FLOAT(v
[1]),
1451 UINT_TO_FLOAT(v
[2]), UINT_TO_FLOAT(v
[3]));
1457 * GL_EXT_gpu_shader / GL 3.0 signed/unsigned integer-valued attributes.
1458 * Note that attribute indexes do NOT alias conventional attributes.
1462 _mesa_VertexAttribI1iv(GLuint index
, const GLint
*v
)
1464 ATTRIBI_1I(index
, v
[0]);
1468 _mesa_VertexAttribI1uiv(GLuint index
, const GLuint
*v
)
1470 ATTRIBI_1UI(index
, v
[0]);
1474 _mesa_VertexAttribI4bv(GLuint index
, const GLbyte
*v
)
1476 ATTRIBI_4I(index
, v
[0], v
[1], v
[2], v
[3]);
1480 _mesa_VertexAttribI4sv(GLuint index
, const GLshort
*v
)
1482 ATTRIBI_4I(index
, v
[0], v
[1], v
[2], v
[3]);
1486 _mesa_VertexAttribI4ubv(GLuint index
, const GLubyte
*v
)
1488 ATTRIBI_4UI(index
, v
[0], v
[1], v
[2], v
[3]);
1492 _mesa_VertexAttribI4usv(GLuint index
, const GLushort
*v
)
1494 ATTRIBI_4UI(index
, v
[0], v
[1], v
[2], v
[3]);
1498 _mesa_VertexAttribL1d(GLuint index
, GLdouble x
)
1500 ATTRIB1_D(index
, x
);
1504 _mesa_VertexAttribL2d(GLuint index
, GLdouble x
, GLdouble y
)
1506 ATTRIB2_D(index
, x
, y
);
1510 _mesa_VertexAttribL3d(GLuint index
, GLdouble x
, GLdouble y
, GLdouble z
)
1512 ATTRIB3_D(index
, x
, y
, z
);
1516 _mesa_VertexAttribL4d(GLuint index
, GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
1518 ATTRIB4_D(index
, x
, y
, z
, w
);
1522 _mesa_VertexAttribL1dv(GLuint index
, const GLdouble
*v
)
1524 ATTRIB1_D(index
, v
[0]);
1528 _mesa_VertexAttribL2dv(GLuint index
, const GLdouble
*v
)
1530 ATTRIB2_D(index
, v
[0], v
[1]);
1534 _mesa_VertexAttribL3dv(GLuint index
, const GLdouble
*v
)
1536 ATTRIB3_D(index
, v
[0], v
[1], v
[2]);
1540 _mesa_VertexAttribL4dv(GLuint index
, const GLdouble
*v
)
1542 ATTRIB4_D(index
, v
[0], v
[1], v
[2], v
[3]);
1546 * This code never registers handlers for any of the entry points
1547 * listed in vtxfmt.h.
1550 _mesa_loopback_init_api_table(const struct gl_context
*ctx
,
1551 struct _glapi_table
*dest
)
1553 if (ctx
->API
!= API_OPENGL_CORE
&& ctx
->API
!= API_OPENGLES2
) {
1554 SET_Color4ub(dest
, _mesa_Color4ub
);
1555 SET_Materialf(dest
, _mesa_Materialf
);
1557 if (ctx
->API
== API_OPENGL_COMPAT
) {
1558 SET_Color3b(dest
, _mesa_Color3b
);
1559 SET_Color3d(dest
, _mesa_Color3d
);
1560 SET_Color3i(dest
, _mesa_Color3i
);
1561 SET_Color3s(dest
, _mesa_Color3s
);
1562 SET_Color3ui(dest
, _mesa_Color3ui
);
1563 SET_Color3us(dest
, _mesa_Color3us
);
1564 SET_Color3ub(dest
, _mesa_Color3ub
);
1565 SET_Color4b(dest
, _mesa_Color4b
);
1566 SET_Color4d(dest
, _mesa_Color4d
);
1567 SET_Color4i(dest
, _mesa_Color4i
);
1568 SET_Color4s(dest
, _mesa_Color4s
);
1569 SET_Color4ui(dest
, _mesa_Color4ui
);
1570 SET_Color4us(dest
, _mesa_Color4us
);
1571 SET_Color3bv(dest
, _mesa_Color3bv
);
1572 SET_Color3dv(dest
, _mesa_Color3dv
);
1573 SET_Color3iv(dest
, _mesa_Color3iv
);
1574 SET_Color3sv(dest
, _mesa_Color3sv
);
1575 SET_Color3uiv(dest
, _mesa_Color3uiv
);
1576 SET_Color3usv(dest
, _mesa_Color3usv
);
1577 SET_Color3ubv(dest
, _mesa_Color3ubv
);
1578 SET_Color4bv(dest
, _mesa_Color4bv
);
1579 SET_Color4dv(dest
, _mesa_Color4dv
);
1580 SET_Color4iv(dest
, _mesa_Color4iv
);
1581 SET_Color4sv(dest
, _mesa_Color4sv
);
1582 SET_Color4uiv(dest
, _mesa_Color4uiv
);
1583 SET_Color4usv(dest
, _mesa_Color4usv
);
1584 SET_Color4ubv(dest
, _mesa_Color4ubv
);
1586 SET_SecondaryColor3b(dest
, _mesa_SecondaryColor3b
);
1587 SET_SecondaryColor3d(dest
, _mesa_SecondaryColor3d
);
1588 SET_SecondaryColor3i(dest
, _mesa_SecondaryColor3i
);
1589 SET_SecondaryColor3s(dest
, _mesa_SecondaryColor3s
);
1590 SET_SecondaryColor3ui(dest
, _mesa_SecondaryColor3ui
);
1591 SET_SecondaryColor3us(dest
, _mesa_SecondaryColor3us
);
1592 SET_SecondaryColor3ub(dest
, _mesa_SecondaryColor3ub
);
1593 SET_SecondaryColor3bv(dest
, _mesa_SecondaryColor3bv
);
1594 SET_SecondaryColor3dv(dest
, _mesa_SecondaryColor3dv
);
1595 SET_SecondaryColor3iv(dest
, _mesa_SecondaryColor3iv
);
1596 SET_SecondaryColor3sv(dest
, _mesa_SecondaryColor3sv
);
1597 SET_SecondaryColor3uiv(dest
, _mesa_SecondaryColor3uiv
);
1598 SET_SecondaryColor3usv(dest
, _mesa_SecondaryColor3usv
);
1599 SET_SecondaryColor3ubv(dest
, _mesa_SecondaryColor3ubv
);
1601 SET_EdgeFlagv(dest
, _mesa_EdgeFlagv
);
1603 SET_Indexd(dest
, _mesa_Indexd
);
1604 SET_Indexi(dest
, _mesa_Indexi
);
1605 SET_Indexs(dest
, _mesa_Indexs
);
1606 SET_Indexub(dest
, _mesa_Indexub
);
1607 SET_Indexdv(dest
, _mesa_Indexdv
);
1608 SET_Indexiv(dest
, _mesa_Indexiv
);
1609 SET_Indexsv(dest
, _mesa_Indexsv
);
1610 SET_Indexubv(dest
, _mesa_Indexubv
);
1611 SET_Normal3b(dest
, _mesa_Normal3b
);
1612 SET_Normal3d(dest
, _mesa_Normal3d
);
1613 SET_Normal3i(dest
, _mesa_Normal3i
);
1614 SET_Normal3s(dest
, _mesa_Normal3s
);
1615 SET_Normal3bv(dest
, _mesa_Normal3bv
);
1616 SET_Normal3dv(dest
, _mesa_Normal3dv
);
1617 SET_Normal3iv(dest
, _mesa_Normal3iv
);
1618 SET_Normal3sv(dest
, _mesa_Normal3sv
);
1619 SET_TexCoord1d(dest
, _mesa_TexCoord1d
);
1620 SET_TexCoord1i(dest
, _mesa_TexCoord1i
);
1621 SET_TexCoord1s(dest
, _mesa_TexCoord1s
);
1622 SET_TexCoord2d(dest
, _mesa_TexCoord2d
);
1623 SET_TexCoord2s(dest
, _mesa_TexCoord2s
);
1624 SET_TexCoord2i(dest
, _mesa_TexCoord2i
);
1625 SET_TexCoord3d(dest
, _mesa_TexCoord3d
);
1626 SET_TexCoord3i(dest
, _mesa_TexCoord3i
);
1627 SET_TexCoord3s(dest
, _mesa_TexCoord3s
);
1628 SET_TexCoord4d(dest
, _mesa_TexCoord4d
);
1629 SET_TexCoord4i(dest
, _mesa_TexCoord4i
);
1630 SET_TexCoord4s(dest
, _mesa_TexCoord4s
);
1631 SET_TexCoord1dv(dest
, _mesa_TexCoord1dv
);
1632 SET_TexCoord1iv(dest
, _mesa_TexCoord1iv
);
1633 SET_TexCoord1sv(dest
, _mesa_TexCoord1sv
);
1634 SET_TexCoord2dv(dest
, _mesa_TexCoord2dv
);
1635 SET_TexCoord2iv(dest
, _mesa_TexCoord2iv
);
1636 SET_TexCoord2sv(dest
, _mesa_TexCoord2sv
);
1637 SET_TexCoord3dv(dest
, _mesa_TexCoord3dv
);
1638 SET_TexCoord3iv(dest
, _mesa_TexCoord3iv
);
1639 SET_TexCoord3sv(dest
, _mesa_TexCoord3sv
);
1640 SET_TexCoord4dv(dest
, _mesa_TexCoord4dv
);
1641 SET_TexCoord4iv(dest
, _mesa_TexCoord4iv
);
1642 SET_TexCoord4sv(dest
, _mesa_TexCoord4sv
);
1643 SET_Vertex2d(dest
, _mesa_Vertex2d
);
1644 SET_Vertex2i(dest
, _mesa_Vertex2i
);
1645 SET_Vertex2s(dest
, _mesa_Vertex2s
);
1646 SET_Vertex3d(dest
, _mesa_Vertex3d
);
1647 SET_Vertex3i(dest
, _mesa_Vertex3i
);
1648 SET_Vertex3s(dest
, _mesa_Vertex3s
);
1649 SET_Vertex4d(dest
, _mesa_Vertex4d
);
1650 SET_Vertex4i(dest
, _mesa_Vertex4i
);
1651 SET_Vertex4s(dest
, _mesa_Vertex4s
);
1652 SET_Vertex2dv(dest
, _mesa_Vertex2dv
);
1653 SET_Vertex2iv(dest
, _mesa_Vertex2iv
);
1654 SET_Vertex2sv(dest
, _mesa_Vertex2sv
);
1655 SET_Vertex3dv(dest
, _mesa_Vertex3dv
);
1656 SET_Vertex3iv(dest
, _mesa_Vertex3iv
);
1657 SET_Vertex3sv(dest
, _mesa_Vertex3sv
);
1658 SET_Vertex4dv(dest
, _mesa_Vertex4dv
);
1659 SET_Vertex4iv(dest
, _mesa_Vertex4iv
);
1660 SET_Vertex4sv(dest
, _mesa_Vertex4sv
);
1661 SET_MultiTexCoord1d(dest
, _mesa_MultiTexCoord1d
);
1662 SET_MultiTexCoord1dv(dest
, _mesa_MultiTexCoord1dv
);
1663 SET_MultiTexCoord1i(dest
, _mesa_MultiTexCoord1i
);
1664 SET_MultiTexCoord1iv(dest
, _mesa_MultiTexCoord1iv
);
1665 SET_MultiTexCoord1s(dest
, _mesa_MultiTexCoord1s
);
1666 SET_MultiTexCoord1sv(dest
, _mesa_MultiTexCoord1sv
);
1667 SET_MultiTexCoord2d(dest
, _mesa_MultiTexCoord2d
);
1668 SET_MultiTexCoord2dv(dest
, _mesa_MultiTexCoord2dv
);
1669 SET_MultiTexCoord2i(dest
, _mesa_MultiTexCoord2i
);
1670 SET_MultiTexCoord2iv(dest
, _mesa_MultiTexCoord2iv
);
1671 SET_MultiTexCoord2s(dest
, _mesa_MultiTexCoord2s
);
1672 SET_MultiTexCoord2sv(dest
, _mesa_MultiTexCoord2sv
);
1673 SET_MultiTexCoord3d(dest
, _mesa_MultiTexCoord3d
);
1674 SET_MultiTexCoord3dv(dest
, _mesa_MultiTexCoord3dv
);
1675 SET_MultiTexCoord3i(dest
, _mesa_MultiTexCoord3i
);
1676 SET_MultiTexCoord3iv(dest
, _mesa_MultiTexCoord3iv
);
1677 SET_MultiTexCoord3s(dest
, _mesa_MultiTexCoord3s
);
1678 SET_MultiTexCoord3sv(dest
, _mesa_MultiTexCoord3sv
);
1679 SET_MultiTexCoord4d(dest
, _mesa_MultiTexCoord4d
);
1680 SET_MultiTexCoord4dv(dest
, _mesa_MultiTexCoord4dv
);
1681 SET_MultiTexCoord4i(dest
, _mesa_MultiTexCoord4i
);
1682 SET_MultiTexCoord4iv(dest
, _mesa_MultiTexCoord4iv
);
1683 SET_MultiTexCoord4s(dest
, _mesa_MultiTexCoord4s
);
1684 SET_MultiTexCoord4sv(dest
, _mesa_MultiTexCoord4sv
);
1685 SET_EvalCoord2dv(dest
, _mesa_EvalCoord2dv
);
1686 SET_EvalCoord2fv(dest
, _mesa_EvalCoord2fv
);
1687 SET_EvalCoord2d(dest
, _mesa_EvalCoord2d
);
1688 SET_EvalCoord1dv(dest
, _mesa_EvalCoord1dv
);
1689 SET_EvalCoord1fv(dest
, _mesa_EvalCoord1fv
);
1690 SET_EvalCoord1d(dest
, _mesa_EvalCoord1d
);
1691 SET_Materiali(dest
, _mesa_Materiali
);
1692 SET_Materialiv(dest
, _mesa_Materialiv
);
1693 SET_Rectd(dest
, _mesa_Rectd
);
1694 SET_Rectdv(dest
, _mesa_Rectdv
);
1695 SET_Rectfv(dest
, _mesa_Rectfv
);
1696 SET_Recti(dest
, _mesa_Recti
);
1697 SET_Rectiv(dest
, _mesa_Rectiv
);
1698 SET_Rects(dest
, _mesa_Rects
);
1699 SET_Rectsv(dest
, _mesa_Rectsv
);
1700 SET_FogCoordd(dest
, _mesa_FogCoordd
);
1701 SET_FogCoorddv(dest
, _mesa_FogCoorddv
);
1704 if (ctx
->API
== API_OPENGL_COMPAT
) {
1705 SET_VertexAttrib1sNV(dest
, _mesa_VertexAttrib1sNV
);
1706 SET_VertexAttrib1dNV(dest
, _mesa_VertexAttrib1dNV
);
1707 SET_VertexAttrib2sNV(dest
, _mesa_VertexAttrib2sNV
);
1708 SET_VertexAttrib2dNV(dest
, _mesa_VertexAttrib2dNV
);
1709 SET_VertexAttrib3sNV(dest
, _mesa_VertexAttrib3sNV
);
1710 SET_VertexAttrib3dNV(dest
, _mesa_VertexAttrib3dNV
);
1711 SET_VertexAttrib4sNV(dest
, _mesa_VertexAttrib4sNV
);
1712 SET_VertexAttrib4dNV(dest
, _mesa_VertexAttrib4dNV
);
1713 SET_VertexAttrib4ubNV(dest
, _mesa_VertexAttrib4ubNV
);
1714 SET_VertexAttrib1svNV(dest
, _mesa_VertexAttrib1svNV
);
1715 SET_VertexAttrib1dvNV(dest
, _mesa_VertexAttrib1dvNV
);
1716 SET_VertexAttrib2svNV(dest
, _mesa_VertexAttrib2svNV
);
1717 SET_VertexAttrib2dvNV(dest
, _mesa_VertexAttrib2dvNV
);
1718 SET_VertexAttrib3svNV(dest
, _mesa_VertexAttrib3svNV
);
1719 SET_VertexAttrib3dvNV(dest
, _mesa_VertexAttrib3dvNV
);
1720 SET_VertexAttrib4svNV(dest
, _mesa_VertexAttrib4svNV
);
1721 SET_VertexAttrib4dvNV(dest
, _mesa_VertexAttrib4dvNV
);
1722 SET_VertexAttrib4ubvNV(dest
, _mesa_VertexAttrib4ubvNV
);
1723 SET_VertexAttribs1svNV(dest
, _mesa_VertexAttribs1svNV
);
1724 SET_VertexAttribs1fvNV(dest
, _mesa_VertexAttribs1fvNV
);
1725 SET_VertexAttribs1dvNV(dest
, _mesa_VertexAttribs1dvNV
);
1726 SET_VertexAttribs2svNV(dest
, _mesa_VertexAttribs2svNV
);
1727 SET_VertexAttribs2fvNV(dest
, _mesa_VertexAttribs2fvNV
);
1728 SET_VertexAttribs2dvNV(dest
, _mesa_VertexAttribs2dvNV
);
1729 SET_VertexAttribs3svNV(dest
, _mesa_VertexAttribs3svNV
);
1730 SET_VertexAttribs3fvNV(dest
, _mesa_VertexAttribs3fvNV
);
1731 SET_VertexAttribs3dvNV(dest
, _mesa_VertexAttribs3dvNV
);
1732 SET_VertexAttribs4svNV(dest
, _mesa_VertexAttribs4svNV
);
1733 SET_VertexAttribs4fvNV(dest
, _mesa_VertexAttribs4fvNV
);
1734 SET_VertexAttribs4dvNV(dest
, _mesa_VertexAttribs4dvNV
);
1735 SET_VertexAttribs4ubvNV(dest
, _mesa_VertexAttribs4ubvNV
);
1738 if (_mesa_is_desktop_gl(ctx
)) {
1739 SET_VertexAttrib1s(dest
, _mesa_VertexAttrib1s
);
1740 SET_VertexAttrib1d(dest
, _mesa_VertexAttrib1d
);
1741 SET_VertexAttrib2s(dest
, _mesa_VertexAttrib2s
);
1742 SET_VertexAttrib2d(dest
, _mesa_VertexAttrib2d
);
1743 SET_VertexAttrib3s(dest
, _mesa_VertexAttrib3s
);
1744 SET_VertexAttrib3d(dest
, _mesa_VertexAttrib3d
);
1745 SET_VertexAttrib4s(dest
, _mesa_VertexAttrib4s
);
1746 SET_VertexAttrib4d(dest
, _mesa_VertexAttrib4d
);
1747 SET_VertexAttrib1sv(dest
, _mesa_VertexAttrib1sv
);
1748 SET_VertexAttrib1dv(dest
, _mesa_VertexAttrib1dv
);
1749 SET_VertexAttrib2sv(dest
, _mesa_VertexAttrib2sv
);
1750 SET_VertexAttrib2dv(dest
, _mesa_VertexAttrib2dv
);
1751 SET_VertexAttrib3sv(dest
, _mesa_VertexAttrib3sv
);
1752 SET_VertexAttrib3dv(dest
, _mesa_VertexAttrib3dv
);
1753 SET_VertexAttrib4sv(dest
, _mesa_VertexAttrib4sv
);
1754 SET_VertexAttrib4dv(dest
, _mesa_VertexAttrib4dv
);
1755 SET_VertexAttrib4Nub(dest
, _mesa_VertexAttrib4Nub
);
1756 SET_VertexAttrib4Nubv(dest
, _mesa_VertexAttrib4Nubv
);
1757 SET_VertexAttrib4bv(dest
, _mesa_VertexAttrib4bv
);
1758 SET_VertexAttrib4iv(dest
, _mesa_VertexAttrib4iv
);
1759 SET_VertexAttrib4ubv(dest
, _mesa_VertexAttrib4ubv
);
1760 SET_VertexAttrib4usv(dest
, _mesa_VertexAttrib4usv
);
1761 SET_VertexAttrib4uiv(dest
, _mesa_VertexAttrib4uiv
);
1762 SET_VertexAttrib4Nbv(dest
, _mesa_VertexAttrib4Nbv
);
1763 SET_VertexAttrib4Nsv(dest
, _mesa_VertexAttrib4Nsv
);
1764 SET_VertexAttrib4Nusv(dest
, _mesa_VertexAttrib4Nusv
);
1765 SET_VertexAttrib4Niv(dest
, _mesa_VertexAttrib4Niv
);
1766 SET_VertexAttrib4Nuiv(dest
, _mesa_VertexAttrib4Nuiv
);
1768 /* GL_EXT_gpu_shader4, GL 3.0 */
1769 SET_VertexAttribI1iv(dest
, _mesa_VertexAttribI1iv
);
1770 SET_VertexAttribI1uiv(dest
, _mesa_VertexAttribI1uiv
);
1771 SET_VertexAttribI4bv(dest
, _mesa_VertexAttribI4bv
);
1772 SET_VertexAttribI4sv(dest
, _mesa_VertexAttribI4sv
);
1773 SET_VertexAttribI4ubv(dest
, _mesa_VertexAttribI4ubv
);
1774 SET_VertexAttribI4usv(dest
, _mesa_VertexAttribI4usv
);
1776 /* GL 4.1 / GL_ARB_vertex_attrib_64bit */
1777 SET_VertexAttribL1d(dest
, _mesa_VertexAttribL1d
);
1778 SET_VertexAttribL2d(dest
, _mesa_VertexAttribL2d
);
1779 SET_VertexAttribL3d(dest
, _mesa_VertexAttribL3d
);
1780 SET_VertexAttribL4d(dest
, _mesa_VertexAttribL4d
);
1782 SET_VertexAttribL1dv(dest
, _mesa_VertexAttribL1dv
);
1783 SET_VertexAttribL2dv(dest
, _mesa_VertexAttribL2dv
);
1784 SET_VertexAttribL3dv(dest
, _mesa_VertexAttribL3dv
);
1785 SET_VertexAttribL4dv(dest
, _mesa_VertexAttribL4dv
);