1 /**************************************************************************
2
3 Copyright 2002 VMware, Inc.
4 Copyright 2011 Dave Airlie (ARB_vertex_type_2_10_10_10_rev support)
5 All Rights Reserved.
6
7 Permission is hereby granted, free of charge, to any person obtaining a
8 copy of this software and associated documentation files (the "Software"),
9 to deal in the Software without restriction, including without limitation
10 on the rights to use, copy, modify, merge, publish, distribute, sub
11 license, and/or sell copies of the Software, and to permit persons to whom
12 the Software is furnished to do so, subject to the following conditions:
13
14 The above copyright notice and this permission notice (including the next
15 paragraph) shall be included in all copies or substantial portions of the
16 Software.
17
18 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
21 VMWARE AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
22 DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
23 OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
24 USE OR OTHER DEALINGS IN THE SOFTWARE.
25
26 **************************************************************************/
27
28 #include "util/format_r11g11b10f.h"
29 #include "main/varray.h"
30 #include "vbo_util.h"
31 #include "util/half_float.h"
32
33
34 /* ATTR */
35 #define ATTRI( A, N, V0, V1, V2, V3 ) \
36 ATTR_UNION(A, N, GL_INT, uint32_t, INT_AS_UINT(V0), INT_AS_UINT(V1), \
37 INT_AS_UINT(V2), INT_AS_UINT(V3))
38 #define ATTRUI( A, N, V0, V1, V2, V3 ) \
39 ATTR_UNION(A, N, GL_UNSIGNED_INT, uint32_t, (uint32_t)(V0), (uint32_t)(V1), \
40 (uint32_t)(V2), (uint32_t)(V3))
41 #define ATTRF( A, N, V0, V1, V2, V3 ) \
42 ATTR_UNION(A, N, GL_FLOAT, uint32_t, FLOAT_AS_UINT(V0), FLOAT_AS_UINT(V1),\
43 FLOAT_AS_UINT(V2), FLOAT_AS_UINT(V3))
44 #define ATTRD( A, N, V0, V1, V2, V3 ) \
45 ATTR_UNION(A, N, GL_DOUBLE, uint64_t, DOUBLE_AS_UINT64(V0), \
46 DOUBLE_AS_UINT64(V1), DOUBLE_AS_UINT64(V2), DOUBLE_AS_UINT64(V3))
47 #define ATTRUI64( A, N, V0, V1, V2, V3 ) \
48 ATTR_UNION(A, N, GL_UNSIGNED_INT64_ARB, uint64_t, V0, V1, V2, V3)
49
50
51 /* float */
52 #define ATTR1FV( A, V ) ATTRF( A, 1, (V)[0], 0, 0, 1 )
53 #define ATTR2FV( A, V ) ATTRF( A, 2, (V)[0], (V)[1], 0, 1 )
54 #define ATTR3FV( A, V ) ATTRF( A, 3, (V)[0], (V)[1], (V)[2], 1 )
55 #define ATTR4FV( A, V ) ATTRF( A, 4, (V)[0], (V)[1], (V)[2], (V)[3] )
56
57 #define ATTR1F( A, X ) ATTRF( A, 1, X, 0, 0, 1 )
58 #define ATTR2F( A, X, Y ) ATTRF( A, 2, X, Y, 0, 1 )
59 #define ATTR3F( A, X, Y, Z ) ATTRF( A, 3, X, Y, Z, 1 )
60 #define ATTR4F( A, X, Y, Z, W ) ATTRF( A, 4, X, Y, Z, W )
61
62
63 /* half */
64 #define ATTR1HV( A, V ) ATTRF( A, 1, _mesa_half_to_float((uint16_t)(V)[0]), \
65 0, 0, 1 )
66 #define ATTR2HV( A, V ) ATTRF( A, 2, _mesa_half_to_float((uint16_t)(V)[0]), \
67 _mesa_half_to_float((uint16_t)(V)[1]), 0, 1 )
68 #define ATTR3HV( A, V ) ATTRF( A, 3, _mesa_half_to_float((uint16_t)(V)[0]), \
69 _mesa_half_to_float((uint16_t)(V)[1]), \
70 _mesa_half_to_float((uint16_t)(V)[2]), 1 )
71 #define ATTR4HV( A, V ) ATTRF( A, 4, _mesa_half_to_float((uint16_t)(V)[0]), \
72 _mesa_half_to_float((uint16_t)(V)[1]), \
73 _mesa_half_to_float((uint16_t)(V)[2]), \
74 _mesa_half_to_float((uint16_t)(V)[3]) )
75
76 #define ATTR1H( A, X ) ATTRF( A, 1, _mesa_half_to_float(X), 0, 0, 1 )
77 #define ATTR2H( A, X, Y ) ATTRF( A, 2, _mesa_half_to_float(X), \
78 _mesa_half_to_float(Y), 0, 1 )
79 #define ATTR3H( A, X, Y, Z ) ATTRF( A, 3, _mesa_half_to_float(X), \
80 _mesa_half_to_float(Y), \
81 _mesa_half_to_float(Z), 1 )
82 #define ATTR4H( A, X, Y, Z, W ) ATTRF( A, 4, _mesa_half_to_float(X), \
83 _mesa_half_to_float(Y), \
84 _mesa_half_to_float(Z), \
85 _mesa_half_to_float(W) )
86
87
88 /* int */
89 #define ATTR2IV( A, V ) ATTRI( A, 2, (V)[0], (V)[1], 0, 1 )
90 #define ATTR3IV( A, V ) ATTRI( A, 3, (V)[0], (V)[1], (V)[2], 1 )
91 #define ATTR4IV( A, V ) ATTRI( A, 4, (V)[0], (V)[1], (V)[2], (V)[3] )
92
93 #define ATTR1I( A, X ) ATTRI( A, 1, X, 0, 0, 1 )
94 #define ATTR2I( A, X, Y ) ATTRI( A, 2, X, Y, 0, 1 )
95 #define ATTR3I( A, X, Y, Z ) ATTRI( A, 3, X, Y, Z, 1 )
96 #define ATTR4I( A, X, Y, Z, W ) ATTRI( A, 4, X, Y, Z, W )
97
98
99 /* uint */
100 #define ATTR2UIV( A, V ) ATTRUI( A, 2, (V)[0], (V)[1], 0, 1 )
101 #define ATTR3UIV( A, V ) ATTRUI( A, 3, (V)[0], (V)[1], (V)[2], 1 )
102 #define ATTR4UIV( A, V ) ATTRUI( A, 4, (V)[0], (V)[1], (V)[2], (V)[3] )
103
104 #define ATTR1UI( A, X ) ATTRUI( A, 1, X, 0, 0, 1 )
105 #define ATTR2UI( A, X, Y ) ATTRUI( A, 2, X, Y, 0, 1 )
106 #define ATTR3UI( A, X, Y, Z ) ATTRUI( A, 3, X, Y, Z, 1 )
107 #define ATTR4UI( A, X, Y, Z, W ) ATTRUI( A, 4, X, Y, Z, W )
108
109 #define MAT_ATTR( A, N, V ) ATTRF( A, N, (V)[0], (V)[1], (V)[2], (V)[3] )
110
111 #define ATTRUI10_1( A, UI ) ATTRF( A, 1, (UI) & 0x3ff, 0, 0, 1 )
112 #define ATTRUI10_2( A, UI ) ATTRF( A, 2, (UI) & 0x3ff, ((UI) >> 10) & 0x3ff, 0, 1 )
113 #define ATTRUI10_3( A, UI ) ATTRF( A, 3, (UI) & 0x3ff, ((UI) >> 10) & 0x3ff, ((UI) >> 20) & 0x3ff, 1 )
114 #define ATTRUI10_4( A, UI ) ATTRF( A, 4, (UI) & 0x3ff, ((UI) >> 10) & 0x3ff, ((UI) >> 20) & 0x3ff, ((UI) >> 30) & 0x3 )
115
116 #define ATTRUI10N_1( A, UI ) ATTRF( A, 1, conv_ui10_to_norm_float((UI) & 0x3ff), 0, 0, 1 )
117 #define ATTRUI10N_2( A, UI ) ATTRF( A, 2, \
118 conv_ui10_to_norm_float((UI) & 0x3ff), \
119 conv_ui10_to_norm_float(((UI) >> 10) & 0x3ff), 0, 1 )
120 #define ATTRUI10N_3( A, UI ) ATTRF( A, 3, \
121 conv_ui10_to_norm_float((UI) & 0x3ff), \
122 conv_ui10_to_norm_float(((UI) >> 10) & 0x3ff), \
123 conv_ui10_to_norm_float(((UI) >> 20) & 0x3ff), 1 )
124 #define ATTRUI10N_4( A, UI ) ATTRF( A, 4, \
125 conv_ui10_to_norm_float((UI) & 0x3ff), \
126 conv_ui10_to_norm_float(((UI) >> 10) & 0x3ff), \
127 conv_ui10_to_norm_float(((UI) >> 20) & 0x3ff), \
128 conv_ui2_to_norm_float(((UI) >> 30) & 0x3) )
129
130 #define ATTRI10_1( A, I10 ) ATTRF( A, 1, conv_i10_to_i((I10) & 0x3ff), 0, 0, 1 )
131 #define ATTRI10_2( A, I10 ) ATTRF( A, 2, \
132 conv_i10_to_i((I10) & 0x3ff), \
133 conv_i10_to_i(((I10) >> 10) & 0x3ff), 0, 1 )
134 #define ATTRI10_3( A, I10 ) ATTRF( A, 3, \
135 conv_i10_to_i((I10) & 0x3ff), \
136 conv_i10_to_i(((I10) >> 10) & 0x3ff), \
137 conv_i10_to_i(((I10) >> 20) & 0x3ff), 1 )
138 #define ATTRI10_4( A, I10 ) ATTRF( A, 4, \
139 conv_i10_to_i((I10) & 0x3ff), \
140 conv_i10_to_i(((I10) >> 10) & 0x3ff), \
141 conv_i10_to_i(((I10) >> 20) & 0x3ff), \
142 conv_i2_to_i(((I10) >> 30) & 0x3))
143
144
145 #define ATTRI10N_1(ctx, A, I10) ATTRF(A, 1, conv_i10_to_norm_float(ctx, (I10) & 0x3ff), 0, 0, 1 )
146 #define ATTRI10N_2(ctx, A, I10) ATTRF(A, 2, \
147 conv_i10_to_norm_float(ctx, (I10) & 0x3ff), \
148 conv_i10_to_norm_float(ctx, ((I10) >> 10) & 0x3ff), 0, 1 )
149 #define ATTRI10N_3(ctx, A, I10) ATTRF(A, 3, \
150 conv_i10_to_norm_float(ctx, (I10) & 0x3ff), \
151 conv_i10_to_norm_float(ctx, ((I10) >> 10) & 0x3ff), \
152 conv_i10_to_norm_float(ctx, ((I10) >> 20) & 0x3ff), 1 )
153 #define ATTRI10N_4(ctx, A, I10) ATTRF(A, 4, \
154 conv_i10_to_norm_float(ctx, (I10) & 0x3ff), \
155 conv_i10_to_norm_float(ctx, ((I10) >> 10) & 0x3ff), \
156 conv_i10_to_norm_float(ctx, ((I10) >> 20) & 0x3ff), \
157 conv_i2_to_norm_float(ctx, ((I10) >> 30) & 0x3))
158
159 #define ATTR_UI(ctx, val, type, normalized, attr, arg) do { \
160 if ((type) == GL_UNSIGNED_INT_2_10_10_10_REV) { \
161 if (normalized) { \
162 ATTRUI10N_##val((attr), (arg)); \
163 } else { \
164 ATTRUI10_##val((attr), (arg)); \
165 } \
166 } else if ((type) == GL_INT_2_10_10_10_REV) { \
167 if (normalized) { \
168 ATTRI10N_##val(ctx, (attr), (arg)); \
169 } else { \
170 ATTRI10_##val((attr), (arg)); \
171 } \
172 } else if ((type) == GL_UNSIGNED_INT_10F_11F_11F_REV) { \
173 float res[4]; \
174 res[3] = 1; \
175 r11g11b10f_to_float3((arg), res); \
176 ATTR##val##FV((attr), res); \
177 } else \
178 ERROR(GL_INVALID_VALUE); \
179 } while(0)
180
181 #define ATTR_UI_INDEX(ctx, val, type, normalized, index, arg) do { \
182 if ((index) == 0 && _mesa_attr_zero_aliases_vertex(ctx)) { \
183 ATTR_UI(ctx, val, (type), normalized, 0, (arg)); \
184 } else if ((index) < MAX_VERTEX_GENERIC_ATTRIBS) { \
185 ATTR_UI(ctx, val, (type), normalized, VBO_ATTRIB_GENERIC0 + (index), (arg)); \
186 } else \
187 ERROR(GL_INVALID_VALUE); \
188 } while(0)
189
190
191 /* Doubles */
192 #define ATTR1DV( A, V ) ATTRD( A, 1, (V)[0], 0, 0, 1 )
193 #define ATTR2DV( A, V ) ATTRD( A, 2, (V)[0], (V)[1], 0, 1 )
194 #define ATTR3DV( A, V ) ATTRD( A, 3, (V)[0], (V)[1], (V)[2], 1 )
195 #define ATTR4DV( A, V ) ATTRD( A, 4, (V)[0], (V)[1], (V)[2], (V)[3] )
196
197 #define ATTR1D( A, X ) ATTRD( A, 1, X, 0, 0, 1 )
198 #define ATTR2D( A, X, Y ) ATTRD( A, 2, X, Y, 0, 1 )
199 #define ATTR3D( A, X, Y, Z ) ATTRD( A, 3, X, Y, Z, 1 )
200 #define ATTR4D( A, X, Y, Z, W ) ATTRD( A, 4, X, Y, Z, W )
201
202 #define ATTR1UIV64( A, V ) ATTRUI64( A, 1, (V)[0], 0, 0, 0 )
203 #define ATTR1UI64( A, X ) ATTRUI64( A, 1, X, 0, 0, 0 )
204
205
206 static void GLAPIENTRY
TAG(Vertex2f)207 TAG(Vertex2f)(GLfloat x, GLfloat y)
208 {
209 GET_CURRENT_CONTEXT(ctx);
210 ATTR2F(VBO_ATTRIB_POS, x, y);
211 }
212
213 static void GLAPIENTRY
TAG(Vertex2fv)214 TAG(Vertex2fv)(const GLfloat * v)
215 {
216 GET_CURRENT_CONTEXT(ctx);
217 ATTR2FV(VBO_ATTRIB_POS, v);
218 }
219
220 static void GLAPIENTRY
TAG(Vertex3f)221 TAG(Vertex3f)(GLfloat x, GLfloat y, GLfloat z)
222 {
223 GET_CURRENT_CONTEXT(ctx);
224 ATTR3F(VBO_ATTRIB_POS, x, y, z);
225 }
226
227 static void GLAPIENTRY
TAG(Vertex3fv)228 TAG(Vertex3fv)(const GLfloat * v)
229 {
230 GET_CURRENT_CONTEXT(ctx);
231 ATTR3FV(VBO_ATTRIB_POS, v);
232 }
233
234 static void GLAPIENTRY
TAG(Vertex4f)235 TAG(Vertex4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
236 {
237 GET_CURRENT_CONTEXT(ctx);
238 ATTR4F(VBO_ATTRIB_POS, x, y, z, w);
239 }
240
241 static void GLAPIENTRY
TAG(Vertex4fv)242 TAG(Vertex4fv)(const GLfloat * v)
243 {
244 GET_CURRENT_CONTEXT(ctx);
245 ATTR4FV(VBO_ATTRIB_POS, v);
246 }
247
248
249
250 static void GLAPIENTRY
TAG(TexCoord1f)251 TAG(TexCoord1f)(GLfloat x)
252 {
253 GET_CURRENT_CONTEXT(ctx);
254 ATTR1F(VBO_ATTRIB_TEX0, x);
255 }
256
257 static void GLAPIENTRY
TAG(TexCoord1fv)258 TAG(TexCoord1fv)(const GLfloat * v)
259 {
260 GET_CURRENT_CONTEXT(ctx);
261 ATTR1FV(VBO_ATTRIB_TEX0, v);
262 }
263
264 static void GLAPIENTRY
TAG(TexCoord2f)265 TAG(TexCoord2f)(GLfloat x, GLfloat y)
266 {
267 GET_CURRENT_CONTEXT(ctx);
268 ATTR2F(VBO_ATTRIB_TEX0, x, y);
269 }
270
271 static void GLAPIENTRY
TAG(TexCoord2fv)272 TAG(TexCoord2fv)(const GLfloat * v)
273 {
274 GET_CURRENT_CONTEXT(ctx);
275 ATTR2FV(VBO_ATTRIB_TEX0, v);
276 }
277
278 static void GLAPIENTRY
TAG(TexCoord3f)279 TAG(TexCoord3f)(GLfloat x, GLfloat y, GLfloat z)
280 {
281 GET_CURRENT_CONTEXT(ctx);
282 ATTR3F(VBO_ATTRIB_TEX0, x, y, z);
283 }
284
285 static void GLAPIENTRY
TAG(TexCoord3fv)286 TAG(TexCoord3fv)(const GLfloat * v)
287 {
288 GET_CURRENT_CONTEXT(ctx);
289 ATTR3FV(VBO_ATTRIB_TEX0, v);
290 }
291
292 static void GLAPIENTRY
TAG(TexCoord4f)293 TAG(TexCoord4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
294 {
295 GET_CURRENT_CONTEXT(ctx);
296 ATTR4F(VBO_ATTRIB_TEX0, x, y, z, w);
297 }
298
299 static void GLAPIENTRY
TAG(TexCoord4fv)300 TAG(TexCoord4fv)(const GLfloat * v)
301 {
302 GET_CURRENT_CONTEXT(ctx);
303 ATTR4FV(VBO_ATTRIB_TEX0, v);
304 }
305
306
307
308 static void GLAPIENTRY
TAG(Normal3f)309 TAG(Normal3f)(GLfloat x, GLfloat y, GLfloat z)
310 {
311 GET_CURRENT_CONTEXT(ctx);
312 ATTR3F(VBO_ATTRIB_NORMAL, x, y, z);
313 }
314
315 static void GLAPIENTRY
TAG(Normal3fv)316 TAG(Normal3fv)(const GLfloat * v)
317 {
318 GET_CURRENT_CONTEXT(ctx);
319 ATTR3FV(VBO_ATTRIB_NORMAL, v);
320 }
321
322
323
324 static void GLAPIENTRY
TAG(FogCoordfEXT)325 TAG(FogCoordfEXT)(GLfloat x)
326 {
327 GET_CURRENT_CONTEXT(ctx);
328 ATTR1F(VBO_ATTRIB_FOG, x);
329 }
330
331
332
333 static void GLAPIENTRY
TAG(FogCoordfvEXT)334 TAG(FogCoordfvEXT)(const GLfloat * v)
335 {
336 GET_CURRENT_CONTEXT(ctx);
337 ATTR1FV(VBO_ATTRIB_FOG, v);
338 }
339
340 static void GLAPIENTRY
TAG(Color3f)341 TAG(Color3f)(GLfloat x, GLfloat y, GLfloat z)
342 {
343 GET_CURRENT_CONTEXT(ctx);
344 ATTR3F(VBO_ATTRIB_COLOR0, x, y, z);
345 }
346
347 static void GLAPIENTRY
TAG(Color3fv)348 TAG(Color3fv)(const GLfloat * v)
349 {
350 GET_CURRENT_CONTEXT(ctx);
351 ATTR3FV(VBO_ATTRIB_COLOR0, v);
352 }
353
354 static void GLAPIENTRY
TAG(Color4f)355 TAG(Color4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
356 {
357 GET_CURRENT_CONTEXT(ctx);
358 ATTR4F(VBO_ATTRIB_COLOR0, x, y, z, w);
359 }
360
361 static void GLAPIENTRY
TAG(Color4fv)362 TAG(Color4fv)(const GLfloat * v)
363 {
364 GET_CURRENT_CONTEXT(ctx);
365 ATTR4FV(VBO_ATTRIB_COLOR0, v);
366 }
367
368
369
370 static void GLAPIENTRY
TAG(SecondaryColor3fEXT)371 TAG(SecondaryColor3fEXT)(GLfloat x, GLfloat y, GLfloat z)
372 {
373 GET_CURRENT_CONTEXT(ctx);
374 ATTR3F(VBO_ATTRIB_COLOR1, x, y, z);
375 }
376
377 static void GLAPIENTRY
TAG(SecondaryColor3fvEXT)378 TAG(SecondaryColor3fvEXT)(const GLfloat * v)
379 {
380 GET_CURRENT_CONTEXT(ctx);
381 ATTR3FV(VBO_ATTRIB_COLOR1, v);
382 }
383
384
385
386 static void GLAPIENTRY
TAG(EdgeFlag)387 TAG(EdgeFlag)(GLboolean b)
388 {
389 GET_CURRENT_CONTEXT(ctx);
390 ATTR1F(VBO_ATTRIB_EDGEFLAG, (GLfloat) b);
391 }
392
393
394
395 static void GLAPIENTRY
TAG(Indexf)396 TAG(Indexf)(GLfloat f)
397 {
398 GET_CURRENT_CONTEXT(ctx);
399 ATTR1F(VBO_ATTRIB_COLOR_INDEX, f);
400 }
401
402 static void GLAPIENTRY
TAG(Indexfv)403 TAG(Indexfv)(const GLfloat * f)
404 {
405 GET_CURRENT_CONTEXT(ctx);
406 ATTR1FV(VBO_ATTRIB_COLOR_INDEX, f);
407 }
408
409
410
411 static void GLAPIENTRY
TAG(MultiTexCoord1f)412 TAG(MultiTexCoord1f)(GLenum target, GLfloat x)
413 {
414 GET_CURRENT_CONTEXT(ctx);
415 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
416 ATTR1F(attr, x);
417 }
418
419 static void GLAPIENTRY
TAG(MultiTexCoord1fv)420 TAG(MultiTexCoord1fv)(GLenum target, const GLfloat * v)
421 {
422 GET_CURRENT_CONTEXT(ctx);
423 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
424 ATTR1FV(attr, v);
425 }
426
427 static void GLAPIENTRY
TAG(MultiTexCoord2f)428 TAG(MultiTexCoord2f)(GLenum target, GLfloat x, GLfloat y)
429 {
430 GET_CURRENT_CONTEXT(ctx);
431 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
432 ATTR2F(attr, x, y);
433 }
434
435 static void GLAPIENTRY
TAG(MultiTexCoord2fv)436 TAG(MultiTexCoord2fv)(GLenum target, const GLfloat * v)
437 {
438 GET_CURRENT_CONTEXT(ctx);
439 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
440 ATTR2FV(attr, v);
441 }
442
443 static void GLAPIENTRY
TAG(MultiTexCoord3f)444 TAG(MultiTexCoord3f)(GLenum target, GLfloat x, GLfloat y, GLfloat z)
445 {
446 GET_CURRENT_CONTEXT(ctx);
447 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
448 ATTR3F(attr, x, y, z);
449 }
450
451 static void GLAPIENTRY
TAG(MultiTexCoord3fv)452 TAG(MultiTexCoord3fv)(GLenum target, const GLfloat * v)
453 {
454 GET_CURRENT_CONTEXT(ctx);
455 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
456 ATTR3FV(attr, v);
457 }
458
459 static void GLAPIENTRY
TAG(MultiTexCoord4f)460 TAG(MultiTexCoord4f)(GLenum target, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
461 {
462 GET_CURRENT_CONTEXT(ctx);
463 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
464 ATTR4F(attr, x, y, z, w);
465 }
466
467 static void GLAPIENTRY
TAG(MultiTexCoord4fv)468 TAG(MultiTexCoord4fv)(GLenum target, const GLfloat * v)
469 {
470 GET_CURRENT_CONTEXT(ctx);
471 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
472 ATTR4FV(attr, v);
473 }
474
475
476 static void GLAPIENTRY
TAG(VertexAttrib1fARB)477 TAG(VertexAttrib1fARB)(GLuint index, GLfloat x)
478 {
479 GET_CURRENT_CONTEXT(ctx);
480 if (is_vertex_position(ctx, index))
481 ATTR1F(0, x);
482 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
483 ATTR1F(VBO_ATTRIB_GENERIC0 + index, x);
484 else
485 ERROR(GL_INVALID_VALUE);
486 }
487
488 static void GLAPIENTRY
TAG(VertexAttrib1fvARB)489 TAG(VertexAttrib1fvARB)(GLuint index, const GLfloat * v)
490 {
491 GET_CURRENT_CONTEXT(ctx);
492 if (is_vertex_position(ctx, index))
493 ATTR1FV(0, v);
494 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
495 ATTR1FV(VBO_ATTRIB_GENERIC0 + index, v);
496 else
497 ERROR(GL_INVALID_VALUE);
498 }
499
500 static void GLAPIENTRY
TAG(VertexAttrib2fARB)501 TAG(VertexAttrib2fARB)(GLuint index, GLfloat x, GLfloat y)
502 {
503 GET_CURRENT_CONTEXT(ctx);
504 if (is_vertex_position(ctx, index))
505 ATTR2F(0, x, y);
506 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
507 ATTR2F(VBO_ATTRIB_GENERIC0 + index, x, y);
508 else
509 ERROR(GL_INVALID_VALUE);
510 }
511
512 static void GLAPIENTRY
TAG(VertexAttrib2fvARB)513 TAG(VertexAttrib2fvARB)(GLuint index, const GLfloat * v)
514 {
515 GET_CURRENT_CONTEXT(ctx);
516 if (is_vertex_position(ctx, index))
517 ATTR2FV(0, v);
518 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
519 ATTR2FV(VBO_ATTRIB_GENERIC0 + index, v);
520 else
521 ERROR(GL_INVALID_VALUE);
522 }
523
524 static void GLAPIENTRY
TAG(VertexAttrib3fARB)525 TAG(VertexAttrib3fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z)
526 {
527 GET_CURRENT_CONTEXT(ctx);
528 if (is_vertex_position(ctx, index))
529 ATTR3F(0, x, y, z);
530 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
531 ATTR3F(VBO_ATTRIB_GENERIC0 + index, x, y, z);
532 else
533 ERROR(GL_INVALID_VALUE);
534 }
535
536 static void GLAPIENTRY
TAG(VertexAttrib3fvARB)537 TAG(VertexAttrib3fvARB)(GLuint index, const GLfloat * v)
538 {
539 GET_CURRENT_CONTEXT(ctx);
540 if (is_vertex_position(ctx, index))
541 ATTR3FV(0, v);
542 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
543 ATTR3FV(VBO_ATTRIB_GENERIC0 + index, v);
544 else
545 ERROR(GL_INVALID_VALUE);
546 }
547
548 static void GLAPIENTRY
TAG(VertexAttrib4fARB)549 TAG(VertexAttrib4fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
550 {
551 GET_CURRENT_CONTEXT(ctx);
552 if (is_vertex_position(ctx, index))
553 ATTR4F(0, x, y, z, w);
554 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
555 ATTR4F(VBO_ATTRIB_GENERIC0 + index, x, y, z, w);
556 else
557 ERROR(GL_INVALID_VALUE);
558 }
559
560 static void GLAPIENTRY
TAG(VertexAttrib4fvARB)561 TAG(VertexAttrib4fvARB)(GLuint index, const GLfloat * v)
562 {
563 GET_CURRENT_CONTEXT(ctx);
564 if (is_vertex_position(ctx, index))
565 ATTR4FV(0, v);
566 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
567 ATTR4FV(VBO_ATTRIB_GENERIC0 + index, v);
568 else
569 ERROR(GL_INVALID_VALUE);
570 }
571
572
573
574 /* Integer-valued generic attributes.
575 * XXX: the integers just get converted to floats at this time
576 */
577 static void GLAPIENTRY
TAG(VertexAttribI1i)578 TAG(VertexAttribI1i)(GLuint index, GLint x)
579 {
580 GET_CURRENT_CONTEXT(ctx);
581 if (is_vertex_position(ctx, index))
582 ATTR1I(0, x);
583 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
584 ATTR1I(VBO_ATTRIB_GENERIC0 + index, x);
585 else
586 ERROR(GL_INVALID_VALUE);
587 }
588
589 static void GLAPIENTRY
TAG(VertexAttribI2i)590 TAG(VertexAttribI2i)(GLuint index, GLint x, GLint y)
591 {
592 GET_CURRENT_CONTEXT(ctx);
593 if (is_vertex_position(ctx, index))
594 ATTR2I(0, x, y);
595 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
596 ATTR2I(VBO_ATTRIB_GENERIC0 + index, x, y);
597 else
598 ERROR(GL_INVALID_VALUE);
599 }
600
601 static void GLAPIENTRY
TAG(VertexAttribI3i)602 TAG(VertexAttribI3i)(GLuint index, GLint x, GLint y, GLint z)
603 {
604 GET_CURRENT_CONTEXT(ctx);
605 if (is_vertex_position(ctx, index))
606 ATTR3I(0, x, y, z);
607 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
608 ATTR3I(VBO_ATTRIB_GENERIC0 + index, x, y, z);
609 else
610 ERROR(GL_INVALID_VALUE);
611 }
612
613 static void GLAPIENTRY
TAG(VertexAttribI4i)614 TAG(VertexAttribI4i)(GLuint index, GLint x, GLint y, GLint z, GLint w)
615 {
616 GET_CURRENT_CONTEXT(ctx);
617 if (is_vertex_position(ctx, index))
618 ATTR4I(0, x, y, z, w);
619 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
620 ATTR4I(VBO_ATTRIB_GENERIC0 + index, x, y, z, w);
621 else
622 ERROR(GL_INVALID_VALUE);
623 }
624
625 static void GLAPIENTRY
TAG(VertexAttribI2iv)626 TAG(VertexAttribI2iv)(GLuint index, const GLint *v)
627 {
628 GET_CURRENT_CONTEXT(ctx);
629 if (is_vertex_position(ctx, index))
630 ATTR2IV(0, v);
631 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
632 ATTR2IV(VBO_ATTRIB_GENERIC0 + index, v);
633 else
634 ERROR(GL_INVALID_VALUE);
635 }
636
637 static void GLAPIENTRY
TAG(VertexAttribI3iv)638 TAG(VertexAttribI3iv)(GLuint index, const GLint *v)
639 {
640 GET_CURRENT_CONTEXT(ctx);
641 if (is_vertex_position(ctx, index))
642 ATTR3IV(0, v);
643 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
644 ATTR3IV(VBO_ATTRIB_GENERIC0 + index, v);
645 else
646 ERROR(GL_INVALID_VALUE);
647 }
648
649 static void GLAPIENTRY
TAG(VertexAttribI4iv)650 TAG(VertexAttribI4iv)(GLuint index, const GLint *v)
651 {
652 GET_CURRENT_CONTEXT(ctx);
653 if (is_vertex_position(ctx, index))
654 ATTR4IV(0, v);
655 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
656 ATTR4IV(VBO_ATTRIB_GENERIC0 + index, v);
657 else
658 ERROR(GL_INVALID_VALUE);
659 }
660
661
662
663 /* Unsigned integer-valued generic attributes.
664 * XXX: the integers just get converted to floats at this time
665 */
666 static void GLAPIENTRY
TAG(VertexAttribI1ui)667 TAG(VertexAttribI1ui)(GLuint index, GLuint x)
668 {
669 GET_CURRENT_CONTEXT(ctx);
670 if (is_vertex_position(ctx, index))
671 ATTR1UI(0, x);
672 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
673 ATTR1UI(VBO_ATTRIB_GENERIC0 + index, x);
674 else
675 ERROR(GL_INVALID_VALUE);
676 }
677
678 static void GLAPIENTRY
TAG(VertexAttribI2ui)679 TAG(VertexAttribI2ui)(GLuint index, GLuint x, GLuint y)
680 {
681 GET_CURRENT_CONTEXT(ctx);
682 if (is_vertex_position(ctx, index))
683 ATTR2UI(0, x, y);
684 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
685 ATTR2UI(VBO_ATTRIB_GENERIC0 + index, x, y);
686 else
687 ERROR(GL_INVALID_VALUE);
688 }
689
690 static void GLAPIENTRY
TAG(VertexAttribI3ui)691 TAG(VertexAttribI3ui)(GLuint index, GLuint x, GLuint y, GLuint z)
692 {
693 GET_CURRENT_CONTEXT(ctx);
694 if (is_vertex_position(ctx, index))
695 ATTR3UI(0, x, y, z);
696 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
697 ATTR3UI(VBO_ATTRIB_GENERIC0 + index, x, y, z);
698 else
699 ERROR(GL_INVALID_VALUE);
700 }
701
702 static void GLAPIENTRY
TAG(VertexAttribI4ui)703 TAG(VertexAttribI4ui)(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w)
704 {
705 GET_CURRENT_CONTEXT(ctx);
706 if (is_vertex_position(ctx, index))
707 ATTR4UI(0, x, y, z, w);
708 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
709 ATTR4UI(VBO_ATTRIB_GENERIC0 + index, x, y, z, w);
710 else
711 ERROR(GL_INVALID_VALUE);
712 }
713
714 static void GLAPIENTRY
TAG(VertexAttribI2uiv)715 TAG(VertexAttribI2uiv)(GLuint index, const GLuint *v)
716 {
717 GET_CURRENT_CONTEXT(ctx);
718 if (is_vertex_position(ctx, index))
719 ATTR2UIV(0, v);
720 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
721 ATTR2UIV(VBO_ATTRIB_GENERIC0 + index, v);
722 else
723 ERROR(GL_INVALID_VALUE);
724 }
725
726 static void GLAPIENTRY
TAG(VertexAttribI3uiv)727 TAG(VertexAttribI3uiv)(GLuint index, const GLuint *v)
728 {
729 GET_CURRENT_CONTEXT(ctx);
730 if (is_vertex_position(ctx, index))
731 ATTR3UIV(0, v);
732 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
733 ATTR3UIV(VBO_ATTRIB_GENERIC0 + index, v);
734 else
735 ERROR(GL_INVALID_VALUE);
736 }
737
738 static void GLAPIENTRY
TAG(VertexAttribI4uiv)739 TAG(VertexAttribI4uiv)(GLuint index, const GLuint *v)
740 {
741 GET_CURRENT_CONTEXT(ctx);
742 if (is_vertex_position(ctx, index))
743 ATTR4UIV(0, v);
744 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
745 ATTR4UIV(VBO_ATTRIB_GENERIC0 + index, v);
746 else
747 ERROR(GL_INVALID_VALUE);
748 }
749
750
751
752 /* These entrypoints are no longer used for NV_vertex_program but they are
753 * used by the display list and other code specifically because of their
754 * property of aliasing with the legacy Vertex, TexCoord, Normal, etc
755 * attributes. (See vbo_save_loopback.c)
756 */
757 static void GLAPIENTRY
TAG(VertexAttrib1fNV)758 TAG(VertexAttrib1fNV)(GLuint index, GLfloat x)
759 {
760 GET_CURRENT_CONTEXT(ctx);
761 if (index < VBO_ATTRIB_MAX)
762 ATTR1F(index, x);
763 }
764
765 static void GLAPIENTRY
TAG(VertexAttrib1fvNV)766 TAG(VertexAttrib1fvNV)(GLuint index, const GLfloat * v)
767 {
768 GET_CURRENT_CONTEXT(ctx);
769 if (index < VBO_ATTRIB_MAX)
770 ATTR1FV(index, v);
771 }
772
773 static void GLAPIENTRY
TAG(VertexAttrib2fNV)774 TAG(VertexAttrib2fNV)(GLuint index, GLfloat x, GLfloat y)
775 {
776 GET_CURRENT_CONTEXT(ctx);
777 if (index < VBO_ATTRIB_MAX)
778 ATTR2F(index, x, y);
779 }
780
781 static void GLAPIENTRY
TAG(VertexAttrib2fvNV)782 TAG(VertexAttrib2fvNV)(GLuint index, const GLfloat * v)
783 {
784 GET_CURRENT_CONTEXT(ctx);
785 if (index < VBO_ATTRIB_MAX)
786 ATTR2FV(index, v);
787 }
788
789 static void GLAPIENTRY
TAG(VertexAttrib3fNV)790 TAG(VertexAttrib3fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z)
791 {
792 GET_CURRENT_CONTEXT(ctx);
793 if (index < VBO_ATTRIB_MAX)
794 ATTR3F(index, x, y, z);
795 }
796
797 static void GLAPIENTRY
TAG(VertexAttrib3fvNV)798 TAG(VertexAttrib3fvNV)(GLuint index,
799 const GLfloat * v)
800 {
801 GET_CURRENT_CONTEXT(ctx);
802 if (index < VBO_ATTRIB_MAX)
803 ATTR3FV(index, v);
804 }
805
806 static void GLAPIENTRY
TAG(VertexAttrib4fNV)807 TAG(VertexAttrib4fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
808 {
809 GET_CURRENT_CONTEXT(ctx);
810 if (index < VBO_ATTRIB_MAX)
811 ATTR4F(index, x, y, z, w);
812 }
813
814 static void GLAPIENTRY
TAG(VertexAttrib4fvNV)815 TAG(VertexAttrib4fvNV)(GLuint index, const GLfloat * v)
816 {
817 GET_CURRENT_CONTEXT(ctx);
818 if (index < VBO_ATTRIB_MAX)
819 ATTR4FV(index, v);
820 }
821
822 static void GLAPIENTRY
TAG(VertexP2ui)823 TAG(VertexP2ui)(GLenum type, GLuint value)
824 {
825 GET_CURRENT_CONTEXT(ctx);
826 ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glVertexP2ui");
827 ATTR_UI(ctx, 2, type, 0, VBO_ATTRIB_POS, value);
828 }
829
830 static void GLAPIENTRY
TAG(VertexP2uiv)831 TAG(VertexP2uiv)(GLenum type, const GLuint *value)
832 {
833 GET_CURRENT_CONTEXT(ctx);
834 ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glVertexP2uiv");
835 ATTR_UI(ctx, 2, type, 0, VBO_ATTRIB_POS, value[0]);
836 }
837
838 static void GLAPIENTRY
TAG(VertexP3ui)839 TAG(VertexP3ui)(GLenum type, GLuint value)
840 {
841 GET_CURRENT_CONTEXT(ctx);
842 ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glVertexP3ui");
843 ATTR_UI(ctx, 3, type, 0, VBO_ATTRIB_POS, value);
844 }
845
846 static void GLAPIENTRY
TAG(VertexP3uiv)847 TAG(VertexP3uiv)(GLenum type, const GLuint *value)
848 {
849 GET_CURRENT_CONTEXT(ctx);
850 ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glVertexP3uiv");
851 ATTR_UI(ctx, 3, type, 0, VBO_ATTRIB_POS, value[0]);
852 }
853
854 static void GLAPIENTRY
TAG(VertexP4ui)855 TAG(VertexP4ui)(GLenum type, GLuint value)
856 {
857 GET_CURRENT_CONTEXT(ctx);
858 ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glVertexP4ui");
859 ATTR_UI(ctx, 4, type, 0, VBO_ATTRIB_POS, value);
860 }
861
862 static void GLAPIENTRY
TAG(VertexP4uiv)863 TAG(VertexP4uiv)(GLenum type, const GLuint *value)
864 {
865 GET_CURRENT_CONTEXT(ctx);
866 ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glVertexP4uiv");
867 ATTR_UI(ctx, 4, type, 0, VBO_ATTRIB_POS, value[0]);
868 }
869
870 static void GLAPIENTRY
TAG(TexCoordP1ui)871 TAG(TexCoordP1ui)(GLenum type, GLuint coords)
872 {
873 GET_CURRENT_CONTEXT(ctx);
874 ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glTexCoordP1ui");
875 ATTR_UI(ctx, 1, type, 0, VBO_ATTRIB_TEX0, coords);
876 }
877
878 static void GLAPIENTRY
TAG(TexCoordP1uiv)879 TAG(TexCoordP1uiv)(GLenum type, const GLuint *coords)
880 {
881 GET_CURRENT_CONTEXT(ctx);
882 ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glTexCoordP1uiv");
883 ATTR_UI(ctx, 1, type, 0, VBO_ATTRIB_TEX0, coords[0]);
884 }
885
886 static void GLAPIENTRY
TAG(TexCoordP2ui)887 TAG(TexCoordP2ui)(GLenum type, GLuint coords)
888 {
889 GET_CURRENT_CONTEXT(ctx);
890 ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glTexCoordP2ui");
891 ATTR_UI(ctx, 2, type, 0, VBO_ATTRIB_TEX0, coords);
892 }
893
894 static void GLAPIENTRY
TAG(TexCoordP2uiv)895 TAG(TexCoordP2uiv)(GLenum type, const GLuint *coords)
896 {
897 GET_CURRENT_CONTEXT(ctx);
898 ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glTexCoordP2uiv");
899 ATTR_UI(ctx, 2, type, 0, VBO_ATTRIB_TEX0, coords[0]);
900 }
901
902 static void GLAPIENTRY
TAG(TexCoordP3ui)903 TAG(TexCoordP3ui)(GLenum type, GLuint coords)
904 {
905 GET_CURRENT_CONTEXT(ctx);
906 ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glTexCoordP3ui");
907 ATTR_UI(ctx, 3, type, 0, VBO_ATTRIB_TEX0, coords);
908 }
909
910 static void GLAPIENTRY
TAG(TexCoordP3uiv)911 TAG(TexCoordP3uiv)(GLenum type, const GLuint *coords)
912 {
913 GET_CURRENT_CONTEXT(ctx);
914 ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glTexCoordP3uiv");
915 ATTR_UI(ctx, 3, type, 0, VBO_ATTRIB_TEX0, coords[0]);
916 }
917
918 static void GLAPIENTRY
TAG(TexCoordP4ui)919 TAG(TexCoordP4ui)(GLenum type, GLuint coords)
920 {
921 GET_CURRENT_CONTEXT(ctx);
922 ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glTexCoordP4ui");
923 ATTR_UI(ctx, 4, type, 0, VBO_ATTRIB_TEX0, coords);
924 }
925
926 static void GLAPIENTRY
TAG(TexCoordP4uiv)927 TAG(TexCoordP4uiv)(GLenum type, const GLuint *coords)
928 {
929 GET_CURRENT_CONTEXT(ctx);
930 ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glTexCoordP4uiv");
931 ATTR_UI(ctx, 4, type, 0, VBO_ATTRIB_TEX0, coords[0]);
932 }
933
934 static void GLAPIENTRY
TAG(MultiTexCoordP1ui)935 TAG(MultiTexCoordP1ui)(GLenum target, GLenum type, GLuint coords)
936 {
937 GET_CURRENT_CONTEXT(ctx);
938 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
939 ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glMultiTexCoordP1ui");
940 ATTR_UI(ctx, 1, type, 0, attr, coords);
941 }
942
943 static void GLAPIENTRY
TAG(MultiTexCoordP1uiv)944 TAG(MultiTexCoordP1uiv)(GLenum target, GLenum type, const GLuint *coords)
945 {
946 GET_CURRENT_CONTEXT(ctx);
947 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
948 ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glMultiTexCoordP1uiv");
949 ATTR_UI(ctx, 1, type, 0, attr, coords[0]);
950 }
951
952 static void GLAPIENTRY
TAG(MultiTexCoordP2ui)953 TAG(MultiTexCoordP2ui)(GLenum target, GLenum type, GLuint coords)
954 {
955 GET_CURRENT_CONTEXT(ctx);
956 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
957 ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glMultiTexCoordP2ui");
958 ATTR_UI(ctx, 2, type, 0, attr, coords);
959 }
960
961 static void GLAPIENTRY
TAG(MultiTexCoordP2uiv)962 TAG(MultiTexCoordP2uiv)(GLenum target, GLenum type, const GLuint *coords)
963 {
964 GET_CURRENT_CONTEXT(ctx);
965 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
966 ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glMultiTexCoordP2uiv");
967 ATTR_UI(ctx, 2, type, 0, attr, coords[0]);
968 }
969
970 static void GLAPIENTRY
TAG(MultiTexCoordP3ui)971 TAG(MultiTexCoordP3ui)(GLenum target, GLenum type, GLuint coords)
972 {
973 GET_CURRENT_CONTEXT(ctx);
974 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
975 ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glMultiTexCoordP3ui");
976 ATTR_UI(ctx, 3, type, 0, attr, coords);
977 }
978
979 static void GLAPIENTRY
TAG(MultiTexCoordP3uiv)980 TAG(MultiTexCoordP3uiv)(GLenum target, GLenum type, const GLuint *coords)
981 {
982 GET_CURRENT_CONTEXT(ctx);
983 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
984 ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glMultiTexCoordP3uiv");
985 ATTR_UI(ctx, 3, type, 0, attr, coords[0]);
986 }
987
988 static void GLAPIENTRY
TAG(MultiTexCoordP4ui)989 TAG(MultiTexCoordP4ui)(GLenum target, GLenum type, GLuint coords)
990 {
991 GET_CURRENT_CONTEXT(ctx);
992 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
993 ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glMultiTexCoordP4ui");
994 ATTR_UI(ctx, 4, type, 0, attr, coords);
995 }
996
997 static void GLAPIENTRY
TAG(MultiTexCoordP4uiv)998 TAG(MultiTexCoordP4uiv)(GLenum target, GLenum type, const GLuint *coords)
999 {
1000 GET_CURRENT_CONTEXT(ctx);
1001 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
1002 ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glMultiTexCoordP4uiv");
1003 ATTR_UI(ctx, 4, type, 0, attr, coords[0]);
1004 }
1005
1006 static void GLAPIENTRY
TAG(NormalP3ui)1007 TAG(NormalP3ui)(GLenum type, GLuint coords)
1008 {
1009 GET_CURRENT_CONTEXT(ctx);
1010 ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glNormalP3ui");
1011 ATTR_UI(ctx, 3, type, 1, VBO_ATTRIB_NORMAL, coords);
1012 }
1013
1014 static void GLAPIENTRY
TAG(NormalP3uiv)1015 TAG(NormalP3uiv)(GLenum type, const GLuint *coords)
1016 {
1017 GET_CURRENT_CONTEXT(ctx);
1018 ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glNormalP3uiv");
1019 ATTR_UI(ctx, 3, type, 1, VBO_ATTRIB_NORMAL, coords[0]);
1020 }
1021
1022 static void GLAPIENTRY
TAG(ColorP3ui)1023 TAG(ColorP3ui)(GLenum type, GLuint color)
1024 {
1025 GET_CURRENT_CONTEXT(ctx);
1026 ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glColorP3ui");
1027 ATTR_UI(ctx, 3, type, 1, VBO_ATTRIB_COLOR0, color);
1028 }
1029
1030 static void GLAPIENTRY
TAG(ColorP3uiv)1031 TAG(ColorP3uiv)(GLenum type, const GLuint *color)
1032 {
1033 GET_CURRENT_CONTEXT(ctx);
1034 ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glColorP3uiv");
1035 ATTR_UI(ctx, 3, type, 1, VBO_ATTRIB_COLOR0, color[0]);
1036 }
1037
1038 static void GLAPIENTRY
TAG(ColorP4ui)1039 TAG(ColorP4ui)(GLenum type, GLuint color)
1040 {
1041 GET_CURRENT_CONTEXT(ctx);
1042 ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glColorP4ui");
1043 ATTR_UI(ctx, 4, type, 1, VBO_ATTRIB_COLOR0, color);
1044 }
1045
1046 static void GLAPIENTRY
TAG(ColorP4uiv)1047 TAG(ColorP4uiv)(GLenum type, const GLuint *color)
1048 {
1049 GET_CURRENT_CONTEXT(ctx);
1050 ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glColorP4uiv");
1051 ATTR_UI(ctx, 4, type, 1, VBO_ATTRIB_COLOR0, color[0]);
1052 }
1053
1054 static void GLAPIENTRY
TAG(SecondaryColorP3ui)1055 TAG(SecondaryColorP3ui)(GLenum type, GLuint color)
1056 {
1057 GET_CURRENT_CONTEXT(ctx);
1058 ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glSecondaryColorP3ui");
1059 ATTR_UI(ctx, 3, type, 1, VBO_ATTRIB_COLOR1, color);
1060 }
1061
1062 static void GLAPIENTRY
TAG(SecondaryColorP3uiv)1063 TAG(SecondaryColorP3uiv)(GLenum type, const GLuint *color)
1064 {
1065 GET_CURRENT_CONTEXT(ctx);
1066 ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glSecondaryColorP3uiv");
1067 ATTR_UI(ctx, 3, type, 1, VBO_ATTRIB_COLOR1, color[0]);
1068 }
1069
1070 static void GLAPIENTRY
TAG(VertexAttribP1ui)1071 TAG(VertexAttribP1ui)(GLuint index, GLenum type, GLboolean normalized,
1072 GLuint value)
1073 {
1074 GET_CURRENT_CONTEXT(ctx);
1075 ERROR_IF_NOT_PACKED_TYPE_EXT(ctx, type, "glVertexAttribP1ui");
1076 ATTR_UI_INDEX(ctx, 1, type, normalized, index, value);
1077 }
1078
1079 static void GLAPIENTRY
TAG(VertexAttribP2ui)1080 TAG(VertexAttribP2ui)(GLuint index, GLenum type, GLboolean normalized,
1081 GLuint value)
1082 {
1083 GET_CURRENT_CONTEXT(ctx);
1084 ERROR_IF_NOT_PACKED_TYPE_EXT(ctx, type, "glVertexAttribP2ui");
1085 ATTR_UI_INDEX(ctx, 2, type, normalized, index, value);
1086 }
1087
1088 static void GLAPIENTRY
TAG(VertexAttribP3ui)1089 TAG(VertexAttribP3ui)(GLuint index, GLenum type, GLboolean normalized,
1090 GLuint value)
1091 {
1092 GET_CURRENT_CONTEXT(ctx);
1093 ERROR_IF_NOT_PACKED_TYPE_EXT(ctx, type, "glVertexAttribP3ui");
1094 ATTR_UI_INDEX(ctx, 3, type, normalized, index, value);
1095 }
1096
1097 static void GLAPIENTRY
TAG(VertexAttribP4ui)1098 TAG(VertexAttribP4ui)(GLuint index, GLenum type, GLboolean normalized,
1099 GLuint value)
1100 {
1101 GET_CURRENT_CONTEXT(ctx);
1102 ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glVertexAttribP4ui");
1103 ATTR_UI_INDEX(ctx, 4, type, normalized, index, value);
1104 }
1105
1106 static void GLAPIENTRY
TAG(VertexAttribP1uiv)1107 TAG(VertexAttribP1uiv)(GLuint index, GLenum type, GLboolean normalized,
1108 const GLuint *value)
1109 {
1110 GET_CURRENT_CONTEXT(ctx);
1111 ERROR_IF_NOT_PACKED_TYPE_EXT(ctx, type, "glVertexAttribP1uiv");
1112 ATTR_UI_INDEX(ctx, 1, type, normalized, index, *value);
1113 }
1114
1115 static void GLAPIENTRY
TAG(VertexAttribP2uiv)1116 TAG(VertexAttribP2uiv)(GLuint index, GLenum type, GLboolean normalized,
1117 const GLuint *value)
1118 {
1119 GET_CURRENT_CONTEXT(ctx);
1120 ERROR_IF_NOT_PACKED_TYPE_EXT(ctx, type, "glVertexAttribP2uiv");
1121 ATTR_UI_INDEX(ctx, 2, type, normalized, index, *value);
1122 }
1123
1124 static void GLAPIENTRY
TAG(VertexAttribP3uiv)1125 TAG(VertexAttribP3uiv)(GLuint index, GLenum type, GLboolean normalized,
1126 const GLuint *value)
1127 {
1128 GET_CURRENT_CONTEXT(ctx);
1129 ERROR_IF_NOT_PACKED_TYPE_EXT(ctx, type, "glVertexAttribP3uiv");
1130 ATTR_UI_INDEX(ctx, 3, type, normalized, index, *value);
1131 }
1132
1133 static void GLAPIENTRY
TAG(VertexAttribP4uiv)1134 TAG(VertexAttribP4uiv)(GLuint index, GLenum type, GLboolean normalized,
1135 const GLuint *value)
1136 {
1137 GET_CURRENT_CONTEXT(ctx);
1138 ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glVertexAttribP4uiv");
1139 ATTR_UI_INDEX(ctx, 4, type, normalized, index, *value);
1140 }
1141
1142
1143
1144 static void GLAPIENTRY
TAG(VertexAttribL1d)1145 TAG(VertexAttribL1d)(GLuint index, GLdouble x)
1146 {
1147 GET_CURRENT_CONTEXT(ctx);
1148 if (is_vertex_position(ctx, index))
1149 ATTR1D(0, x);
1150 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
1151 ATTR1D(VBO_ATTRIB_GENERIC0 + index, x);
1152 else
1153 ERROR(GL_INVALID_VALUE);
1154 }
1155
1156 static void GLAPIENTRY
TAG(VertexAttribL1dv)1157 TAG(VertexAttribL1dv)(GLuint index, const GLdouble * v)
1158 {
1159 GET_CURRENT_CONTEXT(ctx);
1160 if (is_vertex_position(ctx, index))
1161 ATTR1DV(0, v);
1162 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
1163 ATTR1DV(VBO_ATTRIB_GENERIC0 + index, v);
1164 else
1165 ERROR(GL_INVALID_VALUE);
1166 }
1167
1168 static void GLAPIENTRY
TAG(VertexAttribL2d)1169 TAG(VertexAttribL2d)(GLuint index, GLdouble x, GLdouble y)
1170 {
1171 GET_CURRENT_CONTEXT(ctx);
1172 if (is_vertex_position(ctx, index))
1173 ATTR2D(0, x, y);
1174 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
1175 ATTR2D(VBO_ATTRIB_GENERIC0 + index, x, y);
1176 else
1177 ERROR(GL_INVALID_VALUE);
1178 }
1179
1180 static void GLAPIENTRY
TAG(VertexAttribL2dv)1181 TAG(VertexAttribL2dv)(GLuint index, const GLdouble * v)
1182 {
1183 GET_CURRENT_CONTEXT(ctx);
1184 if (is_vertex_position(ctx, index))
1185 ATTR2DV(0, v);
1186 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
1187 ATTR2DV(VBO_ATTRIB_GENERIC0 + index, v);
1188 else
1189 ERROR(GL_INVALID_VALUE);
1190 }
1191
1192 static void GLAPIENTRY
TAG(VertexAttribL3d)1193 TAG(VertexAttribL3d)(GLuint index, GLdouble x, GLdouble y, GLdouble z)
1194 {
1195 GET_CURRENT_CONTEXT(ctx);
1196 if (is_vertex_position(ctx, index))
1197 ATTR3D(0, x, y, z);
1198 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
1199 ATTR3D(VBO_ATTRIB_GENERIC0 + index, x, y, z);
1200 else
1201 ERROR(GL_INVALID_VALUE);
1202 }
1203
1204 static void GLAPIENTRY
TAG(VertexAttribL3dv)1205 TAG(VertexAttribL3dv)(GLuint index, const GLdouble * v)
1206 {
1207 GET_CURRENT_CONTEXT(ctx);
1208 if (is_vertex_position(ctx, index))
1209 ATTR3DV(0, v);
1210 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
1211 ATTR3DV(VBO_ATTRIB_GENERIC0 + index, v);
1212 else
1213 ERROR(GL_INVALID_VALUE);
1214 }
1215
1216 static void GLAPIENTRY
TAG(VertexAttribL4d)1217 TAG(VertexAttribL4d)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
1218 {
1219 GET_CURRENT_CONTEXT(ctx);
1220 if (is_vertex_position(ctx, index))
1221 ATTR4D(0, x, y, z, w);
1222 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
1223 ATTR4D(VBO_ATTRIB_GENERIC0 + index, x, y, z, w);
1224 else
1225 ERROR(GL_INVALID_VALUE);
1226 }
1227
1228 static void GLAPIENTRY
TAG(VertexAttribL4dv)1229 TAG(VertexAttribL4dv)(GLuint index, const GLdouble * v)
1230 {
1231 GET_CURRENT_CONTEXT(ctx);
1232 if (is_vertex_position(ctx, index))
1233 ATTR4DV(0, v);
1234 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
1235 ATTR4DV(VBO_ATTRIB_GENERIC0 + index, v);
1236 else
1237 ERROR(GL_INVALID_VALUE);
1238 }
1239
1240 static void GLAPIENTRY
TAG(VertexAttribL1ui64ARB)1241 TAG(VertexAttribL1ui64ARB)(GLuint index, GLuint64EXT x)
1242 {
1243 GET_CURRENT_CONTEXT(ctx);
1244 if (is_vertex_position(ctx, index))
1245 ATTR1UI64(0, x);
1246 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
1247 ATTR1UI64(VBO_ATTRIB_GENERIC0 + index, x);
1248 else
1249 ERROR(GL_INVALID_VALUE);
1250 }
1251
1252 static void GLAPIENTRY
TAG(VertexAttribL1ui64vARB)1253 TAG(VertexAttribL1ui64vARB)(GLuint index, const GLuint64EXT *v)
1254 {
1255 GET_CURRENT_CONTEXT(ctx);
1256 if (is_vertex_position(ctx, index))
1257 ATTR1UIV64(0, v);
1258 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
1259 ATTR1UIV64(VBO_ATTRIB_GENERIC0 + index, v);
1260 else
1261 ERROR(GL_INVALID_VALUE);
1262 }
1263
1264 /* GL_NV_half_float */
1265 static void GLAPIENTRY
TAG(Vertex2hNV)1266 TAG(Vertex2hNV)(GLhalfNV x, GLhalfNV y)
1267 {
1268 GET_CURRENT_CONTEXT(ctx);
1269 ATTR2H(VBO_ATTRIB_POS, x, y);
1270 }
1271
1272 static void GLAPIENTRY
TAG(Vertex2hvNV)1273 TAG(Vertex2hvNV)(const GLhalfNV * v)
1274 {
1275 GET_CURRENT_CONTEXT(ctx);
1276 ATTR2HV(VBO_ATTRIB_POS, v);
1277 }
1278
1279 static void GLAPIENTRY
TAG(Vertex3hNV)1280 TAG(Vertex3hNV)(GLhalfNV x, GLhalfNV y, GLhalfNV z)
1281 {
1282 GET_CURRENT_CONTEXT(ctx);
1283 ATTR3H(VBO_ATTRIB_POS, x, y, z);
1284 }
1285
1286 static void GLAPIENTRY
TAG(Vertex3hvNV)1287 TAG(Vertex3hvNV)(const GLhalfNV * v)
1288 {
1289 GET_CURRENT_CONTEXT(ctx);
1290 ATTR3HV(VBO_ATTRIB_POS, v);
1291 }
1292
1293 static void GLAPIENTRY
TAG(Vertex4hNV)1294 TAG(Vertex4hNV)(GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w)
1295 {
1296 GET_CURRENT_CONTEXT(ctx);
1297 ATTR4H(VBO_ATTRIB_POS, x, y, z, w);
1298 }
1299
1300 static void GLAPIENTRY
TAG(Vertex4hvNV)1301 TAG(Vertex4hvNV)(const GLhalfNV * v)
1302 {
1303 GET_CURRENT_CONTEXT(ctx);
1304 ATTR4HV(VBO_ATTRIB_POS, v);
1305 }
1306
1307
1308
1309 static void GLAPIENTRY
TAG(Normal3hNV)1310 TAG(Normal3hNV)(GLhalfNV x, GLhalfNV y, GLhalfNV z)
1311 {
1312 GET_CURRENT_CONTEXT(ctx);
1313 ATTR3H(VBO_ATTRIB_NORMAL, x, y, z);
1314 }
1315
1316 static void GLAPIENTRY
TAG(Normal3hvNV)1317 TAG(Normal3hvNV)(const GLhalfNV * v)
1318 {
1319 GET_CURRENT_CONTEXT(ctx);
1320 ATTR3HV(VBO_ATTRIB_NORMAL, v);
1321 }
1322
1323
1324
1325 static void GLAPIENTRY
TAG(Color3hNV)1326 TAG(Color3hNV)(GLhalfNV x, GLhalfNV y, GLhalfNV z)
1327 {
1328 GET_CURRENT_CONTEXT(ctx);
1329 ATTR3H(VBO_ATTRIB_COLOR0, x, y, z);
1330 }
1331
1332 static void GLAPIENTRY
TAG(Color3hvNV)1333 TAG(Color3hvNV)(const GLhalfNV * v)
1334 {
1335 GET_CURRENT_CONTEXT(ctx);
1336 ATTR3HV(VBO_ATTRIB_COLOR0, v);
1337 }
1338
1339 static void GLAPIENTRY
TAG(Color4hNV)1340 TAG(Color4hNV)(GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w)
1341 {
1342 GET_CURRENT_CONTEXT(ctx);
1343 ATTR4H(VBO_ATTRIB_COLOR0, x, y, z, w);
1344 }
1345
1346 static void GLAPIENTRY
TAG(Color4hvNV)1347 TAG(Color4hvNV)(const GLhalfNV * v)
1348 {
1349 GET_CURRENT_CONTEXT(ctx);
1350 ATTR4HV(VBO_ATTRIB_COLOR0, v);
1351 }
1352
1353
1354
1355 static void GLAPIENTRY
TAG(TexCoord1hNV)1356 TAG(TexCoord1hNV)(GLhalfNV x)
1357 {
1358 GET_CURRENT_CONTEXT(ctx);
1359 ATTR1H(VBO_ATTRIB_TEX0, x);
1360 }
1361
1362 static void GLAPIENTRY
TAG(TexCoord1hvNV)1363 TAG(TexCoord1hvNV)(const GLhalfNV * v)
1364 {
1365 GET_CURRENT_CONTEXT(ctx);
1366 ATTR1HV(VBO_ATTRIB_TEX0, v);
1367 }
1368
1369 static void GLAPIENTRY
TAG(TexCoord2hNV)1370 TAG(TexCoord2hNV)(GLhalfNV x, GLhalfNV y)
1371 {
1372 GET_CURRENT_CONTEXT(ctx);
1373 ATTR2H(VBO_ATTRIB_TEX0, x, y);
1374 }
1375
1376 static void GLAPIENTRY
TAG(TexCoord2hvNV)1377 TAG(TexCoord2hvNV)(const GLhalfNV * v)
1378 {
1379 GET_CURRENT_CONTEXT(ctx);
1380 ATTR2HV(VBO_ATTRIB_TEX0, v);
1381 }
1382
1383 static void GLAPIENTRY
TAG(TexCoord3hNV)1384 TAG(TexCoord3hNV)(GLhalfNV x, GLhalfNV y, GLhalfNV z)
1385 {
1386 GET_CURRENT_CONTEXT(ctx);
1387 ATTR3H(VBO_ATTRIB_TEX0, x, y, z);
1388 }
1389
1390 static void GLAPIENTRY
TAG(TexCoord3hvNV)1391 TAG(TexCoord3hvNV)(const GLhalfNV * v)
1392 {
1393 GET_CURRENT_CONTEXT(ctx);
1394 ATTR3HV(VBO_ATTRIB_TEX0, v);
1395 }
1396
1397 static void GLAPIENTRY
TAG(TexCoord4hNV)1398 TAG(TexCoord4hNV)(GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w)
1399 {
1400 GET_CURRENT_CONTEXT(ctx);
1401 ATTR4H(VBO_ATTRIB_TEX0, x, y, z, w);
1402 }
1403
1404 static void GLAPIENTRY
TAG(TexCoord4hvNV)1405 TAG(TexCoord4hvNV)(const GLhalfNV * v)
1406 {
1407 GET_CURRENT_CONTEXT(ctx);
1408 ATTR4HV(VBO_ATTRIB_TEX0, v);
1409 }
1410
1411
1412
1413 static void GLAPIENTRY
TAG(MultiTexCoord1hNV)1414 TAG(MultiTexCoord1hNV)(GLenum target, GLhalfNV x)
1415 {
1416 GET_CURRENT_CONTEXT(ctx);
1417 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
1418 ATTR1H(attr, x);
1419 }
1420
1421 static void GLAPIENTRY
TAG(MultiTexCoord1hvNV)1422 TAG(MultiTexCoord1hvNV)(GLenum target, const GLhalfNV * v)
1423 {
1424 GET_CURRENT_CONTEXT(ctx);
1425 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
1426 ATTR1HV(attr, v);
1427 }
1428
1429 static void GLAPIENTRY
TAG(MultiTexCoord2hNV)1430 TAG(MultiTexCoord2hNV)(GLenum target, GLhalfNV x, GLhalfNV y)
1431 {
1432 GET_CURRENT_CONTEXT(ctx);
1433 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
1434 ATTR2H(attr, x, y);
1435 }
1436
1437 static void GLAPIENTRY
TAG(MultiTexCoord2hvNV)1438 TAG(MultiTexCoord2hvNV)(GLenum target, const GLhalfNV * v)
1439 {
1440 GET_CURRENT_CONTEXT(ctx);
1441 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
1442 ATTR2HV(attr, v);
1443 }
1444
1445 static void GLAPIENTRY
TAG(MultiTexCoord3hNV)1446 TAG(MultiTexCoord3hNV)(GLenum target, GLhalfNV x, GLhalfNV y, GLhalfNV z)
1447 {
1448 GET_CURRENT_CONTEXT(ctx);
1449 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
1450 ATTR3H(attr, x, y, z);
1451 }
1452
1453 static void GLAPIENTRY
TAG(MultiTexCoord3hvNV)1454 TAG(MultiTexCoord3hvNV)(GLenum target, const GLhalfNV * v)
1455 {
1456 GET_CURRENT_CONTEXT(ctx);
1457 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
1458 ATTR3HV(attr, v);
1459 }
1460
1461 static void GLAPIENTRY
TAG(MultiTexCoord4hNV)1462 TAG(MultiTexCoord4hNV)(GLenum target, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w)
1463 {
1464 GET_CURRENT_CONTEXT(ctx);
1465 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
1466 ATTR4H(attr, x, y, z, w);
1467 }
1468
1469 static void GLAPIENTRY
TAG(MultiTexCoord4hvNV)1470 TAG(MultiTexCoord4hvNV)(GLenum target, const GLhalfNV * v)
1471 {
1472 GET_CURRENT_CONTEXT(ctx);
1473 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
1474 ATTR4HV(attr, v);
1475 }
1476
1477
1478
1479 static void GLAPIENTRY
TAG(FogCoordhNV)1480 TAG(FogCoordhNV)(GLhalf x)
1481 {
1482 GET_CURRENT_CONTEXT(ctx);
1483 ATTR1H(VBO_ATTRIB_FOG, x);
1484 }
1485
1486 static void GLAPIENTRY
TAG(FogCoordhvNV)1487 TAG(FogCoordhvNV)(const GLhalf * v)
1488 {
1489 GET_CURRENT_CONTEXT(ctx);
1490 ATTR1HV(VBO_ATTRIB_FOG, v);
1491 }
1492
1493
1494
1495 static void GLAPIENTRY
TAG(SecondaryColor3hNV)1496 TAG(SecondaryColor3hNV)(GLhalfNV x, GLhalfNV y, GLhalfNV z)
1497 {
1498 GET_CURRENT_CONTEXT(ctx);
1499 ATTR3H(VBO_ATTRIB_COLOR1, x, y, z);
1500 }
1501
1502 static void GLAPIENTRY
TAG(SecondaryColor3hvNV)1503 TAG(SecondaryColor3hvNV)(const GLhalfNV * v)
1504 {
1505 GET_CURRENT_CONTEXT(ctx);
1506 ATTR3HV(VBO_ATTRIB_COLOR1, v);
1507 }
1508
1509
1510 static void GLAPIENTRY
TAG(Color3b)1511 TAG(Color3b)(GLbyte red, GLbyte green, GLbyte blue)
1512 {
1513 GET_CURRENT_CONTEXT(ctx);
1514 ATTR4F(VBO_ATTRIB_COLOR0, BYTE_TO_FLOAT(red),
1515 BYTE_TO_FLOAT(green),
1516 BYTE_TO_FLOAT(blue),
1517 1.0);
1518 }
1519
1520 static void GLAPIENTRY
TAG(Color3d)1521 TAG(Color3d)(GLdouble red, GLdouble green, GLdouble blue)
1522 {
1523 GET_CURRENT_CONTEXT(ctx);
1524 ATTR4F(VBO_ATTRIB_COLOR0, (GLfloat) red, (GLfloat) green, (GLfloat) blue, 1.0);
1525 }
1526
1527 static void GLAPIENTRY
TAG(Color3i)1528 TAG(Color3i)(GLint red, GLint green, GLint blue)
1529 {
1530 GET_CURRENT_CONTEXT(ctx);
1531 ATTR4F(VBO_ATTRIB_COLOR0, INT_TO_FLOAT(red), INT_TO_FLOAT(green),
1532 INT_TO_FLOAT(blue), 1.0);
1533 }
1534
1535 static void GLAPIENTRY
TAG(Color3s)1536 TAG(Color3s)(GLshort red, GLshort green, GLshort blue)
1537 {
1538 GET_CURRENT_CONTEXT(ctx);
1539 ATTR4F(VBO_ATTRIB_COLOR0, SHORT_TO_FLOAT(red), SHORT_TO_FLOAT(green),
1540 SHORT_TO_FLOAT(blue), 1.0);
1541 }
1542
1543 static void GLAPIENTRY
TAG(Color3ui)1544 TAG(Color3ui)(GLuint red, GLuint green, GLuint blue)
1545 {
1546 GET_CURRENT_CONTEXT(ctx);
1547 ATTR4F(VBO_ATTRIB_COLOR0, UINT_TO_FLOAT(red), UINT_TO_FLOAT(green),
1548 UINT_TO_FLOAT(blue), 1.0);
1549 }
1550
1551 static void GLAPIENTRY
TAG(Color3us)1552 TAG(Color3us)(GLushort red, GLushort green, GLushort blue)
1553 {
1554 GET_CURRENT_CONTEXT(ctx);
1555 ATTR4F(VBO_ATTRIB_COLOR0, USHORT_TO_FLOAT(red), USHORT_TO_FLOAT(green),
1556 USHORT_TO_FLOAT(blue), 1.0);
1557 }
1558
1559 static void GLAPIENTRY
TAG(Color3ub)1560 TAG(Color3ub)(GLubyte red, GLubyte green, GLubyte blue)
1561 {
1562 GET_CURRENT_CONTEXT(ctx);
1563 ATTR4F(VBO_ATTRIB_COLOR0, UBYTE_TO_FLOAT(red), UBYTE_TO_FLOAT(green),
1564 UBYTE_TO_FLOAT(blue), 1.0);
1565 }
1566
1567
1568 static void GLAPIENTRY
TAG(Color3bv)1569 TAG(Color3bv)(const GLbyte *v)
1570 {
1571 GET_CURRENT_CONTEXT(ctx);
1572 ATTR4F(VBO_ATTRIB_COLOR0, BYTE_TO_FLOAT(v[0]), BYTE_TO_FLOAT(v[1]),
1573 BYTE_TO_FLOAT(v[2]), 1.0);
1574 }
1575
1576 static void GLAPIENTRY
TAG(Color3dv)1577 TAG(Color3dv)(const GLdouble *v)
1578 {
1579 GET_CURRENT_CONTEXT(ctx);
1580 ATTR4F(VBO_ATTRIB_COLOR0, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0);
1581 }
1582
1583 static void GLAPIENTRY
TAG(Color3iv)1584 TAG(Color3iv)(const GLint *v)
1585 {
1586 GET_CURRENT_CONTEXT(ctx);
1587 ATTR4F(VBO_ATTRIB_COLOR0, INT_TO_FLOAT(v[0]), INT_TO_FLOAT(v[1]),
1588 INT_TO_FLOAT(v[2]), 1.0);
1589 }
1590
1591 static void GLAPIENTRY
TAG(Color3sv)1592 TAG(Color3sv)(const GLshort *v)
1593 {
1594 GET_CURRENT_CONTEXT(ctx);
1595 ATTR4F(VBO_ATTRIB_COLOR0, SHORT_TO_FLOAT(v[0]), SHORT_TO_FLOAT(v[1]),
1596 SHORT_TO_FLOAT(v[2]), 1.0);
1597 }
1598
1599 static void GLAPIENTRY
TAG(Color3uiv)1600 TAG(Color3uiv)(const GLuint *v)
1601 {
1602 GET_CURRENT_CONTEXT(ctx);
1603 ATTR4F(VBO_ATTRIB_COLOR0, UINT_TO_FLOAT(v[0]), UINT_TO_FLOAT(v[1]),
1604 UINT_TO_FLOAT(v[2]), 1.0);
1605 }
1606
1607 static void GLAPIENTRY
TAG(Color3usv)1608 TAG(Color3usv)(const GLushort *v)
1609 {
1610 GET_CURRENT_CONTEXT(ctx);
1611 ATTR4F(VBO_ATTRIB_COLOR0, USHORT_TO_FLOAT(v[0]), USHORT_TO_FLOAT(v[1]),
1612 USHORT_TO_FLOAT(v[2]), 1.0);
1613 }
1614
1615 static void GLAPIENTRY
TAG(Color3ubv)1616 TAG(Color3ubv)(const GLubyte *v)
1617 {
1618 GET_CURRENT_CONTEXT(ctx);
1619 ATTR4F(VBO_ATTRIB_COLOR0, UBYTE_TO_FLOAT(v[0]), UBYTE_TO_FLOAT(v[1]),
1620 UBYTE_TO_FLOAT(v[2]), 1.0);
1621 }
1622
1623
1624 static void GLAPIENTRY
TAG(Color4b)1625 TAG(Color4b)(GLbyte red, GLbyte green, GLbyte blue,
1626 GLbyte alpha)
1627 {
1628 GET_CURRENT_CONTEXT(ctx);
1629 ATTR4F(VBO_ATTRIB_COLOR0, BYTE_TO_FLOAT(red), BYTE_TO_FLOAT(green),
1630 BYTE_TO_FLOAT(blue), BYTE_TO_FLOAT(alpha));
1631 }
1632
1633 static void GLAPIENTRY
TAG(Color4d)1634 TAG(Color4d)(GLdouble red, GLdouble green, GLdouble blue,
1635 GLdouble alpha)
1636 {
1637 GET_CURRENT_CONTEXT(ctx);
1638 ATTR4F(VBO_ATTRIB_COLOR0, (GLfloat) red, (GLfloat) green, (GLfloat) blue, (GLfloat) alpha);
1639 }
1640
1641 static void GLAPIENTRY
TAG(Color4i)1642 TAG(Color4i)(GLint red, GLint green, GLint blue, GLint alpha)
1643 {
1644 GET_CURRENT_CONTEXT(ctx);
1645 ATTR4F(VBO_ATTRIB_COLOR0, INT_TO_FLOAT(red), INT_TO_FLOAT(green),
1646 INT_TO_FLOAT(blue), INT_TO_FLOAT(alpha));
1647 }
1648
1649 static void GLAPIENTRY
TAG(Color4s)1650 TAG(Color4s)(GLshort red, GLshort green, GLshort blue,
1651 GLshort alpha)
1652 {
1653 GET_CURRENT_CONTEXT(ctx);
1654 ATTR4F(VBO_ATTRIB_COLOR0, SHORT_TO_FLOAT(red), SHORT_TO_FLOAT(green),
1655 SHORT_TO_FLOAT(blue), SHORT_TO_FLOAT(alpha));
1656 }
1657
1658 static void GLAPIENTRY
TAG(Color4ui)1659 TAG(Color4ui)(GLuint red, GLuint green, GLuint blue, GLuint alpha)
1660 {
1661 GET_CURRENT_CONTEXT(ctx);
1662 ATTR4F(VBO_ATTRIB_COLOR0, UINT_TO_FLOAT(red), UINT_TO_FLOAT(green),
1663 UINT_TO_FLOAT(blue), UINT_TO_FLOAT(alpha));
1664 }
1665
1666 static void GLAPIENTRY
TAG(Color4us)1667 TAG(Color4us)(GLushort red, GLushort green, GLushort blue, GLushort alpha)
1668 {
1669 GET_CURRENT_CONTEXT(ctx);
1670 ATTR4F(VBO_ATTRIB_COLOR0, USHORT_TO_FLOAT(red), USHORT_TO_FLOAT(green),
1671 USHORT_TO_FLOAT(blue), USHORT_TO_FLOAT(alpha));
1672 }
1673
1674 static void GLAPIENTRY
TAG(Color4ub)1675 TAG(Color4ub)(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)
1676 {
1677 GET_CURRENT_CONTEXT(ctx);
1678 ATTR4F(VBO_ATTRIB_COLOR0, UBYTE_TO_FLOAT(red), UBYTE_TO_FLOAT(green),
1679 UBYTE_TO_FLOAT(blue), UBYTE_TO_FLOAT(alpha));
1680 }
1681
1682
1683 static void GLAPIENTRY
TAG(Color4iv)1684 TAG(Color4iv)(const GLint *v)
1685 {
1686 GET_CURRENT_CONTEXT(ctx);
1687 ATTR4F(VBO_ATTRIB_COLOR0, INT_TO_FLOAT(v[0]), INT_TO_FLOAT(v[1]),
1688 INT_TO_FLOAT(v[2]), INT_TO_FLOAT(v[3]));
1689 }
1690
1691
1692 static void GLAPIENTRY
TAG(Color4bv)1693 TAG(Color4bv)(const GLbyte *v)
1694 {
1695 GET_CURRENT_CONTEXT(ctx);
1696 ATTR4F(VBO_ATTRIB_COLOR0, BYTE_TO_FLOAT(v[0]), BYTE_TO_FLOAT(v[1]),
1697 BYTE_TO_FLOAT(v[2]), BYTE_TO_FLOAT(v[3]));
1698 }
1699
1700 static void GLAPIENTRY
TAG(Color4dv)1701 TAG(Color4dv)(const GLdouble *v)
1702 {
1703 GET_CURRENT_CONTEXT(ctx);
1704 ATTR4F(VBO_ATTRIB_COLOR0, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3]);
1705 }
1706
1707
1708 static void GLAPIENTRY
TAG(Color4sv)1709 TAG(Color4sv)(const GLshort *v)
1710 {
1711 GET_CURRENT_CONTEXT(ctx);
1712 ATTR4F(VBO_ATTRIB_COLOR0, SHORT_TO_FLOAT(v[0]), SHORT_TO_FLOAT(v[1]),
1713 SHORT_TO_FLOAT(v[2]), SHORT_TO_FLOAT(v[3]));
1714 }
1715
1716
1717 static void GLAPIENTRY
TAG(Color4uiv)1718 TAG(Color4uiv)(const GLuint *v)
1719 {
1720 GET_CURRENT_CONTEXT(ctx);
1721 ATTR4F(VBO_ATTRIB_COLOR0, UINT_TO_FLOAT(v[0]), UINT_TO_FLOAT(v[1]),
1722 UINT_TO_FLOAT(v[2]), UINT_TO_FLOAT(v[3]));
1723 }
1724
1725 static void GLAPIENTRY
TAG(Color4usv)1726 TAG(Color4usv)(const GLushort *v)
1727 {
1728 GET_CURRENT_CONTEXT(ctx);
1729 ATTR4F(VBO_ATTRIB_COLOR0, USHORT_TO_FLOAT(v[0]), USHORT_TO_FLOAT(v[1]),
1730 USHORT_TO_FLOAT(v[2]), USHORT_TO_FLOAT(v[3]));
1731 }
1732
1733 static void GLAPIENTRY
TAG(Color4ubv)1734 TAG(Color4ubv)(const GLubyte *v)
1735 {
1736 GET_CURRENT_CONTEXT(ctx);
1737 ATTR4F(VBO_ATTRIB_COLOR0, UBYTE_TO_FLOAT(v[0]), UBYTE_TO_FLOAT(v[1]),
1738 UBYTE_TO_FLOAT(v[2]), UBYTE_TO_FLOAT(v[3]));
1739 }
1740
1741
1742 static void GLAPIENTRY
TAG(FogCoordd)1743 TAG(FogCoordd)(GLdouble d)
1744 {
1745 GET_CURRENT_CONTEXT(ctx);
1746 ATTR1F(VBO_ATTRIB_FOG, (GLfloat) d);
1747 }
1748
1749 static void GLAPIENTRY
TAG(FogCoorddv)1750 TAG(FogCoorddv)(const GLdouble *v)
1751 {
1752 GET_CURRENT_CONTEXT(ctx);
1753 ATTR1F(VBO_ATTRIB_FOG, (GLfloat) *v);
1754 }
1755
1756
1757 static void GLAPIENTRY
TAG(Indexd)1758 TAG(Indexd)(GLdouble c)
1759 {
1760 GET_CURRENT_CONTEXT(ctx);
1761 ATTR1F(VBO_ATTRIB_COLOR_INDEX, (GLfloat) c);
1762 }
1763
1764 static void GLAPIENTRY
TAG(Indexi)1765 TAG(Indexi)(GLint c)
1766 {
1767 GET_CURRENT_CONTEXT(ctx);
1768 ATTR1F(VBO_ATTRIB_COLOR_INDEX, (GLfloat) c);
1769 }
1770
1771 static void GLAPIENTRY
TAG(Indexs)1772 TAG(Indexs)(GLshort c)
1773 {
1774 GET_CURRENT_CONTEXT(ctx);
1775 ATTR1F(VBO_ATTRIB_COLOR_INDEX, (GLfloat) c);
1776 }
1777
1778 static void GLAPIENTRY
TAG(Indexub)1779 TAG(Indexub)(GLubyte c)
1780 {
1781 GET_CURRENT_CONTEXT(ctx);
1782 ATTR1F(VBO_ATTRIB_COLOR_INDEX, (GLfloat) c);
1783 }
1784
1785 static void GLAPIENTRY
TAG(Indexdv)1786 TAG(Indexdv)(const GLdouble *c)
1787 {
1788 GET_CURRENT_CONTEXT(ctx);
1789 ATTR1F(VBO_ATTRIB_COLOR_INDEX, (GLfloat) *c);
1790 }
1791
1792 static void GLAPIENTRY
TAG(Indexiv)1793 TAG(Indexiv)(const GLint *c)
1794 {
1795 GET_CURRENT_CONTEXT(ctx);
1796 ATTR1F(VBO_ATTRIB_COLOR_INDEX, (GLfloat) *c);
1797 }
1798
1799 static void GLAPIENTRY
TAG(Indexsv)1800 TAG(Indexsv)(const GLshort *c)
1801 {
1802 GET_CURRENT_CONTEXT(ctx);
1803 ATTR1F(VBO_ATTRIB_COLOR_INDEX, (GLfloat) *c);
1804 }
1805
1806 static void GLAPIENTRY
TAG(Indexubv)1807 TAG(Indexubv)(const GLubyte *c)
1808 {
1809 GET_CURRENT_CONTEXT(ctx);
1810 ATTR1F(VBO_ATTRIB_COLOR_INDEX, (GLfloat) *c);
1811 }
1812
1813
1814 static void GLAPIENTRY
TAG(EdgeFlagv)1815 TAG(EdgeFlagv)(const GLboolean *flag)
1816 {
1817 GET_CURRENT_CONTEXT(ctx);
1818 ATTR1F(VBO_ATTRIB_EDGEFLAG, (GLfloat)*flag);
1819 }
1820
1821
1822 static void GLAPIENTRY
TAG(Normal3b)1823 TAG(Normal3b)(GLbyte nx, GLbyte ny, GLbyte nz)
1824 {
1825 GET_CURRENT_CONTEXT(ctx);
1826 ATTR3F(VBO_ATTRIB_NORMAL, BYTE_TO_FLOAT(nx), BYTE_TO_FLOAT(ny), BYTE_TO_FLOAT(nz));
1827 }
1828
1829 static void GLAPIENTRY
TAG(Normal3d)1830 TAG(Normal3d)(GLdouble nx, GLdouble ny, GLdouble nz)
1831 {
1832 GET_CURRENT_CONTEXT(ctx);
1833 ATTR3F(VBO_ATTRIB_NORMAL, (GLfloat) nx, (GLfloat) ny, (GLfloat) nz);
1834 }
1835
1836 static void GLAPIENTRY
TAG(Normal3i)1837 TAG(Normal3i)(GLint nx, GLint ny, GLint nz)
1838 {
1839 GET_CURRENT_CONTEXT(ctx);
1840 ATTR3F(VBO_ATTRIB_NORMAL, INT_TO_FLOAT(nx), INT_TO_FLOAT(ny), INT_TO_FLOAT(nz));
1841 }
1842
1843 static void GLAPIENTRY
TAG(Normal3s)1844 TAG(Normal3s)(GLshort nx, GLshort ny, GLshort nz)
1845 {
1846 GET_CURRENT_CONTEXT(ctx);
1847 ATTR3F(VBO_ATTRIB_NORMAL, SHORT_TO_FLOAT(nx), SHORT_TO_FLOAT(ny), SHORT_TO_FLOAT(nz));
1848 }
1849
1850 static void GLAPIENTRY
TAG(Normal3bv)1851 TAG(Normal3bv)(const GLbyte *v)
1852 {
1853 GET_CURRENT_CONTEXT(ctx);
1854 ATTR3F(VBO_ATTRIB_NORMAL, BYTE_TO_FLOAT(v[0]), BYTE_TO_FLOAT(v[1]), BYTE_TO_FLOAT(v[2]));
1855 }
1856
1857 static void GLAPIENTRY
TAG(Normal3dv)1858 TAG(Normal3dv)(const GLdouble *v)
1859 {
1860 GET_CURRENT_CONTEXT(ctx);
1861 ATTR3F(VBO_ATTRIB_NORMAL, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2]);
1862 }
1863
1864 static void GLAPIENTRY
TAG(Normal3iv)1865 TAG(Normal3iv)(const GLint *v)
1866 {
1867 GET_CURRENT_CONTEXT(ctx);
1868 ATTR3F(VBO_ATTRIB_NORMAL, INT_TO_FLOAT(v[0]), INT_TO_FLOAT(v[1]), INT_TO_FLOAT(v[2]));
1869 }
1870
1871 static void GLAPIENTRY
TAG(Normal3sv)1872 TAG(Normal3sv)(const GLshort *v)
1873 {
1874 GET_CURRENT_CONTEXT(ctx);
1875 ATTR3F(VBO_ATTRIB_NORMAL, SHORT_TO_FLOAT(v[0]), SHORT_TO_FLOAT(v[1]), SHORT_TO_FLOAT(v[2]));
1876 }
1877
1878 static void GLAPIENTRY
TAG(TexCoord1d)1879 TAG(TexCoord1d)(GLdouble s)
1880 {
1881 GET_CURRENT_CONTEXT(ctx);
1882 ATTR1F(VBO_ATTRIB_TEX0, (GLfloat) s);
1883 }
1884
1885 static void GLAPIENTRY
TAG(TexCoord1i)1886 TAG(TexCoord1i)(GLint s)
1887 {
1888 GET_CURRENT_CONTEXT(ctx);
1889 ATTR1F(VBO_ATTRIB_TEX0, (GLfloat) s);
1890 }
1891
1892 static void GLAPIENTRY
TAG(TexCoord1s)1893 TAG(TexCoord1s)(GLshort s)
1894 {
1895 GET_CURRENT_CONTEXT(ctx);
1896 ATTR1F(VBO_ATTRIB_TEX0, (GLfloat) s);
1897 }
1898
1899 static void GLAPIENTRY
TAG(TexCoord2d)1900 TAG(TexCoord2d)(GLdouble s, GLdouble t)
1901 {
1902 GET_CURRENT_CONTEXT(ctx);
1903 ATTR2F(VBO_ATTRIB_TEX0, (GLfloat) s,(GLfloat) t);
1904 }
1905
1906 static void GLAPIENTRY
TAG(TexCoord2s)1907 TAG(TexCoord2s)(GLshort s, GLshort t)
1908 {
1909 GET_CURRENT_CONTEXT(ctx);
1910 ATTR2F(VBO_ATTRIB_TEX0, (GLfloat) s,(GLfloat) t);
1911 }
1912
1913 static void GLAPIENTRY
TAG(TexCoord2i)1914 TAG(TexCoord2i)(GLint s, GLint t)
1915 {
1916 GET_CURRENT_CONTEXT(ctx);
1917 ATTR2F(VBO_ATTRIB_TEX0, (GLfloat) s,(GLfloat) t);
1918 }
1919
1920 static void GLAPIENTRY
TAG(TexCoord3d)1921 TAG(TexCoord3d)(GLdouble s, GLdouble t, GLdouble r)
1922 {
1923 GET_CURRENT_CONTEXT(ctx);
1924 ATTR3F(VBO_ATTRIB_TEX0, (GLfloat) s,(GLfloat) t,(GLfloat) r);
1925 }
1926
1927 static void GLAPIENTRY
TAG(TexCoord3i)1928 TAG(TexCoord3i)(GLint s, GLint t, GLint r)
1929 {
1930 GET_CURRENT_CONTEXT(ctx);
1931 ATTR3F(VBO_ATTRIB_TEX0, (GLfloat) s,(GLfloat) t,(GLfloat) r);
1932 }
1933
1934 static void GLAPIENTRY
TAG(TexCoord3s)1935 TAG(TexCoord3s)(GLshort s, GLshort t, GLshort r)
1936 {
1937 GET_CURRENT_CONTEXT(ctx);
1938 ATTR3F(VBO_ATTRIB_TEX0, (GLfloat) s,(GLfloat) t,(GLfloat) r);
1939 }
1940
1941 static void GLAPIENTRY
TAG(TexCoord4d)1942 TAG(TexCoord4d)(GLdouble s, GLdouble t, GLdouble r, GLdouble q)
1943 {
1944 GET_CURRENT_CONTEXT(ctx);
1945 ATTR4F(VBO_ATTRIB_TEX0, (GLfloat) s,(GLfloat) t,(GLfloat) r,(GLfloat) q);
1946 }
1947
1948 static void GLAPIENTRY
TAG(TexCoord4i)1949 TAG(TexCoord4i)(GLint s, GLint t, GLint r, GLint q)
1950 {
1951 GET_CURRENT_CONTEXT(ctx);
1952 ATTR4F(VBO_ATTRIB_TEX0, (GLfloat) s,(GLfloat) t,(GLfloat) r,(GLfloat) q);
1953 }
1954
1955 static void GLAPIENTRY
TAG(TexCoord4s)1956 TAG(TexCoord4s)(GLshort s, GLshort t, GLshort r, GLshort q)
1957 {
1958 GET_CURRENT_CONTEXT(ctx);
1959 ATTR4F(VBO_ATTRIB_TEX0, (GLfloat) s,(GLfloat) t,(GLfloat) r,(GLfloat) q);
1960 }
1961
1962 static void GLAPIENTRY
TAG(TexCoord1dv)1963 TAG(TexCoord1dv)(const GLdouble *v)
1964 {
1965 GET_CURRENT_CONTEXT(ctx);
1966 ATTR1F(VBO_ATTRIB_TEX0, (GLfloat) v[0]);
1967 }
1968
1969 static void GLAPIENTRY
TAG(TexCoord1iv)1970 TAG(TexCoord1iv)(const GLint *v)
1971 {
1972 GET_CURRENT_CONTEXT(ctx);
1973 ATTR1F(VBO_ATTRIB_TEX0, (GLfloat) v[0]);
1974 }
1975
1976 static void GLAPIENTRY
TAG(TexCoord1sv)1977 TAG(TexCoord1sv)(const GLshort *v)
1978 {
1979 GET_CURRENT_CONTEXT(ctx);
1980 ATTR1F(VBO_ATTRIB_TEX0, (GLfloat) v[0]);
1981 }
1982
1983 static void GLAPIENTRY
TAG(TexCoord2dv)1984 TAG(TexCoord2dv)(const GLdouble *v)
1985 {
1986 GET_CURRENT_CONTEXT(ctx);
1987 ATTR2F(VBO_ATTRIB_TEX0, (GLfloat) v[0],(GLfloat) v[1]);
1988 }
1989
1990 static void GLAPIENTRY
TAG(TexCoord2iv)1991 TAG(TexCoord2iv)(const GLint *v)
1992 {
1993 GET_CURRENT_CONTEXT(ctx);
1994 ATTR2F(VBO_ATTRIB_TEX0, (GLfloat) v[0],(GLfloat) v[1]);
1995 }
1996
1997 static void GLAPIENTRY
TAG(TexCoord2sv)1998 TAG(TexCoord2sv)(const GLshort *v)
1999 {
2000 GET_CURRENT_CONTEXT(ctx);
2001 ATTR2F(VBO_ATTRIB_TEX0, (GLfloat) v[0],(GLfloat) v[1]);
2002 }
2003
2004 static void GLAPIENTRY
TAG(TexCoord3dv)2005 TAG(TexCoord3dv)(const GLdouble *v)
2006 {
2007 GET_CURRENT_CONTEXT(ctx);
2008 ATTR3F(VBO_ATTRIB_TEX0, (GLfloat) v[0],(GLfloat) v[1],(GLfloat) v[2]);
2009 }
2010
2011 static void GLAPIENTRY
TAG(TexCoord3iv)2012 TAG(TexCoord3iv)(const GLint *v)
2013 {
2014 GET_CURRENT_CONTEXT(ctx);
2015 ATTR3F(VBO_ATTRIB_TEX0, (GLfloat) v[0],(GLfloat) v[1],(GLfloat) v[2]);
2016 }
2017
2018 static void GLAPIENTRY
TAG(TexCoord3sv)2019 TAG(TexCoord3sv)(const GLshort *v)
2020 {
2021 GET_CURRENT_CONTEXT(ctx);
2022 ATTR3F(VBO_ATTRIB_TEX0, (GLfloat) v[0],(GLfloat) v[1],(GLfloat) v[2]);
2023 }
2024
2025 static void GLAPIENTRY
TAG(TexCoord4dv)2026 TAG(TexCoord4dv)(const GLdouble *v)
2027 {
2028 GET_CURRENT_CONTEXT(ctx);
2029 ATTR4F(VBO_ATTRIB_TEX0, (GLfloat) v[0],(GLfloat) v[1],(GLfloat) v[2],(GLfloat) v[3]);
2030 }
2031
2032 static void GLAPIENTRY
TAG(TexCoord4iv)2033 TAG(TexCoord4iv)(const GLint *v)
2034 {
2035 GET_CURRENT_CONTEXT(ctx);
2036 ATTR4F(VBO_ATTRIB_TEX0, (GLfloat) v[0],(GLfloat) v[1],(GLfloat) v[2],(GLfloat) v[3]);
2037 }
2038
2039 static void GLAPIENTRY
TAG(TexCoord4sv)2040 TAG(TexCoord4sv)(const GLshort *v)
2041 {
2042 GET_CURRENT_CONTEXT(ctx);
2043 ATTR4F(VBO_ATTRIB_TEX0, (GLfloat) v[0],(GLfloat) v[1],(GLfloat) v[2],(GLfloat) v[3]);
2044 }
2045
2046 static void GLAPIENTRY
TAG(Vertex2d)2047 TAG(Vertex2d)(GLdouble x, GLdouble y)
2048 {
2049 GET_CURRENT_CONTEXT(ctx);
2050 ATTR2F(VBO_ATTRIB_POS, (GLfloat) x, (GLfloat) y);
2051 }
2052
2053 static void GLAPIENTRY
TAG(Vertex2i)2054 TAG(Vertex2i)(GLint x, GLint y)
2055 {
2056 GET_CURRENT_CONTEXT(ctx);
2057 ATTR2F(VBO_ATTRIB_POS, (GLfloat) x, (GLfloat) y);
2058 }
2059
2060 static void GLAPIENTRY
TAG(Vertex2s)2061 TAG(Vertex2s)(GLshort x, GLshort y)
2062 {
2063 GET_CURRENT_CONTEXT(ctx);
2064 ATTR2F(VBO_ATTRIB_POS, (GLfloat) x, (GLfloat) y);
2065 }
2066
2067 static void GLAPIENTRY
TAG(Vertex3d)2068 TAG(Vertex3d)(GLdouble x, GLdouble y, GLdouble z)
2069 {
2070 GET_CURRENT_CONTEXT(ctx);
2071 ATTR3F(VBO_ATTRIB_POS, (GLfloat) x, (GLfloat) y, (GLfloat) z);
2072 }
2073
2074 static void GLAPIENTRY
TAG(Vertex3i)2075 TAG(Vertex3i)(GLint x, GLint y, GLint z)
2076 {
2077 GET_CURRENT_CONTEXT(ctx);
2078 ATTR3F(VBO_ATTRIB_POS, (GLfloat) x, (GLfloat) y, (GLfloat) z);
2079 }
2080
2081 static void GLAPIENTRY
TAG(Vertex3s)2082 TAG(Vertex3s)(GLshort x, GLshort y, GLshort z)
2083 {
2084 GET_CURRENT_CONTEXT(ctx);
2085 ATTR3F(VBO_ATTRIB_POS, (GLfloat) x, (GLfloat) y, (GLfloat) z);
2086 }
2087
2088 static void GLAPIENTRY
TAG(Vertex4d)2089 TAG(Vertex4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
2090 {
2091 GET_CURRENT_CONTEXT(ctx);
2092 ATTR4F(VBO_ATTRIB_POS, (GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w);
2093 }
2094
2095 static void GLAPIENTRY
TAG(Vertex4i)2096 TAG(Vertex4i)(GLint x, GLint y, GLint z, GLint w)
2097 {
2098 GET_CURRENT_CONTEXT(ctx);
2099 ATTR4F(VBO_ATTRIB_POS, (GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w);
2100 }
2101
2102 static void GLAPIENTRY
TAG(Vertex4s)2103 TAG(Vertex4s)(GLshort x, GLshort y, GLshort z, GLshort w)
2104 {
2105 GET_CURRENT_CONTEXT(ctx);
2106 ATTR4F(VBO_ATTRIB_POS, (GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w);
2107 }
2108
2109 static void GLAPIENTRY
TAG(Vertex2dv)2110 TAG(Vertex2dv)(const GLdouble *v)
2111 {
2112 GET_CURRENT_CONTEXT(ctx);
2113 ATTR2F(VBO_ATTRIB_POS, (GLfloat) v[0], (GLfloat) v[1]);
2114 }
2115
2116 static void GLAPIENTRY
TAG(Vertex2iv)2117 TAG(Vertex2iv)(const GLint *v)
2118 {
2119 GET_CURRENT_CONTEXT(ctx);
2120 ATTR2F(VBO_ATTRIB_POS, (GLfloat) v[0], (GLfloat) v[1]);
2121 }
2122
2123 static void GLAPIENTRY
TAG(Vertex2sv)2124 TAG(Vertex2sv)(const GLshort *v)
2125 {
2126 GET_CURRENT_CONTEXT(ctx);
2127 ATTR2F(VBO_ATTRIB_POS, (GLfloat) v[0], (GLfloat) v[1]);
2128 }
2129
2130 static void GLAPIENTRY
TAG(Vertex3dv)2131 TAG(Vertex3dv)(const GLdouble *v)
2132 {
2133 GET_CURRENT_CONTEXT(ctx);
2134 ATTR3F(VBO_ATTRIB_POS, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2]);
2135 }
2136
2137 static void GLAPIENTRY
TAG(Vertex3iv)2138 TAG(Vertex3iv)(const GLint *v)
2139 {
2140 GET_CURRENT_CONTEXT(ctx);
2141 ATTR3F(VBO_ATTRIB_POS, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2]);
2142 }
2143
2144 static void GLAPIENTRY
TAG(Vertex3sv)2145 TAG(Vertex3sv)(const GLshort *v)
2146 {
2147 GET_CURRENT_CONTEXT(ctx);
2148 ATTR3F(VBO_ATTRIB_POS, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2]);
2149 }
2150
2151 static void GLAPIENTRY
TAG(Vertex4dv)2152 TAG(Vertex4dv)(const GLdouble *v)
2153 {
2154 GET_CURRENT_CONTEXT(ctx);
2155 ATTR4F(VBO_ATTRIB_POS, (GLfloat) v[0], (GLfloat) v[1],
2156 (GLfloat) v[2], (GLfloat) v[3]);
2157 }
2158
2159 static void GLAPIENTRY
TAG(Vertex4iv)2160 TAG(Vertex4iv)(const GLint *v)
2161 {
2162 GET_CURRENT_CONTEXT(ctx);
2163 ATTR4F(VBO_ATTRIB_POS, (GLfloat) v[0], (GLfloat) v[1],
2164 (GLfloat) v[2], (GLfloat) v[3]);
2165 }
2166
2167 static void GLAPIENTRY
TAG(Vertex4sv)2168 TAG(Vertex4sv)(const GLshort *v)
2169 {
2170 GET_CURRENT_CONTEXT(ctx);
2171 ATTR4F(VBO_ATTRIB_POS, (GLfloat) v[0], (GLfloat) v[1],
2172 (GLfloat) v[2], (GLfloat) v[3]);
2173 }
2174
2175 static void GLAPIENTRY
TAG(MultiTexCoord1d)2176 TAG(MultiTexCoord1d)(GLenum target, GLdouble s)
2177 {
2178 GET_CURRENT_CONTEXT(ctx);
2179 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
2180 ATTR1F(attr, (GLfloat) s);
2181 }
2182
2183 static void GLAPIENTRY
TAG(MultiTexCoord1dv)2184 TAG(MultiTexCoord1dv)(GLenum target, const GLdouble *v)
2185 {
2186 GET_CURRENT_CONTEXT(ctx);
2187 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
2188 ATTR1F(attr, (GLfloat) v[0]);
2189 }
2190
2191 static void GLAPIENTRY
TAG(MultiTexCoord1i)2192 TAG(MultiTexCoord1i)(GLenum target, GLint s)
2193 {
2194 GET_CURRENT_CONTEXT(ctx);
2195 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
2196 ATTR1F(attr, (GLfloat) s);
2197 }
2198
2199 static void GLAPIENTRY
TAG(MultiTexCoord1iv)2200 TAG(MultiTexCoord1iv)(GLenum target, const GLint *v)
2201 {
2202 GET_CURRENT_CONTEXT(ctx);
2203 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
2204 ATTR1F(attr, (GLfloat) v[0]);
2205 }
2206
2207 static void GLAPIENTRY
TAG(MultiTexCoord1s)2208 TAG(MultiTexCoord1s)(GLenum target, GLshort s)
2209 {
2210 GET_CURRENT_CONTEXT(ctx);
2211 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
2212 ATTR1F(attr, (GLfloat) s);
2213 }
2214
2215 static void GLAPIENTRY
TAG(MultiTexCoord1sv)2216 TAG(MultiTexCoord1sv)(GLenum target, const GLshort *v)
2217 {
2218 GET_CURRENT_CONTEXT(ctx);
2219 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
2220 ATTR1F(attr, (GLfloat) v[0]);
2221 }
2222
2223 static void GLAPIENTRY
TAG(MultiTexCoord2d)2224 TAG(MultiTexCoord2d)(GLenum target, GLdouble s, GLdouble t)
2225 {
2226 GET_CURRENT_CONTEXT(ctx);
2227 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
2228 ATTR2F(attr, (GLfloat) s, (GLfloat) t);
2229 }
2230
2231 static void GLAPIENTRY
TAG(MultiTexCoord2dv)2232 TAG(MultiTexCoord2dv)(GLenum target, const GLdouble *v)
2233 {
2234 GET_CURRENT_CONTEXT(ctx);
2235 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
2236 ATTR2F(attr, (GLfloat) v[0], (GLfloat) v[1]);
2237 }
2238
2239 static void GLAPIENTRY
TAG(MultiTexCoord2i)2240 TAG(MultiTexCoord2i)(GLenum target, GLint s, GLint t)
2241 {
2242 GET_CURRENT_CONTEXT(ctx);
2243 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
2244 ATTR2F(attr, (GLfloat) s, (GLfloat) t);
2245 }
2246
2247 static void GLAPIENTRY
TAG(MultiTexCoord2iv)2248 TAG(MultiTexCoord2iv)(GLenum target, const GLint *v)
2249 {
2250 GET_CURRENT_CONTEXT(ctx);
2251 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
2252 ATTR2F(attr, (GLfloat) v[0], (GLfloat) v[1]);
2253 }
2254
2255 static void GLAPIENTRY
TAG(MultiTexCoord2s)2256 TAG(MultiTexCoord2s)(GLenum target, GLshort s, GLshort t)
2257 {
2258 GET_CURRENT_CONTEXT(ctx);
2259 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
2260 ATTR2F(attr, (GLfloat) s, (GLfloat) t);
2261 }
2262
2263 static void GLAPIENTRY
TAG(MultiTexCoord2sv)2264 TAG(MultiTexCoord2sv)(GLenum target, const GLshort *v)
2265 {
2266 GET_CURRENT_CONTEXT(ctx);
2267 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
2268 ATTR2F(attr, (GLfloat) v[0], (GLfloat) v[1]);
2269 }
2270
2271 static void GLAPIENTRY
TAG(MultiTexCoord3d)2272 TAG(MultiTexCoord3d)(GLenum target, GLdouble s, GLdouble t, GLdouble r)
2273 {
2274 GET_CURRENT_CONTEXT(ctx);
2275 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
2276 ATTR3F(attr, (GLfloat) s, (GLfloat) t, (GLfloat) r);
2277 }
2278
2279 static void GLAPIENTRY
TAG(MultiTexCoord3dv)2280 TAG(MultiTexCoord3dv)(GLenum target, const GLdouble *v)
2281 {
2282 GET_CURRENT_CONTEXT(ctx);
2283 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
2284 ATTR3F(attr, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2]);
2285 }
2286
2287 static void GLAPIENTRY
TAG(MultiTexCoord3i)2288 TAG(MultiTexCoord3i)(GLenum target, GLint s, GLint t, GLint r)
2289 {
2290 GET_CURRENT_CONTEXT(ctx);
2291 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
2292 ATTR3F(attr, (GLfloat) s, (GLfloat) t, (GLfloat) r);
2293 }
2294
2295 static void GLAPIENTRY
TAG(MultiTexCoord3iv)2296 TAG(MultiTexCoord3iv)(GLenum target, const GLint *v)
2297 {
2298 GET_CURRENT_CONTEXT(ctx);
2299 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
2300 ATTR3F(attr, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2]);
2301 }
2302
2303 static void GLAPIENTRY
TAG(MultiTexCoord3s)2304 TAG(MultiTexCoord3s)(GLenum target, GLshort s, GLshort t, GLshort r)
2305 {
2306 GET_CURRENT_CONTEXT(ctx);
2307 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
2308 ATTR3F(attr, (GLfloat) s, (GLfloat) t, (GLfloat) r);
2309 }
2310
2311 static void GLAPIENTRY
TAG(MultiTexCoord3sv)2312 TAG(MultiTexCoord3sv)(GLenum target, const GLshort *v)
2313 {
2314 GET_CURRENT_CONTEXT(ctx);
2315 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
2316 ATTR3F(attr, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2]);
2317 }
2318
2319 static void GLAPIENTRY
TAG(MultiTexCoord4d)2320 TAG(MultiTexCoord4d)(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q)
2321 {
2322 GET_CURRENT_CONTEXT(ctx);
2323 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
2324 ATTR4F(attr, (GLfloat) s, (GLfloat) t, (GLfloat) r, (GLfloat) q);
2325 }
2326
2327 static void GLAPIENTRY
TAG(MultiTexCoord4dv)2328 TAG(MultiTexCoord4dv)(GLenum target, const GLdouble *v)
2329 {
2330 GET_CURRENT_CONTEXT(ctx);
2331 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
2332 ATTR4F(attr, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3]);
2333 }
2334
2335 static void GLAPIENTRY
TAG(MultiTexCoord4i)2336 TAG(MultiTexCoord4i)(GLenum target, GLint s, GLint t, GLint r, GLint q)
2337 {
2338 GET_CURRENT_CONTEXT(ctx);
2339 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
2340 ATTR4F(attr, (GLfloat) s, (GLfloat) t, (GLfloat) r, (GLfloat) q);
2341 }
2342
2343 static void GLAPIENTRY
TAG(MultiTexCoord4iv)2344 TAG(MultiTexCoord4iv)(GLenum target, const GLint *v)
2345 {
2346 GET_CURRENT_CONTEXT(ctx);
2347 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
2348 ATTR4F(attr, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3]);
2349 }
2350
2351 static void GLAPIENTRY
TAG(MultiTexCoord4s)2352 TAG(MultiTexCoord4s)(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q)
2353 {
2354 GET_CURRENT_CONTEXT(ctx);
2355 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
2356 ATTR4F(attr, (GLfloat) s, (GLfloat) t, (GLfloat) r, (GLfloat) q);
2357 }
2358
2359 static void GLAPIENTRY
TAG(MultiTexCoord4sv)2360 TAG(MultiTexCoord4sv)(GLenum target, const GLshort *v)
2361 {
2362 GET_CURRENT_CONTEXT(ctx);
2363 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
2364 ATTR4F(attr, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3]);
2365 }
2366
2367
2368 static void GLAPIENTRY
TAG(EvalCoord2dv)2369 TAG(EvalCoord2dv)(const GLdouble *u)
2370 {
2371 TAG(EvalCoord2f)((GLfloat) u[0], (GLfloat) u[1]);
2372 }
2373
2374 static void GLAPIENTRY
TAG(EvalCoord2d)2375 TAG(EvalCoord2d)(GLdouble u, GLdouble v)
2376 {
2377 TAG(EvalCoord2f)((GLfloat) u, (GLfloat) v);
2378 }
2379
2380 static void GLAPIENTRY
TAG(EvalCoord1dv)2381 TAG(EvalCoord1dv)(const GLdouble *u)
2382 {
2383 TAG(EvalCoord1f)((GLfloat) *u);
2384 }
2385
2386 static void GLAPIENTRY
TAG(EvalCoord1d)2387 TAG(EvalCoord1d)(GLdouble u)
2388 {
2389 TAG(EvalCoord1f)((GLfloat) u);
2390 }
2391
2392
2393 static void GLAPIENTRY
TAG(Materialf)2394 TAG(Materialf)(GLenum face, GLenum pname, GLfloat param)
2395 {
2396 GLfloat fparam[4];
2397 fparam[0] = param;
2398 TAG(Materialfv)(face, pname, fparam);
2399 }
2400
2401 static void GLAPIENTRY
TAG(Materiali)2402 TAG(Materiali)(GLenum face, GLenum pname, GLint param)
2403 {
2404 GLfloat p[4];
2405 p[0] = (GLfloat) param;
2406 TAG(Materialfv)(face, pname, p);
2407 }
2408
2409 static void GLAPIENTRY
TAG(Materialiv)2410 TAG(Materialiv)(GLenum face, GLenum pname, const GLint *params)
2411 {
2412 GLfloat fparam[4];
2413 switch (pname) {
2414 case GL_AMBIENT:
2415 case GL_DIFFUSE:
2416 case GL_SPECULAR:
2417 case GL_EMISSION:
2418 case GL_AMBIENT_AND_DIFFUSE:
2419 fparam[0] = INT_TO_FLOAT(params[0]);
2420 fparam[1] = INT_TO_FLOAT(params[1]);
2421 fparam[2] = INT_TO_FLOAT(params[2]);
2422 fparam[3] = INT_TO_FLOAT(params[3]);
2423 break;
2424 case GL_SHININESS:
2425 fparam[0] = (GLfloat) params[0];
2426 break;
2427 case GL_COLOR_INDEXES:
2428 fparam[0] = (GLfloat) params[0];
2429 fparam[1] = (GLfloat) params[1];
2430 fparam[2] = (GLfloat) params[2];
2431 break;
2432 default:
2433 ;
2434 }
2435 TAG(Materialfv)(face, pname, fparam);
2436 }
2437
2438
2439 static void GLAPIENTRY
TAG(SecondaryColor3b)2440 TAG(SecondaryColor3b)(GLbyte red, GLbyte green, GLbyte blue)
2441 {
2442 GET_CURRENT_CONTEXT(ctx);
2443 ATTR3F(VBO_ATTRIB_COLOR1, BYTE_TO_FLOAT(red),
2444 BYTE_TO_FLOAT(green),
2445 BYTE_TO_FLOAT(blue));
2446 }
2447
2448 static void GLAPIENTRY
TAG(SecondaryColor3d)2449 TAG(SecondaryColor3d)(GLdouble red, GLdouble green, GLdouble blue)
2450 {
2451 GET_CURRENT_CONTEXT(ctx);
2452 ATTR3F(VBO_ATTRIB_COLOR1, (GLfloat) red, (GLfloat) green, (GLfloat) blue);
2453 }
2454
2455 static void GLAPIENTRY
TAG(SecondaryColor3i)2456 TAG(SecondaryColor3i)(GLint red, GLint green, GLint blue)
2457 {
2458 GET_CURRENT_CONTEXT(ctx);
2459 ATTR3F(VBO_ATTRIB_COLOR1, INT_TO_FLOAT(red),
2460 INT_TO_FLOAT(green),
2461 INT_TO_FLOAT(blue));
2462 }
2463
2464 static void GLAPIENTRY
TAG(SecondaryColor3s)2465 TAG(SecondaryColor3s)(GLshort red, GLshort green, GLshort blue)
2466 {
2467 GET_CURRENT_CONTEXT(ctx);
2468 ATTR3F(VBO_ATTRIB_COLOR1, SHORT_TO_FLOAT(red),
2469 SHORT_TO_FLOAT(green),
2470 SHORT_TO_FLOAT(blue));
2471 }
2472
2473 static void GLAPIENTRY
TAG(SecondaryColor3ui)2474 TAG(SecondaryColor3ui)(GLuint red, GLuint green, GLuint blue)
2475 {
2476 GET_CURRENT_CONTEXT(ctx);
2477 ATTR3F(VBO_ATTRIB_COLOR1, UINT_TO_FLOAT(red),
2478 UINT_TO_FLOAT(green),
2479 UINT_TO_FLOAT(blue));
2480 }
2481
2482 static void GLAPIENTRY
TAG(SecondaryColor3us)2483 TAG(SecondaryColor3us)(GLushort red, GLushort green, GLushort blue)
2484 {
2485 GET_CURRENT_CONTEXT(ctx);
2486 ATTR3F(VBO_ATTRIB_COLOR1, USHORT_TO_FLOAT(red),
2487 USHORT_TO_FLOAT(green),
2488 USHORT_TO_FLOAT(blue));
2489 }
2490
2491 static void GLAPIENTRY
TAG(SecondaryColor3ub)2492 TAG(SecondaryColor3ub)(GLubyte red, GLubyte green, GLubyte blue)
2493 {
2494 GET_CURRENT_CONTEXT(ctx);
2495 ATTR3F(VBO_ATTRIB_COLOR1, UBYTE_TO_FLOAT(red),
2496 UBYTE_TO_FLOAT(green),
2497 UBYTE_TO_FLOAT(blue));
2498 }
2499
2500 static void GLAPIENTRY
TAG(SecondaryColor3bv)2501 TAG(SecondaryColor3bv)(const GLbyte *v)
2502 {
2503 GET_CURRENT_CONTEXT(ctx);
2504 ATTR3F(VBO_ATTRIB_COLOR1, BYTE_TO_FLOAT(v[0]),
2505 BYTE_TO_FLOAT(v[1]),
2506 BYTE_TO_FLOAT(v[2]));
2507 }
2508
2509 static void GLAPIENTRY
TAG(SecondaryColor3dv)2510 TAG(SecondaryColor3dv)(const GLdouble *v)
2511 {
2512 GET_CURRENT_CONTEXT(ctx);
2513 ATTR3F(VBO_ATTRIB_COLOR1, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2]);
2514 }
2515
2516 static void GLAPIENTRY
TAG(SecondaryColor3iv)2517 TAG(SecondaryColor3iv)(const GLint *v)
2518 {
2519 GET_CURRENT_CONTEXT(ctx);
2520 ATTR3F(VBO_ATTRIB_COLOR1, INT_TO_FLOAT(v[0]),
2521 INT_TO_FLOAT(v[1]),
2522 INT_TO_FLOAT(v[2]));
2523 }
2524
2525 static void GLAPIENTRY
TAG(SecondaryColor3sv)2526 TAG(SecondaryColor3sv)(const GLshort *v)
2527 {
2528 GET_CURRENT_CONTEXT(ctx);
2529 ATTR3F(VBO_ATTRIB_COLOR1, SHORT_TO_FLOAT(v[0]),
2530 SHORT_TO_FLOAT(v[1]),
2531 SHORT_TO_FLOAT(v[2]));
2532 }
2533
2534 static void GLAPIENTRY
TAG(SecondaryColor3uiv)2535 TAG(SecondaryColor3uiv)(const GLuint *v)
2536 {
2537 GET_CURRENT_CONTEXT(ctx);
2538 ATTR3F(VBO_ATTRIB_COLOR1, UINT_TO_FLOAT(v[0]),
2539 UINT_TO_FLOAT(v[1]),
2540 UINT_TO_FLOAT(v[2]));
2541 }
2542
2543 static void GLAPIENTRY
TAG(SecondaryColor3usv)2544 TAG(SecondaryColor3usv)(const GLushort *v)
2545 {
2546 GET_CURRENT_CONTEXT(ctx);
2547 ATTR3F(VBO_ATTRIB_COLOR1, USHORT_TO_FLOAT(v[0]),
2548 USHORT_TO_FLOAT(v[1]),
2549 USHORT_TO_FLOAT(v[2]));
2550 }
2551
2552 static void GLAPIENTRY
TAG(SecondaryColor3ubv)2553 TAG(SecondaryColor3ubv)(const GLubyte *v)
2554 {
2555 GET_CURRENT_CONTEXT(ctx);
2556 ATTR3F(VBO_ATTRIB_COLOR1, UBYTE_TO_FLOAT(v[0]),
2557 UBYTE_TO_FLOAT(v[1]),
2558 UBYTE_TO_FLOAT(v[2]));
2559 }
2560
2561
2562 /*
2563 * GL_NV_vertex_program:
2564 * Note that attribute indexes DO alias conventional vertex attributes.
2565 */
2566
2567 static void GLAPIENTRY
TAG(VertexAttrib1sNV)2568 TAG(VertexAttrib1sNV)(GLuint index, GLshort x)
2569 {
2570 GET_CURRENT_CONTEXT(ctx);
2571 if (index < VBO_ATTRIB_MAX) ATTR1F(index, (GLfloat) x);
2572 }
2573
2574 static void GLAPIENTRY
TAG(VertexAttrib1dNV)2575 TAG(VertexAttrib1dNV)(GLuint index, GLdouble x)
2576 {
2577 GET_CURRENT_CONTEXT(ctx);
2578 if (index < VBO_ATTRIB_MAX) ATTR1F(index, (GLfloat) x);
2579 }
2580
2581 static void GLAPIENTRY
TAG(VertexAttrib2sNV)2582 TAG(VertexAttrib2sNV)(GLuint index, GLshort x, GLshort y)
2583 {
2584 GET_CURRENT_CONTEXT(ctx);
2585 if (index < VBO_ATTRIB_MAX) ATTR2F(index, (GLfloat) x, y);
2586 }
2587
2588 static void GLAPIENTRY
TAG(VertexAttrib2dNV)2589 TAG(VertexAttrib2dNV)(GLuint index, GLdouble x, GLdouble y)
2590 {
2591 GET_CURRENT_CONTEXT(ctx);
2592 if (index < VBO_ATTRIB_MAX) ATTR2F(index, (GLfloat) x, (GLfloat) y);
2593 }
2594
2595 static void GLAPIENTRY
TAG(VertexAttrib3sNV)2596 TAG(VertexAttrib3sNV)(GLuint index, GLshort x, GLshort y, GLshort z)
2597 {
2598 GET_CURRENT_CONTEXT(ctx);
2599 if (index < VBO_ATTRIB_MAX) ATTR3F(index, (GLfloat) x, (GLfloat) y, (GLfloat) z);
2600 }
2601
2602 static void GLAPIENTRY
TAG(VertexAttrib3dNV)2603 TAG(VertexAttrib3dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z)
2604 {
2605 GET_CURRENT_CONTEXT(ctx);
2606 if (index < VBO_ATTRIB_MAX) ATTR4F(index, (GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F);
2607 }
2608
2609 static void GLAPIENTRY
TAG(VertexAttrib4sNV)2610 TAG(VertexAttrib4sNV)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w)
2611 {
2612 GET_CURRENT_CONTEXT(ctx);
2613 if (index < VBO_ATTRIB_MAX) ATTR4F(index, (GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w);
2614 }
2615
2616 static void GLAPIENTRY
TAG(VertexAttrib4dNV)2617 TAG(VertexAttrib4dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
2618 {
2619 GET_CURRENT_CONTEXT(ctx);
2620 if (index < VBO_ATTRIB_MAX) ATTR4F(index, (GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w);
2621 }
2622
2623 static void GLAPIENTRY
TAG(VertexAttrib4ubNV)2624 TAG(VertexAttrib4ubNV)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w)
2625 {
2626 GET_CURRENT_CONTEXT(ctx);
2627 if (index < VBO_ATTRIB_MAX) ATTR4F(index, UBYTE_TO_FLOAT(x), UBYTE_TO_FLOAT(y),
2628 UBYTE_TO_FLOAT(z), UBYTE_TO_FLOAT(w));
2629 }
2630
2631 static void GLAPIENTRY
TAG(VertexAttrib1svNV)2632 TAG(VertexAttrib1svNV)(GLuint index, const GLshort *v)
2633 {
2634 GET_CURRENT_CONTEXT(ctx);
2635 if (index < VBO_ATTRIB_MAX) ATTR1F(index, (GLfloat) v[0]);
2636 }
2637
2638 static void GLAPIENTRY
TAG(VertexAttrib1dvNV)2639 TAG(VertexAttrib1dvNV)(GLuint index, const GLdouble *v)
2640 {
2641 GET_CURRENT_CONTEXT(ctx);
2642 if (index < VBO_ATTRIB_MAX) ATTR1F(index, (GLfloat) v[0]);
2643 }
2644
2645 static void GLAPIENTRY
TAG(VertexAttrib2svNV)2646 TAG(VertexAttrib2svNV)(GLuint index, const GLshort *v)
2647 {
2648 GET_CURRENT_CONTEXT(ctx);
2649 if (index < VBO_ATTRIB_MAX) ATTR2F(index, (GLfloat) v[0], (GLfloat) v[1]);
2650 }
2651
2652 static void GLAPIENTRY
TAG(VertexAttrib2dvNV)2653 TAG(VertexAttrib2dvNV)(GLuint index, const GLdouble *v)
2654 {
2655 GET_CURRENT_CONTEXT(ctx);
2656 if (index < VBO_ATTRIB_MAX) ATTR2F(index, (GLfloat) v[0], (GLfloat) v[1]);
2657 }
2658
2659 static void GLAPIENTRY
TAG(VertexAttrib3svNV)2660 TAG(VertexAttrib3svNV)(GLuint index, const GLshort *v)
2661 {
2662 GET_CURRENT_CONTEXT(ctx);
2663 if (index < VBO_ATTRIB_MAX) ATTR3F(index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2]);
2664 }
2665
2666 static void GLAPIENTRY
TAG(VertexAttrib3dvNV)2667 TAG(VertexAttrib3dvNV)(GLuint index, const GLdouble *v)
2668 {
2669 GET_CURRENT_CONTEXT(ctx);
2670 if (index < VBO_ATTRIB_MAX) ATTR3F(index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2]);
2671 }
2672
2673 static void GLAPIENTRY
TAG(VertexAttrib4svNV)2674 TAG(VertexAttrib4svNV)(GLuint index, const GLshort *v)
2675 {
2676 GET_CURRENT_CONTEXT(ctx);
2677 if (index < VBO_ATTRIB_MAX) ATTR4F(index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2],
2678 (GLfloat)v[3]);
2679 }
2680
2681 static void GLAPIENTRY
TAG(VertexAttrib4dvNV)2682 TAG(VertexAttrib4dvNV)(GLuint index, const GLdouble *v)
2683 {
2684 GET_CURRENT_CONTEXT(ctx);
2685 if (index < VBO_ATTRIB_MAX) ATTR4F(index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3]);
2686 }
2687
2688 static void GLAPIENTRY
TAG(VertexAttrib4ubvNV)2689 TAG(VertexAttrib4ubvNV)(GLuint index, const GLubyte *v)
2690 {
2691 GET_CURRENT_CONTEXT(ctx);
2692 if (index < VBO_ATTRIB_MAX) ATTR4F(index, UBYTE_TO_FLOAT(v[0]), UBYTE_TO_FLOAT(v[1]),
2693 UBYTE_TO_FLOAT(v[2]), UBYTE_TO_FLOAT(v[3]));
2694 }
2695
2696
2697 static void GLAPIENTRY
TAG(VertexAttribs1svNV)2698 TAG(VertexAttribs1svNV)(GLuint index, GLsizei n, const GLshort *v)
2699 {
2700 GET_CURRENT_CONTEXT(ctx);
2701 GLint i;
2702 n = MIN2(n, VBO_ATTRIB_MAX - index);
2703 for (i = n - 1; i >= 0; i--)
2704 ATTR1F(index + i, (GLfloat) v[i]);
2705 }
2706
2707 static void GLAPIENTRY
TAG(VertexAttribs1fvNV)2708 TAG(VertexAttribs1fvNV)(GLuint index, GLsizei n, const GLfloat *v)
2709 {
2710 GET_CURRENT_CONTEXT(ctx);
2711 GLint i;
2712 n = MIN2(n, VBO_ATTRIB_MAX - index);
2713 for (i = n - 1; i >= 0; i--)
2714 ATTR1F(index + i, v[i]);
2715 }
2716
2717 static void GLAPIENTRY
TAG(VertexAttribs1dvNV)2718 TAG(VertexAttribs1dvNV)(GLuint index, GLsizei n, const GLdouble *v)
2719 {
2720 GET_CURRENT_CONTEXT(ctx);
2721 GLint i;
2722 n = MIN2(n, VBO_ATTRIB_MAX - index);
2723 for (i = n - 1; i >= 0; i--)
2724 ATTR1F(index + i, (GLfloat) v[i]);
2725 }
2726
2727 static void GLAPIENTRY
TAG(VertexAttribs2svNV)2728 TAG(VertexAttribs2svNV)(GLuint index, GLsizei n, const GLshort *v)
2729 {
2730 GET_CURRENT_CONTEXT(ctx);
2731 GLint i;
2732 n = MIN2(n, VBO_ATTRIB_MAX - index);
2733 for (i = n - 1; i >= 0; i--)
2734 ATTR2F(index + i, (GLfloat) v[2 * i], (GLfloat) v[2 * i + 1]);
2735 }
2736
2737 static void GLAPIENTRY
TAG(VertexAttribs2fvNV)2738 TAG(VertexAttribs2fvNV)(GLuint index, GLsizei n, const GLfloat *v)
2739 {
2740 GET_CURRENT_CONTEXT(ctx);
2741 GLint i;
2742 n = MIN2(n, VBO_ATTRIB_MAX - index);
2743 for (i = n - 1; i >= 0; i--)
2744 ATTR2F(index + i, v[2 * i], v[2 * i + 1]);
2745 }
2746
2747 static void GLAPIENTRY
TAG(VertexAttribs2dvNV)2748 TAG(VertexAttribs2dvNV)(GLuint index, GLsizei n, const GLdouble *v)
2749 {
2750 GET_CURRENT_CONTEXT(ctx);
2751 GLint i;
2752 n = MIN2(n, VBO_ATTRIB_MAX - index);
2753 for (i = n - 1; i >= 0; i--)
2754 ATTR2F(index + i, (GLfloat) v[2 * i], (GLfloat) v[2 * i + 1]);
2755 }
2756
2757 static void GLAPIENTRY
TAG(VertexAttribs3svNV)2758 TAG(VertexAttribs3svNV)(GLuint index, GLsizei n, const GLshort *v)
2759 {
2760 GET_CURRENT_CONTEXT(ctx);
2761 GLint i;
2762 n = MIN2(n, VBO_ATTRIB_MAX - index);
2763 for (i = n - 1; i >= 0; i--)
2764 ATTR3F(index + i, (GLfloat) v[3 * i], (GLfloat) v[3 * i + 1], (GLfloat) v[3 * i + 2]);
2765 }
2766
2767 static void GLAPIENTRY
TAG(VertexAttribs3fvNV)2768 TAG(VertexAttribs3fvNV)(GLuint index, GLsizei n, const GLfloat *v)
2769 {
2770 GET_CURRENT_CONTEXT(ctx);
2771 GLint i;
2772 n = MIN2(n, VBO_ATTRIB_MAX - index);
2773 for (i = n - 1; i >= 0; i--)
2774 ATTR3F(index + i, v[3 * i], v[3 * i + 1], v[3 * i + 2]);
2775 }
2776
2777 static void GLAPIENTRY
TAG(VertexAttribs3dvNV)2778 TAG(VertexAttribs3dvNV)(GLuint index, GLsizei n, const GLdouble *v)
2779 {
2780 GET_CURRENT_CONTEXT(ctx);
2781 GLint i;
2782 n = MIN2(n, VBO_ATTRIB_MAX - index);
2783 for (i = n - 1; i >= 0; i--)
2784 ATTR3F(index + i, (GLfloat) v[3 * i], (GLfloat) v[3 * i + 1], (GLfloat) v[3 * i + 2]);
2785 }
2786
2787 static void GLAPIENTRY
TAG(VertexAttribs4svNV)2788 TAG(VertexAttribs4svNV)(GLuint index, GLsizei n, const GLshort *v)
2789 {
2790 GET_CURRENT_CONTEXT(ctx);
2791 GLint i;
2792 n = MIN2(n, VBO_ATTRIB_MAX - index);
2793 for (i = n - 1; i >= 0; i--)
2794 ATTR4F(index + i, (GLfloat) v[4 * i], (GLfloat) v[4 * i + 1], (GLfloat) v[4 * i + 2], (GLfloat) v[4 * i + 3]);
2795 }
2796
2797 static void GLAPIENTRY
TAG(VertexAttribs4fvNV)2798 TAG(VertexAttribs4fvNV)(GLuint index, GLsizei n, const GLfloat *v)
2799 {
2800 GET_CURRENT_CONTEXT(ctx);
2801 GLint i;
2802 n = MIN2(n, VBO_ATTRIB_MAX - index);
2803 for (i = n - 1; i >= 0; i--)
2804 ATTR4F(index + i, v[4 * i], v[4 * i + 1], v[4 * i + 2], v[4 * i + 3]);
2805 }
2806
2807 static void GLAPIENTRY
TAG(VertexAttribs4dvNV)2808 TAG(VertexAttribs4dvNV)(GLuint index, GLsizei n, const GLdouble *v)
2809 {
2810 GET_CURRENT_CONTEXT(ctx);
2811 GLint i;
2812 n = MIN2(n, VBO_ATTRIB_MAX - index);
2813 for (i = n - 1; i >= 0; i--)
2814 ATTR4F(index + i, (GLfloat) v[4 * i], (GLfloat) v[4 * i + 1], (GLfloat) v[4 * i + 2], (GLfloat) v[4 * i + 3]);
2815 }
2816
2817 static void GLAPIENTRY
TAG(VertexAttribs4ubvNV)2818 TAG(VertexAttribs4ubvNV)(GLuint index, GLsizei n, const GLubyte *v)
2819 {
2820 GET_CURRENT_CONTEXT(ctx);
2821 GLint i;
2822 n = MIN2(n, VBO_ATTRIB_MAX - index);
2823 for (i = n - 1; i >= 0; i--)
2824 ATTR4F(index + i, UBYTE_TO_FLOAT(v[4 * i]), UBYTE_TO_FLOAT(v[4 * i + 1]),
2825 UBYTE_TO_FLOAT(v[4 * i + 2]), UBYTE_TO_FLOAT(v[4 * i + 3]));
2826 }
2827
2828
2829 /*
2830 * GL_ARB_vertex_program
2831 * Note that attribute indexes do NOT alias conventional attributes.
2832 */
2833
2834 static void GLAPIENTRY
TAG(VertexAttrib1s)2835 TAG(VertexAttrib1s)(GLuint index, GLshort x)
2836 {
2837 GET_CURRENT_CONTEXT(ctx);
2838 if (is_vertex_position(ctx, index))
2839 ATTR1F(0, (GLfloat) x);
2840 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
2841 ATTR1F(VBO_ATTRIB_GENERIC0 + index, (GLfloat) x);
2842 else
2843 ERROR(GL_INVALID_VALUE);
2844 }
2845
2846 static void GLAPIENTRY
TAG(VertexAttrib1d)2847 TAG(VertexAttrib1d)(GLuint index, GLdouble x)
2848 {
2849 GET_CURRENT_CONTEXT(ctx);
2850 if (is_vertex_position(ctx, index))
2851 ATTR1F(0, (GLfloat) x);
2852 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
2853 ATTR1F(VBO_ATTRIB_GENERIC0 + index, (GLfloat) x);
2854 else
2855 ERROR(GL_INVALID_VALUE);
2856 }
2857
2858 static void GLAPIENTRY
TAG(VertexAttrib2s)2859 TAG(VertexAttrib2s)(GLuint index, GLshort x, GLshort y)
2860 {
2861 GET_CURRENT_CONTEXT(ctx);
2862 if (is_vertex_position(ctx, index))
2863 ATTR2F(0, (GLfloat) x, (GLfloat) y);
2864 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
2865 ATTR2F(VBO_ATTRIB_GENERIC0 + index, (GLfloat) x, (GLfloat) y);
2866 else
2867 ERROR(GL_INVALID_VALUE);
2868 }
2869
2870 static void GLAPIENTRY
TAG(VertexAttrib2d)2871 TAG(VertexAttrib2d)(GLuint index, GLdouble x, GLdouble y)
2872 {
2873 GET_CURRENT_CONTEXT(ctx);
2874 if (is_vertex_position(ctx, index))
2875 ATTR2F(0, (GLfloat) x, (GLfloat) y);
2876 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
2877 ATTR2F(VBO_ATTRIB_GENERIC0 + index, (GLfloat) x, (GLfloat) y);
2878 else
2879 ERROR(GL_INVALID_VALUE);
2880 }
2881
2882 static void GLAPIENTRY
TAG(VertexAttrib3s)2883 TAG(VertexAttrib3s)(GLuint index, GLshort x, GLshort y, GLshort z)
2884 {
2885 GET_CURRENT_CONTEXT(ctx);
2886 if (is_vertex_position(ctx, index))
2887 ATTR3F(0, (GLfloat) x, (GLfloat) y, (GLfloat) z);
2888 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
2889 ATTR3F(VBO_ATTRIB_GENERIC0 + index, (GLfloat) x, (GLfloat) y, (GLfloat) z);
2890 else
2891 ERROR(GL_INVALID_VALUE);
2892 }
2893
2894 static void GLAPIENTRY
TAG(VertexAttrib3d)2895 TAG(VertexAttrib3d)(GLuint index, GLdouble x, GLdouble y, GLdouble z)
2896 {
2897 GET_CURRENT_CONTEXT(ctx);
2898 if (is_vertex_position(ctx, index))
2899 ATTR3F(0, (GLfloat) x, (GLfloat) y, (GLfloat) z);
2900 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
2901 ATTR3F(VBO_ATTRIB_GENERIC0 + index, (GLfloat) x, (GLfloat) y, (GLfloat) z);
2902 else
2903 ERROR(GL_INVALID_VALUE);
2904 }
2905
2906 static void GLAPIENTRY
TAG(VertexAttrib4s)2907 TAG(VertexAttrib4s)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w)
2908 {
2909 GET_CURRENT_CONTEXT(ctx);
2910 if (is_vertex_position(ctx, index))
2911 ATTR4F(0, (GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w);
2912 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
2913 ATTR4F(VBO_ATTRIB_GENERIC0 + index, (GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w);
2914 else
2915 ERROR(GL_INVALID_VALUE);
2916 }
2917
2918 static void GLAPIENTRY
TAG(VertexAttrib4d)2919 TAG(VertexAttrib4d)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
2920 {
2921 GET_CURRENT_CONTEXT(ctx);
2922 if (is_vertex_position(ctx, index))
2923 ATTR4F(0, (GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w);
2924 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
2925 ATTR4F(VBO_ATTRIB_GENERIC0 + index, (GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w);
2926 else
2927 ERROR(GL_INVALID_VALUE);
2928 }
2929
2930 static void GLAPIENTRY
TAG(VertexAttrib1sv)2931 TAG(VertexAttrib1sv)(GLuint index, const GLshort *v)
2932 {
2933 GET_CURRENT_CONTEXT(ctx);
2934 if (is_vertex_position(ctx, index))
2935 ATTR1F(0, (GLfloat) v[0]);
2936 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
2937 ATTR1F(VBO_ATTRIB_GENERIC0 + index, (GLfloat) v[0]);
2938 else
2939 ERROR(GL_INVALID_VALUE);
2940 }
2941
2942 static void GLAPIENTRY
TAG(VertexAttrib1dv)2943 TAG(VertexAttrib1dv)(GLuint index, const GLdouble *v)
2944 {
2945 GET_CURRENT_CONTEXT(ctx);
2946 if (is_vertex_position(ctx, index))
2947 ATTR1F(0, (GLfloat) v[0]);
2948 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
2949 ATTR1F(VBO_ATTRIB_GENERIC0 + index, (GLfloat) v[0]);
2950 else
2951 ERROR(GL_INVALID_VALUE);
2952 }
2953
2954 static void GLAPIENTRY
TAG(VertexAttrib2sv)2955 TAG(VertexAttrib2sv)(GLuint index, const GLshort *v)
2956 {
2957 GET_CURRENT_CONTEXT(ctx);
2958 if (is_vertex_position(ctx, index))
2959 ATTR2F(0, (GLfloat) v[0], (GLfloat) v[1]);
2960 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
2961 ATTR2F(VBO_ATTRIB_GENERIC0 + index, (GLfloat) v[0], (GLfloat) v[1]);
2962 else
2963 ERROR(GL_INVALID_VALUE);
2964 }
2965
2966 static void GLAPIENTRY
TAG(VertexAttrib2dv)2967 TAG(VertexAttrib2dv)(GLuint index, const GLdouble *v)
2968 {
2969 GET_CURRENT_CONTEXT(ctx);
2970 if (is_vertex_position(ctx, index))
2971 ATTR2F(0, (GLfloat) v[0], (GLfloat) v[1]);
2972 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
2973 ATTR2F(VBO_ATTRIB_GENERIC0 + index, (GLfloat) v[0], (GLfloat) v[1]);
2974 else
2975 ERROR(GL_INVALID_VALUE);
2976 }
2977
2978 static void GLAPIENTRY
TAG(VertexAttrib3sv)2979 TAG(VertexAttrib3sv)(GLuint index, const GLshort *v)
2980 {
2981 GET_CURRENT_CONTEXT(ctx);
2982 if (is_vertex_position(ctx, index))
2983 ATTR3F(0, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2]);
2984 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
2985 ATTR3F(VBO_ATTRIB_GENERIC0 + index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2]);
2986 else
2987 ERROR(GL_INVALID_VALUE);
2988 }
2989
2990 static void GLAPIENTRY
TAG(VertexAttrib3dv)2991 TAG(VertexAttrib3dv)(GLuint index, const GLdouble *v)
2992 {
2993 GET_CURRENT_CONTEXT(ctx);
2994 if (is_vertex_position(ctx, index))
2995 ATTR3F(0, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2]);
2996 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
2997 ATTR3F(VBO_ATTRIB_GENERIC0 + index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2]);
2998 else
2999 ERROR(GL_INVALID_VALUE);
3000 }
3001
3002 static void GLAPIENTRY
TAG(VertexAttrib4sv)3003 TAG(VertexAttrib4sv)(GLuint index, const GLshort *v)
3004 {
3005 GET_CURRENT_CONTEXT(ctx);
3006 if (is_vertex_position(ctx, index))
3007 ATTR4F(0, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat)v[3]);
3008 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
3009 ATTR4F(VBO_ATTRIB_GENERIC0 + index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat)v[3]);
3010 else
3011 ERROR(GL_INVALID_VALUE);
3012 }
3013
3014 static void GLAPIENTRY
TAG(VertexAttrib4dv)3015 TAG(VertexAttrib4dv)(GLuint index, const GLdouble *v)
3016 {
3017 GET_CURRENT_CONTEXT(ctx);
3018 if (is_vertex_position(ctx, index))
3019 ATTR4F(0, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat)v[3]);
3020 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
3021 ATTR4F(VBO_ATTRIB_GENERIC0 + index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat)v[3]);
3022 else
3023 ERROR(GL_INVALID_VALUE);
3024 }
3025
3026 static void GLAPIENTRY
TAG(VertexAttrib4bv)3027 TAG(VertexAttrib4bv)(GLuint index, const GLbyte * v)
3028 {
3029 GET_CURRENT_CONTEXT(ctx);
3030 if (is_vertex_position(ctx, index))
3031 ATTR4F(0, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat)v[3]);
3032 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
3033 ATTR4F(VBO_ATTRIB_GENERIC0 + index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat)v[3]);
3034 else
3035 ERROR(GL_INVALID_VALUE);
3036 }
3037
3038 static void GLAPIENTRY
TAG(VertexAttrib4iv)3039 TAG(VertexAttrib4iv)(GLuint index, const GLint * v)
3040 {
3041 GET_CURRENT_CONTEXT(ctx);
3042 if (is_vertex_position(ctx, index))
3043 ATTR4F(0, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat)v[3]);
3044 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
3045 ATTR4F(VBO_ATTRIB_GENERIC0 + index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat)v[3]);
3046 else
3047 ERROR(GL_INVALID_VALUE);
3048 }
3049
3050 static void GLAPIENTRY
TAG(VertexAttrib4ubv)3051 TAG(VertexAttrib4ubv)(GLuint index, const GLubyte * v)
3052 {
3053 GET_CURRENT_CONTEXT(ctx);
3054 if (is_vertex_position(ctx, index))
3055 ATTR4F(0, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat)v[3]);
3056 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
3057 ATTR4F(VBO_ATTRIB_GENERIC0 + index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat)v[3]);
3058 else
3059 ERROR(GL_INVALID_VALUE);
3060 }
3061
3062 static void GLAPIENTRY
TAG(VertexAttrib4usv)3063 TAG(VertexAttrib4usv)(GLuint index, const GLushort * v)
3064 {
3065 GET_CURRENT_CONTEXT(ctx);
3066 if (is_vertex_position(ctx, index))
3067 ATTR4F(0, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat)v[3]);
3068 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
3069 ATTR4F(VBO_ATTRIB_GENERIC0 + index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat)v[3]);
3070 else
3071 ERROR(GL_INVALID_VALUE);
3072 }
3073
3074 static void GLAPIENTRY
TAG(VertexAttrib4uiv)3075 TAG(VertexAttrib4uiv)(GLuint index, const GLuint * v)
3076 {
3077 GET_CURRENT_CONTEXT(ctx);
3078 if (is_vertex_position(ctx, index))
3079 ATTR4F(0, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat)v[3]);
3080 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
3081 ATTR4F(VBO_ATTRIB_GENERIC0 + index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat)v[3]);
3082 else
3083 ERROR(GL_INVALID_VALUE);
3084 }
3085
3086 static void GLAPIENTRY
TAG(VertexAttrib4Nbv)3087 TAG(VertexAttrib4Nbv)(GLuint index, const GLbyte * v)
3088 {
3089 GET_CURRENT_CONTEXT(ctx);
3090 if (is_vertex_position(ctx, index))
3091 ATTR4F(0, BYTE_TO_FLOAT(v[0]), BYTE_TO_FLOAT(v[1]), BYTE_TO_FLOAT(v[2]), BYTE_TO_FLOAT(v[3]));
3092 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
3093 ATTR4F(VBO_ATTRIB_GENERIC0 + index, BYTE_TO_FLOAT(v[0]), BYTE_TO_FLOAT(v[1]), BYTE_TO_FLOAT(v[2]), BYTE_TO_FLOAT(v[3]));
3094 else
3095 ERROR(GL_INVALID_VALUE);
3096 }
3097
3098 static void GLAPIENTRY
TAG(VertexAttrib4Nsv)3099 TAG(VertexAttrib4Nsv)(GLuint index, const GLshort * v)
3100 {
3101 GET_CURRENT_CONTEXT(ctx);
3102 if (is_vertex_position(ctx, index))
3103 ATTR4F(0, SHORT_TO_FLOAT(v[0]), SHORT_TO_FLOAT(v[1]), SHORT_TO_FLOAT(v[2]), SHORT_TO_FLOAT(v[3]));
3104 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
3105 ATTR4F(VBO_ATTRIB_GENERIC0 + index, SHORT_TO_FLOAT(v[0]), SHORT_TO_FLOAT(v[1]), SHORT_TO_FLOAT(v[2]), SHORT_TO_FLOAT(v[3]));
3106 else
3107 ERROR(GL_INVALID_VALUE);
3108 }
3109
3110 static void GLAPIENTRY
TAG(VertexAttrib4Niv)3111 TAG(VertexAttrib4Niv)(GLuint index, const GLint * v)
3112 {
3113 GET_CURRENT_CONTEXT(ctx);
3114 if (is_vertex_position(ctx, index))
3115 ATTR4F(0, INT_TO_FLOAT(v[0]), INT_TO_FLOAT(v[1]), INT_TO_FLOAT(v[2]), INT_TO_FLOAT(v[3]));
3116 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
3117 ATTR4F(VBO_ATTRIB_GENERIC0 + index, INT_TO_FLOAT(v[0]), INT_TO_FLOAT(v[1]), INT_TO_FLOAT(v[2]), INT_TO_FLOAT(v[3]));
3118 else
3119 ERROR(GL_INVALID_VALUE);
3120 }
3121
3122 static void GLAPIENTRY
TAG(VertexAttrib4Nub)3123 TAG(VertexAttrib4Nub)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w)
3124 {
3125 GET_CURRENT_CONTEXT(ctx);
3126 if (is_vertex_position(ctx, index))
3127 ATTR4F(0, UBYTE_TO_FLOAT(x), UBYTE_TO_FLOAT(y), UBYTE_TO_FLOAT(z), UBYTE_TO_FLOAT(w));
3128 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
3129 ATTR4F(VBO_ATTRIB_GENERIC0 + index, UBYTE_TO_FLOAT(x), UBYTE_TO_FLOAT(y), UBYTE_TO_FLOAT(z), UBYTE_TO_FLOAT(w));
3130 else
3131 ERROR(GL_INVALID_VALUE);
3132 }
3133
3134 static void GLAPIENTRY
TAG(VertexAttrib4Nubv)3135 TAG(VertexAttrib4Nubv)(GLuint index, const GLubyte * v)
3136 {
3137 GET_CURRENT_CONTEXT(ctx);
3138 if (is_vertex_position(ctx, index))
3139 ATTR4F(0, UBYTE_TO_FLOAT(v[0]), UBYTE_TO_FLOAT(v[1]), UBYTE_TO_FLOAT(v[2]), UBYTE_TO_FLOAT(v[3]));
3140 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
3141 ATTR4F(VBO_ATTRIB_GENERIC0 + index, UBYTE_TO_FLOAT(v[0]), UBYTE_TO_FLOAT(v[1]), UBYTE_TO_FLOAT(v[2]), UBYTE_TO_FLOAT(v[3]));
3142 else
3143 ERROR(GL_INVALID_VALUE);
3144 }
3145
3146 static void GLAPIENTRY
TAG(VertexAttrib4Nusv)3147 TAG(VertexAttrib4Nusv)(GLuint index, const GLushort * v)
3148 {
3149 GET_CURRENT_CONTEXT(ctx);
3150 if (is_vertex_position(ctx, index))
3151 ATTR4F(0, USHORT_TO_FLOAT(v[0]), USHORT_TO_FLOAT(v[1]), USHORT_TO_FLOAT(v[2]), USHORT_TO_FLOAT(v[3]));
3152 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
3153 ATTR4F(VBO_ATTRIB_GENERIC0 + index, USHORT_TO_FLOAT(v[0]), USHORT_TO_FLOAT(v[1]), USHORT_TO_FLOAT(v[2]), USHORT_TO_FLOAT(v[3]));
3154 else
3155 ERROR(GL_INVALID_VALUE);
3156 }
3157
3158 static void GLAPIENTRY
TAG(VertexAttrib4Nuiv)3159 TAG(VertexAttrib4Nuiv)(GLuint index, const GLuint * v)
3160 {
3161 GET_CURRENT_CONTEXT(ctx);
3162 if (is_vertex_position(ctx, index))
3163 ATTR4F(0, UINT_TO_FLOAT(v[0]), UINT_TO_FLOAT(v[1]), UINT_TO_FLOAT(v[2]), UINT_TO_FLOAT(v[3]));
3164 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
3165 ATTR4F(VBO_ATTRIB_GENERIC0 + index, UINT_TO_FLOAT(v[0]), UINT_TO_FLOAT(v[1]), UINT_TO_FLOAT(v[2]), UINT_TO_FLOAT(v[3]));
3166 else
3167 ERROR(GL_INVALID_VALUE);
3168 }
3169
3170
3171
3172 /**
3173 * GL_EXT_gpu_shader / GL 3.0 signed/unsigned integer-valued attributes.
3174 * Note that attribute indexes do NOT alias conventional attributes.
3175 */
3176
3177 static void GLAPIENTRY
TAG(VertexAttribI1iv)3178 TAG(VertexAttribI1iv)(GLuint index, const GLint *v)
3179 {
3180 GET_CURRENT_CONTEXT(ctx);
3181 if (is_vertex_position(ctx, index))
3182 ATTR1I(0, v[0]);
3183 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
3184 ATTR1I(VBO_ATTRIB_GENERIC0 + index, v[0]);
3185 else
3186 ERROR(GL_INVALID_VALUE);
3187 }
3188
3189 static void GLAPIENTRY
TAG(VertexAttribI1uiv)3190 TAG(VertexAttribI1uiv)(GLuint index, const GLuint *v)
3191 {
3192 GET_CURRENT_CONTEXT(ctx);
3193 if (is_vertex_position(ctx, index))
3194 ATTR1UI(0, v[0]);
3195 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
3196 ATTR1UI(VBO_ATTRIB_GENERIC0 + index, v[0]);
3197 else
3198 ERROR(GL_INVALID_VALUE);
3199 }
3200
3201 static void GLAPIENTRY
TAG(VertexAttribI4bv)3202 TAG(VertexAttribI4bv)(GLuint index, const GLbyte *v)
3203 {
3204 GET_CURRENT_CONTEXT(ctx);
3205 if (is_vertex_position(ctx, index))
3206 ATTR4I(0, v[0], v[1], v[2], v[3]);
3207 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
3208 ATTR4I(VBO_ATTRIB_GENERIC0 + index, v[0], v[1], v[2], v[3]);
3209 else
3210 ERROR(GL_INVALID_VALUE);
3211 }
3212
3213 static void GLAPIENTRY
TAG(VertexAttribI4sv)3214 TAG(VertexAttribI4sv)(GLuint index, const GLshort *v)
3215 {
3216 GET_CURRENT_CONTEXT(ctx);
3217 if (is_vertex_position(ctx, index))
3218 ATTR4I(0, v[0], v[1], v[2], v[3]);
3219 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
3220 ATTR4I(VBO_ATTRIB_GENERIC0 + index, v[0], v[1], v[2], v[3]);
3221 else
3222 ERROR(GL_INVALID_VALUE);
3223 }
3224
3225 static void GLAPIENTRY
TAG(VertexAttribI4ubv)3226 TAG(VertexAttribI4ubv)(GLuint index, const GLubyte *v)
3227 {
3228 GET_CURRENT_CONTEXT(ctx);
3229 if (is_vertex_position(ctx, index))
3230 ATTR4UI(0, v[0], v[1], v[2], v[3]);
3231 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
3232 ATTR4UI(VBO_ATTRIB_GENERIC0 + index, v[0], v[1], v[2], v[3]);
3233 else
3234 ERROR(GL_INVALID_VALUE);
3235 }
3236
3237 static void GLAPIENTRY
TAG(VertexAttribI4usv)3238 TAG(VertexAttribI4usv)(GLuint index, const GLushort *v)
3239 {
3240 GET_CURRENT_CONTEXT(ctx);
3241 if (is_vertex_position(ctx, index))
3242 ATTR4UI(0, v[0], v[1], v[2], v[3]);
3243 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
3244 ATTR4UI(VBO_ATTRIB_GENERIC0 + index, v[0], v[1], v[2], v[3]);
3245 else
3246 ERROR(GL_INVALID_VALUE);
3247 }
3248
3249 #undef ATTR1FV
3250 #undef ATTR2FV
3251 #undef ATTR3FV
3252 #undef ATTR4FV
3253
3254 #undef ATTR1F
3255 #undef ATTR2F
3256 #undef ATTR3F
3257 #undef ATTR4F
3258
3259 #undef ATTR_UI
3260
3261 #undef MAT
3262