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(VertexAttrib1hNV)1480 TAG(VertexAttrib1hNV)(GLuint index, GLhalfNV x)
1481 {
1482 GET_CURRENT_CONTEXT(ctx);
1483 if (is_vertex_position(ctx, index))
1484 ATTR1H(0, x);
1485 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
1486 ATTR1H(VBO_ATTRIB_GENERIC0 + index, x);
1487 else
1488 ERROR(GL_INVALID_VALUE);
1489 }
1490
1491 static void GLAPIENTRY
TAG(VertexAttrib2hNV)1492 TAG(VertexAttrib2hNV)(GLuint index, GLhalfNV x, GLhalfNV y)
1493 {
1494 GET_CURRENT_CONTEXT(ctx);
1495 if (is_vertex_position(ctx, index))
1496 ATTR2H(0, x, y);
1497 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
1498 ATTR2H(VBO_ATTRIB_GENERIC0 + index, x, y);
1499 else
1500 ERROR(GL_INVALID_VALUE);
1501 }
1502
1503 static void GLAPIENTRY
TAG(VertexAttrib3hNV)1504 TAG(VertexAttrib3hNV)(GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z)
1505 {
1506 GET_CURRENT_CONTEXT(ctx);
1507 if (is_vertex_position(ctx, index))
1508 ATTR3H(0, x, y, z);
1509 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
1510 ATTR3H(VBO_ATTRIB_GENERIC0 + index, x, y, z);
1511 else
1512 ERROR(GL_INVALID_VALUE);
1513 }
1514
1515 static void GLAPIENTRY
TAG(VertexAttrib4hNV)1516 TAG(VertexAttrib4hNV)(GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w)
1517 {
1518 GET_CURRENT_CONTEXT(ctx);
1519 if (is_vertex_position(ctx, index))
1520 ATTR4H(0, x, y, z, w);
1521 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
1522 ATTR4H(VBO_ATTRIB_GENERIC0 + index, x, y, z, w);
1523 else
1524 ERROR(GL_INVALID_VALUE);
1525 }
1526
1527 static void GLAPIENTRY
TAG(VertexAttrib1hvNV)1528 TAG(VertexAttrib1hvNV)(GLuint index, const GLhalfNV * v)
1529 {
1530 GET_CURRENT_CONTEXT(ctx);
1531 if (is_vertex_position(ctx, index))
1532 ATTR1HV(0, v);
1533 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
1534 ATTR1HV(VBO_ATTRIB_GENERIC0 + index, v);
1535 else
1536 ERROR(GL_INVALID_VALUE);
1537 }
1538
1539 static void GLAPIENTRY
TAG(VertexAttrib2hvNV)1540 TAG(VertexAttrib2hvNV)(GLuint index, const GLhalfNV * v)
1541 {
1542 GET_CURRENT_CONTEXT(ctx);
1543 if (is_vertex_position(ctx, index))
1544 ATTR2HV(0, v);
1545 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
1546 ATTR2HV(VBO_ATTRIB_GENERIC0 + index, v);
1547 else
1548 ERROR(GL_INVALID_VALUE);
1549 }
1550
1551 static void GLAPIENTRY
TAG(VertexAttrib3hvNV)1552 TAG(VertexAttrib3hvNV)(GLuint index, const GLhalfNV * v)
1553 {
1554 GET_CURRENT_CONTEXT(ctx);
1555 if (is_vertex_position(ctx, index))
1556 ATTR3HV(0, v);
1557 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
1558 ATTR3HV(VBO_ATTRIB_GENERIC0 + index, v);
1559 else
1560 ERROR(GL_INVALID_VALUE);
1561 }
1562
1563 static void GLAPIENTRY
TAG(VertexAttrib4hvNV)1564 TAG(VertexAttrib4hvNV)(GLuint index, const GLhalfNV * v)
1565 {
1566 GET_CURRENT_CONTEXT(ctx);
1567 if (is_vertex_position(ctx, index))
1568 ATTR4HV(0, v);
1569 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
1570 ATTR4HV(VBO_ATTRIB_GENERIC0 + index, v);
1571 else
1572 ERROR(GL_INVALID_VALUE);
1573 }
1574
1575 static void GLAPIENTRY
TAG(VertexAttribs1hvNV)1576 TAG(VertexAttribs1hvNV)(GLuint index, GLsizei n, const GLhalfNV *v)
1577 {
1578 GET_CURRENT_CONTEXT(ctx);
1579 n = MIN2(n, VBO_ATTRIB_MAX - index);
1580 for (GLint i = n - 1; i >= 0; i--)
1581 ATTR1H(index + i, v[i]);
1582 }
1583
1584 static void GLAPIENTRY
TAG(VertexAttribs2hvNV)1585 TAG(VertexAttribs2hvNV)(GLuint index, GLsizei n, const GLhalfNV *v)
1586 {
1587 GET_CURRENT_CONTEXT(ctx);
1588 n = MIN2(n, VBO_ATTRIB_MAX - index);
1589 for (GLint i = n - 1; i >= 0; i--)
1590 ATTR2H(index + i, v[2 * i], v[2 * i + 1]);
1591 }
1592
1593 static void GLAPIENTRY
TAG(VertexAttribs3hvNV)1594 TAG(VertexAttribs3hvNV)(GLuint index, GLsizei n, const GLhalfNV *v)
1595 {
1596 GET_CURRENT_CONTEXT(ctx);
1597 n = MIN2(n, VBO_ATTRIB_MAX - index);
1598 for (GLint i = n - 1; i >= 0; i--)
1599 ATTR3H(index + i, v[3 * i], v[3 * i + 1], v[3 * i + 2]);
1600 }
1601
1602
1603 static void GLAPIENTRY
TAG(VertexAttribs4hvNV)1604 TAG(VertexAttribs4hvNV)(GLuint index, GLsizei n, const GLhalfNV *v)
1605 {
1606 GET_CURRENT_CONTEXT(ctx);
1607 n = MIN2(n, VBO_ATTRIB_MAX - index);
1608 for (GLint i = n - 1; i >= 0; i--)
1609 ATTR4H(index + i, v[4 * i], v[4 * i + 1], v[4 * i + 2], v[4 * i + 3]);
1610 }
1611
1612
1613
1614 static void GLAPIENTRY
TAG(FogCoordhNV)1615 TAG(FogCoordhNV)(GLhalf x)
1616 {
1617 GET_CURRENT_CONTEXT(ctx);
1618 ATTR1H(VBO_ATTRIB_FOG, x);
1619 }
1620
1621 static void GLAPIENTRY
TAG(FogCoordhvNV)1622 TAG(FogCoordhvNV)(const GLhalf * v)
1623 {
1624 GET_CURRENT_CONTEXT(ctx);
1625 ATTR1HV(VBO_ATTRIB_FOG, v);
1626 }
1627
1628
1629
1630 static void GLAPIENTRY
TAG(SecondaryColor3hNV)1631 TAG(SecondaryColor3hNV)(GLhalfNV x, GLhalfNV y, GLhalfNV z)
1632 {
1633 GET_CURRENT_CONTEXT(ctx);
1634 ATTR3H(VBO_ATTRIB_COLOR1, x, y, z);
1635 }
1636
1637 static void GLAPIENTRY
TAG(SecondaryColor3hvNV)1638 TAG(SecondaryColor3hvNV)(const GLhalfNV * v)
1639 {
1640 GET_CURRENT_CONTEXT(ctx);
1641 ATTR3HV(VBO_ATTRIB_COLOR1, v);
1642 }
1643
1644
1645 static void GLAPIENTRY
TAG(Color3b)1646 TAG(Color3b)(GLbyte red, GLbyte green, GLbyte blue)
1647 {
1648 GET_CURRENT_CONTEXT(ctx);
1649 ATTR4F(VBO_ATTRIB_COLOR0, BYTE_TO_FLOAT(red),
1650 BYTE_TO_FLOAT(green),
1651 BYTE_TO_FLOAT(blue),
1652 1.0);
1653 }
1654
1655 static void GLAPIENTRY
TAG(Color3d)1656 TAG(Color3d)(GLdouble red, GLdouble green, GLdouble blue)
1657 {
1658 GET_CURRENT_CONTEXT(ctx);
1659 ATTR4F(VBO_ATTRIB_COLOR0, (GLfloat) red, (GLfloat) green, (GLfloat) blue, 1.0);
1660 }
1661
1662 static void GLAPIENTRY
TAG(Color3i)1663 TAG(Color3i)(GLint red, GLint green, GLint blue)
1664 {
1665 GET_CURRENT_CONTEXT(ctx);
1666 ATTR4F(VBO_ATTRIB_COLOR0, INT_TO_FLOAT(red), INT_TO_FLOAT(green),
1667 INT_TO_FLOAT(blue), 1.0);
1668 }
1669
1670 static void GLAPIENTRY
TAG(Color3s)1671 TAG(Color3s)(GLshort red, GLshort green, GLshort blue)
1672 {
1673 GET_CURRENT_CONTEXT(ctx);
1674 ATTR4F(VBO_ATTRIB_COLOR0, SHORT_TO_FLOAT(red), SHORT_TO_FLOAT(green),
1675 SHORT_TO_FLOAT(blue), 1.0);
1676 }
1677
1678 static void GLAPIENTRY
TAG(Color3ui)1679 TAG(Color3ui)(GLuint red, GLuint green, GLuint blue)
1680 {
1681 GET_CURRENT_CONTEXT(ctx);
1682 ATTR4F(VBO_ATTRIB_COLOR0, UINT_TO_FLOAT(red), UINT_TO_FLOAT(green),
1683 UINT_TO_FLOAT(blue), 1.0);
1684 }
1685
1686 static void GLAPIENTRY
TAG(Color3us)1687 TAG(Color3us)(GLushort red, GLushort green, GLushort blue)
1688 {
1689 GET_CURRENT_CONTEXT(ctx);
1690 ATTR4F(VBO_ATTRIB_COLOR0, USHORT_TO_FLOAT(red), USHORT_TO_FLOAT(green),
1691 USHORT_TO_FLOAT(blue), 1.0);
1692 }
1693
1694 static void GLAPIENTRY
TAG(Color3ub)1695 TAG(Color3ub)(GLubyte red, GLubyte green, GLubyte blue)
1696 {
1697 GET_CURRENT_CONTEXT(ctx);
1698 ATTR4F(VBO_ATTRIB_COLOR0, UBYTE_TO_FLOAT(red), UBYTE_TO_FLOAT(green),
1699 UBYTE_TO_FLOAT(blue), 1.0);
1700 }
1701
1702
1703 static void GLAPIENTRY
TAG(Color3bv)1704 TAG(Color3bv)(const GLbyte *v)
1705 {
1706 GET_CURRENT_CONTEXT(ctx);
1707 ATTR4F(VBO_ATTRIB_COLOR0, BYTE_TO_FLOAT(v[0]), BYTE_TO_FLOAT(v[1]),
1708 BYTE_TO_FLOAT(v[2]), 1.0);
1709 }
1710
1711 static void GLAPIENTRY
TAG(Color3dv)1712 TAG(Color3dv)(const GLdouble *v)
1713 {
1714 GET_CURRENT_CONTEXT(ctx);
1715 ATTR4F(VBO_ATTRIB_COLOR0, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0);
1716 }
1717
1718 static void GLAPIENTRY
TAG(Color3iv)1719 TAG(Color3iv)(const GLint *v)
1720 {
1721 GET_CURRENT_CONTEXT(ctx);
1722 ATTR4F(VBO_ATTRIB_COLOR0, INT_TO_FLOAT(v[0]), INT_TO_FLOAT(v[1]),
1723 INT_TO_FLOAT(v[2]), 1.0);
1724 }
1725
1726 static void GLAPIENTRY
TAG(Color3sv)1727 TAG(Color3sv)(const GLshort *v)
1728 {
1729 GET_CURRENT_CONTEXT(ctx);
1730 ATTR4F(VBO_ATTRIB_COLOR0, SHORT_TO_FLOAT(v[0]), SHORT_TO_FLOAT(v[1]),
1731 SHORT_TO_FLOAT(v[2]), 1.0);
1732 }
1733
1734 static void GLAPIENTRY
TAG(Color3uiv)1735 TAG(Color3uiv)(const GLuint *v)
1736 {
1737 GET_CURRENT_CONTEXT(ctx);
1738 ATTR4F(VBO_ATTRIB_COLOR0, UINT_TO_FLOAT(v[0]), UINT_TO_FLOAT(v[1]),
1739 UINT_TO_FLOAT(v[2]), 1.0);
1740 }
1741
1742 static void GLAPIENTRY
TAG(Color3usv)1743 TAG(Color3usv)(const GLushort *v)
1744 {
1745 GET_CURRENT_CONTEXT(ctx);
1746 ATTR4F(VBO_ATTRIB_COLOR0, USHORT_TO_FLOAT(v[0]), USHORT_TO_FLOAT(v[1]),
1747 USHORT_TO_FLOAT(v[2]), 1.0);
1748 }
1749
1750 static void GLAPIENTRY
TAG(Color3ubv)1751 TAG(Color3ubv)(const GLubyte *v)
1752 {
1753 GET_CURRENT_CONTEXT(ctx);
1754 ATTR4F(VBO_ATTRIB_COLOR0, UBYTE_TO_FLOAT(v[0]), UBYTE_TO_FLOAT(v[1]),
1755 UBYTE_TO_FLOAT(v[2]), 1.0);
1756 }
1757
1758
1759 static void GLAPIENTRY
TAG(Color4b)1760 TAG(Color4b)(GLbyte red, GLbyte green, GLbyte blue,
1761 GLbyte alpha)
1762 {
1763 GET_CURRENT_CONTEXT(ctx);
1764 ATTR4F(VBO_ATTRIB_COLOR0, BYTE_TO_FLOAT(red), BYTE_TO_FLOAT(green),
1765 BYTE_TO_FLOAT(blue), BYTE_TO_FLOAT(alpha));
1766 }
1767
1768 static void GLAPIENTRY
TAG(Color4d)1769 TAG(Color4d)(GLdouble red, GLdouble green, GLdouble blue,
1770 GLdouble alpha)
1771 {
1772 GET_CURRENT_CONTEXT(ctx);
1773 ATTR4F(VBO_ATTRIB_COLOR0, (GLfloat) red, (GLfloat) green, (GLfloat) blue, (GLfloat) alpha);
1774 }
1775
1776 static void GLAPIENTRY
TAG(Color4i)1777 TAG(Color4i)(GLint red, GLint green, GLint blue, GLint alpha)
1778 {
1779 GET_CURRENT_CONTEXT(ctx);
1780 ATTR4F(VBO_ATTRIB_COLOR0, INT_TO_FLOAT(red), INT_TO_FLOAT(green),
1781 INT_TO_FLOAT(blue), INT_TO_FLOAT(alpha));
1782 }
1783
1784 static void GLAPIENTRY
TAG(Color4s)1785 TAG(Color4s)(GLshort red, GLshort green, GLshort blue,
1786 GLshort alpha)
1787 {
1788 GET_CURRENT_CONTEXT(ctx);
1789 ATTR4F(VBO_ATTRIB_COLOR0, SHORT_TO_FLOAT(red), SHORT_TO_FLOAT(green),
1790 SHORT_TO_FLOAT(blue), SHORT_TO_FLOAT(alpha));
1791 }
1792
1793 static void GLAPIENTRY
TAG(Color4ui)1794 TAG(Color4ui)(GLuint red, GLuint green, GLuint blue, GLuint alpha)
1795 {
1796 GET_CURRENT_CONTEXT(ctx);
1797 ATTR4F(VBO_ATTRIB_COLOR0, UINT_TO_FLOAT(red), UINT_TO_FLOAT(green),
1798 UINT_TO_FLOAT(blue), UINT_TO_FLOAT(alpha));
1799 }
1800
1801 static void GLAPIENTRY
TAG(Color4us)1802 TAG(Color4us)(GLushort red, GLushort green, GLushort blue, GLushort alpha)
1803 {
1804 GET_CURRENT_CONTEXT(ctx);
1805 ATTR4F(VBO_ATTRIB_COLOR0, USHORT_TO_FLOAT(red), USHORT_TO_FLOAT(green),
1806 USHORT_TO_FLOAT(blue), USHORT_TO_FLOAT(alpha));
1807 }
1808
1809 static void GLAPIENTRY
TAG(Color4ub)1810 TAG(Color4ub)(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)
1811 {
1812 GET_CURRENT_CONTEXT(ctx);
1813 ATTR4F(VBO_ATTRIB_COLOR0, UBYTE_TO_FLOAT(red), UBYTE_TO_FLOAT(green),
1814 UBYTE_TO_FLOAT(blue), UBYTE_TO_FLOAT(alpha));
1815 }
1816
1817
1818 static void GLAPIENTRY
TAG(Color4iv)1819 TAG(Color4iv)(const GLint *v)
1820 {
1821 GET_CURRENT_CONTEXT(ctx);
1822 ATTR4F(VBO_ATTRIB_COLOR0, INT_TO_FLOAT(v[0]), INT_TO_FLOAT(v[1]),
1823 INT_TO_FLOAT(v[2]), INT_TO_FLOAT(v[3]));
1824 }
1825
1826
1827 static void GLAPIENTRY
TAG(Color4bv)1828 TAG(Color4bv)(const GLbyte *v)
1829 {
1830 GET_CURRENT_CONTEXT(ctx);
1831 ATTR4F(VBO_ATTRIB_COLOR0, BYTE_TO_FLOAT(v[0]), BYTE_TO_FLOAT(v[1]),
1832 BYTE_TO_FLOAT(v[2]), BYTE_TO_FLOAT(v[3]));
1833 }
1834
1835 static void GLAPIENTRY
TAG(Color4dv)1836 TAG(Color4dv)(const GLdouble *v)
1837 {
1838 GET_CURRENT_CONTEXT(ctx);
1839 ATTR4F(VBO_ATTRIB_COLOR0, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3]);
1840 }
1841
1842
1843 static void GLAPIENTRY
TAG(Color4sv)1844 TAG(Color4sv)(const GLshort *v)
1845 {
1846 GET_CURRENT_CONTEXT(ctx);
1847 ATTR4F(VBO_ATTRIB_COLOR0, SHORT_TO_FLOAT(v[0]), SHORT_TO_FLOAT(v[1]),
1848 SHORT_TO_FLOAT(v[2]), SHORT_TO_FLOAT(v[3]));
1849 }
1850
1851
1852 static void GLAPIENTRY
TAG(Color4uiv)1853 TAG(Color4uiv)(const GLuint *v)
1854 {
1855 GET_CURRENT_CONTEXT(ctx);
1856 ATTR4F(VBO_ATTRIB_COLOR0, UINT_TO_FLOAT(v[0]), UINT_TO_FLOAT(v[1]),
1857 UINT_TO_FLOAT(v[2]), UINT_TO_FLOAT(v[3]));
1858 }
1859
1860 static void GLAPIENTRY
TAG(Color4usv)1861 TAG(Color4usv)(const GLushort *v)
1862 {
1863 GET_CURRENT_CONTEXT(ctx);
1864 ATTR4F(VBO_ATTRIB_COLOR0, USHORT_TO_FLOAT(v[0]), USHORT_TO_FLOAT(v[1]),
1865 USHORT_TO_FLOAT(v[2]), USHORT_TO_FLOAT(v[3]));
1866 }
1867
1868 static void GLAPIENTRY
TAG(Color4ubv)1869 TAG(Color4ubv)(const GLubyte *v)
1870 {
1871 GET_CURRENT_CONTEXT(ctx);
1872 ATTR4F(VBO_ATTRIB_COLOR0, UBYTE_TO_FLOAT(v[0]), UBYTE_TO_FLOAT(v[1]),
1873 UBYTE_TO_FLOAT(v[2]), UBYTE_TO_FLOAT(v[3]));
1874 }
1875
1876
1877 static void GLAPIENTRY
TAG(FogCoordd)1878 TAG(FogCoordd)(GLdouble d)
1879 {
1880 GET_CURRENT_CONTEXT(ctx);
1881 ATTR1F(VBO_ATTRIB_FOG, (GLfloat) d);
1882 }
1883
1884 static void GLAPIENTRY
TAG(FogCoorddv)1885 TAG(FogCoorddv)(const GLdouble *v)
1886 {
1887 GET_CURRENT_CONTEXT(ctx);
1888 ATTR1F(VBO_ATTRIB_FOG, (GLfloat) *v);
1889 }
1890
1891
1892 static void GLAPIENTRY
TAG(Indexd)1893 TAG(Indexd)(GLdouble c)
1894 {
1895 GET_CURRENT_CONTEXT(ctx);
1896 ATTR1F(VBO_ATTRIB_COLOR_INDEX, (GLfloat) c);
1897 }
1898
1899 static void GLAPIENTRY
TAG(Indexi)1900 TAG(Indexi)(GLint c)
1901 {
1902 GET_CURRENT_CONTEXT(ctx);
1903 ATTR1F(VBO_ATTRIB_COLOR_INDEX, (GLfloat) c);
1904 }
1905
1906 static void GLAPIENTRY
TAG(Indexs)1907 TAG(Indexs)(GLshort c)
1908 {
1909 GET_CURRENT_CONTEXT(ctx);
1910 ATTR1F(VBO_ATTRIB_COLOR_INDEX, (GLfloat) c);
1911 }
1912
1913 static void GLAPIENTRY
TAG(Indexub)1914 TAG(Indexub)(GLubyte c)
1915 {
1916 GET_CURRENT_CONTEXT(ctx);
1917 ATTR1F(VBO_ATTRIB_COLOR_INDEX, (GLfloat) c);
1918 }
1919
1920 static void GLAPIENTRY
TAG(Indexdv)1921 TAG(Indexdv)(const GLdouble *c)
1922 {
1923 GET_CURRENT_CONTEXT(ctx);
1924 ATTR1F(VBO_ATTRIB_COLOR_INDEX, (GLfloat) *c);
1925 }
1926
1927 static void GLAPIENTRY
TAG(Indexiv)1928 TAG(Indexiv)(const GLint *c)
1929 {
1930 GET_CURRENT_CONTEXT(ctx);
1931 ATTR1F(VBO_ATTRIB_COLOR_INDEX, (GLfloat) *c);
1932 }
1933
1934 static void GLAPIENTRY
TAG(Indexsv)1935 TAG(Indexsv)(const GLshort *c)
1936 {
1937 GET_CURRENT_CONTEXT(ctx);
1938 ATTR1F(VBO_ATTRIB_COLOR_INDEX, (GLfloat) *c);
1939 }
1940
1941 static void GLAPIENTRY
TAG(Indexubv)1942 TAG(Indexubv)(const GLubyte *c)
1943 {
1944 GET_CURRENT_CONTEXT(ctx);
1945 ATTR1F(VBO_ATTRIB_COLOR_INDEX, (GLfloat) *c);
1946 }
1947
1948
1949 static void GLAPIENTRY
TAG(EdgeFlagv)1950 TAG(EdgeFlagv)(const GLboolean *flag)
1951 {
1952 GET_CURRENT_CONTEXT(ctx);
1953 ATTR1F(VBO_ATTRIB_EDGEFLAG, (GLfloat)*flag);
1954 }
1955
1956
1957 static void GLAPIENTRY
TAG(Normal3b)1958 TAG(Normal3b)(GLbyte nx, GLbyte ny, GLbyte nz)
1959 {
1960 GET_CURRENT_CONTEXT(ctx);
1961 ATTR3F(VBO_ATTRIB_NORMAL, BYTE_TO_FLOAT(nx), BYTE_TO_FLOAT(ny), BYTE_TO_FLOAT(nz));
1962 }
1963
1964 static void GLAPIENTRY
TAG(Normal3d)1965 TAG(Normal3d)(GLdouble nx, GLdouble ny, GLdouble nz)
1966 {
1967 GET_CURRENT_CONTEXT(ctx);
1968 ATTR3F(VBO_ATTRIB_NORMAL, (GLfloat) nx, (GLfloat) ny, (GLfloat) nz);
1969 }
1970
1971 static void GLAPIENTRY
TAG(Normal3i)1972 TAG(Normal3i)(GLint nx, GLint ny, GLint nz)
1973 {
1974 GET_CURRENT_CONTEXT(ctx);
1975 ATTR3F(VBO_ATTRIB_NORMAL, INT_TO_FLOAT(nx), INT_TO_FLOAT(ny), INT_TO_FLOAT(nz));
1976 }
1977
1978 static void GLAPIENTRY
TAG(Normal3s)1979 TAG(Normal3s)(GLshort nx, GLshort ny, GLshort nz)
1980 {
1981 GET_CURRENT_CONTEXT(ctx);
1982 ATTR3F(VBO_ATTRIB_NORMAL, SHORT_TO_FLOAT(nx), SHORT_TO_FLOAT(ny), SHORT_TO_FLOAT(nz));
1983 }
1984
1985 static void GLAPIENTRY
TAG(Normal3bv)1986 TAG(Normal3bv)(const GLbyte *v)
1987 {
1988 GET_CURRENT_CONTEXT(ctx);
1989 ATTR3F(VBO_ATTRIB_NORMAL, BYTE_TO_FLOAT(v[0]), BYTE_TO_FLOAT(v[1]), BYTE_TO_FLOAT(v[2]));
1990 }
1991
1992 static void GLAPIENTRY
TAG(Normal3dv)1993 TAG(Normal3dv)(const GLdouble *v)
1994 {
1995 GET_CURRENT_CONTEXT(ctx);
1996 ATTR3F(VBO_ATTRIB_NORMAL, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2]);
1997 }
1998
1999 static void GLAPIENTRY
TAG(Normal3iv)2000 TAG(Normal3iv)(const GLint *v)
2001 {
2002 GET_CURRENT_CONTEXT(ctx);
2003 ATTR3F(VBO_ATTRIB_NORMAL, INT_TO_FLOAT(v[0]), INT_TO_FLOAT(v[1]), INT_TO_FLOAT(v[2]));
2004 }
2005
2006 static void GLAPIENTRY
TAG(Normal3sv)2007 TAG(Normal3sv)(const GLshort *v)
2008 {
2009 GET_CURRENT_CONTEXT(ctx);
2010 ATTR3F(VBO_ATTRIB_NORMAL, SHORT_TO_FLOAT(v[0]), SHORT_TO_FLOAT(v[1]), SHORT_TO_FLOAT(v[2]));
2011 }
2012
2013 static void GLAPIENTRY
TAG(TexCoord1d)2014 TAG(TexCoord1d)(GLdouble s)
2015 {
2016 GET_CURRENT_CONTEXT(ctx);
2017 ATTR1F(VBO_ATTRIB_TEX0, (GLfloat) s);
2018 }
2019
2020 static void GLAPIENTRY
TAG(TexCoord1i)2021 TAG(TexCoord1i)(GLint s)
2022 {
2023 GET_CURRENT_CONTEXT(ctx);
2024 ATTR1F(VBO_ATTRIB_TEX0, (GLfloat) s);
2025 }
2026
2027 static void GLAPIENTRY
TAG(TexCoord1s)2028 TAG(TexCoord1s)(GLshort s)
2029 {
2030 GET_CURRENT_CONTEXT(ctx);
2031 ATTR1F(VBO_ATTRIB_TEX0, (GLfloat) s);
2032 }
2033
2034 static void GLAPIENTRY
TAG(TexCoord2d)2035 TAG(TexCoord2d)(GLdouble s, GLdouble t)
2036 {
2037 GET_CURRENT_CONTEXT(ctx);
2038 ATTR2F(VBO_ATTRIB_TEX0, (GLfloat) s,(GLfloat) t);
2039 }
2040
2041 static void GLAPIENTRY
TAG(TexCoord2s)2042 TAG(TexCoord2s)(GLshort s, GLshort t)
2043 {
2044 GET_CURRENT_CONTEXT(ctx);
2045 ATTR2F(VBO_ATTRIB_TEX0, (GLfloat) s,(GLfloat) t);
2046 }
2047
2048 static void GLAPIENTRY
TAG(TexCoord2i)2049 TAG(TexCoord2i)(GLint s, GLint t)
2050 {
2051 GET_CURRENT_CONTEXT(ctx);
2052 ATTR2F(VBO_ATTRIB_TEX0, (GLfloat) s,(GLfloat) t);
2053 }
2054
2055 static void GLAPIENTRY
TAG(TexCoord3d)2056 TAG(TexCoord3d)(GLdouble s, GLdouble t, GLdouble r)
2057 {
2058 GET_CURRENT_CONTEXT(ctx);
2059 ATTR3F(VBO_ATTRIB_TEX0, (GLfloat) s,(GLfloat) t,(GLfloat) r);
2060 }
2061
2062 static void GLAPIENTRY
TAG(TexCoord3i)2063 TAG(TexCoord3i)(GLint s, GLint t, GLint r)
2064 {
2065 GET_CURRENT_CONTEXT(ctx);
2066 ATTR3F(VBO_ATTRIB_TEX0, (GLfloat) s,(GLfloat) t,(GLfloat) r);
2067 }
2068
2069 static void GLAPIENTRY
TAG(TexCoord3s)2070 TAG(TexCoord3s)(GLshort s, GLshort t, GLshort r)
2071 {
2072 GET_CURRENT_CONTEXT(ctx);
2073 ATTR3F(VBO_ATTRIB_TEX0, (GLfloat) s,(GLfloat) t,(GLfloat) r);
2074 }
2075
2076 static void GLAPIENTRY
TAG(TexCoord4d)2077 TAG(TexCoord4d)(GLdouble s, GLdouble t, GLdouble r, GLdouble q)
2078 {
2079 GET_CURRENT_CONTEXT(ctx);
2080 ATTR4F(VBO_ATTRIB_TEX0, (GLfloat) s,(GLfloat) t,(GLfloat) r,(GLfloat) q);
2081 }
2082
2083 static void GLAPIENTRY
TAG(TexCoord4i)2084 TAG(TexCoord4i)(GLint s, GLint t, GLint r, GLint q)
2085 {
2086 GET_CURRENT_CONTEXT(ctx);
2087 ATTR4F(VBO_ATTRIB_TEX0, (GLfloat) s,(GLfloat) t,(GLfloat) r,(GLfloat) q);
2088 }
2089
2090 static void GLAPIENTRY
TAG(TexCoord4s)2091 TAG(TexCoord4s)(GLshort s, GLshort t, GLshort r, GLshort q)
2092 {
2093 GET_CURRENT_CONTEXT(ctx);
2094 ATTR4F(VBO_ATTRIB_TEX0, (GLfloat) s,(GLfloat) t,(GLfloat) r,(GLfloat) q);
2095 }
2096
2097 static void GLAPIENTRY
TAG(TexCoord1dv)2098 TAG(TexCoord1dv)(const GLdouble *v)
2099 {
2100 GET_CURRENT_CONTEXT(ctx);
2101 ATTR1F(VBO_ATTRIB_TEX0, (GLfloat) v[0]);
2102 }
2103
2104 static void GLAPIENTRY
TAG(TexCoord1iv)2105 TAG(TexCoord1iv)(const GLint *v)
2106 {
2107 GET_CURRENT_CONTEXT(ctx);
2108 ATTR1F(VBO_ATTRIB_TEX0, (GLfloat) v[0]);
2109 }
2110
2111 static void GLAPIENTRY
TAG(TexCoord1sv)2112 TAG(TexCoord1sv)(const GLshort *v)
2113 {
2114 GET_CURRENT_CONTEXT(ctx);
2115 ATTR1F(VBO_ATTRIB_TEX0, (GLfloat) v[0]);
2116 }
2117
2118 static void GLAPIENTRY
TAG(TexCoord2dv)2119 TAG(TexCoord2dv)(const GLdouble *v)
2120 {
2121 GET_CURRENT_CONTEXT(ctx);
2122 ATTR2F(VBO_ATTRIB_TEX0, (GLfloat) v[0],(GLfloat) v[1]);
2123 }
2124
2125 static void GLAPIENTRY
TAG(TexCoord2iv)2126 TAG(TexCoord2iv)(const GLint *v)
2127 {
2128 GET_CURRENT_CONTEXT(ctx);
2129 ATTR2F(VBO_ATTRIB_TEX0, (GLfloat) v[0],(GLfloat) v[1]);
2130 }
2131
2132 static void GLAPIENTRY
TAG(TexCoord2sv)2133 TAG(TexCoord2sv)(const GLshort *v)
2134 {
2135 GET_CURRENT_CONTEXT(ctx);
2136 ATTR2F(VBO_ATTRIB_TEX0, (GLfloat) v[0],(GLfloat) v[1]);
2137 }
2138
2139 static void GLAPIENTRY
TAG(TexCoord3dv)2140 TAG(TexCoord3dv)(const GLdouble *v)
2141 {
2142 GET_CURRENT_CONTEXT(ctx);
2143 ATTR3F(VBO_ATTRIB_TEX0, (GLfloat) v[0],(GLfloat) v[1],(GLfloat) v[2]);
2144 }
2145
2146 static void GLAPIENTRY
TAG(TexCoord3iv)2147 TAG(TexCoord3iv)(const GLint *v)
2148 {
2149 GET_CURRENT_CONTEXT(ctx);
2150 ATTR3F(VBO_ATTRIB_TEX0, (GLfloat) v[0],(GLfloat) v[1],(GLfloat) v[2]);
2151 }
2152
2153 static void GLAPIENTRY
TAG(TexCoord3sv)2154 TAG(TexCoord3sv)(const GLshort *v)
2155 {
2156 GET_CURRENT_CONTEXT(ctx);
2157 ATTR3F(VBO_ATTRIB_TEX0, (GLfloat) v[0],(GLfloat) v[1],(GLfloat) v[2]);
2158 }
2159
2160 static void GLAPIENTRY
TAG(TexCoord4dv)2161 TAG(TexCoord4dv)(const GLdouble *v)
2162 {
2163 GET_CURRENT_CONTEXT(ctx);
2164 ATTR4F(VBO_ATTRIB_TEX0, (GLfloat) v[0],(GLfloat) v[1],(GLfloat) v[2],(GLfloat) v[3]);
2165 }
2166
2167 static void GLAPIENTRY
TAG(TexCoord4iv)2168 TAG(TexCoord4iv)(const GLint *v)
2169 {
2170 GET_CURRENT_CONTEXT(ctx);
2171 ATTR4F(VBO_ATTRIB_TEX0, (GLfloat) v[0],(GLfloat) v[1],(GLfloat) v[2],(GLfloat) v[3]);
2172 }
2173
2174 static void GLAPIENTRY
TAG(TexCoord4sv)2175 TAG(TexCoord4sv)(const GLshort *v)
2176 {
2177 GET_CURRENT_CONTEXT(ctx);
2178 ATTR4F(VBO_ATTRIB_TEX0, (GLfloat) v[0],(GLfloat) v[1],(GLfloat) v[2],(GLfloat) v[3]);
2179 }
2180
2181 static void GLAPIENTRY
TAG(Vertex2d)2182 TAG(Vertex2d)(GLdouble x, GLdouble y)
2183 {
2184 GET_CURRENT_CONTEXT(ctx);
2185 ATTR2F(VBO_ATTRIB_POS, (GLfloat) x, (GLfloat) y);
2186 }
2187
2188 static void GLAPIENTRY
TAG(Vertex2i)2189 TAG(Vertex2i)(GLint x, GLint y)
2190 {
2191 GET_CURRENT_CONTEXT(ctx);
2192 ATTR2F(VBO_ATTRIB_POS, (GLfloat) x, (GLfloat) y);
2193 }
2194
2195 static void GLAPIENTRY
TAG(Vertex2s)2196 TAG(Vertex2s)(GLshort x, GLshort y)
2197 {
2198 GET_CURRENT_CONTEXT(ctx);
2199 ATTR2F(VBO_ATTRIB_POS, (GLfloat) x, (GLfloat) y);
2200 }
2201
2202 static void GLAPIENTRY
TAG(Vertex3d)2203 TAG(Vertex3d)(GLdouble x, GLdouble y, GLdouble z)
2204 {
2205 GET_CURRENT_CONTEXT(ctx);
2206 ATTR3F(VBO_ATTRIB_POS, (GLfloat) x, (GLfloat) y, (GLfloat) z);
2207 }
2208
2209 static void GLAPIENTRY
TAG(Vertex3i)2210 TAG(Vertex3i)(GLint x, GLint y, GLint z)
2211 {
2212 GET_CURRENT_CONTEXT(ctx);
2213 ATTR3F(VBO_ATTRIB_POS, (GLfloat) x, (GLfloat) y, (GLfloat) z);
2214 }
2215
2216 static void GLAPIENTRY
TAG(Vertex3s)2217 TAG(Vertex3s)(GLshort x, GLshort y, GLshort z)
2218 {
2219 GET_CURRENT_CONTEXT(ctx);
2220 ATTR3F(VBO_ATTRIB_POS, (GLfloat) x, (GLfloat) y, (GLfloat) z);
2221 }
2222
2223 static void GLAPIENTRY
TAG(Vertex4d)2224 TAG(Vertex4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
2225 {
2226 GET_CURRENT_CONTEXT(ctx);
2227 ATTR4F(VBO_ATTRIB_POS, (GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w);
2228 }
2229
2230 static void GLAPIENTRY
TAG(Vertex4i)2231 TAG(Vertex4i)(GLint x, GLint y, GLint z, GLint w)
2232 {
2233 GET_CURRENT_CONTEXT(ctx);
2234 ATTR4F(VBO_ATTRIB_POS, (GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w);
2235 }
2236
2237 static void GLAPIENTRY
TAG(Vertex4s)2238 TAG(Vertex4s)(GLshort x, GLshort y, GLshort z, GLshort w)
2239 {
2240 GET_CURRENT_CONTEXT(ctx);
2241 ATTR4F(VBO_ATTRIB_POS, (GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w);
2242 }
2243
2244 static void GLAPIENTRY
TAG(Vertex2dv)2245 TAG(Vertex2dv)(const GLdouble *v)
2246 {
2247 GET_CURRENT_CONTEXT(ctx);
2248 ATTR2F(VBO_ATTRIB_POS, (GLfloat) v[0], (GLfloat) v[1]);
2249 }
2250
2251 static void GLAPIENTRY
TAG(Vertex2iv)2252 TAG(Vertex2iv)(const GLint *v)
2253 {
2254 GET_CURRENT_CONTEXT(ctx);
2255 ATTR2F(VBO_ATTRIB_POS, (GLfloat) v[0], (GLfloat) v[1]);
2256 }
2257
2258 static void GLAPIENTRY
TAG(Vertex2sv)2259 TAG(Vertex2sv)(const GLshort *v)
2260 {
2261 GET_CURRENT_CONTEXT(ctx);
2262 ATTR2F(VBO_ATTRIB_POS, (GLfloat) v[0], (GLfloat) v[1]);
2263 }
2264
2265 static void GLAPIENTRY
TAG(Vertex3dv)2266 TAG(Vertex3dv)(const GLdouble *v)
2267 {
2268 GET_CURRENT_CONTEXT(ctx);
2269 ATTR3F(VBO_ATTRIB_POS, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2]);
2270 }
2271
2272 static void GLAPIENTRY
TAG(Vertex3iv)2273 TAG(Vertex3iv)(const GLint *v)
2274 {
2275 GET_CURRENT_CONTEXT(ctx);
2276 ATTR3F(VBO_ATTRIB_POS, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2]);
2277 }
2278
2279 static void GLAPIENTRY
TAG(Vertex3sv)2280 TAG(Vertex3sv)(const GLshort *v)
2281 {
2282 GET_CURRENT_CONTEXT(ctx);
2283 ATTR3F(VBO_ATTRIB_POS, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2]);
2284 }
2285
2286 static void GLAPIENTRY
TAG(Vertex4dv)2287 TAG(Vertex4dv)(const GLdouble *v)
2288 {
2289 GET_CURRENT_CONTEXT(ctx);
2290 ATTR4F(VBO_ATTRIB_POS, (GLfloat) v[0], (GLfloat) v[1],
2291 (GLfloat) v[2], (GLfloat) v[3]);
2292 }
2293
2294 static void GLAPIENTRY
TAG(Vertex4iv)2295 TAG(Vertex4iv)(const GLint *v)
2296 {
2297 GET_CURRENT_CONTEXT(ctx);
2298 ATTR4F(VBO_ATTRIB_POS, (GLfloat) v[0], (GLfloat) v[1],
2299 (GLfloat) v[2], (GLfloat) v[3]);
2300 }
2301
2302 static void GLAPIENTRY
TAG(Vertex4sv)2303 TAG(Vertex4sv)(const GLshort *v)
2304 {
2305 GET_CURRENT_CONTEXT(ctx);
2306 ATTR4F(VBO_ATTRIB_POS, (GLfloat) v[0], (GLfloat) v[1],
2307 (GLfloat) v[2], (GLfloat) v[3]);
2308 }
2309
2310 static void GLAPIENTRY
TAG(MultiTexCoord1d)2311 TAG(MultiTexCoord1d)(GLenum target, GLdouble s)
2312 {
2313 GET_CURRENT_CONTEXT(ctx);
2314 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
2315 ATTR1F(attr, (GLfloat) s);
2316 }
2317
2318 static void GLAPIENTRY
TAG(MultiTexCoord1dv)2319 TAG(MultiTexCoord1dv)(GLenum target, const GLdouble *v)
2320 {
2321 GET_CURRENT_CONTEXT(ctx);
2322 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
2323 ATTR1F(attr, (GLfloat) v[0]);
2324 }
2325
2326 static void GLAPIENTRY
TAG(MultiTexCoord1i)2327 TAG(MultiTexCoord1i)(GLenum target, GLint s)
2328 {
2329 GET_CURRENT_CONTEXT(ctx);
2330 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
2331 ATTR1F(attr, (GLfloat) s);
2332 }
2333
2334 static void GLAPIENTRY
TAG(MultiTexCoord1iv)2335 TAG(MultiTexCoord1iv)(GLenum target, const GLint *v)
2336 {
2337 GET_CURRENT_CONTEXT(ctx);
2338 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
2339 ATTR1F(attr, (GLfloat) v[0]);
2340 }
2341
2342 static void GLAPIENTRY
TAG(MultiTexCoord1s)2343 TAG(MultiTexCoord1s)(GLenum target, GLshort s)
2344 {
2345 GET_CURRENT_CONTEXT(ctx);
2346 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
2347 ATTR1F(attr, (GLfloat) s);
2348 }
2349
2350 static void GLAPIENTRY
TAG(MultiTexCoord1sv)2351 TAG(MultiTexCoord1sv)(GLenum target, const GLshort *v)
2352 {
2353 GET_CURRENT_CONTEXT(ctx);
2354 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
2355 ATTR1F(attr, (GLfloat) v[0]);
2356 }
2357
2358 static void GLAPIENTRY
TAG(MultiTexCoord2d)2359 TAG(MultiTexCoord2d)(GLenum target, GLdouble s, GLdouble t)
2360 {
2361 GET_CURRENT_CONTEXT(ctx);
2362 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
2363 ATTR2F(attr, (GLfloat) s, (GLfloat) t);
2364 }
2365
2366 static void GLAPIENTRY
TAG(MultiTexCoord2dv)2367 TAG(MultiTexCoord2dv)(GLenum target, const GLdouble *v)
2368 {
2369 GET_CURRENT_CONTEXT(ctx);
2370 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
2371 ATTR2F(attr, (GLfloat) v[0], (GLfloat) v[1]);
2372 }
2373
2374 static void GLAPIENTRY
TAG(MultiTexCoord2i)2375 TAG(MultiTexCoord2i)(GLenum target, GLint s, GLint t)
2376 {
2377 GET_CURRENT_CONTEXT(ctx);
2378 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
2379 ATTR2F(attr, (GLfloat) s, (GLfloat) t);
2380 }
2381
2382 static void GLAPIENTRY
TAG(MultiTexCoord2iv)2383 TAG(MultiTexCoord2iv)(GLenum target, const GLint *v)
2384 {
2385 GET_CURRENT_CONTEXT(ctx);
2386 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
2387 ATTR2F(attr, (GLfloat) v[0], (GLfloat) v[1]);
2388 }
2389
2390 static void GLAPIENTRY
TAG(MultiTexCoord2s)2391 TAG(MultiTexCoord2s)(GLenum target, GLshort s, GLshort t)
2392 {
2393 GET_CURRENT_CONTEXT(ctx);
2394 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
2395 ATTR2F(attr, (GLfloat) s, (GLfloat) t);
2396 }
2397
2398 static void GLAPIENTRY
TAG(MultiTexCoord2sv)2399 TAG(MultiTexCoord2sv)(GLenum target, const GLshort *v)
2400 {
2401 GET_CURRENT_CONTEXT(ctx);
2402 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
2403 ATTR2F(attr, (GLfloat) v[0], (GLfloat) v[1]);
2404 }
2405
2406 static void GLAPIENTRY
TAG(MultiTexCoord3d)2407 TAG(MultiTexCoord3d)(GLenum target, GLdouble s, GLdouble t, GLdouble r)
2408 {
2409 GET_CURRENT_CONTEXT(ctx);
2410 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
2411 ATTR3F(attr, (GLfloat) s, (GLfloat) t, (GLfloat) r);
2412 }
2413
2414 static void GLAPIENTRY
TAG(MultiTexCoord3dv)2415 TAG(MultiTexCoord3dv)(GLenum target, const GLdouble *v)
2416 {
2417 GET_CURRENT_CONTEXT(ctx);
2418 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
2419 ATTR3F(attr, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2]);
2420 }
2421
2422 static void GLAPIENTRY
TAG(MultiTexCoord3i)2423 TAG(MultiTexCoord3i)(GLenum target, GLint s, GLint t, GLint r)
2424 {
2425 GET_CURRENT_CONTEXT(ctx);
2426 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
2427 ATTR3F(attr, (GLfloat) s, (GLfloat) t, (GLfloat) r);
2428 }
2429
2430 static void GLAPIENTRY
TAG(MultiTexCoord3iv)2431 TAG(MultiTexCoord3iv)(GLenum target, const GLint *v)
2432 {
2433 GET_CURRENT_CONTEXT(ctx);
2434 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
2435 ATTR3F(attr, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2]);
2436 }
2437
2438 static void GLAPIENTRY
TAG(MultiTexCoord3s)2439 TAG(MultiTexCoord3s)(GLenum target, GLshort s, GLshort t, GLshort r)
2440 {
2441 GET_CURRENT_CONTEXT(ctx);
2442 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
2443 ATTR3F(attr, (GLfloat) s, (GLfloat) t, (GLfloat) r);
2444 }
2445
2446 static void GLAPIENTRY
TAG(MultiTexCoord3sv)2447 TAG(MultiTexCoord3sv)(GLenum target, const GLshort *v)
2448 {
2449 GET_CURRENT_CONTEXT(ctx);
2450 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
2451 ATTR3F(attr, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2]);
2452 }
2453
2454 static void GLAPIENTRY
TAG(MultiTexCoord4d)2455 TAG(MultiTexCoord4d)(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q)
2456 {
2457 GET_CURRENT_CONTEXT(ctx);
2458 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
2459 ATTR4F(attr, (GLfloat) s, (GLfloat) t, (GLfloat) r, (GLfloat) q);
2460 }
2461
2462 static void GLAPIENTRY
TAG(MultiTexCoord4dv)2463 TAG(MultiTexCoord4dv)(GLenum target, const GLdouble *v)
2464 {
2465 GET_CURRENT_CONTEXT(ctx);
2466 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
2467 ATTR4F(attr, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3]);
2468 }
2469
2470 static void GLAPIENTRY
TAG(MultiTexCoord4i)2471 TAG(MultiTexCoord4i)(GLenum target, GLint s, GLint t, GLint r, GLint q)
2472 {
2473 GET_CURRENT_CONTEXT(ctx);
2474 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
2475 ATTR4F(attr, (GLfloat) s, (GLfloat) t, (GLfloat) r, (GLfloat) q);
2476 }
2477
2478 static void GLAPIENTRY
TAG(MultiTexCoord4iv)2479 TAG(MultiTexCoord4iv)(GLenum target, const GLint *v)
2480 {
2481 GET_CURRENT_CONTEXT(ctx);
2482 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
2483 ATTR4F(attr, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3]);
2484 }
2485
2486 static void GLAPIENTRY
TAG(MultiTexCoord4s)2487 TAG(MultiTexCoord4s)(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q)
2488 {
2489 GET_CURRENT_CONTEXT(ctx);
2490 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
2491 ATTR4F(attr, (GLfloat) s, (GLfloat) t, (GLfloat) r, (GLfloat) q);
2492 }
2493
2494 static void GLAPIENTRY
TAG(MultiTexCoord4sv)2495 TAG(MultiTexCoord4sv)(GLenum target, const GLshort *v)
2496 {
2497 GET_CURRENT_CONTEXT(ctx);
2498 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0;
2499 ATTR4F(attr, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3]);
2500 }
2501
2502
2503 static void GLAPIENTRY
TAG(EvalCoord2dv)2504 TAG(EvalCoord2dv)(const GLdouble *u)
2505 {
2506 TAG(EvalCoord2f)((GLfloat) u[0], (GLfloat) u[1]);
2507 }
2508
2509 static void GLAPIENTRY
TAG(EvalCoord2d)2510 TAG(EvalCoord2d)(GLdouble u, GLdouble v)
2511 {
2512 TAG(EvalCoord2f)((GLfloat) u, (GLfloat) v);
2513 }
2514
2515 static void GLAPIENTRY
TAG(EvalCoord1dv)2516 TAG(EvalCoord1dv)(const GLdouble *u)
2517 {
2518 TAG(EvalCoord1f)((GLfloat) *u);
2519 }
2520
2521 static void GLAPIENTRY
TAG(EvalCoord1d)2522 TAG(EvalCoord1d)(GLdouble u)
2523 {
2524 TAG(EvalCoord1f)((GLfloat) u);
2525 }
2526
2527
2528 static void GLAPIENTRY
TAG(Materialf)2529 TAG(Materialf)(GLenum face, GLenum pname, GLfloat param)
2530 {
2531 GLfloat fparam[4];
2532 fparam[0] = param;
2533 TAG(Materialfv)(face, pname, fparam);
2534 }
2535
2536 static void GLAPIENTRY
TAG(Materiali)2537 TAG(Materiali)(GLenum face, GLenum pname, GLint param)
2538 {
2539 GLfloat p[4];
2540 p[0] = (GLfloat) param;
2541 TAG(Materialfv)(face, pname, p);
2542 }
2543
2544 static void GLAPIENTRY
TAG(Materialiv)2545 TAG(Materialiv)(GLenum face, GLenum pname, const GLint *params)
2546 {
2547 GLfloat fparam[4];
2548 switch (pname) {
2549 case GL_AMBIENT:
2550 case GL_DIFFUSE:
2551 case GL_SPECULAR:
2552 case GL_EMISSION:
2553 case GL_AMBIENT_AND_DIFFUSE:
2554 fparam[0] = INT_TO_FLOAT(params[0]);
2555 fparam[1] = INT_TO_FLOAT(params[1]);
2556 fparam[2] = INT_TO_FLOAT(params[2]);
2557 fparam[3] = INT_TO_FLOAT(params[3]);
2558 break;
2559 case GL_SHININESS:
2560 fparam[0] = (GLfloat) params[0];
2561 break;
2562 case GL_COLOR_INDEXES:
2563 fparam[0] = (GLfloat) params[0];
2564 fparam[1] = (GLfloat) params[1];
2565 fparam[2] = (GLfloat) params[2];
2566 break;
2567 default:
2568 ;
2569 }
2570 TAG(Materialfv)(face, pname, fparam);
2571 }
2572
2573
2574 static void GLAPIENTRY
TAG(SecondaryColor3b)2575 TAG(SecondaryColor3b)(GLbyte red, GLbyte green, GLbyte blue)
2576 {
2577 GET_CURRENT_CONTEXT(ctx);
2578 ATTR3F(VBO_ATTRIB_COLOR1, BYTE_TO_FLOAT(red),
2579 BYTE_TO_FLOAT(green),
2580 BYTE_TO_FLOAT(blue));
2581 }
2582
2583 static void GLAPIENTRY
TAG(SecondaryColor3d)2584 TAG(SecondaryColor3d)(GLdouble red, GLdouble green, GLdouble blue)
2585 {
2586 GET_CURRENT_CONTEXT(ctx);
2587 ATTR3F(VBO_ATTRIB_COLOR1, (GLfloat) red, (GLfloat) green, (GLfloat) blue);
2588 }
2589
2590 static void GLAPIENTRY
TAG(SecondaryColor3i)2591 TAG(SecondaryColor3i)(GLint red, GLint green, GLint blue)
2592 {
2593 GET_CURRENT_CONTEXT(ctx);
2594 ATTR3F(VBO_ATTRIB_COLOR1, INT_TO_FLOAT(red),
2595 INT_TO_FLOAT(green),
2596 INT_TO_FLOAT(blue));
2597 }
2598
2599 static void GLAPIENTRY
TAG(SecondaryColor3s)2600 TAG(SecondaryColor3s)(GLshort red, GLshort green, GLshort blue)
2601 {
2602 GET_CURRENT_CONTEXT(ctx);
2603 ATTR3F(VBO_ATTRIB_COLOR1, SHORT_TO_FLOAT(red),
2604 SHORT_TO_FLOAT(green),
2605 SHORT_TO_FLOAT(blue));
2606 }
2607
2608 static void GLAPIENTRY
TAG(SecondaryColor3ui)2609 TAG(SecondaryColor3ui)(GLuint red, GLuint green, GLuint blue)
2610 {
2611 GET_CURRENT_CONTEXT(ctx);
2612 ATTR3F(VBO_ATTRIB_COLOR1, UINT_TO_FLOAT(red),
2613 UINT_TO_FLOAT(green),
2614 UINT_TO_FLOAT(blue));
2615 }
2616
2617 static void GLAPIENTRY
TAG(SecondaryColor3us)2618 TAG(SecondaryColor3us)(GLushort red, GLushort green, GLushort blue)
2619 {
2620 GET_CURRENT_CONTEXT(ctx);
2621 ATTR3F(VBO_ATTRIB_COLOR1, USHORT_TO_FLOAT(red),
2622 USHORT_TO_FLOAT(green),
2623 USHORT_TO_FLOAT(blue));
2624 }
2625
2626 static void GLAPIENTRY
TAG(SecondaryColor3ub)2627 TAG(SecondaryColor3ub)(GLubyte red, GLubyte green, GLubyte blue)
2628 {
2629 GET_CURRENT_CONTEXT(ctx);
2630 ATTR3F(VBO_ATTRIB_COLOR1, UBYTE_TO_FLOAT(red),
2631 UBYTE_TO_FLOAT(green),
2632 UBYTE_TO_FLOAT(blue));
2633 }
2634
2635 static void GLAPIENTRY
TAG(SecondaryColor3bv)2636 TAG(SecondaryColor3bv)(const GLbyte *v)
2637 {
2638 GET_CURRENT_CONTEXT(ctx);
2639 ATTR3F(VBO_ATTRIB_COLOR1, BYTE_TO_FLOAT(v[0]),
2640 BYTE_TO_FLOAT(v[1]),
2641 BYTE_TO_FLOAT(v[2]));
2642 }
2643
2644 static void GLAPIENTRY
TAG(SecondaryColor3dv)2645 TAG(SecondaryColor3dv)(const GLdouble *v)
2646 {
2647 GET_CURRENT_CONTEXT(ctx);
2648 ATTR3F(VBO_ATTRIB_COLOR1, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2]);
2649 }
2650
2651 static void GLAPIENTRY
TAG(SecondaryColor3iv)2652 TAG(SecondaryColor3iv)(const GLint *v)
2653 {
2654 GET_CURRENT_CONTEXT(ctx);
2655 ATTR3F(VBO_ATTRIB_COLOR1, INT_TO_FLOAT(v[0]),
2656 INT_TO_FLOAT(v[1]),
2657 INT_TO_FLOAT(v[2]));
2658 }
2659
2660 static void GLAPIENTRY
TAG(SecondaryColor3sv)2661 TAG(SecondaryColor3sv)(const GLshort *v)
2662 {
2663 GET_CURRENT_CONTEXT(ctx);
2664 ATTR3F(VBO_ATTRIB_COLOR1, SHORT_TO_FLOAT(v[0]),
2665 SHORT_TO_FLOAT(v[1]),
2666 SHORT_TO_FLOAT(v[2]));
2667 }
2668
2669 static void GLAPIENTRY
TAG(SecondaryColor3uiv)2670 TAG(SecondaryColor3uiv)(const GLuint *v)
2671 {
2672 GET_CURRENT_CONTEXT(ctx);
2673 ATTR3F(VBO_ATTRIB_COLOR1, UINT_TO_FLOAT(v[0]),
2674 UINT_TO_FLOAT(v[1]),
2675 UINT_TO_FLOAT(v[2]));
2676 }
2677
2678 static void GLAPIENTRY
TAG(SecondaryColor3usv)2679 TAG(SecondaryColor3usv)(const GLushort *v)
2680 {
2681 GET_CURRENT_CONTEXT(ctx);
2682 ATTR3F(VBO_ATTRIB_COLOR1, USHORT_TO_FLOAT(v[0]),
2683 USHORT_TO_FLOAT(v[1]),
2684 USHORT_TO_FLOAT(v[2]));
2685 }
2686
2687 static void GLAPIENTRY
TAG(SecondaryColor3ubv)2688 TAG(SecondaryColor3ubv)(const GLubyte *v)
2689 {
2690 GET_CURRENT_CONTEXT(ctx);
2691 ATTR3F(VBO_ATTRIB_COLOR1, UBYTE_TO_FLOAT(v[0]),
2692 UBYTE_TO_FLOAT(v[1]),
2693 UBYTE_TO_FLOAT(v[2]));
2694 }
2695
2696
2697 /*
2698 * GL_NV_vertex_program:
2699 * Note that attribute indexes DO alias conventional vertex attributes.
2700 */
2701
2702 static void GLAPIENTRY
TAG(VertexAttrib1sNV)2703 TAG(VertexAttrib1sNV)(GLuint index, GLshort x)
2704 {
2705 GET_CURRENT_CONTEXT(ctx);
2706 if (index < VBO_ATTRIB_MAX) ATTR1F(index, (GLfloat) x);
2707 }
2708
2709 static void GLAPIENTRY
TAG(VertexAttrib1dNV)2710 TAG(VertexAttrib1dNV)(GLuint index, GLdouble x)
2711 {
2712 GET_CURRENT_CONTEXT(ctx);
2713 if (index < VBO_ATTRIB_MAX) ATTR1F(index, (GLfloat) x);
2714 }
2715
2716 static void GLAPIENTRY
TAG(VertexAttrib2sNV)2717 TAG(VertexAttrib2sNV)(GLuint index, GLshort x, GLshort y)
2718 {
2719 GET_CURRENT_CONTEXT(ctx);
2720 if (index < VBO_ATTRIB_MAX) ATTR2F(index, (GLfloat) x, y);
2721 }
2722
2723 static void GLAPIENTRY
TAG(VertexAttrib2dNV)2724 TAG(VertexAttrib2dNV)(GLuint index, GLdouble x, GLdouble y)
2725 {
2726 GET_CURRENT_CONTEXT(ctx);
2727 if (index < VBO_ATTRIB_MAX) ATTR2F(index, (GLfloat) x, (GLfloat) y);
2728 }
2729
2730 static void GLAPIENTRY
TAG(VertexAttrib3sNV)2731 TAG(VertexAttrib3sNV)(GLuint index, GLshort x, GLshort y, GLshort z)
2732 {
2733 GET_CURRENT_CONTEXT(ctx);
2734 if (index < VBO_ATTRIB_MAX) ATTR3F(index, (GLfloat) x, (GLfloat) y, (GLfloat) z);
2735 }
2736
2737 static void GLAPIENTRY
TAG(VertexAttrib3dNV)2738 TAG(VertexAttrib3dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z)
2739 {
2740 GET_CURRENT_CONTEXT(ctx);
2741 if (index < VBO_ATTRIB_MAX) ATTR4F(index, (GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F);
2742 }
2743
2744 static void GLAPIENTRY
TAG(VertexAttrib4sNV)2745 TAG(VertexAttrib4sNV)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w)
2746 {
2747 GET_CURRENT_CONTEXT(ctx);
2748 if (index < VBO_ATTRIB_MAX) ATTR4F(index, (GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w);
2749 }
2750
2751 static void GLAPIENTRY
TAG(VertexAttrib4dNV)2752 TAG(VertexAttrib4dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
2753 {
2754 GET_CURRENT_CONTEXT(ctx);
2755 if (index < VBO_ATTRIB_MAX) ATTR4F(index, (GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w);
2756 }
2757
2758 static void GLAPIENTRY
TAG(VertexAttrib4ubNV)2759 TAG(VertexAttrib4ubNV)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w)
2760 {
2761 GET_CURRENT_CONTEXT(ctx);
2762 if (index < VBO_ATTRIB_MAX) ATTR4F(index, UBYTE_TO_FLOAT(x), UBYTE_TO_FLOAT(y),
2763 UBYTE_TO_FLOAT(z), UBYTE_TO_FLOAT(w));
2764 }
2765
2766 static void GLAPIENTRY
TAG(VertexAttrib1svNV)2767 TAG(VertexAttrib1svNV)(GLuint index, const GLshort *v)
2768 {
2769 GET_CURRENT_CONTEXT(ctx);
2770 if (index < VBO_ATTRIB_MAX) ATTR1F(index, (GLfloat) v[0]);
2771 }
2772
2773 static void GLAPIENTRY
TAG(VertexAttrib1dvNV)2774 TAG(VertexAttrib1dvNV)(GLuint index, const GLdouble *v)
2775 {
2776 GET_CURRENT_CONTEXT(ctx);
2777 if (index < VBO_ATTRIB_MAX) ATTR1F(index, (GLfloat) v[0]);
2778 }
2779
2780 static void GLAPIENTRY
TAG(VertexAttrib2svNV)2781 TAG(VertexAttrib2svNV)(GLuint index, const GLshort *v)
2782 {
2783 GET_CURRENT_CONTEXT(ctx);
2784 if (index < VBO_ATTRIB_MAX) ATTR2F(index, (GLfloat) v[0], (GLfloat) v[1]);
2785 }
2786
2787 static void GLAPIENTRY
TAG(VertexAttrib2dvNV)2788 TAG(VertexAttrib2dvNV)(GLuint index, const GLdouble *v)
2789 {
2790 GET_CURRENT_CONTEXT(ctx);
2791 if (index < VBO_ATTRIB_MAX) ATTR2F(index, (GLfloat) v[0], (GLfloat) v[1]);
2792 }
2793
2794 static void GLAPIENTRY
TAG(VertexAttrib3svNV)2795 TAG(VertexAttrib3svNV)(GLuint index, const GLshort *v)
2796 {
2797 GET_CURRENT_CONTEXT(ctx);
2798 if (index < VBO_ATTRIB_MAX) ATTR3F(index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2]);
2799 }
2800
2801 static void GLAPIENTRY
TAG(VertexAttrib3dvNV)2802 TAG(VertexAttrib3dvNV)(GLuint index, const GLdouble *v)
2803 {
2804 GET_CURRENT_CONTEXT(ctx);
2805 if (index < VBO_ATTRIB_MAX) ATTR3F(index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2]);
2806 }
2807
2808 static void GLAPIENTRY
TAG(VertexAttrib4svNV)2809 TAG(VertexAttrib4svNV)(GLuint index, const GLshort *v)
2810 {
2811 GET_CURRENT_CONTEXT(ctx);
2812 if (index < VBO_ATTRIB_MAX) ATTR4F(index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2],
2813 (GLfloat)v[3]);
2814 }
2815
2816 static void GLAPIENTRY
TAG(VertexAttrib4dvNV)2817 TAG(VertexAttrib4dvNV)(GLuint index, const GLdouble *v)
2818 {
2819 GET_CURRENT_CONTEXT(ctx);
2820 if (index < VBO_ATTRIB_MAX) ATTR4F(index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3]);
2821 }
2822
2823 static void GLAPIENTRY
TAG(VertexAttrib4ubvNV)2824 TAG(VertexAttrib4ubvNV)(GLuint index, const GLubyte *v)
2825 {
2826 GET_CURRENT_CONTEXT(ctx);
2827 if (index < VBO_ATTRIB_MAX) ATTR4F(index, UBYTE_TO_FLOAT(v[0]), UBYTE_TO_FLOAT(v[1]),
2828 UBYTE_TO_FLOAT(v[2]), UBYTE_TO_FLOAT(v[3]));
2829 }
2830
2831
2832 static void GLAPIENTRY
TAG(VertexAttribs1svNV)2833 TAG(VertexAttribs1svNV)(GLuint index, GLsizei n, const GLshort *v)
2834 {
2835 GET_CURRENT_CONTEXT(ctx);
2836 GLint i;
2837 n = MIN2(n, VBO_ATTRIB_MAX - index);
2838 for (i = n - 1; i >= 0; i--)
2839 ATTR1F(index + i, (GLfloat) v[i]);
2840 }
2841
2842 static void GLAPIENTRY
TAG(VertexAttribs1fvNV)2843 TAG(VertexAttribs1fvNV)(GLuint index, GLsizei n, const GLfloat *v)
2844 {
2845 GET_CURRENT_CONTEXT(ctx);
2846 GLint i;
2847 n = MIN2(n, VBO_ATTRIB_MAX - index);
2848 for (i = n - 1; i >= 0; i--)
2849 ATTR1F(index + i, v[i]);
2850 }
2851
2852 static void GLAPIENTRY
TAG(VertexAttribs1dvNV)2853 TAG(VertexAttribs1dvNV)(GLuint index, GLsizei n, const GLdouble *v)
2854 {
2855 GET_CURRENT_CONTEXT(ctx);
2856 GLint i;
2857 n = MIN2(n, VBO_ATTRIB_MAX - index);
2858 for (i = n - 1; i >= 0; i--)
2859 ATTR1F(index + i, (GLfloat) v[i]);
2860 }
2861
2862 static void GLAPIENTRY
TAG(VertexAttribs2svNV)2863 TAG(VertexAttribs2svNV)(GLuint index, GLsizei n, const GLshort *v)
2864 {
2865 GET_CURRENT_CONTEXT(ctx);
2866 GLint i;
2867 n = MIN2(n, VBO_ATTRIB_MAX - index);
2868 for (i = n - 1; i >= 0; i--)
2869 ATTR2F(index + i, (GLfloat) v[2 * i], (GLfloat) v[2 * i + 1]);
2870 }
2871
2872 static void GLAPIENTRY
TAG(VertexAttribs2fvNV)2873 TAG(VertexAttribs2fvNV)(GLuint index, GLsizei n, const GLfloat *v)
2874 {
2875 GET_CURRENT_CONTEXT(ctx);
2876 GLint i;
2877 n = MIN2(n, VBO_ATTRIB_MAX - index);
2878 for (i = n - 1; i >= 0; i--)
2879 ATTR2F(index + i, v[2 * i], v[2 * i + 1]);
2880 }
2881
2882 static void GLAPIENTRY
TAG(VertexAttribs2dvNV)2883 TAG(VertexAttribs2dvNV)(GLuint index, GLsizei n, const GLdouble *v)
2884 {
2885 GET_CURRENT_CONTEXT(ctx);
2886 GLint i;
2887 n = MIN2(n, VBO_ATTRIB_MAX - index);
2888 for (i = n - 1; i >= 0; i--)
2889 ATTR2F(index + i, (GLfloat) v[2 * i], (GLfloat) v[2 * i + 1]);
2890 }
2891
2892 static void GLAPIENTRY
TAG(VertexAttribs3svNV)2893 TAG(VertexAttribs3svNV)(GLuint index, GLsizei n, const GLshort *v)
2894 {
2895 GET_CURRENT_CONTEXT(ctx);
2896 GLint i;
2897 n = MIN2(n, VBO_ATTRIB_MAX - index);
2898 for (i = n - 1; i >= 0; i--)
2899 ATTR3F(index + i, (GLfloat) v[3 * i], (GLfloat) v[3 * i + 1], (GLfloat) v[3 * i + 2]);
2900 }
2901
2902 static void GLAPIENTRY
TAG(VertexAttribs3fvNV)2903 TAG(VertexAttribs3fvNV)(GLuint index, GLsizei n, const GLfloat *v)
2904 {
2905 GET_CURRENT_CONTEXT(ctx);
2906 GLint i;
2907 n = MIN2(n, VBO_ATTRIB_MAX - index);
2908 for (i = n - 1; i >= 0; i--)
2909 ATTR3F(index + i, v[3 * i], v[3 * i + 1], v[3 * i + 2]);
2910 }
2911
2912 static void GLAPIENTRY
TAG(VertexAttribs3dvNV)2913 TAG(VertexAttribs3dvNV)(GLuint index, GLsizei n, const GLdouble *v)
2914 {
2915 GET_CURRENT_CONTEXT(ctx);
2916 GLint i;
2917 n = MIN2(n, VBO_ATTRIB_MAX - index);
2918 for (i = n - 1; i >= 0; i--)
2919 ATTR3F(index + i, (GLfloat) v[3 * i], (GLfloat) v[3 * i + 1], (GLfloat) v[3 * i + 2]);
2920 }
2921
2922 static void GLAPIENTRY
TAG(VertexAttribs4svNV)2923 TAG(VertexAttribs4svNV)(GLuint index, GLsizei n, const GLshort *v)
2924 {
2925 GET_CURRENT_CONTEXT(ctx);
2926 GLint i;
2927 n = MIN2(n, VBO_ATTRIB_MAX - index);
2928 for (i = n - 1; i >= 0; i--)
2929 ATTR4F(index + i, (GLfloat) v[4 * i], (GLfloat) v[4 * i + 1], (GLfloat) v[4 * i + 2], (GLfloat) v[4 * i + 3]);
2930 }
2931
2932 static void GLAPIENTRY
TAG(VertexAttribs4fvNV)2933 TAG(VertexAttribs4fvNV)(GLuint index, GLsizei n, const GLfloat *v)
2934 {
2935 GET_CURRENT_CONTEXT(ctx);
2936 GLint i;
2937 n = MIN2(n, VBO_ATTRIB_MAX - index);
2938 for (i = n - 1; i >= 0; i--)
2939 ATTR4F(index + i, v[4 * i], v[4 * i + 1], v[4 * i + 2], v[4 * i + 3]);
2940 }
2941
2942 static void GLAPIENTRY
TAG(VertexAttribs4dvNV)2943 TAG(VertexAttribs4dvNV)(GLuint index, GLsizei n, const GLdouble *v)
2944 {
2945 GET_CURRENT_CONTEXT(ctx);
2946 GLint i;
2947 n = MIN2(n, VBO_ATTRIB_MAX - index);
2948 for (i = n - 1; i >= 0; i--)
2949 ATTR4F(index + i, (GLfloat) v[4 * i], (GLfloat) v[4 * i + 1], (GLfloat) v[4 * i + 2], (GLfloat) v[4 * i + 3]);
2950 }
2951
2952 static void GLAPIENTRY
TAG(VertexAttribs4ubvNV)2953 TAG(VertexAttribs4ubvNV)(GLuint index, GLsizei n, const GLubyte *v)
2954 {
2955 GET_CURRENT_CONTEXT(ctx);
2956 GLint i;
2957 n = MIN2(n, VBO_ATTRIB_MAX - index);
2958 for (i = n - 1; i >= 0; i--)
2959 ATTR4F(index + i, UBYTE_TO_FLOAT(v[4 * i]), UBYTE_TO_FLOAT(v[4 * i + 1]),
2960 UBYTE_TO_FLOAT(v[4 * i + 2]), UBYTE_TO_FLOAT(v[4 * i + 3]));
2961 }
2962
2963
2964 /*
2965 * GL_ARB_vertex_program
2966 * Note that attribute indexes do NOT alias conventional attributes.
2967 */
2968
2969 static void GLAPIENTRY
TAG(VertexAttrib1s)2970 TAG(VertexAttrib1s)(GLuint index, GLshort x)
2971 {
2972 GET_CURRENT_CONTEXT(ctx);
2973 if (is_vertex_position(ctx, index))
2974 ATTR1F(0, (GLfloat) x);
2975 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
2976 ATTR1F(VBO_ATTRIB_GENERIC0 + index, (GLfloat) x);
2977 else
2978 ERROR(GL_INVALID_VALUE);
2979 }
2980
2981 static void GLAPIENTRY
TAG(VertexAttrib1d)2982 TAG(VertexAttrib1d)(GLuint index, GLdouble x)
2983 {
2984 GET_CURRENT_CONTEXT(ctx);
2985 if (is_vertex_position(ctx, index))
2986 ATTR1F(0, (GLfloat) x);
2987 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
2988 ATTR1F(VBO_ATTRIB_GENERIC0 + index, (GLfloat) x);
2989 else
2990 ERROR(GL_INVALID_VALUE);
2991 }
2992
2993 static void GLAPIENTRY
TAG(VertexAttrib2s)2994 TAG(VertexAttrib2s)(GLuint index, GLshort x, GLshort y)
2995 {
2996 GET_CURRENT_CONTEXT(ctx);
2997 if (is_vertex_position(ctx, index))
2998 ATTR2F(0, (GLfloat) x, (GLfloat) y);
2999 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
3000 ATTR2F(VBO_ATTRIB_GENERIC0 + index, (GLfloat) x, (GLfloat) y);
3001 else
3002 ERROR(GL_INVALID_VALUE);
3003 }
3004
3005 static void GLAPIENTRY
TAG(VertexAttrib2d)3006 TAG(VertexAttrib2d)(GLuint index, GLdouble x, GLdouble y)
3007 {
3008 GET_CURRENT_CONTEXT(ctx);
3009 if (is_vertex_position(ctx, index))
3010 ATTR2F(0, (GLfloat) x, (GLfloat) y);
3011 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
3012 ATTR2F(VBO_ATTRIB_GENERIC0 + index, (GLfloat) x, (GLfloat) y);
3013 else
3014 ERROR(GL_INVALID_VALUE);
3015 }
3016
3017 static void GLAPIENTRY
TAG(VertexAttrib3s)3018 TAG(VertexAttrib3s)(GLuint index, GLshort x, GLshort y, GLshort z)
3019 {
3020 GET_CURRENT_CONTEXT(ctx);
3021 if (is_vertex_position(ctx, index))
3022 ATTR3F(0, (GLfloat) x, (GLfloat) y, (GLfloat) z);
3023 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
3024 ATTR3F(VBO_ATTRIB_GENERIC0 + index, (GLfloat) x, (GLfloat) y, (GLfloat) z);
3025 else
3026 ERROR(GL_INVALID_VALUE);
3027 }
3028
3029 static void GLAPIENTRY
TAG(VertexAttrib3d)3030 TAG(VertexAttrib3d)(GLuint index, GLdouble x, GLdouble y, GLdouble z)
3031 {
3032 GET_CURRENT_CONTEXT(ctx);
3033 if (is_vertex_position(ctx, index))
3034 ATTR3F(0, (GLfloat) x, (GLfloat) y, (GLfloat) z);
3035 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
3036 ATTR3F(VBO_ATTRIB_GENERIC0 + index, (GLfloat) x, (GLfloat) y, (GLfloat) z);
3037 else
3038 ERROR(GL_INVALID_VALUE);
3039 }
3040
3041 static void GLAPIENTRY
TAG(VertexAttrib4s)3042 TAG(VertexAttrib4s)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w)
3043 {
3044 GET_CURRENT_CONTEXT(ctx);
3045 if (is_vertex_position(ctx, index))
3046 ATTR4F(0, (GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w);
3047 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
3048 ATTR4F(VBO_ATTRIB_GENERIC0 + index, (GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w);
3049 else
3050 ERROR(GL_INVALID_VALUE);
3051 }
3052
3053 static void GLAPIENTRY
TAG(VertexAttrib4d)3054 TAG(VertexAttrib4d)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
3055 {
3056 GET_CURRENT_CONTEXT(ctx);
3057 if (is_vertex_position(ctx, index))
3058 ATTR4F(0, (GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w);
3059 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
3060 ATTR4F(VBO_ATTRIB_GENERIC0 + index, (GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w);
3061 else
3062 ERROR(GL_INVALID_VALUE);
3063 }
3064
3065 static void GLAPIENTRY
TAG(VertexAttrib1sv)3066 TAG(VertexAttrib1sv)(GLuint index, const GLshort *v)
3067 {
3068 GET_CURRENT_CONTEXT(ctx);
3069 if (is_vertex_position(ctx, index))
3070 ATTR1F(0, (GLfloat) v[0]);
3071 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
3072 ATTR1F(VBO_ATTRIB_GENERIC0 + index, (GLfloat) v[0]);
3073 else
3074 ERROR(GL_INVALID_VALUE);
3075 }
3076
3077 static void GLAPIENTRY
TAG(VertexAttrib1dv)3078 TAG(VertexAttrib1dv)(GLuint index, const GLdouble *v)
3079 {
3080 GET_CURRENT_CONTEXT(ctx);
3081 if (is_vertex_position(ctx, index))
3082 ATTR1F(0, (GLfloat) v[0]);
3083 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
3084 ATTR1F(VBO_ATTRIB_GENERIC0 + index, (GLfloat) v[0]);
3085 else
3086 ERROR(GL_INVALID_VALUE);
3087 }
3088
3089 static void GLAPIENTRY
TAG(VertexAttrib2sv)3090 TAG(VertexAttrib2sv)(GLuint index, const GLshort *v)
3091 {
3092 GET_CURRENT_CONTEXT(ctx);
3093 if (is_vertex_position(ctx, index))
3094 ATTR2F(0, (GLfloat) v[0], (GLfloat) v[1]);
3095 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
3096 ATTR2F(VBO_ATTRIB_GENERIC0 + index, (GLfloat) v[0], (GLfloat) v[1]);
3097 else
3098 ERROR(GL_INVALID_VALUE);
3099 }
3100
3101 static void GLAPIENTRY
TAG(VertexAttrib2dv)3102 TAG(VertexAttrib2dv)(GLuint index, const GLdouble *v)
3103 {
3104 GET_CURRENT_CONTEXT(ctx);
3105 if (is_vertex_position(ctx, index))
3106 ATTR2F(0, (GLfloat) v[0], (GLfloat) v[1]);
3107 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
3108 ATTR2F(VBO_ATTRIB_GENERIC0 + index, (GLfloat) v[0], (GLfloat) v[1]);
3109 else
3110 ERROR(GL_INVALID_VALUE);
3111 }
3112
3113 static void GLAPIENTRY
TAG(VertexAttrib3sv)3114 TAG(VertexAttrib3sv)(GLuint index, const GLshort *v)
3115 {
3116 GET_CURRENT_CONTEXT(ctx);
3117 if (is_vertex_position(ctx, index))
3118 ATTR3F(0, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2]);
3119 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
3120 ATTR3F(VBO_ATTRIB_GENERIC0 + index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2]);
3121 else
3122 ERROR(GL_INVALID_VALUE);
3123 }
3124
3125 static void GLAPIENTRY
TAG(VertexAttrib3dv)3126 TAG(VertexAttrib3dv)(GLuint index, const GLdouble *v)
3127 {
3128 GET_CURRENT_CONTEXT(ctx);
3129 if (is_vertex_position(ctx, index))
3130 ATTR3F(0, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2]);
3131 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
3132 ATTR3F(VBO_ATTRIB_GENERIC0 + index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2]);
3133 else
3134 ERROR(GL_INVALID_VALUE);
3135 }
3136
3137 static void GLAPIENTRY
TAG(VertexAttrib4sv)3138 TAG(VertexAttrib4sv)(GLuint index, const GLshort *v)
3139 {
3140 GET_CURRENT_CONTEXT(ctx);
3141 if (is_vertex_position(ctx, index))
3142 ATTR4F(0, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat)v[3]);
3143 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
3144 ATTR4F(VBO_ATTRIB_GENERIC0 + index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat)v[3]);
3145 else
3146 ERROR(GL_INVALID_VALUE);
3147 }
3148
3149 static void GLAPIENTRY
TAG(VertexAttrib4dv)3150 TAG(VertexAttrib4dv)(GLuint index, const GLdouble *v)
3151 {
3152 GET_CURRENT_CONTEXT(ctx);
3153 if (is_vertex_position(ctx, index))
3154 ATTR4F(0, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat)v[3]);
3155 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
3156 ATTR4F(VBO_ATTRIB_GENERIC0 + index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat)v[3]);
3157 else
3158 ERROR(GL_INVALID_VALUE);
3159 }
3160
3161 static void GLAPIENTRY
TAG(VertexAttrib4bv)3162 TAG(VertexAttrib4bv)(GLuint index, const GLbyte * v)
3163 {
3164 GET_CURRENT_CONTEXT(ctx);
3165 if (is_vertex_position(ctx, index))
3166 ATTR4F(0, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat)v[3]);
3167 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
3168 ATTR4F(VBO_ATTRIB_GENERIC0 + index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat)v[3]);
3169 else
3170 ERROR(GL_INVALID_VALUE);
3171 }
3172
3173 static void GLAPIENTRY
TAG(VertexAttrib4iv)3174 TAG(VertexAttrib4iv)(GLuint index, const GLint * v)
3175 {
3176 GET_CURRENT_CONTEXT(ctx);
3177 if (is_vertex_position(ctx, index))
3178 ATTR4F(0, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat)v[3]);
3179 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
3180 ATTR4F(VBO_ATTRIB_GENERIC0 + index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat)v[3]);
3181 else
3182 ERROR(GL_INVALID_VALUE);
3183 }
3184
3185 static void GLAPIENTRY
TAG(VertexAttrib4ubv)3186 TAG(VertexAttrib4ubv)(GLuint index, const GLubyte * v)
3187 {
3188 GET_CURRENT_CONTEXT(ctx);
3189 if (is_vertex_position(ctx, index))
3190 ATTR4F(0, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat)v[3]);
3191 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
3192 ATTR4F(VBO_ATTRIB_GENERIC0 + index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat)v[3]);
3193 else
3194 ERROR(GL_INVALID_VALUE);
3195 }
3196
3197 static void GLAPIENTRY
TAG(VertexAttrib4usv)3198 TAG(VertexAttrib4usv)(GLuint index, const GLushort * v)
3199 {
3200 GET_CURRENT_CONTEXT(ctx);
3201 if (is_vertex_position(ctx, index))
3202 ATTR4F(0, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat)v[3]);
3203 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
3204 ATTR4F(VBO_ATTRIB_GENERIC0 + index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat)v[3]);
3205 else
3206 ERROR(GL_INVALID_VALUE);
3207 }
3208
3209 static void GLAPIENTRY
TAG(VertexAttrib4uiv)3210 TAG(VertexAttrib4uiv)(GLuint index, const GLuint * v)
3211 {
3212 GET_CURRENT_CONTEXT(ctx);
3213 if (is_vertex_position(ctx, index))
3214 ATTR4F(0, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat)v[3]);
3215 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
3216 ATTR4F(VBO_ATTRIB_GENERIC0 + index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat)v[3]);
3217 else
3218 ERROR(GL_INVALID_VALUE);
3219 }
3220
3221 static void GLAPIENTRY
TAG(VertexAttrib4Nbv)3222 TAG(VertexAttrib4Nbv)(GLuint index, const GLbyte * v)
3223 {
3224 GET_CURRENT_CONTEXT(ctx);
3225 if (is_vertex_position(ctx, index))
3226 ATTR4F(0, BYTE_TO_FLOAT(v[0]), BYTE_TO_FLOAT(v[1]), BYTE_TO_FLOAT(v[2]), BYTE_TO_FLOAT(v[3]));
3227 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
3228 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]));
3229 else
3230 ERROR(GL_INVALID_VALUE);
3231 }
3232
3233 static void GLAPIENTRY
TAG(VertexAttrib4Nsv)3234 TAG(VertexAttrib4Nsv)(GLuint index, const GLshort * v)
3235 {
3236 GET_CURRENT_CONTEXT(ctx);
3237 if (is_vertex_position(ctx, index))
3238 ATTR4F(0, SHORT_TO_FLOAT(v[0]), SHORT_TO_FLOAT(v[1]), SHORT_TO_FLOAT(v[2]), SHORT_TO_FLOAT(v[3]));
3239 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
3240 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]));
3241 else
3242 ERROR(GL_INVALID_VALUE);
3243 }
3244
3245 static void GLAPIENTRY
TAG(VertexAttrib4Niv)3246 TAG(VertexAttrib4Niv)(GLuint index, const GLint * v)
3247 {
3248 GET_CURRENT_CONTEXT(ctx);
3249 if (is_vertex_position(ctx, index))
3250 ATTR4F(0, INT_TO_FLOAT(v[0]), INT_TO_FLOAT(v[1]), INT_TO_FLOAT(v[2]), INT_TO_FLOAT(v[3]));
3251 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
3252 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]));
3253 else
3254 ERROR(GL_INVALID_VALUE);
3255 }
3256
3257 static void GLAPIENTRY
TAG(VertexAttrib4Nub)3258 TAG(VertexAttrib4Nub)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w)
3259 {
3260 GET_CURRENT_CONTEXT(ctx);
3261 if (is_vertex_position(ctx, index))
3262 ATTR4F(0, UBYTE_TO_FLOAT(x), UBYTE_TO_FLOAT(y), UBYTE_TO_FLOAT(z), UBYTE_TO_FLOAT(w));
3263 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
3264 ATTR4F(VBO_ATTRIB_GENERIC0 + index, UBYTE_TO_FLOAT(x), UBYTE_TO_FLOAT(y), UBYTE_TO_FLOAT(z), UBYTE_TO_FLOAT(w));
3265 else
3266 ERROR(GL_INVALID_VALUE);
3267 }
3268
3269 static void GLAPIENTRY
TAG(VertexAttrib4Nubv)3270 TAG(VertexAttrib4Nubv)(GLuint index, const GLubyte * v)
3271 {
3272 GET_CURRENT_CONTEXT(ctx);
3273 if (is_vertex_position(ctx, index))
3274 ATTR4F(0, UBYTE_TO_FLOAT(v[0]), UBYTE_TO_FLOAT(v[1]), UBYTE_TO_FLOAT(v[2]), UBYTE_TO_FLOAT(v[3]));
3275 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
3276 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]));
3277 else
3278 ERROR(GL_INVALID_VALUE);
3279 }
3280
3281 static void GLAPIENTRY
TAG(VertexAttrib4Nusv)3282 TAG(VertexAttrib4Nusv)(GLuint index, const GLushort * v)
3283 {
3284 GET_CURRENT_CONTEXT(ctx);
3285 if (is_vertex_position(ctx, index))
3286 ATTR4F(0, USHORT_TO_FLOAT(v[0]), USHORT_TO_FLOAT(v[1]), USHORT_TO_FLOAT(v[2]), USHORT_TO_FLOAT(v[3]));
3287 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
3288 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]));
3289 else
3290 ERROR(GL_INVALID_VALUE);
3291 }
3292
3293 static void GLAPIENTRY
TAG(VertexAttrib4Nuiv)3294 TAG(VertexAttrib4Nuiv)(GLuint index, const GLuint * v)
3295 {
3296 GET_CURRENT_CONTEXT(ctx);
3297 if (is_vertex_position(ctx, index))
3298 ATTR4F(0, UINT_TO_FLOAT(v[0]), UINT_TO_FLOAT(v[1]), UINT_TO_FLOAT(v[2]), UINT_TO_FLOAT(v[3]));
3299 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
3300 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]));
3301 else
3302 ERROR(GL_INVALID_VALUE);
3303 }
3304
3305
3306
3307 /**
3308 * GL_EXT_gpu_shader / GL 3.0 signed/unsigned integer-valued attributes.
3309 * Note that attribute indexes do NOT alias conventional attributes.
3310 */
3311
3312 static void GLAPIENTRY
TAG(VertexAttribI1iv)3313 TAG(VertexAttribI1iv)(GLuint index, const GLint *v)
3314 {
3315 GET_CURRENT_CONTEXT(ctx);
3316 if (is_vertex_position(ctx, index))
3317 ATTR1I(0, v[0]);
3318 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
3319 ATTR1I(VBO_ATTRIB_GENERIC0 + index, v[0]);
3320 else
3321 ERROR(GL_INVALID_VALUE);
3322 }
3323
3324 static void GLAPIENTRY
TAG(VertexAttribI1uiv)3325 TAG(VertexAttribI1uiv)(GLuint index, const GLuint *v)
3326 {
3327 GET_CURRENT_CONTEXT(ctx);
3328 if (is_vertex_position(ctx, index))
3329 ATTR1UI(0, v[0]);
3330 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
3331 ATTR1UI(VBO_ATTRIB_GENERIC0 + index, v[0]);
3332 else
3333 ERROR(GL_INVALID_VALUE);
3334 }
3335
3336 static void GLAPIENTRY
TAG(VertexAttribI4bv)3337 TAG(VertexAttribI4bv)(GLuint index, const GLbyte *v)
3338 {
3339 GET_CURRENT_CONTEXT(ctx);
3340 if (is_vertex_position(ctx, index))
3341 ATTR4I(0, v[0], v[1], v[2], v[3]);
3342 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
3343 ATTR4I(VBO_ATTRIB_GENERIC0 + index, v[0], v[1], v[2], v[3]);
3344 else
3345 ERROR(GL_INVALID_VALUE);
3346 }
3347
3348 static void GLAPIENTRY
TAG(VertexAttribI4sv)3349 TAG(VertexAttribI4sv)(GLuint index, const GLshort *v)
3350 {
3351 GET_CURRENT_CONTEXT(ctx);
3352 if (is_vertex_position(ctx, index))
3353 ATTR4I(0, v[0], v[1], v[2], v[3]);
3354 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
3355 ATTR4I(VBO_ATTRIB_GENERIC0 + index, v[0], v[1], v[2], v[3]);
3356 else
3357 ERROR(GL_INVALID_VALUE);
3358 }
3359
3360 static void GLAPIENTRY
TAG(VertexAttribI4ubv)3361 TAG(VertexAttribI4ubv)(GLuint index, const GLubyte *v)
3362 {
3363 GET_CURRENT_CONTEXT(ctx);
3364 if (is_vertex_position(ctx, index))
3365 ATTR4UI(0, v[0], v[1], v[2], v[3]);
3366 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
3367 ATTR4UI(VBO_ATTRIB_GENERIC0 + index, v[0], v[1], v[2], v[3]);
3368 else
3369 ERROR(GL_INVALID_VALUE);
3370 }
3371
3372 static void GLAPIENTRY
TAG(VertexAttribI4usv)3373 TAG(VertexAttribI4usv)(GLuint index, const GLushort *v)
3374 {
3375 GET_CURRENT_CONTEXT(ctx);
3376 if (is_vertex_position(ctx, index))
3377 ATTR4UI(0, v[0], v[1], v[2], v[3]);
3378 else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
3379 ATTR4UI(VBO_ATTRIB_GENERIC0 + index, v[0], v[1], v[2], v[3]);
3380 else
3381 ERROR(GL_INVALID_VALUE);
3382 }
3383
3384 #undef ATTR1FV
3385 #undef ATTR2FV
3386 #undef ATTR3FV
3387 #undef ATTR4FV
3388
3389 #undef ATTR1F
3390 #undef ATTR2F
3391 #undef ATTR3F
3392 #undef ATTR4F
3393
3394 #undef ATTR_UI
3395
3396 #undef MAT
3397