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))
88 _mesa_Color3b( GLbyte red
, GLbyte green
, GLbyte blue
)
90 COLORF( BYTE_TO_FLOAT(red
),
97 _mesa_Color3d( GLdouble red
, GLdouble green
, GLdouble blue
)
99 COLORF( (GLfloat
) red
, (GLfloat
) green
, (GLfloat
) blue
, 1.0 );
103 _mesa_Color3i( GLint red
, GLint green
, GLint blue
)
105 COLORF( INT_TO_FLOAT(red
), INT_TO_FLOAT(green
),
106 INT_TO_FLOAT(blue
), 1.0);
110 _mesa_Color3s( GLshort red
, GLshort green
, GLshort blue
)
112 COLORF( SHORT_TO_FLOAT(red
), SHORT_TO_FLOAT(green
),
113 SHORT_TO_FLOAT(blue
), 1.0);
117 _mesa_Color3ui( GLuint red
, GLuint green
, GLuint blue
)
119 COLORF( UINT_TO_FLOAT(red
), UINT_TO_FLOAT(green
),
120 UINT_TO_FLOAT(blue
), 1.0 );
124 _mesa_Color3us( GLushort red
, GLushort green
, GLushort blue
)
126 COLORF( USHORT_TO_FLOAT(red
), USHORT_TO_FLOAT(green
),
127 USHORT_TO_FLOAT(blue
), 1.0 );
131 _mesa_Color3ub( GLubyte red
, GLubyte green
, GLubyte blue
)
133 COLORF( UBYTE_TO_FLOAT(red
), UBYTE_TO_FLOAT(green
),
134 UBYTE_TO_FLOAT(blue
), 1.0 );
139 _mesa_Color3bv( const GLbyte
*v
)
141 COLORF( BYTE_TO_FLOAT(v
[0]), BYTE_TO_FLOAT(v
[1]),
142 BYTE_TO_FLOAT(v
[2]), 1.0 );
146 _mesa_Color3dv( const GLdouble
*v
)
148 COLORF( (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0 );
152 _mesa_Color3iv( const GLint
*v
)
154 COLORF( INT_TO_FLOAT(v
[0]), INT_TO_FLOAT(v
[1]),
155 INT_TO_FLOAT(v
[2]), 1.0 );
159 _mesa_Color3sv( const GLshort
*v
)
161 COLORF( SHORT_TO_FLOAT(v
[0]), SHORT_TO_FLOAT(v
[1]),
162 SHORT_TO_FLOAT(v
[2]), 1.0 );
166 _mesa_Color3uiv( const GLuint
*v
)
168 COLORF( UINT_TO_FLOAT(v
[0]), UINT_TO_FLOAT(v
[1]),
169 UINT_TO_FLOAT(v
[2]), 1.0 );
173 _mesa_Color3usv( const GLushort
*v
)
175 COLORF( USHORT_TO_FLOAT(v
[0]), USHORT_TO_FLOAT(v
[1]),
176 USHORT_TO_FLOAT(v
[2]), 1.0 );
180 _mesa_Color3ubv( const GLubyte
*v
)
182 COLORF( UBYTE_TO_FLOAT(v
[0]), UBYTE_TO_FLOAT(v
[1]),
183 UBYTE_TO_FLOAT(v
[2]), 1.0 );
188 _mesa_Color4b( GLbyte red
, GLbyte green
, GLbyte blue
,
191 COLORF( BYTE_TO_FLOAT(red
), BYTE_TO_FLOAT(green
),
192 BYTE_TO_FLOAT(blue
), BYTE_TO_FLOAT(alpha
) );
196 _mesa_Color4d( GLdouble red
, GLdouble green
, GLdouble blue
,
199 COLORF( (GLfloat
) red
, (GLfloat
) green
, (GLfloat
) blue
, (GLfloat
) alpha
);
203 _mesa_Color4i( GLint red
, GLint green
, GLint blue
, GLint alpha
)
205 COLORF( INT_TO_FLOAT(red
), INT_TO_FLOAT(green
),
206 INT_TO_FLOAT(blue
), INT_TO_FLOAT(alpha
) );
210 _mesa_Color4s( GLshort red
, GLshort green
, GLshort blue
,
213 COLORF( SHORT_TO_FLOAT(red
), SHORT_TO_FLOAT(green
),
214 SHORT_TO_FLOAT(blue
), SHORT_TO_FLOAT(alpha
) );
218 _mesa_Color4ui( GLuint red
, GLuint green
, GLuint blue
, GLuint alpha
)
220 COLORF( UINT_TO_FLOAT(red
), UINT_TO_FLOAT(green
),
221 UINT_TO_FLOAT(blue
), UINT_TO_FLOAT(alpha
) );
225 _mesa_Color4us( GLushort red
, GLushort green
, GLushort blue
, GLushort alpha
)
227 COLORF( USHORT_TO_FLOAT(red
), USHORT_TO_FLOAT(green
),
228 USHORT_TO_FLOAT(blue
), USHORT_TO_FLOAT(alpha
) );
232 _mesa_Color4ub( GLubyte red
, GLubyte green
, GLubyte blue
, GLubyte alpha
)
234 COLORF( UBYTE_TO_FLOAT(red
), UBYTE_TO_FLOAT(green
),
235 UBYTE_TO_FLOAT(blue
), UBYTE_TO_FLOAT(alpha
) );
240 _mesa_Color4iv( const GLint
*v
)
242 COLORF( INT_TO_FLOAT(v
[0]), INT_TO_FLOAT(v
[1]),
243 INT_TO_FLOAT(v
[2]), INT_TO_FLOAT(v
[3]) );
248 _mesa_Color4bv( const GLbyte
*v
)
250 COLORF( BYTE_TO_FLOAT(v
[0]), BYTE_TO_FLOAT(v
[1]),
251 BYTE_TO_FLOAT(v
[2]), BYTE_TO_FLOAT(v
[3]) );
255 _mesa_Color4dv( const GLdouble
*v
)
257 COLORF( (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], (GLfloat
) v
[3] );
262 _mesa_Color4sv( const GLshort
*v
)
264 COLORF( SHORT_TO_FLOAT(v
[0]), SHORT_TO_FLOAT(v
[1]),
265 SHORT_TO_FLOAT(v
[2]), SHORT_TO_FLOAT(v
[3]) );
270 _mesa_Color4uiv( const GLuint
*v
)
272 COLORF( UINT_TO_FLOAT(v
[0]), UINT_TO_FLOAT(v
[1]),
273 UINT_TO_FLOAT(v
[2]), UINT_TO_FLOAT(v
[3]) );
277 _mesa_Color4usv( const GLushort
*v
)
279 COLORF( USHORT_TO_FLOAT(v
[0]), USHORT_TO_FLOAT(v
[1]),
280 USHORT_TO_FLOAT(v
[2]), USHORT_TO_FLOAT(v
[3]) );
284 _mesa_Color4ubv( const GLubyte
*v
)
286 COLORF( UBYTE_TO_FLOAT(v
[0]), UBYTE_TO_FLOAT(v
[1]),
287 UBYTE_TO_FLOAT(v
[2]), UBYTE_TO_FLOAT(v
[3]) );
292 _mesa_FogCoordd( GLdouble d
)
294 FOGCOORDF( (GLfloat
) d
);
298 _mesa_FogCoorddv( const GLdouble
*v
)
300 FOGCOORDF( (GLfloat
) *v
);
305 _mesa_Indexd( GLdouble c
)
307 INDEX( (GLfloat
) c
);
311 _mesa_Indexi( GLint c
)
313 INDEX( (GLfloat
) c
);
317 _mesa_Indexs( GLshort c
)
319 INDEX( (GLfloat
) c
);
323 _mesa_Indexub( GLubyte c
)
325 INDEX( (GLfloat
) c
);
329 _mesa_Indexdv( const GLdouble
*c
)
331 INDEX( (GLfloat
) *c
);
335 _mesa_Indexiv( const GLint
*c
)
337 INDEX( (GLfloat
) *c
);
341 _mesa_Indexsv( const GLshort
*c
)
343 INDEX( (GLfloat
) *c
);
347 _mesa_Indexubv( const GLubyte
*c
)
349 INDEX( (GLfloat
) *c
);
354 _mesa_EdgeFlagv(const GLboolean
*flag
)
356 CALL_EdgeFlag(GET_DISPATCH(), (*flag
));
361 _mesa_Normal3b( GLbyte nx
, GLbyte ny
, GLbyte nz
)
363 NORMAL( BYTE_TO_FLOAT(nx
), BYTE_TO_FLOAT(ny
), BYTE_TO_FLOAT(nz
) );
367 _mesa_Normal3d( GLdouble nx
, GLdouble ny
, GLdouble nz
)
369 NORMAL((GLfloat
) nx
, (GLfloat
) ny
, (GLfloat
) nz
);
373 _mesa_Normal3i( GLint nx
, GLint ny
, GLint nz
)
375 NORMAL( INT_TO_FLOAT(nx
), INT_TO_FLOAT(ny
), INT_TO_FLOAT(nz
) );
379 _mesa_Normal3s( GLshort nx
, GLshort ny
, GLshort nz
)
381 NORMAL( SHORT_TO_FLOAT(nx
), SHORT_TO_FLOAT(ny
), SHORT_TO_FLOAT(nz
) );
385 _mesa_Normal3bv( const GLbyte
*v
)
387 NORMAL( BYTE_TO_FLOAT(v
[0]), BYTE_TO_FLOAT(v
[1]), BYTE_TO_FLOAT(v
[2]) );
391 _mesa_Normal3dv( const GLdouble
*v
)
393 NORMAL( (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2] );
397 _mesa_Normal3iv( const GLint
*v
)
399 NORMAL( INT_TO_FLOAT(v
[0]), INT_TO_FLOAT(v
[1]), INT_TO_FLOAT(v
[2]) );
403 _mesa_Normal3sv( const GLshort
*v
)
405 NORMAL( SHORT_TO_FLOAT(v
[0]), SHORT_TO_FLOAT(v
[1]), SHORT_TO_FLOAT(v
[2]) );
409 _mesa_TexCoord1d( GLdouble s
)
411 TEXCOORD1((GLfloat
) s
);
415 _mesa_TexCoord1i( GLint s
)
417 TEXCOORD1((GLfloat
) s
);
421 _mesa_TexCoord1s( GLshort s
)
423 TEXCOORD1((GLfloat
) s
);
427 _mesa_TexCoord2d( GLdouble s
, GLdouble t
)
429 TEXCOORD2((GLfloat
) s
,(GLfloat
) t
);
433 _mesa_TexCoord2s( GLshort s
, GLshort t
)
435 TEXCOORD2((GLfloat
) s
,(GLfloat
) t
);
439 _mesa_TexCoord2i( GLint s
, GLint t
)
441 TEXCOORD2((GLfloat
) s
,(GLfloat
) t
);
445 _mesa_TexCoord3d( GLdouble s
, GLdouble t
, GLdouble r
)
447 TEXCOORD3((GLfloat
) s
,(GLfloat
) t
,(GLfloat
) r
);
451 _mesa_TexCoord3i( GLint s
, GLint t
, GLint r
)
453 TEXCOORD3((GLfloat
) s
,(GLfloat
) t
,(GLfloat
) r
);
457 _mesa_TexCoord3s( GLshort s
, GLshort t
, GLshort r
)
459 TEXCOORD3((GLfloat
) s
,(GLfloat
) t
,(GLfloat
) r
);
463 _mesa_TexCoord4d( GLdouble s
, GLdouble t
, GLdouble r
, GLdouble q
)
465 TEXCOORD4((GLfloat
) s
,(GLfloat
) t
,(GLfloat
) r
,(GLfloat
) q
);
469 _mesa_TexCoord4i( GLint s
, GLint t
, GLint r
, GLint q
)
471 TEXCOORD4((GLfloat
) s
,(GLfloat
) t
,(GLfloat
) r
,(GLfloat
) q
);
475 _mesa_TexCoord4s( GLshort s
, GLshort t
, GLshort r
, GLshort q
)
477 TEXCOORD4((GLfloat
) s
,(GLfloat
) t
,(GLfloat
) r
,(GLfloat
) q
);
481 _mesa_TexCoord1dv( const GLdouble
*v
)
483 TEXCOORD1((GLfloat
) v
[0]);
487 _mesa_TexCoord1iv( const GLint
*v
)
489 TEXCOORD1((GLfloat
) v
[0]);
493 _mesa_TexCoord1sv( const GLshort
*v
)
495 TEXCOORD1((GLfloat
) v
[0]);
499 _mesa_TexCoord2dv( const GLdouble
*v
)
501 TEXCOORD2((GLfloat
) v
[0],(GLfloat
) v
[1]);
505 _mesa_TexCoord2iv( const GLint
*v
)
507 TEXCOORD2((GLfloat
) v
[0],(GLfloat
) v
[1]);
511 _mesa_TexCoord2sv( const GLshort
*v
)
513 TEXCOORD2((GLfloat
) v
[0],(GLfloat
) v
[1]);
517 _mesa_TexCoord3dv( const GLdouble
*v
)
519 TEXCOORD3((GLfloat
) v
[0],(GLfloat
) v
[1],(GLfloat
) v
[2]);
523 _mesa_TexCoord3iv( const GLint
*v
)
525 TEXCOORD3((GLfloat
) v
[0],(GLfloat
) v
[1],(GLfloat
) v
[2]);
529 _mesa_TexCoord3sv( const GLshort
*v
)
531 TEXCOORD3((GLfloat
) v
[0],(GLfloat
) v
[1],(GLfloat
) v
[2]);
535 _mesa_TexCoord4dv( const GLdouble
*v
)
537 TEXCOORD4((GLfloat
) v
[0],(GLfloat
) v
[1],(GLfloat
) v
[2],(GLfloat
) v
[3]);
541 _mesa_TexCoord4iv( const GLint
*v
)
543 TEXCOORD4((GLfloat
) v
[0],(GLfloat
) v
[1],(GLfloat
) v
[2],(GLfloat
) v
[3]);
547 _mesa_TexCoord4sv( const GLshort
*v
)
549 TEXCOORD4((GLfloat
) v
[0],(GLfloat
) v
[1],(GLfloat
) v
[2],(GLfloat
) v
[3]);
553 _mesa_Vertex2d( GLdouble x
, GLdouble y
)
555 VERTEX2( (GLfloat
) x
, (GLfloat
) y
);
559 _mesa_Vertex2i( GLint x
, GLint y
)
561 VERTEX2( (GLfloat
) x
, (GLfloat
) y
);
565 _mesa_Vertex2s( GLshort x
, GLshort y
)
567 VERTEX2( (GLfloat
) x
, (GLfloat
) y
);
571 _mesa_Vertex3d( GLdouble x
, GLdouble y
, GLdouble z
)
573 VERTEX3( (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
577 _mesa_Vertex3i( GLint x
, GLint y
, GLint z
)
579 VERTEX3( (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
583 _mesa_Vertex3s( GLshort x
, GLshort y
, GLshort z
)
585 VERTEX3( (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
589 _mesa_Vertex4d( GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
591 VERTEX4( (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
595 _mesa_Vertex4i( GLint x
, GLint y
, GLint z
, GLint w
)
597 VERTEX4( (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
601 _mesa_Vertex4s( GLshort x
, GLshort y
, GLshort z
, GLshort w
)
603 VERTEX4( (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
607 _mesa_Vertex2dv( const GLdouble
*v
)
609 VERTEX2( (GLfloat
) v
[0], (GLfloat
) v
[1] );
613 _mesa_Vertex2iv( const GLint
*v
)
615 VERTEX2( (GLfloat
) v
[0], (GLfloat
) v
[1] );
619 _mesa_Vertex2sv( const GLshort
*v
)
621 VERTEX2( (GLfloat
) v
[0], (GLfloat
) v
[1] );
625 _mesa_Vertex3dv( const GLdouble
*v
)
627 VERTEX3( (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2] );
631 _mesa_Vertex3iv( const GLint
*v
)
633 VERTEX3( (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2] );
637 _mesa_Vertex3sv( const GLshort
*v
)
639 VERTEX3( (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2] );
643 _mesa_Vertex4dv( const GLdouble
*v
)
645 VERTEX4( (GLfloat
) v
[0], (GLfloat
) v
[1],
646 (GLfloat
) v
[2], (GLfloat
) v
[3] );
650 _mesa_Vertex4iv( const GLint
*v
)
652 VERTEX4( (GLfloat
) v
[0], (GLfloat
) v
[1],
653 (GLfloat
) v
[2], (GLfloat
) v
[3] );
657 _mesa_Vertex4sv( const GLshort
*v
)
659 VERTEX4( (GLfloat
) v
[0], (GLfloat
) v
[1],
660 (GLfloat
) v
[2], (GLfloat
) v
[3] );
664 _mesa_MultiTexCoord1d(GLenum target
, GLdouble s
)
666 MULTI_TEXCOORD1( target
, (GLfloat
) s
);
670 _mesa_MultiTexCoord1dv(GLenum target
, const GLdouble
*v
)
672 MULTI_TEXCOORD1( target
, (GLfloat
) v
[0] );
676 _mesa_MultiTexCoord1i(GLenum target
, GLint s
)
678 MULTI_TEXCOORD1( target
, (GLfloat
) s
);
682 _mesa_MultiTexCoord1iv(GLenum target
, const GLint
*v
)
684 MULTI_TEXCOORD1( target
, (GLfloat
) v
[0] );
688 _mesa_MultiTexCoord1s(GLenum target
, GLshort s
)
690 MULTI_TEXCOORD1( target
, (GLfloat
) s
);
694 _mesa_MultiTexCoord1sv(GLenum target
, const GLshort
*v
)
696 MULTI_TEXCOORD1( target
, (GLfloat
) v
[0] );
700 _mesa_MultiTexCoord2d(GLenum target
, GLdouble s
, GLdouble t
)
702 MULTI_TEXCOORD2( target
, (GLfloat
) s
, (GLfloat
) t
);
706 _mesa_MultiTexCoord2dv(GLenum target
, const GLdouble
*v
)
708 MULTI_TEXCOORD2( target
, (GLfloat
) v
[0], (GLfloat
) v
[1] );
712 _mesa_MultiTexCoord2i(GLenum target
, GLint s
, GLint t
)
714 MULTI_TEXCOORD2( target
, (GLfloat
) s
, (GLfloat
) t
);
718 _mesa_MultiTexCoord2iv(GLenum target
, const GLint
*v
)
720 MULTI_TEXCOORD2( target
, (GLfloat
) v
[0], (GLfloat
) v
[1] );
724 _mesa_MultiTexCoord2s(GLenum target
, GLshort s
, GLshort t
)
726 MULTI_TEXCOORD2( target
, (GLfloat
) s
, (GLfloat
) t
);
730 _mesa_MultiTexCoord2sv(GLenum target
, const GLshort
*v
)
732 MULTI_TEXCOORD2( target
, (GLfloat
) v
[0], (GLfloat
) v
[1] );
736 _mesa_MultiTexCoord3d(GLenum target
, GLdouble s
, GLdouble t
, GLdouble r
)
738 MULTI_TEXCOORD3( target
, (GLfloat
) s
, (GLfloat
) t
, (GLfloat
) r
);
742 _mesa_MultiTexCoord3dv(GLenum target
, const GLdouble
*v
)
744 MULTI_TEXCOORD3( target
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2] );
748 _mesa_MultiTexCoord3i(GLenum target
, GLint s
, GLint t
, GLint r
)
750 MULTI_TEXCOORD3( target
, (GLfloat
) s
, (GLfloat
) t
, (GLfloat
) r
);
754 _mesa_MultiTexCoord3iv(GLenum target
, const GLint
*v
)
756 MULTI_TEXCOORD3( target
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2] );
760 _mesa_MultiTexCoord3s(GLenum target
, GLshort s
, GLshort t
, GLshort r
)
762 MULTI_TEXCOORD3( target
, (GLfloat
) s
, (GLfloat
) t
, (GLfloat
) r
);
766 _mesa_MultiTexCoord3sv(GLenum target
, const GLshort
*v
)
768 MULTI_TEXCOORD3( target
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2] );
772 _mesa_MultiTexCoord4d(GLenum target
, GLdouble s
, GLdouble t
, GLdouble r
, GLdouble q
)
774 MULTI_TEXCOORD4( target
, (GLfloat
) s
, (GLfloat
) t
,
775 (GLfloat
) r
, (GLfloat
) q
);
779 _mesa_MultiTexCoord4dv(GLenum target
, const GLdouble
*v
)
781 MULTI_TEXCOORD4( target
, (GLfloat
) v
[0], (GLfloat
) v
[1],
782 (GLfloat
) v
[2], (GLfloat
) v
[3] );
786 _mesa_MultiTexCoord4i(GLenum target
, GLint s
, GLint t
, GLint r
, GLint q
)
788 MULTI_TEXCOORD4( target
, (GLfloat
) s
, (GLfloat
) t
,
789 (GLfloat
) r
, (GLfloat
) q
);
793 _mesa_MultiTexCoord4iv(GLenum target
, const GLint
*v
)
795 MULTI_TEXCOORD4( target
, (GLfloat
) v
[0], (GLfloat
) v
[1],
796 (GLfloat
) v
[2], (GLfloat
) v
[3] );
800 _mesa_MultiTexCoord4s(GLenum target
, GLshort s
, GLshort t
, GLshort r
, GLshort q
)
802 MULTI_TEXCOORD4( target
, (GLfloat
) s
, (GLfloat
) t
,
803 (GLfloat
) r
, (GLfloat
) q
);
807 _mesa_MultiTexCoord4sv(GLenum target
, const GLshort
*v
)
809 MULTI_TEXCOORD4( target
, (GLfloat
) v
[0], (GLfloat
) v
[1],
810 (GLfloat
) v
[2], (GLfloat
) v
[3] );
814 _mesa_EvalCoord2dv( const GLdouble
*u
)
816 EVALCOORD2( (GLfloat
) u
[0], (GLfloat
) u
[1] );
820 _mesa_EvalCoord2d( GLdouble u
, GLdouble v
)
822 EVALCOORD2( (GLfloat
) u
, (GLfloat
) v
);
826 _mesa_EvalCoord1dv( const GLdouble
*u
)
828 EVALCOORD1( (GLfloat
) *u
);
832 _mesa_EvalCoord1d( GLdouble u
)
834 EVALCOORD1( (GLfloat
) u
);
838 _mesa_Materialf( GLenum face
, GLenum pname
, GLfloat param
)
842 MATERIALFV( face
, pname
, fparam
);
846 _mesa_Materiali(GLenum face
, GLenum pname
, GLint param
)
849 p
[0] = (GLfloat
) param
;
850 MATERIALFV(face
, pname
, p
);
854 _mesa_Materialiv(GLenum face
, GLenum pname
, const GLint
*params
)
862 case GL_AMBIENT_AND_DIFFUSE
:
863 fparam
[0] = INT_TO_FLOAT( params
[0] );
864 fparam
[1] = INT_TO_FLOAT( params
[1] );
865 fparam
[2] = INT_TO_FLOAT( params
[2] );
866 fparam
[3] = INT_TO_FLOAT( params
[3] );
869 fparam
[0] = (GLfloat
) params
[0];
871 case GL_COLOR_INDEXES
:
872 fparam
[0] = (GLfloat
) params
[0];
873 fparam
[1] = (GLfloat
) params
[1];
874 fparam
[2] = (GLfloat
) params
[2];
879 MATERIALFV(face
, pname
, fparam
);
884 _mesa_Rectd(GLdouble x1
, GLdouble y1
, GLdouble x2
, GLdouble y2
)
886 RECTF((GLfloat
) x1
, (GLfloat
) y1
, (GLfloat
) x2
, (GLfloat
) y2
);
890 _mesa_Rectdv(const GLdouble
*v1
, const GLdouble
*v2
)
892 RECTF((GLfloat
) v1
[0], (GLfloat
) v1
[1], (GLfloat
) v2
[0], (GLfloat
) v2
[1]);
896 _mesa_Rectfv(const GLfloat
*v1
, const GLfloat
*v2
)
898 RECTF(v1
[0], v1
[1], v2
[0], v2
[1]);
902 _mesa_Recti(GLint x1
, GLint y1
, GLint x2
, GLint y2
)
904 RECTF((GLfloat
) x1
, (GLfloat
) y1
, (GLfloat
) x2
, (GLfloat
) y2
);
908 _mesa_Rectiv(const GLint
*v1
, const GLint
*v2
)
910 RECTF((GLfloat
) v1
[0], (GLfloat
) v1
[1], (GLfloat
) v2
[0], (GLfloat
) v2
[1]);
914 _mesa_Rects(GLshort x1
, GLshort y1
, GLshort x2
, GLshort y2
)
916 RECTF((GLfloat
) x1
, (GLfloat
) y1
, (GLfloat
) x2
, (GLfloat
) y2
);
920 _mesa_Rectsv(const GLshort
*v1
, const GLshort
*v2
)
922 RECTF((GLfloat
) v1
[0], (GLfloat
) v1
[1], (GLfloat
) v2
[0], (GLfloat
) v2
[1]);
926 _mesa_SecondaryColor3b( GLbyte red
, GLbyte green
, GLbyte blue
)
928 SECONDARYCOLORF( BYTE_TO_FLOAT(red
),
929 BYTE_TO_FLOAT(green
),
930 BYTE_TO_FLOAT(blue
) );
934 _mesa_SecondaryColor3d( GLdouble red
, GLdouble green
, GLdouble blue
)
936 SECONDARYCOLORF( (GLfloat
) red
, (GLfloat
) green
, (GLfloat
) blue
);
940 _mesa_SecondaryColor3i( GLint red
, GLint green
, GLint blue
)
942 SECONDARYCOLORF( INT_TO_FLOAT(red
),
948 _mesa_SecondaryColor3s( GLshort red
, GLshort green
, GLshort blue
)
950 SECONDARYCOLORF(SHORT_TO_FLOAT(red
),
951 SHORT_TO_FLOAT(green
),
952 SHORT_TO_FLOAT(blue
));
956 _mesa_SecondaryColor3ui( GLuint red
, GLuint green
, GLuint blue
)
958 SECONDARYCOLORF(UINT_TO_FLOAT(red
),
959 UINT_TO_FLOAT(green
),
960 UINT_TO_FLOAT(blue
));
964 _mesa_SecondaryColor3us( GLushort red
, GLushort green
, GLushort blue
)
966 SECONDARYCOLORF(USHORT_TO_FLOAT(red
),
967 USHORT_TO_FLOAT(green
),
968 USHORT_TO_FLOAT(blue
));
972 _mesa_SecondaryColor3ub( GLubyte red
, GLubyte green
, GLubyte blue
)
974 SECONDARYCOLORF(UBYTE_TO_FLOAT(red
),
975 UBYTE_TO_FLOAT(green
),
976 UBYTE_TO_FLOAT(blue
));
980 _mesa_SecondaryColor3bv( const GLbyte
*v
)
982 SECONDARYCOLORF(BYTE_TO_FLOAT(v
[0]),
984 BYTE_TO_FLOAT(v
[2]));
988 _mesa_SecondaryColor3dv( const GLdouble
*v
)
990 SECONDARYCOLORF( (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2] );
993 _mesa_SecondaryColor3iv( const GLint
*v
)
995 SECONDARYCOLORF(INT_TO_FLOAT(v
[0]),
1001 _mesa_SecondaryColor3sv( const GLshort
*v
)
1003 SECONDARYCOLORF(SHORT_TO_FLOAT(v
[0]),
1004 SHORT_TO_FLOAT(v
[1]),
1005 SHORT_TO_FLOAT(v
[2]));
1009 _mesa_SecondaryColor3uiv( const GLuint
*v
)
1011 SECONDARYCOLORF(UINT_TO_FLOAT(v
[0]),
1012 UINT_TO_FLOAT(v
[1]),
1013 UINT_TO_FLOAT(v
[2]));
1017 _mesa_SecondaryColor3usv( const GLushort
*v
)
1019 SECONDARYCOLORF(USHORT_TO_FLOAT(v
[0]),
1020 USHORT_TO_FLOAT(v
[1]),
1021 USHORT_TO_FLOAT(v
[2]));
1025 _mesa_SecondaryColor3ubv( const GLubyte
*v
)
1027 SECONDARYCOLORF(UBYTE_TO_FLOAT(v
[0]),
1028 UBYTE_TO_FLOAT(v
[1]),
1029 UBYTE_TO_FLOAT(v
[2]));
1034 * GL_NV_vertex_program:
1035 * Always loop-back to one of the VertexAttrib[1234]f[v]NV functions.
1036 * Note that attribute indexes DO alias conventional vertex attributes.
1040 _mesa_VertexAttrib1sNV(GLuint index
, GLshort x
)
1042 ATTRIB1NV(index
, (GLfloat
) x
);
1046 _mesa_VertexAttrib1dNV(GLuint index
, GLdouble x
)
1048 ATTRIB1NV(index
, (GLfloat
) x
);
1052 _mesa_VertexAttrib2sNV(GLuint index
, GLshort x
, GLshort y
)
1054 ATTRIB2NV(index
, (GLfloat
) x
, y
);
1058 _mesa_VertexAttrib2dNV(GLuint index
, GLdouble x
, GLdouble y
)
1060 ATTRIB2NV(index
, (GLfloat
) x
, (GLfloat
) y
);
1064 _mesa_VertexAttrib3sNV(GLuint index
, GLshort x
, GLshort y
, GLshort z
)
1066 ATTRIB3NV(index
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
1070 _mesa_VertexAttrib3dNV(GLuint index
, GLdouble x
, GLdouble y
, GLdouble z
)
1072 ATTRIB4NV(index
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
1076 _mesa_VertexAttrib4sNV(GLuint index
, GLshort x
, GLshort y
, GLshort z
, GLshort w
)
1078 ATTRIB4NV(index
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
1082 _mesa_VertexAttrib4dNV(GLuint index
, GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
1084 ATTRIB4NV(index
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
1088 _mesa_VertexAttrib4ubNV(GLuint index
, GLubyte x
, GLubyte y
, GLubyte z
, GLubyte w
)
1090 ATTRIB4NV(index
, UBYTE_TO_FLOAT(x
), UBYTE_TO_FLOAT(y
),
1091 UBYTE_TO_FLOAT(z
), UBYTE_TO_FLOAT(w
));
1095 _mesa_VertexAttrib1svNV(GLuint index
, const GLshort
*v
)
1097 ATTRIB1NV(index
, (GLfloat
) v
[0]);
1101 _mesa_VertexAttrib1dvNV(GLuint index
, const GLdouble
*v
)
1103 ATTRIB1NV(index
, (GLfloat
) v
[0]);
1107 _mesa_VertexAttrib2svNV(GLuint index
, const GLshort
*v
)
1109 ATTRIB2NV(index
, (GLfloat
) v
[0], (GLfloat
) v
[1]);
1113 _mesa_VertexAttrib2dvNV(GLuint index
, const GLdouble
*v
)
1115 ATTRIB2NV(index
, (GLfloat
) v
[0], (GLfloat
) v
[1]);
1119 _mesa_VertexAttrib3svNV(GLuint index
, const GLshort
*v
)
1121 ATTRIB3NV(index
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2]);
1125 _mesa_VertexAttrib3dvNV(GLuint index
, const GLdouble
*v
)
1127 ATTRIB3NV(index
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2]);
1131 _mesa_VertexAttrib4svNV(GLuint index
, const GLshort
*v
)
1133 ATTRIB4NV(index
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2],
1138 _mesa_VertexAttrib4dvNV(GLuint index
, const GLdouble
*v
)
1140 ATTRIB4NV(index
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], (GLfloat
) v
[3]);
1144 _mesa_VertexAttrib4ubvNV(GLuint index
, const GLubyte
*v
)
1146 ATTRIB4NV(index
, UBYTE_TO_FLOAT(v
[0]), UBYTE_TO_FLOAT(v
[1]),
1147 UBYTE_TO_FLOAT(v
[2]), UBYTE_TO_FLOAT(v
[3]));
1152 _mesa_VertexAttribs1svNV(GLuint index
, GLsizei n
, const GLshort
*v
)
1155 for (i
= n
- 1; i
>= 0; i
--)
1156 _mesa_VertexAttrib1svNV(index
+ i
, v
+ i
);
1160 _mesa_VertexAttribs1fvNV(GLuint index
, GLsizei n
, const GLfloat
*v
)
1163 for (i
= n
- 1; i
>= 0; i
--)
1164 ATTRIB1NV(index
+ i
, v
[i
]);
1168 _mesa_VertexAttribs1dvNV(GLuint index
, GLsizei n
, const GLdouble
*v
)
1171 for (i
= n
- 1; i
>= 0; i
--)
1172 _mesa_VertexAttrib1dvNV(index
+ i
, v
+ i
);
1176 _mesa_VertexAttribs2svNV(GLuint index
, GLsizei n
, const GLshort
*v
)
1179 for (i
= n
- 1; i
>= 0; i
--)
1180 _mesa_VertexAttrib2svNV(index
+ i
, v
+ 2 * i
);
1184 _mesa_VertexAttribs2fvNV(GLuint index
, GLsizei n
, const GLfloat
*v
)
1187 for (i
= n
- 1; i
>= 0; i
--)
1188 ATTRIB2NV(index
+ i
, v
[2 * i
], v
[2 * i
+ 1]);
1192 _mesa_VertexAttribs2dvNV(GLuint index
, GLsizei n
, const GLdouble
*v
)
1195 for (i
= n
- 1; i
>= 0; i
--)
1196 _mesa_VertexAttrib2dvNV(index
+ i
, v
+ 2 * i
);
1200 _mesa_VertexAttribs3svNV(GLuint index
, GLsizei n
, const GLshort
*v
)
1203 for (i
= n
- 1; i
>= 0; i
--)
1204 _mesa_VertexAttrib3svNV(index
+ i
, v
+ 3 * i
);
1208 _mesa_VertexAttribs3fvNV(GLuint index
, GLsizei n
, const GLfloat
*v
)
1211 for (i
= n
- 1; i
>= 0; i
--)
1212 ATTRIB3NV(index
+ i
, v
[3 * i
], v
[3 * i
+ 1], v
[3 * i
+ 2]);
1216 _mesa_VertexAttribs3dvNV(GLuint index
, GLsizei n
, const GLdouble
*v
)
1219 for (i
= n
- 1; i
>= 0; i
--)
1220 _mesa_VertexAttrib3dvNV(index
+ i
, v
+ 3 * i
);
1224 _mesa_VertexAttribs4svNV(GLuint index
, GLsizei n
, const GLshort
*v
)
1227 for (i
= n
- 1; i
>= 0; i
--)
1228 _mesa_VertexAttrib4svNV(index
+ i
, v
+ 4 * i
);
1232 _mesa_VertexAttribs4fvNV(GLuint index
, GLsizei n
, const GLfloat
*v
)
1235 for (i
= n
- 1; i
>= 0; i
--)
1236 ATTRIB4NV(index
+ i
, v
[4 * i
], v
[4 * i
+ 1], v
[4 * i
+ 2], v
[4 * i
+ 3]);
1240 _mesa_VertexAttribs4dvNV(GLuint index
, GLsizei n
, const GLdouble
*v
)
1243 for (i
= n
- 1; i
>= 0; i
--)
1244 _mesa_VertexAttrib4dvNV(index
+ i
, v
+ 4 * i
);
1248 _mesa_VertexAttribs4ubvNV(GLuint index
, GLsizei n
, const GLubyte
*v
)
1251 for (i
= n
- 1; i
>= 0; i
--)
1252 _mesa_VertexAttrib4ubvNV(index
+ i
, v
+ 4 * i
);
1257 * GL_ARB_vertex_program
1258 * Always loop-back to one of the VertexAttrib[1234]f[v]ARB functions.
1259 * Note that attribute indexes do NOT alias conventional attributes.
1263 _mesa_VertexAttrib1s(GLuint index
, GLshort x
)
1265 ATTRIB1ARB(index
, (GLfloat
) x
);
1269 _mesa_VertexAttrib1d(GLuint index
, GLdouble x
)
1271 ATTRIB1ARB(index
, (GLfloat
) x
);
1275 _mesa_VertexAttrib2s(GLuint index
, GLshort x
, GLshort y
)
1277 ATTRIB2ARB(index
, (GLfloat
) x
, y
);
1281 _mesa_VertexAttrib2d(GLuint index
, GLdouble x
, GLdouble y
)
1283 ATTRIB2ARB(index
, (GLfloat
) x
, (GLfloat
) y
);
1287 _mesa_VertexAttrib3s(GLuint index
, GLshort x
, GLshort y
, GLshort z
)
1289 ATTRIB3ARB(index
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
1293 _mesa_VertexAttrib3d(GLuint index
, GLdouble x
, GLdouble y
, GLdouble z
)
1295 ATTRIB4ARB(index
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
1299 _mesa_VertexAttrib4s(GLuint index
, GLshort x
, GLshort y
, GLshort z
, GLshort w
)
1301 ATTRIB4ARB(index
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
1305 _mesa_VertexAttrib4d(GLuint index
, GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
1307 ATTRIB4ARB(index
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
1311 _mesa_VertexAttrib1sv(GLuint index
, const GLshort
*v
)
1313 ATTRIB1ARB(index
, (GLfloat
) v
[0]);
1317 _mesa_VertexAttrib1dv(GLuint index
, const GLdouble
*v
)
1319 ATTRIB1ARB(index
, (GLfloat
) v
[0]);
1323 _mesa_VertexAttrib2sv(GLuint index
, const GLshort
*v
)
1325 ATTRIB2ARB(index
, (GLfloat
) v
[0], (GLfloat
) v
[1]);
1329 _mesa_VertexAttrib2dv(GLuint index
, const GLdouble
*v
)
1331 ATTRIB2ARB(index
, (GLfloat
) v
[0], (GLfloat
) v
[1]);
1335 _mesa_VertexAttrib3sv(GLuint index
, const GLshort
*v
)
1337 ATTRIB3ARB(index
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2]);
1341 _mesa_VertexAttrib3dv(GLuint index
, const GLdouble
*v
)
1343 ATTRIB3ARB(index
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2]);
1347 _mesa_VertexAttrib4sv(GLuint index
, const GLshort
*v
)
1349 ATTRIB4ARB(index
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2],
1354 _mesa_VertexAttrib4dv(GLuint index
, const GLdouble
*v
)
1356 ATTRIB4ARB(index
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], (GLfloat
) v
[3]);
1360 _mesa_VertexAttrib4bv(GLuint index
, const GLbyte
* v
)
1362 ATTRIB4ARB(index
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], (GLfloat
) v
[3]);
1366 _mesa_VertexAttrib4iv(GLuint index
, const GLint
* v
)
1368 ATTRIB4ARB(index
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], (GLfloat
) v
[3]);
1372 _mesa_VertexAttrib4ubv(GLuint index
, const GLubyte
* v
)
1374 ATTRIB4ARB(index
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], (GLfloat
) v
[3]);
1378 _mesa_VertexAttrib4usv(GLuint index
, const GLushort
* v
)
1380 ATTRIB4ARB(index
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], (GLfloat
) v
[3]);
1384 _mesa_VertexAttrib4uiv(GLuint index
, const GLuint
* v
)
1386 ATTRIB4ARB(index
, (GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], (GLfloat
) v
[3]);
1390 _mesa_VertexAttrib4Nbv(GLuint index
, const GLbyte
* v
)
1392 ATTRIB4ARB(index
, BYTE_TO_FLOAT(v
[0]), BYTE_TO_FLOAT(v
[1]),
1393 BYTE_TO_FLOAT(v
[2]), BYTE_TO_FLOAT(v
[3]));
1397 _mesa_VertexAttrib4Nsv(GLuint index
, const GLshort
* v
)
1399 ATTRIB4ARB(index
, SHORT_TO_FLOAT(v
[0]), SHORT_TO_FLOAT(v
[1]),
1400 SHORT_TO_FLOAT(v
[2]), SHORT_TO_FLOAT(v
[3]));
1404 _mesa_VertexAttrib4Niv(GLuint index
, const GLint
* v
)
1406 ATTRIB4ARB(index
, INT_TO_FLOAT(v
[0]), INT_TO_FLOAT(v
[1]),
1407 INT_TO_FLOAT(v
[2]), INT_TO_FLOAT(v
[3]));
1411 _mesa_VertexAttrib4Nub(GLuint index
, GLubyte x
, GLubyte y
, GLubyte z
, GLubyte w
)
1413 ATTRIB4ARB(index
, UBYTE_TO_FLOAT(x
), UBYTE_TO_FLOAT(y
),
1414 UBYTE_TO_FLOAT(z
), UBYTE_TO_FLOAT(w
));
1418 _mesa_VertexAttrib4Nubv(GLuint index
, const GLubyte
* v
)
1420 ATTRIB4ARB(index
, UBYTE_TO_FLOAT(v
[0]), UBYTE_TO_FLOAT(v
[1]),
1421 UBYTE_TO_FLOAT(v
[2]), UBYTE_TO_FLOAT(v
[3]));
1425 _mesa_VertexAttrib4Nusv(GLuint index
, const GLushort
* v
)
1427 ATTRIB4ARB(index
, USHORT_TO_FLOAT(v
[0]), USHORT_TO_FLOAT(v
[1]),
1428 USHORT_TO_FLOAT(v
[2]), USHORT_TO_FLOAT(v
[3]));
1432 _mesa_VertexAttrib4Nuiv(GLuint index
, const GLuint
* v
)
1434 ATTRIB4ARB(index
, UINT_TO_FLOAT(v
[0]), UINT_TO_FLOAT(v
[1]),
1435 UINT_TO_FLOAT(v
[2]), UINT_TO_FLOAT(v
[3]));
1441 * GL_EXT_gpu_shader / GL 3.0 signed/unsigned integer-valued attributes.
1442 * Note that attribute indexes do NOT alias conventional attributes.
1446 _mesa_VertexAttribI1iv(GLuint index
, const GLint
*v
)
1448 ATTRIBI_1I(index
, v
[0]);
1452 _mesa_VertexAttribI1uiv(GLuint index
, const GLuint
*v
)
1454 ATTRIBI_1UI(index
, v
[0]);
1458 _mesa_VertexAttribI4bv(GLuint index
, const GLbyte
*v
)
1460 ATTRIBI_4I(index
, v
[0], v
[1], v
[2], v
[3]);
1464 _mesa_VertexAttribI4sv(GLuint index
, const GLshort
*v
)
1466 ATTRIBI_4I(index
, v
[0], v
[1], v
[2], v
[3]);
1470 _mesa_VertexAttribI4ubv(GLuint index
, const GLubyte
*v
)
1472 ATTRIBI_4UI(index
, v
[0], v
[1], v
[2], v
[3]);
1476 _mesa_VertexAttribI4usv(GLuint index
, const GLushort
*v
)
1478 ATTRIBI_4UI(index
, v
[0], v
[1], v
[2], v
[3]);
1482 * This code never registers handlers for any of the entry points
1483 * listed in vtxfmt.h.
1486 _mesa_loopback_init_api_table(const struct gl_context
*ctx
,
1487 struct _glapi_table
*dest
)
1489 if (ctx
->API
!= API_OPENGL_CORE
&& ctx
->API
!= API_OPENGLES2
) {
1490 SET_Color4ub(dest
, _mesa_Color4ub
);
1491 SET_Materialf(dest
, _mesa_Materialf
);
1493 if (ctx
->API
== API_OPENGL_COMPAT
) {
1494 SET_Color3b(dest
, _mesa_Color3b
);
1495 SET_Color3d(dest
, _mesa_Color3d
);
1496 SET_Color3i(dest
, _mesa_Color3i
);
1497 SET_Color3s(dest
, _mesa_Color3s
);
1498 SET_Color3ui(dest
, _mesa_Color3ui
);
1499 SET_Color3us(dest
, _mesa_Color3us
);
1500 SET_Color3ub(dest
, _mesa_Color3ub
);
1501 SET_Color4b(dest
, _mesa_Color4b
);
1502 SET_Color4d(dest
, _mesa_Color4d
);
1503 SET_Color4i(dest
, _mesa_Color4i
);
1504 SET_Color4s(dest
, _mesa_Color4s
);
1505 SET_Color4ui(dest
, _mesa_Color4ui
);
1506 SET_Color4us(dest
, _mesa_Color4us
);
1507 SET_Color3bv(dest
, _mesa_Color3bv
);
1508 SET_Color3dv(dest
, _mesa_Color3dv
);
1509 SET_Color3iv(dest
, _mesa_Color3iv
);
1510 SET_Color3sv(dest
, _mesa_Color3sv
);
1511 SET_Color3uiv(dest
, _mesa_Color3uiv
);
1512 SET_Color3usv(dest
, _mesa_Color3usv
);
1513 SET_Color3ubv(dest
, _mesa_Color3ubv
);
1514 SET_Color4bv(dest
, _mesa_Color4bv
);
1515 SET_Color4dv(dest
, _mesa_Color4dv
);
1516 SET_Color4iv(dest
, _mesa_Color4iv
);
1517 SET_Color4sv(dest
, _mesa_Color4sv
);
1518 SET_Color4uiv(dest
, _mesa_Color4uiv
);
1519 SET_Color4usv(dest
, _mesa_Color4usv
);
1520 SET_Color4ubv(dest
, _mesa_Color4ubv
);
1522 SET_SecondaryColor3b(dest
, _mesa_SecondaryColor3b
);
1523 SET_SecondaryColor3d(dest
, _mesa_SecondaryColor3d
);
1524 SET_SecondaryColor3i(dest
, _mesa_SecondaryColor3i
);
1525 SET_SecondaryColor3s(dest
, _mesa_SecondaryColor3s
);
1526 SET_SecondaryColor3ui(dest
, _mesa_SecondaryColor3ui
);
1527 SET_SecondaryColor3us(dest
, _mesa_SecondaryColor3us
);
1528 SET_SecondaryColor3ub(dest
, _mesa_SecondaryColor3ub
);
1529 SET_SecondaryColor3bv(dest
, _mesa_SecondaryColor3bv
);
1530 SET_SecondaryColor3dv(dest
, _mesa_SecondaryColor3dv
);
1531 SET_SecondaryColor3iv(dest
, _mesa_SecondaryColor3iv
);
1532 SET_SecondaryColor3sv(dest
, _mesa_SecondaryColor3sv
);
1533 SET_SecondaryColor3uiv(dest
, _mesa_SecondaryColor3uiv
);
1534 SET_SecondaryColor3usv(dest
, _mesa_SecondaryColor3usv
);
1535 SET_SecondaryColor3ubv(dest
, _mesa_SecondaryColor3ubv
);
1537 SET_EdgeFlagv(dest
, _mesa_EdgeFlagv
);
1539 SET_Indexd(dest
, _mesa_Indexd
);
1540 SET_Indexi(dest
, _mesa_Indexi
);
1541 SET_Indexs(dest
, _mesa_Indexs
);
1542 SET_Indexub(dest
, _mesa_Indexub
);
1543 SET_Indexdv(dest
, _mesa_Indexdv
);
1544 SET_Indexiv(dest
, _mesa_Indexiv
);
1545 SET_Indexsv(dest
, _mesa_Indexsv
);
1546 SET_Indexubv(dest
, _mesa_Indexubv
);
1547 SET_Normal3b(dest
, _mesa_Normal3b
);
1548 SET_Normal3d(dest
, _mesa_Normal3d
);
1549 SET_Normal3i(dest
, _mesa_Normal3i
);
1550 SET_Normal3s(dest
, _mesa_Normal3s
);
1551 SET_Normal3bv(dest
, _mesa_Normal3bv
);
1552 SET_Normal3dv(dest
, _mesa_Normal3dv
);
1553 SET_Normal3iv(dest
, _mesa_Normal3iv
);
1554 SET_Normal3sv(dest
, _mesa_Normal3sv
);
1555 SET_TexCoord1d(dest
, _mesa_TexCoord1d
);
1556 SET_TexCoord1i(dest
, _mesa_TexCoord1i
);
1557 SET_TexCoord1s(dest
, _mesa_TexCoord1s
);
1558 SET_TexCoord2d(dest
, _mesa_TexCoord2d
);
1559 SET_TexCoord2s(dest
, _mesa_TexCoord2s
);
1560 SET_TexCoord2i(dest
, _mesa_TexCoord2i
);
1561 SET_TexCoord3d(dest
, _mesa_TexCoord3d
);
1562 SET_TexCoord3i(dest
, _mesa_TexCoord3i
);
1563 SET_TexCoord3s(dest
, _mesa_TexCoord3s
);
1564 SET_TexCoord4d(dest
, _mesa_TexCoord4d
);
1565 SET_TexCoord4i(dest
, _mesa_TexCoord4i
);
1566 SET_TexCoord4s(dest
, _mesa_TexCoord4s
);
1567 SET_TexCoord1dv(dest
, _mesa_TexCoord1dv
);
1568 SET_TexCoord1iv(dest
, _mesa_TexCoord1iv
);
1569 SET_TexCoord1sv(dest
, _mesa_TexCoord1sv
);
1570 SET_TexCoord2dv(dest
, _mesa_TexCoord2dv
);
1571 SET_TexCoord2iv(dest
, _mesa_TexCoord2iv
);
1572 SET_TexCoord2sv(dest
, _mesa_TexCoord2sv
);
1573 SET_TexCoord3dv(dest
, _mesa_TexCoord3dv
);
1574 SET_TexCoord3iv(dest
, _mesa_TexCoord3iv
);
1575 SET_TexCoord3sv(dest
, _mesa_TexCoord3sv
);
1576 SET_TexCoord4dv(dest
, _mesa_TexCoord4dv
);
1577 SET_TexCoord4iv(dest
, _mesa_TexCoord4iv
);
1578 SET_TexCoord4sv(dest
, _mesa_TexCoord4sv
);
1579 SET_Vertex2d(dest
, _mesa_Vertex2d
);
1580 SET_Vertex2i(dest
, _mesa_Vertex2i
);
1581 SET_Vertex2s(dest
, _mesa_Vertex2s
);
1582 SET_Vertex3d(dest
, _mesa_Vertex3d
);
1583 SET_Vertex3i(dest
, _mesa_Vertex3i
);
1584 SET_Vertex3s(dest
, _mesa_Vertex3s
);
1585 SET_Vertex4d(dest
, _mesa_Vertex4d
);
1586 SET_Vertex4i(dest
, _mesa_Vertex4i
);
1587 SET_Vertex4s(dest
, _mesa_Vertex4s
);
1588 SET_Vertex2dv(dest
, _mesa_Vertex2dv
);
1589 SET_Vertex2iv(dest
, _mesa_Vertex2iv
);
1590 SET_Vertex2sv(dest
, _mesa_Vertex2sv
);
1591 SET_Vertex3dv(dest
, _mesa_Vertex3dv
);
1592 SET_Vertex3iv(dest
, _mesa_Vertex3iv
);
1593 SET_Vertex3sv(dest
, _mesa_Vertex3sv
);
1594 SET_Vertex4dv(dest
, _mesa_Vertex4dv
);
1595 SET_Vertex4iv(dest
, _mesa_Vertex4iv
);
1596 SET_Vertex4sv(dest
, _mesa_Vertex4sv
);
1597 SET_MultiTexCoord1d(dest
, _mesa_MultiTexCoord1d
);
1598 SET_MultiTexCoord1dv(dest
, _mesa_MultiTexCoord1dv
);
1599 SET_MultiTexCoord1i(dest
, _mesa_MultiTexCoord1i
);
1600 SET_MultiTexCoord1iv(dest
, _mesa_MultiTexCoord1iv
);
1601 SET_MultiTexCoord1s(dest
, _mesa_MultiTexCoord1s
);
1602 SET_MultiTexCoord1sv(dest
, _mesa_MultiTexCoord1sv
);
1603 SET_MultiTexCoord2d(dest
, _mesa_MultiTexCoord2d
);
1604 SET_MultiTexCoord2dv(dest
, _mesa_MultiTexCoord2dv
);
1605 SET_MultiTexCoord2i(dest
, _mesa_MultiTexCoord2i
);
1606 SET_MultiTexCoord2iv(dest
, _mesa_MultiTexCoord2iv
);
1607 SET_MultiTexCoord2s(dest
, _mesa_MultiTexCoord2s
);
1608 SET_MultiTexCoord2sv(dest
, _mesa_MultiTexCoord2sv
);
1609 SET_MultiTexCoord3d(dest
, _mesa_MultiTexCoord3d
);
1610 SET_MultiTexCoord3dv(dest
, _mesa_MultiTexCoord3dv
);
1611 SET_MultiTexCoord3i(dest
, _mesa_MultiTexCoord3i
);
1612 SET_MultiTexCoord3iv(dest
, _mesa_MultiTexCoord3iv
);
1613 SET_MultiTexCoord3s(dest
, _mesa_MultiTexCoord3s
);
1614 SET_MultiTexCoord3sv(dest
, _mesa_MultiTexCoord3sv
);
1615 SET_MultiTexCoord4d(dest
, _mesa_MultiTexCoord4d
);
1616 SET_MultiTexCoord4dv(dest
, _mesa_MultiTexCoord4dv
);
1617 SET_MultiTexCoord4i(dest
, _mesa_MultiTexCoord4i
);
1618 SET_MultiTexCoord4iv(dest
, _mesa_MultiTexCoord4iv
);
1619 SET_MultiTexCoord4s(dest
, _mesa_MultiTexCoord4s
);
1620 SET_MultiTexCoord4sv(dest
, _mesa_MultiTexCoord4sv
);
1621 SET_EvalCoord2dv(dest
, _mesa_EvalCoord2dv
);
1622 SET_EvalCoord2d(dest
, _mesa_EvalCoord2d
);
1623 SET_EvalCoord1dv(dest
, _mesa_EvalCoord1dv
);
1624 SET_EvalCoord1d(dest
, _mesa_EvalCoord1d
);
1625 SET_Materiali(dest
, _mesa_Materiali
);
1626 SET_Materialiv(dest
, _mesa_Materialiv
);
1627 SET_Rectd(dest
, _mesa_Rectd
);
1628 SET_Rectdv(dest
, _mesa_Rectdv
);
1629 SET_Rectfv(dest
, _mesa_Rectfv
);
1630 SET_Recti(dest
, _mesa_Recti
);
1631 SET_Rectiv(dest
, _mesa_Rectiv
);
1632 SET_Rects(dest
, _mesa_Rects
);
1633 SET_Rectsv(dest
, _mesa_Rectsv
);
1634 SET_FogCoordd(dest
, _mesa_FogCoordd
);
1635 SET_FogCoorddv(dest
, _mesa_FogCoorddv
);
1638 if (ctx
->API
== API_OPENGL_COMPAT
) {
1639 SET_VertexAttrib1sNV(dest
, _mesa_VertexAttrib1sNV
);
1640 SET_VertexAttrib1dNV(dest
, _mesa_VertexAttrib1dNV
);
1641 SET_VertexAttrib2sNV(dest
, _mesa_VertexAttrib2sNV
);
1642 SET_VertexAttrib2dNV(dest
, _mesa_VertexAttrib2dNV
);
1643 SET_VertexAttrib3sNV(dest
, _mesa_VertexAttrib3sNV
);
1644 SET_VertexAttrib3dNV(dest
, _mesa_VertexAttrib3dNV
);
1645 SET_VertexAttrib4sNV(dest
, _mesa_VertexAttrib4sNV
);
1646 SET_VertexAttrib4dNV(dest
, _mesa_VertexAttrib4dNV
);
1647 SET_VertexAttrib4ubNV(dest
, _mesa_VertexAttrib4ubNV
);
1648 SET_VertexAttrib1svNV(dest
, _mesa_VertexAttrib1svNV
);
1649 SET_VertexAttrib1dvNV(dest
, _mesa_VertexAttrib1dvNV
);
1650 SET_VertexAttrib2svNV(dest
, _mesa_VertexAttrib2svNV
);
1651 SET_VertexAttrib2dvNV(dest
, _mesa_VertexAttrib2dvNV
);
1652 SET_VertexAttrib3svNV(dest
, _mesa_VertexAttrib3svNV
);
1653 SET_VertexAttrib3dvNV(dest
, _mesa_VertexAttrib3dvNV
);
1654 SET_VertexAttrib4svNV(dest
, _mesa_VertexAttrib4svNV
);
1655 SET_VertexAttrib4dvNV(dest
, _mesa_VertexAttrib4dvNV
);
1656 SET_VertexAttrib4ubvNV(dest
, _mesa_VertexAttrib4ubvNV
);
1657 SET_VertexAttribs1svNV(dest
, _mesa_VertexAttribs1svNV
);
1658 SET_VertexAttribs1fvNV(dest
, _mesa_VertexAttribs1fvNV
);
1659 SET_VertexAttribs1dvNV(dest
, _mesa_VertexAttribs1dvNV
);
1660 SET_VertexAttribs2svNV(dest
, _mesa_VertexAttribs2svNV
);
1661 SET_VertexAttribs2fvNV(dest
, _mesa_VertexAttribs2fvNV
);
1662 SET_VertexAttribs2dvNV(dest
, _mesa_VertexAttribs2dvNV
);
1663 SET_VertexAttribs3svNV(dest
, _mesa_VertexAttribs3svNV
);
1664 SET_VertexAttribs3fvNV(dest
, _mesa_VertexAttribs3fvNV
);
1665 SET_VertexAttribs3dvNV(dest
, _mesa_VertexAttribs3dvNV
);
1666 SET_VertexAttribs4svNV(dest
, _mesa_VertexAttribs4svNV
);
1667 SET_VertexAttribs4fvNV(dest
, _mesa_VertexAttribs4fvNV
);
1668 SET_VertexAttribs4dvNV(dest
, _mesa_VertexAttribs4dvNV
);
1669 SET_VertexAttribs4ubvNV(dest
, _mesa_VertexAttribs4ubvNV
);
1672 if (_mesa_is_desktop_gl(ctx
)) {
1673 SET_VertexAttrib1s(dest
, _mesa_VertexAttrib1s
);
1674 SET_VertexAttrib1d(dest
, _mesa_VertexAttrib1d
);
1675 SET_VertexAttrib2s(dest
, _mesa_VertexAttrib2s
);
1676 SET_VertexAttrib2d(dest
, _mesa_VertexAttrib2d
);
1677 SET_VertexAttrib3s(dest
, _mesa_VertexAttrib3s
);
1678 SET_VertexAttrib3d(dest
, _mesa_VertexAttrib3d
);
1679 SET_VertexAttrib4s(dest
, _mesa_VertexAttrib4s
);
1680 SET_VertexAttrib4d(dest
, _mesa_VertexAttrib4d
);
1681 SET_VertexAttrib1sv(dest
, _mesa_VertexAttrib1sv
);
1682 SET_VertexAttrib1dv(dest
, _mesa_VertexAttrib1dv
);
1683 SET_VertexAttrib2sv(dest
, _mesa_VertexAttrib2sv
);
1684 SET_VertexAttrib2dv(dest
, _mesa_VertexAttrib2dv
);
1685 SET_VertexAttrib3sv(dest
, _mesa_VertexAttrib3sv
);
1686 SET_VertexAttrib3dv(dest
, _mesa_VertexAttrib3dv
);
1687 SET_VertexAttrib4sv(dest
, _mesa_VertexAttrib4sv
);
1688 SET_VertexAttrib4dv(dest
, _mesa_VertexAttrib4dv
);
1689 SET_VertexAttrib4Nub(dest
, _mesa_VertexAttrib4Nub
);
1690 SET_VertexAttrib4Nubv(dest
, _mesa_VertexAttrib4Nubv
);
1691 SET_VertexAttrib4bv(dest
, _mesa_VertexAttrib4bv
);
1692 SET_VertexAttrib4iv(dest
, _mesa_VertexAttrib4iv
);
1693 SET_VertexAttrib4ubv(dest
, _mesa_VertexAttrib4ubv
);
1694 SET_VertexAttrib4usv(dest
, _mesa_VertexAttrib4usv
);
1695 SET_VertexAttrib4uiv(dest
, _mesa_VertexAttrib4uiv
);
1696 SET_VertexAttrib4Nbv(dest
, _mesa_VertexAttrib4Nbv
);
1697 SET_VertexAttrib4Nsv(dest
, _mesa_VertexAttrib4Nsv
);
1698 SET_VertexAttrib4Nusv(dest
, _mesa_VertexAttrib4Nusv
);
1699 SET_VertexAttrib4Niv(dest
, _mesa_VertexAttrib4Niv
);
1700 SET_VertexAttrib4Nuiv(dest
, _mesa_VertexAttrib4Nuiv
);
1702 /* GL_EXT_gpu_shader4, GL 3.0 */
1703 SET_VertexAttribI1iv(dest
, _mesa_VertexAttribI1iv
);
1704 SET_VertexAttribI1uiv(dest
, _mesa_VertexAttribI1uiv
);
1705 SET_VertexAttribI4bv(dest
, _mesa_VertexAttribI4bv
);
1706 SET_VertexAttribI4sv(dest
, _mesa_VertexAttribI4sv
);
1707 SET_VertexAttribI4ubv(dest
, _mesa_VertexAttribI4ubv
);
1708 SET_VertexAttribI4usv(dest
, _mesa_VertexAttribI4usv
);