api_arrayelt.c revision 2cf44390d1e819f23e1d7ceb3199276c9148c647
122144ab7552f0799bcfca506bf4ffa7f70a06649Gareth Hughes/*
222144ab7552f0799bcfca506bf4ffa7f70a06649Gareth Hughes * Mesa 3-D graphics library
3095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul * Version:  6.5.1
422144ab7552f0799bcfca506bf4ffa7f70a06649Gareth Hughes *
5eec33cc310ce2b99164d182719c8d6d54b80a704Brian Paul * Copyright (C) 1999-2006  Brian Paul   All Rights Reserved.
622144ab7552f0799bcfca506bf4ffa7f70a06649Gareth Hughes *
722144ab7552f0799bcfca506bf4ffa7f70a06649Gareth Hughes * Permission is hereby granted, free of charge, to any person obtaining a
822144ab7552f0799bcfca506bf4ffa7f70a06649Gareth Hughes * copy of this software and associated documentation files (the "Software"),
922144ab7552f0799bcfca506bf4ffa7f70a06649Gareth Hughes * to deal in the Software without restriction, including without limitation
1022144ab7552f0799bcfca506bf4ffa7f70a06649Gareth Hughes * the rights to use, copy, modify, merge, publish, distribute, sublicense,
1122144ab7552f0799bcfca506bf4ffa7f70a06649Gareth Hughes * and/or sell copies of the Software, and to permit persons to whom the
1222144ab7552f0799bcfca506bf4ffa7f70a06649Gareth Hughes * Software is furnished to do so, subject to the following conditions:
1322144ab7552f0799bcfca506bf4ffa7f70a06649Gareth Hughes *
1422144ab7552f0799bcfca506bf4ffa7f70a06649Gareth Hughes * The above copyright notice and this permission notice shall be included
1522144ab7552f0799bcfca506bf4ffa7f70a06649Gareth Hughes * in all copies or substantial portions of the Software.
1622144ab7552f0799bcfca506bf4ffa7f70a06649Gareth Hughes *
1722144ab7552f0799bcfca506bf4ffa7f70a06649Gareth Hughes * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1822144ab7552f0799bcfca506bf4ffa7f70a06649Gareth Hughes * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1922144ab7552f0799bcfca506bf4ffa7f70a06649Gareth Hughes * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
2022144ab7552f0799bcfca506bf4ffa7f70a06649Gareth Hughes * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
2122144ab7552f0799bcfca506bf4ffa7f70a06649Gareth Hughes * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
2222144ab7552f0799bcfca506bf4ffa7f70a06649Gareth Hughes * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2322144ab7552f0799bcfca506bf4ffa7f70a06649Gareth Hughes */
2422144ab7552f0799bcfca506bf4ffa7f70a06649Gareth Hughes
25fc00cbe8d1ac48faf345e41a13757a8a1e2e5ebeKeith Whitwell/* Author:
2605a4b37707d2c598ea68c05d07a3d65bcbf5a076Brian Paul *    Keith Whitwell <keith@tungstengraphics.com>
27fc00cbe8d1ac48faf345e41a13757a8a1e2e5ebeKeith Whitwell */
28fc00cbe8d1ac48faf345e41a13757a8a1e2e5ebeKeith Whitwell
29cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell#include "glheader.h"
304b7d6f216bf768482e07e4d7feb8ca3e1be92d53Keith Whitwell#include "api_arrayelt.h"
31434ec3ada841915a00ffc23f699401eb3e7b37eeBrian Paul#include "bufferobj.h"
32cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell#include "context.h"
333c63452e64df7e10aa073c6c3b9492b1d7dabbb8Brian Paul#include "imports.h"
34cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell#include "macros.h"
352cf44390d1e819f23e1d7ceb3199276c9148c647Chia-I Wu#include "main/dispatch.h"
36cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell
37faaf78aeb0e18c75c9b204a634f296b9c056cf5cRoland Scheideggertypedef void (GLAPIENTRY *array_func)( const void * );
380aa8a1062a06616fad18a1901afb5fa67fdcf82aBrian Paul
39cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwelltypedef struct {
400d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul   const struct gl_client_array *array;
419bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick   int offset;
42faaf78aeb0e18c75c9b204a634f296b9c056cf5cRoland Scheidegger} AEarray;
430aa8a1062a06616fad18a1901afb5fa67fdcf82aBrian Paul
440d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paultypedef void (GLAPIENTRY *attrib_func)( GLuint indx, const void *data );
450d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
460d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paultypedef struct {
470d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul   const struct gl_client_array *array;
480d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul   attrib_func func;
490d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul   GLuint index;
500d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul} AEattrib;
510d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
520aa8a1062a06616fad18a1901afb5fa67fdcf82aBrian Paultypedef struct {
5353ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul   AEarray arrays[32];
540d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul   AEattrib attribs[VERT_ATTRIB_MAX + 1];
55cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell   GLuint NewState;
56b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell
57b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell   struct gl_buffer_object *vbo[VERT_ATTRIB_MAX];
58b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell   GLuint nr_vbos;
59b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell   GLboolean mapped_vbos;
60b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell
614b7d6f216bf768482e07e4d7feb8ca3e1be92d53Keith Whitwell} AEcontext;
624b7d6f216bf768482e07e4d7feb8ca3e1be92d53Keith Whitwell
634b7d6f216bf768482e07e4d7feb8ca3e1be92d53Keith Whitwell#define AE_CONTEXT(ctx) ((AEcontext *)(ctx)->aelt_context)
640d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
659bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick
660d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul/*
670d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul * Convert GL_BYTE, GL_UNSIGNED_BYTE, .. GL_DOUBLE into an integer
680d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul * in the range [0, 7].  Luckily these type tokens are sequentially
69f2f33507748260fe766742a0ed8b02c49d548bd8Brian Paul * numbered in gl.h, except for GL_DOUBLE.
700d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul */
71f2f33507748260fe766742a0ed8b02c49d548bd8Brian Paul#define TYPE_IDX(t) ( (t) == GL_DOUBLE ? 7 : (t) & 7 )
72cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell
7380630d1fed6cd32e75f5e97e2cd27509be21d093Chia-I Wu
7480630d1fed6cd32e75f5e97e2cd27509be21d093Chia-I Wu#if FEATURE_arrayelt
7580630d1fed6cd32e75f5e97e2cd27509be21d093Chia-I Wu
7680630d1fed6cd32e75f5e97e2cd27509be21d093Chia-I Wu
779bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanickstatic const int ColorFuncs[2][8] = {
7894987beb2c9e87d9c55db5cb7c089dc77f78df94Adam Jackson   {
799bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick      _gloffset_Color3bv,
809bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick      _gloffset_Color3ubv,
819bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick      _gloffset_Color3sv,
829bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick      _gloffset_Color3usv,
839bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick      _gloffset_Color3iv,
849bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick      _gloffset_Color3uiv,
859bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick      _gloffset_Color3fv,
869bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick      _gloffset_Color3dv,
8794987beb2c9e87d9c55db5cb7c089dc77f78df94Adam Jackson   },
8894987beb2c9e87d9c55db5cb7c089dc77f78df94Adam Jackson   {
899bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick      _gloffset_Color4bv,
909bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick      _gloffset_Color4ubv,
919bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick      _gloffset_Color4sv,
929bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick      _gloffset_Color4usv,
939bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick      _gloffset_Color4iv,
949bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick      _gloffset_Color4uiv,
959bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick      _gloffset_Color4fv,
969bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick      _gloffset_Color4dv,
9794987beb2c9e87d9c55db5cb7c089dc77f78df94Adam Jackson   },
9853ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul};
9953ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul
1009bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanickstatic const int VertexFuncs[3][8] = {
10194987beb2c9e87d9c55db5cb7c089dc77f78df94Adam Jackson   {
1029bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick      -1,
1039bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick      -1,
1049bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick      _gloffset_Vertex2sv,
1059bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick      -1,
1069bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick      _gloffset_Vertex2iv,
1079bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick      -1,
1089bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick      _gloffset_Vertex2fv,
1099bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick      _gloffset_Vertex2dv,
11094987beb2c9e87d9c55db5cb7c089dc77f78df94Adam Jackson   },
11194987beb2c9e87d9c55db5cb7c089dc77f78df94Adam Jackson   {
1129bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick      -1,
1139bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick      -1,
1149bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick      _gloffset_Vertex3sv,
1159bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick      -1,
1169bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick      _gloffset_Vertex3iv,
1179bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick      -1,
1189bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick      _gloffset_Vertex3fv,
1199bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick      _gloffset_Vertex3dv,
12094987beb2c9e87d9c55db5cb7c089dc77f78df94Adam Jackson   },
12194987beb2c9e87d9c55db5cb7c089dc77f78df94Adam Jackson   {
1229bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick      -1,
1239bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick      -1,
1249bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick      _gloffset_Vertex4sv,
1259bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick      -1,
1269bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick      _gloffset_Vertex4iv,
1279bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick      -1,
1289bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick      _gloffset_Vertex4fv,
1299bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick      _gloffset_Vertex4dv,
13094987beb2c9e87d9c55db5cb7c089dc77f78df94Adam Jackson   },
13153ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul};
13253ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul
1339bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanickstatic const int IndexFuncs[8] = {
1349bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick   -1,
1359bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick   _gloffset_Indexubv,
1369bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick   _gloffset_Indexsv,
1379bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick   -1,
1389bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick   _gloffset_Indexiv,
1399bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick   -1,
1409bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick   _gloffset_Indexfv,
1419bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick   _gloffset_Indexdv,
142cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell};
143cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell
1449bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanickstatic const int NormalFuncs[8] = {
1459bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick   _gloffset_Normal3bv,
1469bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick   -1,
1479bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick   _gloffset_Normal3sv,
1489bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick   -1,
1499bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick   _gloffset_Normal3iv,
1509bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick   -1,
1519bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick   _gloffset_Normal3fv,
1529bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick   _gloffset_Normal3dv,
15353ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul};
15453ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul
1550f1d98c422129b002bd3d90699da7fe8286b3c47Brian Paul/* Note: _gloffset_* for these may not be a compile-time constant. */
156126c89e35fb5179fe077f7593f31ea874c89dd65Ian Romanickstatic int SecondaryColorFuncs[8];
1570f1d98c422129b002bd3d90699da7fe8286b3c47Brian Paulstatic int FogCoordFuncs[8];
15853ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul
159095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
160095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul/**
161095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul ** GL_NV_vertex_program
162095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul **/
1630d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
1640d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul/* GL_BYTE attributes */
1650d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
166b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paulstatic void GLAPIENTRY VertexAttrib1NbvNV(GLuint index, const GLbyte *v)
1670d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{
1689bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick   CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, BYTE_TO_FLOAT(v[0])));
1690d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul}
1700d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
171b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paulstatic void GLAPIENTRY VertexAttrib1bvNV(GLuint index, const GLbyte *v)
1720d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{
173c07e274f44356cb662c04817f810d8d1adedd872Keith Whitwell   CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, (GLfloat)v[0]));
1740d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul}
1750d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
176b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paulstatic void GLAPIENTRY VertexAttrib2NbvNV(GLuint index, const GLbyte *v)
1770d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{
1789bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick   CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, BYTE_TO_FLOAT(v[0]), BYTE_TO_FLOAT(v[1])));
1790d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul}
1800d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
181b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paulstatic void GLAPIENTRY VertexAttrib2bvNV(GLuint index, const GLbyte *v)
1820d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{
183c07e274f44356cb662c04817f810d8d1adedd872Keith Whitwell   CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1]));
1840d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul}
1850d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
186b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paulstatic void GLAPIENTRY VertexAttrib3NbvNV(GLuint index, const GLbyte *v)
1870d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{
1889bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick   CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, BYTE_TO_FLOAT(v[0]),
1899bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick					       BYTE_TO_FLOAT(v[1]),
1909bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick					       BYTE_TO_FLOAT(v[2])));
1910d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul}
1920d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
193b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paulstatic void GLAPIENTRY VertexAttrib3bvNV(GLuint index, const GLbyte *v)
1940d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{
195c07e274f44356cb662c04817f810d8d1adedd872Keith Whitwell   CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2]));
1960d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul}
1970d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
198b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paulstatic void GLAPIENTRY VertexAttrib4NbvNV(GLuint index, const GLbyte *v)
1990d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{
2009bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick   CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, BYTE_TO_FLOAT(v[0]),
2019bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick					       BYTE_TO_FLOAT(v[1]),
2029bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick					       BYTE_TO_FLOAT(v[2]),
2039bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick					       BYTE_TO_FLOAT(v[3])));
2040d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul}
2050d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
206b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paulstatic void GLAPIENTRY VertexAttrib4bvNV(GLuint index, const GLbyte *v)
2070d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{
208c07e274f44356cb662c04817f810d8d1adedd872Keith Whitwell   CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2], (GLfloat)v[3]));
2090d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul}
2100d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
2110d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul/* GL_UNSIGNED_BYTE attributes */
2120d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
213b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paulstatic void GLAPIENTRY VertexAttrib1NubvNV(GLuint index, const GLubyte *v)
2140d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{
2159bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick   CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, UBYTE_TO_FLOAT(v[0])));
2160d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul}
2170d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
218b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paulstatic void GLAPIENTRY VertexAttrib1ubvNV(GLuint index, const GLubyte *v)
2190d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{
220c07e274f44356cb662c04817f810d8d1adedd872Keith Whitwell   CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, (GLfloat)v[0]));
2210d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul}
2220d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
223b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paulstatic void GLAPIENTRY VertexAttrib2NubvNV(GLuint index, const GLubyte *v)
2240d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{
2259bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick   CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, UBYTE_TO_FLOAT(v[0]),
2269bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick					       UBYTE_TO_FLOAT(v[1])));
2270d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul}
2280d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
229b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paulstatic void GLAPIENTRY VertexAttrib2ubvNV(GLuint index, const GLubyte *v)
2300d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{
231c07e274f44356cb662c04817f810d8d1adedd872Keith Whitwell   CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1]));
2320d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul}
2330d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
234b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paulstatic void GLAPIENTRY VertexAttrib3NubvNV(GLuint index, const GLubyte *v)
2350d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{
2369bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick   CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, UBYTE_TO_FLOAT(v[0]),
2379bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick					       UBYTE_TO_FLOAT(v[1]),
2389bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick					       UBYTE_TO_FLOAT(v[2])));
2390d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul}
240b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paulstatic void GLAPIENTRY VertexAttrib3ubvNV(GLuint index, const GLubyte *v)
2410d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{
242c07e274f44356cb662c04817f810d8d1adedd872Keith Whitwell   CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2]));
2430d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul}
2440d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
245b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paulstatic void GLAPIENTRY VertexAttrib4NubvNV(GLuint index, const GLubyte *v)
2460d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{
2479bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick   CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, UBYTE_TO_FLOAT(v[0]),
2480d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul                                     UBYTE_TO_FLOAT(v[1]),
2490d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul                                     UBYTE_TO_FLOAT(v[2]),
2509bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick                                     UBYTE_TO_FLOAT(v[3])));
2510d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul}
2520d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
253b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paulstatic void GLAPIENTRY VertexAttrib4ubvNV(GLuint index, const GLubyte *v)
2540d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{
255c07e274f44356cb662c04817f810d8d1adedd872Keith Whitwell   CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2], (GLfloat)v[3]));
2560d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul}
2570d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
2580d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul/* GL_SHORT attributes */
2590d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
260b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paulstatic void GLAPIENTRY VertexAttrib1NsvNV(GLuint index, const GLshort *v)
2610d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{
2629bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick   CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, SHORT_TO_FLOAT(v[0])));
2630d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul}
2640d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
265b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paulstatic void GLAPIENTRY VertexAttrib1svNV(GLuint index, const GLshort *v)
2660d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{
267c07e274f44356cb662c04817f810d8d1adedd872Keith Whitwell   CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, (GLfloat)v[0]));
2680d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul}
2690d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
270b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paulstatic void GLAPIENTRY VertexAttrib2NsvNV(GLuint index, const GLshort *v)
2710d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{
2729bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick   CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, SHORT_TO_FLOAT(v[0]),
2739bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick					       SHORT_TO_FLOAT(v[1])));
2740d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul}
2750d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
276b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paulstatic void GLAPIENTRY VertexAttrib2svNV(GLuint index, const GLshort *v)
2770d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{
278c07e274f44356cb662c04817f810d8d1adedd872Keith Whitwell   CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1]));
2790d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul}
2800d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
281b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paulstatic void GLAPIENTRY VertexAttrib3NsvNV(GLuint index, const GLshort *v)
2820d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{
2839bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick   CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, SHORT_TO_FLOAT(v[0]),
284c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick			     SHORT_TO_FLOAT(v[1]),
2859bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick			     SHORT_TO_FLOAT(v[2])));
2860d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul}
2870d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
288b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paulstatic void GLAPIENTRY VertexAttrib3svNV(GLuint index, const GLshort *v)
2890d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{
290c07e274f44356cb662c04817f810d8d1adedd872Keith Whitwell   CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2]));
2910d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul}
2920d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
293b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paulstatic void GLAPIENTRY VertexAttrib4NsvNV(GLuint index, const GLshort *v)
2940d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{
2959bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick   CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, SHORT_TO_FLOAT(v[0]),
296c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick			     SHORT_TO_FLOAT(v[1]),
297c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick			     SHORT_TO_FLOAT(v[2]),
2989bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick			     SHORT_TO_FLOAT(v[3])));
2990d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul}
3000d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
301b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paulstatic void GLAPIENTRY VertexAttrib4svNV(GLuint index, const GLshort *v)
3020d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{
303c07e274f44356cb662c04817f810d8d1adedd872Keith Whitwell   CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2], (GLfloat)v[3]));
3040d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul}
3050d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
3060d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul/* GL_UNSIGNED_SHORT attributes */
3070d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
308b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paulstatic void GLAPIENTRY VertexAttrib1NusvNV(GLuint index, const GLushort *v)
3090d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{
3109bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick   CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, USHORT_TO_FLOAT(v[0])));
3110d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul}
3120d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
313b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paulstatic void GLAPIENTRY VertexAttrib1usvNV(GLuint index, const GLushort *v)
3140d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{
315c07e274f44356cb662c04817f810d8d1adedd872Keith Whitwell   CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, (GLfloat)v[0]));
3160d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul}
3170d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
318b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paulstatic void GLAPIENTRY VertexAttrib2NusvNV(GLuint index, const GLushort *v)
3190d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{
3209bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick   CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, USHORT_TO_FLOAT(v[0]),
3219bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick			     USHORT_TO_FLOAT(v[1])));
3220d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul}
3230d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
324b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paulstatic void GLAPIENTRY VertexAttrib2usvNV(GLuint index, const GLushort *v)
3250d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{
326c07e274f44356cb662c04817f810d8d1adedd872Keith Whitwell   CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1]));
3270d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul}
3280d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
329b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paulstatic void GLAPIENTRY VertexAttrib3NusvNV(GLuint index, const GLushort *v)
3300d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{
3319bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick   CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, USHORT_TO_FLOAT(v[0]),
3329bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick					       USHORT_TO_FLOAT(v[1]),
3339bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick					       USHORT_TO_FLOAT(v[2])));
3340d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul}
3350d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
336b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paulstatic void GLAPIENTRY VertexAttrib3usvNV(GLuint index, const GLushort *v)
3370d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{
338c07e274f44356cb662c04817f810d8d1adedd872Keith Whitwell   CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2]));
3390d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul}
3400d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
341b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paulstatic void GLAPIENTRY VertexAttrib4NusvNV(GLuint index, const GLushort *v)
3420d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{
3439bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick   CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, USHORT_TO_FLOAT(v[0]),
3449bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick					       USHORT_TO_FLOAT(v[1]),
3459bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick					       USHORT_TO_FLOAT(v[2]),
3469bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick					       USHORT_TO_FLOAT(v[3])));
3470d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul}
3480d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
349b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paulstatic void GLAPIENTRY VertexAttrib4usvNV(GLuint index, const GLushort *v)
3500d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{
351c07e274f44356cb662c04817f810d8d1adedd872Keith Whitwell   CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2], (GLfloat)v[3]));
3520d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul}
3530d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
3540d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul/* GL_INT attributes */
3550d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
356b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paulstatic void GLAPIENTRY VertexAttrib1NivNV(GLuint index, const GLint *v)
3570d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{
3589bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick   CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, INT_TO_FLOAT(v[0])));
3590d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul}
3600d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
361b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paulstatic void GLAPIENTRY VertexAttrib1ivNV(GLuint index, const GLint *v)
3620d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{
363c07e274f44356cb662c04817f810d8d1adedd872Keith Whitwell   CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, (GLfloat)v[0]));
3640d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul}
3650d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
366b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paulstatic void GLAPIENTRY VertexAttrib2NivNV(GLuint index, const GLint *v)
3670d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{
3689bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick   CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, INT_TO_FLOAT(v[0]),
3699bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick					       INT_TO_FLOAT(v[1])));
3700d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul}
3710d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
372b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paulstatic void GLAPIENTRY VertexAttrib2ivNV(GLuint index, const GLint *v)
3730d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{
374c07e274f44356cb662c04817f810d8d1adedd872Keith Whitwell   CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1]));
3750d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul}
3760d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
377b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paulstatic void GLAPIENTRY VertexAttrib3NivNV(GLuint index, const GLint *v)
3780d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{
3799bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick   CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, INT_TO_FLOAT(v[0]),
3809bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick					       INT_TO_FLOAT(v[1]),
3819bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick					       INT_TO_FLOAT(v[2])));
3820d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul}
3830d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
384b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paulstatic void GLAPIENTRY VertexAttrib3ivNV(GLuint index, const GLint *v)
3850d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{
386c07e274f44356cb662c04817f810d8d1adedd872Keith Whitwell   CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2]));
3870d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul}
3880d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
389b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paulstatic void GLAPIENTRY VertexAttrib4NivNV(GLuint index, const GLint *v)
3900d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{
3919bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick   CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, INT_TO_FLOAT(v[0]),
3929bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick					       INT_TO_FLOAT(v[1]),
3939bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick					       INT_TO_FLOAT(v[2]),
3949bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick					       INT_TO_FLOAT(v[3])));
3950d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul}
3960d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
397b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paulstatic void GLAPIENTRY VertexAttrib4ivNV(GLuint index, const GLint *v)
3980d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{
399c07e274f44356cb662c04817f810d8d1adedd872Keith Whitwell   CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2], (GLfloat)v[3]));
4000d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul}
4010d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
4020d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul/* GL_UNSIGNED_INT attributes */
4030d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
404b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paulstatic void GLAPIENTRY VertexAttrib1NuivNV(GLuint index, const GLuint *v)
4050d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{
4069bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick   CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, UINT_TO_FLOAT(v[0])));
4070d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul}
4080d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
409b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paulstatic void GLAPIENTRY VertexAttrib1uivNV(GLuint index, const GLuint *v)
4100d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{
411c07e274f44356cb662c04817f810d8d1adedd872Keith Whitwell   CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, (GLfloat)v[0]));
4120d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul}
4130d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
414b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paulstatic void GLAPIENTRY VertexAttrib2NuivNV(GLuint index, const GLuint *v)
4150d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{
4169bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick   CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, UINT_TO_FLOAT(v[0]),
4179bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick					       UINT_TO_FLOAT(v[1])));
4180d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul}
4190d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
420b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paulstatic void GLAPIENTRY VertexAttrib2uivNV(GLuint index, const GLuint *v)
4210d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{
422c07e274f44356cb662c04817f810d8d1adedd872Keith Whitwell   CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1]));
4230d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul}
4240d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
425b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paulstatic void GLAPIENTRY VertexAttrib3NuivNV(GLuint index, const GLuint *v)
4260d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{
4279bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick   CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, UINT_TO_FLOAT(v[0]),
4289bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick					       UINT_TO_FLOAT(v[1]),
4299bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick					       UINT_TO_FLOAT(v[2])));
4300d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul}
4310d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
432b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paulstatic void GLAPIENTRY VertexAttrib3uivNV(GLuint index, const GLuint *v)
4330d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{
434c07e274f44356cb662c04817f810d8d1adedd872Keith Whitwell   CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2]));
4350d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul}
4360d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
437b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paulstatic void GLAPIENTRY VertexAttrib4NuivNV(GLuint index, const GLuint *v)
4380d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{
4399bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick   CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, UINT_TO_FLOAT(v[0]),
4409bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick					       UINT_TO_FLOAT(v[1]),
4419bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick					       UINT_TO_FLOAT(v[2]),
4429bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick					       UINT_TO_FLOAT(v[3])));
4430d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul}
4440d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
445b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paulstatic void GLAPIENTRY VertexAttrib4uivNV(GLuint index, const GLuint *v)
4460d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{
447c07e274f44356cb662c04817f810d8d1adedd872Keith Whitwell   CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2], (GLfloat)v[3]));
4480d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul}
4490d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
4500d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul/* GL_FLOAT attributes */
4510d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
452b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paulstatic void GLAPIENTRY VertexAttrib1fvNV(GLuint index, const GLfloat *v)
4530d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{
4549bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick   CALL_VertexAttrib1fvNV(GET_DISPATCH(), (index, v));
4550d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul}
4560d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
457b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paulstatic void GLAPIENTRY VertexAttrib2fvNV(GLuint index, const GLfloat *v)
4580d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{
4599bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick   CALL_VertexAttrib2fvNV(GET_DISPATCH(), (index, v));
4600d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul}
4610d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
462b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paulstatic void GLAPIENTRY VertexAttrib3fvNV(GLuint index, const GLfloat *v)
4630d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{
4649bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick   CALL_VertexAttrib3fvNV(GET_DISPATCH(), (index, v));
4650d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul}
4660d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
467b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paulstatic void GLAPIENTRY VertexAttrib4fvNV(GLuint index, const GLfloat *v)
4680d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{
4699bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick   CALL_VertexAttrib4fvNV(GET_DISPATCH(), (index, v));
4700d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul}
4710d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
4720d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul/* GL_DOUBLE attributes */
4730d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
474b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paulstatic void GLAPIENTRY VertexAttrib1dvNV(GLuint index, const GLdouble *v)
4750d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{
4769bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick   CALL_VertexAttrib1dvNV(GET_DISPATCH(), (index, v));
4770d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul}
4780d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
479b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paulstatic void GLAPIENTRY VertexAttrib2dvNV(GLuint index, const GLdouble *v)
4800d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{
4819bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick   CALL_VertexAttrib2dvNV(GET_DISPATCH(), (index, v));
4820d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul}
4830d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
484b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paulstatic void GLAPIENTRY VertexAttrib3dvNV(GLuint index, const GLdouble *v)
4850d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{
4869bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick   CALL_VertexAttrib3dvNV(GET_DISPATCH(), (index, v));
4870d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul}
4880d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
489b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paulstatic void GLAPIENTRY VertexAttrib4dvNV(GLuint index, const GLdouble *v)
4900d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{
4919bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick   CALL_VertexAttrib4dvNV(GET_DISPATCH(), (index, v));
4920d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul}
4930d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
4940d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
4950d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul/*
4960d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul * Array [size][type] of VertexAttrib functions
4970d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul */
498b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paulstatic attrib_func AttribFuncsNV[2][4][8] = {
4990d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul   {
5000d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul      /* non-normalized */
5010d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul      {
5020d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul         /* size 1 */
503b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib1bvNV,
504b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib1ubvNV,
505b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib1svNV,
506b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib1usvNV,
507b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib1ivNV,
508b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib1uivNV,
509b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib1fvNV,
510b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib1dvNV
5110d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul      },
5120d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul      {
5130d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul         /* size 2 */
514b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib2bvNV,
515b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib2ubvNV,
516b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib2svNV,
517b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib2usvNV,
518b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib2ivNV,
519b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib2uivNV,
520b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib2fvNV,
521b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib2dvNV
5220d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul      },
5230d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul      {
5240d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul         /* size 3 */
525b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib3bvNV,
526b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib3ubvNV,
527b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib3svNV,
528b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib3usvNV,
529b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib3ivNV,
530b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib3uivNV,
531b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib3fvNV,
532b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib3dvNV
5330d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul      },
5340d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul      {
5350d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul         /* size 4 */
536b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib4bvNV,
537b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib4ubvNV,
538b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib4svNV,
539b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib4usvNV,
540b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib4ivNV,
541b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib4uivNV,
542b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib4fvNV,
543b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib4dvNV
5440d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul      }
5450d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul   },
5460d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul   {
5470d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul      /* normalized (except for float/double) */
5480d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul      {
5490d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul         /* size 1 */
550b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib1NbvNV,
551b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib1NubvNV,
552b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib1NsvNV,
553b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib1NusvNV,
554b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib1NivNV,
555b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib1NuivNV,
556b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib1fvNV,
557b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib1dvNV
5580d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul      },
5590d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul      {
5600d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul         /* size 2 */
561b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib2NbvNV,
562b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib2NubvNV,
563b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib2NsvNV,
564b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib2NusvNV,
565b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib2NivNV,
566b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib2NuivNV,
567b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib2fvNV,
568b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib2dvNV
5690d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul      },
5700d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul      {
5710d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul         /* size 3 */
572b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib3NbvNV,
573b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib3NubvNV,
574b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib3NsvNV,
575b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib3NusvNV,
576b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib3NivNV,
577b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib3NuivNV,
578b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib3fvNV,
579b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib3dvNV
5800d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul      },
5810d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul      {
5820d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul         /* size 4 */
583b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib4NbvNV,
584b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib4NubvNV,
585b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib4NsvNV,
586b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib4NusvNV,
587b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib4NivNV,
588b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib4NuivNV,
589b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib4fvNV,
590b5b8d22c4ee921dff99b898a5907023b20670a27Brian Paul         (attrib_func) VertexAttrib4dvNV
5910d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul      }
5920d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul   }
5930d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul};
5940d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
595095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
596095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul/**
597095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul ** GL_ARB_vertex_program
598095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul **/
599095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
600095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul/* GL_BYTE attributes */
601095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
602095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paulstatic void GLAPIENTRY VertexAttrib1NbvARB(GLuint index, const GLbyte *v)
603095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul{
604095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul   CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, BYTE_TO_FLOAT(v[0])));
605095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul}
606095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
607095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paulstatic void GLAPIENTRY VertexAttrib1bvARB(GLuint index, const GLbyte *v)
608095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul{
609c07e274f44356cb662c04817f810d8d1adedd872Keith Whitwell   CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, (GLfloat)v[0]));
610095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul}
611095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
612095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paulstatic void GLAPIENTRY VertexAttrib2NbvARB(GLuint index, const GLbyte *v)
613095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul{
614095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul   CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, BYTE_TO_FLOAT(v[0]), BYTE_TO_FLOAT(v[1])));
615095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul}
616095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
617095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paulstatic void GLAPIENTRY VertexAttrib2bvARB(GLuint index, const GLbyte *v)
618095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul{
619c07e274f44356cb662c04817f810d8d1adedd872Keith Whitwell   CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1]));
620095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul}
621095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
622095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paulstatic void GLAPIENTRY VertexAttrib3NbvARB(GLuint index, const GLbyte *v)
623095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul{
624095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul   CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, BYTE_TO_FLOAT(v[0]),
625095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul					       BYTE_TO_FLOAT(v[1]),
626095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul					       BYTE_TO_FLOAT(v[2])));
627095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul}
628095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
629095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paulstatic void GLAPIENTRY VertexAttrib3bvARB(GLuint index, const GLbyte *v)
630095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul{
631c07e274f44356cb662c04817f810d8d1adedd872Keith Whitwell   CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2]));
632095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul}
633095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
634095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paulstatic void GLAPIENTRY VertexAttrib4NbvARB(GLuint index, const GLbyte *v)
635095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul{
636095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul   CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, BYTE_TO_FLOAT(v[0]),
637095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul					       BYTE_TO_FLOAT(v[1]),
638095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul					       BYTE_TO_FLOAT(v[2]),
639095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul					       BYTE_TO_FLOAT(v[3])));
640095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul}
641095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
642095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paulstatic void GLAPIENTRY VertexAttrib4bvARB(GLuint index, const GLbyte *v)
643095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul{
644c07e274f44356cb662c04817f810d8d1adedd872Keith Whitwell   CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2], (GLfloat)v[3]));
645095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul}
646095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
647095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul/* GL_UNSIGNED_BYTE attributes */
648095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
649095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paulstatic void GLAPIENTRY VertexAttrib1NubvARB(GLuint index, const GLubyte *v)
650095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul{
651095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul   CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, UBYTE_TO_FLOAT(v[0])));
652095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul}
653095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
654095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paulstatic void GLAPIENTRY VertexAttrib1ubvARB(GLuint index, const GLubyte *v)
655095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul{
656c07e274f44356cb662c04817f810d8d1adedd872Keith Whitwell   CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, (GLfloat)v[0]));
657095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul}
658095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
659095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paulstatic void GLAPIENTRY VertexAttrib2NubvARB(GLuint index, const GLubyte *v)
660095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul{
661095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul   CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, UBYTE_TO_FLOAT(v[0]),
662095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul					       UBYTE_TO_FLOAT(v[1])));
663095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul}
664095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
665095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paulstatic void GLAPIENTRY VertexAttrib2ubvARB(GLuint index, const GLubyte *v)
666095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul{
667c07e274f44356cb662c04817f810d8d1adedd872Keith Whitwell   CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1]));
668095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul}
669095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
670095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paulstatic void GLAPIENTRY VertexAttrib3NubvARB(GLuint index, const GLubyte *v)
671095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul{
672095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul   CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, UBYTE_TO_FLOAT(v[0]),
673095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul					       UBYTE_TO_FLOAT(v[1]),
674095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul					       UBYTE_TO_FLOAT(v[2])));
675095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul}
676095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paulstatic void GLAPIENTRY VertexAttrib3ubvARB(GLuint index, const GLubyte *v)
677095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul{
678c07e274f44356cb662c04817f810d8d1adedd872Keith Whitwell   CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2]));
679095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul}
680095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
681095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paulstatic void GLAPIENTRY VertexAttrib4NubvARB(GLuint index, const GLubyte *v)
682095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul{
683095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul   CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, UBYTE_TO_FLOAT(v[0]),
684095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul                                     UBYTE_TO_FLOAT(v[1]),
685095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul                                     UBYTE_TO_FLOAT(v[2]),
686095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul                                     UBYTE_TO_FLOAT(v[3])));
687095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul}
688095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
689095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paulstatic void GLAPIENTRY VertexAttrib4ubvARB(GLuint index, const GLubyte *v)
690095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul{
691c07e274f44356cb662c04817f810d8d1adedd872Keith Whitwell   CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2], (GLfloat)v[3]));
692095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul}
693095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
694095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul/* GL_SHORT attributes */
695095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
696095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paulstatic void GLAPIENTRY VertexAttrib1NsvARB(GLuint index, const GLshort *v)
697095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul{
698095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul   CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, SHORT_TO_FLOAT(v[0])));
699095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul}
700095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
701095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paulstatic void GLAPIENTRY VertexAttrib1svARB(GLuint index, const GLshort *v)
702095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul{
703c07e274f44356cb662c04817f810d8d1adedd872Keith Whitwell   CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, (GLfloat)v[0]));
704095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul}
705095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
706095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paulstatic void GLAPIENTRY VertexAttrib2NsvARB(GLuint index, const GLshort *v)
707095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul{
708095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul   CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, SHORT_TO_FLOAT(v[0]),
709095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul					       SHORT_TO_FLOAT(v[1])));
710095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul}
711095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
712095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paulstatic void GLAPIENTRY VertexAttrib2svARB(GLuint index, const GLshort *v)
713095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul{
714c07e274f44356cb662c04817f810d8d1adedd872Keith Whitwell   CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1]));
715095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul}
716095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
717095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paulstatic void GLAPIENTRY VertexAttrib3NsvARB(GLuint index, const GLshort *v)
718095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul{
719095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul   CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, SHORT_TO_FLOAT(v[0]),
720095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul			     SHORT_TO_FLOAT(v[1]),
721095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul			     SHORT_TO_FLOAT(v[2])));
722095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul}
723095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
724095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paulstatic void GLAPIENTRY VertexAttrib3svARB(GLuint index, const GLshort *v)
725095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul{
726c07e274f44356cb662c04817f810d8d1adedd872Keith Whitwell   CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2]));
727095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul}
728095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
729095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paulstatic void GLAPIENTRY VertexAttrib4NsvARB(GLuint index, const GLshort *v)
730095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul{
731095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul   CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, SHORT_TO_FLOAT(v[0]),
732095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul			     SHORT_TO_FLOAT(v[1]),
733095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul			     SHORT_TO_FLOAT(v[2]),
734095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul			     SHORT_TO_FLOAT(v[3])));
735095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul}
736095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
737095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paulstatic void GLAPIENTRY VertexAttrib4svARB(GLuint index, const GLshort *v)
738095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul{
739c07e274f44356cb662c04817f810d8d1adedd872Keith Whitwell   CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2], (GLfloat)v[3]));
740095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul}
741095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
742095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul/* GL_UNSIGNED_SHORT attributes */
743095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
744095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paulstatic void GLAPIENTRY VertexAttrib1NusvARB(GLuint index, const GLushort *v)
745095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul{
746095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul   CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, USHORT_TO_FLOAT(v[0])));
747095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul}
748095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
749095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paulstatic void GLAPIENTRY VertexAttrib1usvARB(GLuint index, const GLushort *v)
750095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul{
751c07e274f44356cb662c04817f810d8d1adedd872Keith Whitwell   CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, (GLfloat)v[0]));
752095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul}
753095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
754095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paulstatic void GLAPIENTRY VertexAttrib2NusvARB(GLuint index, const GLushort *v)
755095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul{
756095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul   CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, USHORT_TO_FLOAT(v[0]),
757095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul			     USHORT_TO_FLOAT(v[1])));
758095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul}
759095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
760095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paulstatic void GLAPIENTRY VertexAttrib2usvARB(GLuint index, const GLushort *v)
761095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul{
762c07e274f44356cb662c04817f810d8d1adedd872Keith Whitwell   CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1]));
763095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul}
764095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
765095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paulstatic void GLAPIENTRY VertexAttrib3NusvARB(GLuint index, const GLushort *v)
766095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul{
767095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul   CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, USHORT_TO_FLOAT(v[0]),
768095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul					       USHORT_TO_FLOAT(v[1]),
769095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul					       USHORT_TO_FLOAT(v[2])));
770095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul}
771095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
772095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paulstatic void GLAPIENTRY VertexAttrib3usvARB(GLuint index, const GLushort *v)
773095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul{
774c07e274f44356cb662c04817f810d8d1adedd872Keith Whitwell   CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2]));
775095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul}
776095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
777095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paulstatic void GLAPIENTRY VertexAttrib4NusvARB(GLuint index, const GLushort *v)
778095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul{
779095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul   CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, USHORT_TO_FLOAT(v[0]),
780095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul					       USHORT_TO_FLOAT(v[1]),
781095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul					       USHORT_TO_FLOAT(v[2]),
782095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul					       USHORT_TO_FLOAT(v[3])));
783095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul}
784095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
785095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paulstatic void GLAPIENTRY VertexAttrib4usvARB(GLuint index, const GLushort *v)
786095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul{
787c07e274f44356cb662c04817f810d8d1adedd872Keith Whitwell   CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2], (GLfloat)v[3]));
788095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul}
789095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
790095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul/* GL_INT attributes */
791095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
792095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paulstatic void GLAPIENTRY VertexAttrib1NivARB(GLuint index, const GLint *v)
793095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul{
794095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul   CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, INT_TO_FLOAT(v[0])));
795095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul}
796095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
797095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paulstatic void GLAPIENTRY VertexAttrib1ivARB(GLuint index, const GLint *v)
798095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul{
799c07e274f44356cb662c04817f810d8d1adedd872Keith Whitwell   CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, (GLfloat)v[0]));
800095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul}
801095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
802095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paulstatic void GLAPIENTRY VertexAttrib2NivARB(GLuint index, const GLint *v)
803095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul{
804095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul   CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, INT_TO_FLOAT(v[0]),
805095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul					       INT_TO_FLOAT(v[1])));
806095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul}
807095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
808095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paulstatic void GLAPIENTRY VertexAttrib2ivARB(GLuint index, const GLint *v)
809095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul{
810c07e274f44356cb662c04817f810d8d1adedd872Keith Whitwell   CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1]));
811095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul}
812095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
813095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paulstatic void GLAPIENTRY VertexAttrib3NivARB(GLuint index, const GLint *v)
814095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul{
815095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul   CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, INT_TO_FLOAT(v[0]),
816095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul					       INT_TO_FLOAT(v[1]),
817095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul					       INT_TO_FLOAT(v[2])));
818095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul}
819095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
820095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paulstatic void GLAPIENTRY VertexAttrib3ivARB(GLuint index, const GLint *v)
821095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul{
822c07e274f44356cb662c04817f810d8d1adedd872Keith Whitwell   CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2]));
823095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul}
824095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
825095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paulstatic void GLAPIENTRY VertexAttrib4NivARB(GLuint index, const GLint *v)
826095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul{
827095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul   CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, INT_TO_FLOAT(v[0]),
828095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul					       INT_TO_FLOAT(v[1]),
829095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul					       INT_TO_FLOAT(v[2]),
830095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul					       INT_TO_FLOAT(v[3])));
831095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul}
832095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
833095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paulstatic void GLAPIENTRY VertexAttrib4ivARB(GLuint index, const GLint *v)
834095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul{
835c07e274f44356cb662c04817f810d8d1adedd872Keith Whitwell   CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2], (GLfloat)v[3]));
836095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul}
837095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
838095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul/* GL_UNSIGNED_INT attributes */
839095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
840095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paulstatic void GLAPIENTRY VertexAttrib1NuivARB(GLuint index, const GLuint *v)
841095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul{
842095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul   CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, UINT_TO_FLOAT(v[0])));
843095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul}
844095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
845095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paulstatic void GLAPIENTRY VertexAttrib1uivARB(GLuint index, const GLuint *v)
846095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul{
847c07e274f44356cb662c04817f810d8d1adedd872Keith Whitwell   CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, (GLfloat)v[0]));
848095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul}
849095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
850095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paulstatic void GLAPIENTRY VertexAttrib2NuivARB(GLuint index, const GLuint *v)
851095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul{
852095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul   CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, UINT_TO_FLOAT(v[0]),
853095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul					       UINT_TO_FLOAT(v[1])));
854095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul}
855095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
856095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paulstatic void GLAPIENTRY VertexAttrib2uivARB(GLuint index, const GLuint *v)
857095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul{
858c07e274f44356cb662c04817f810d8d1adedd872Keith Whitwell   CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1]));
859095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul}
860095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
861095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paulstatic void GLAPIENTRY VertexAttrib3NuivARB(GLuint index, const GLuint *v)
862095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul{
863095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul   CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, UINT_TO_FLOAT(v[0]),
864095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul					       UINT_TO_FLOAT(v[1]),
865095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul					       UINT_TO_FLOAT(v[2])));
866095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul}
867095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
868095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paulstatic void GLAPIENTRY VertexAttrib3uivARB(GLuint index, const GLuint *v)
869095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul{
870c07e274f44356cb662c04817f810d8d1adedd872Keith Whitwell   CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2]));
871095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul}
872095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
873095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paulstatic void GLAPIENTRY VertexAttrib4NuivARB(GLuint index, const GLuint *v)
874095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul{
875095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul   CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, UINT_TO_FLOAT(v[0]),
876095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul					       UINT_TO_FLOAT(v[1]),
877095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul					       UINT_TO_FLOAT(v[2]),
878095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul					       UINT_TO_FLOAT(v[3])));
879095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul}
880095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
881095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paulstatic void GLAPIENTRY VertexAttrib4uivARB(GLuint index, const GLuint *v)
882095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul{
883c07e274f44356cb662c04817f810d8d1adedd872Keith Whitwell   CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2], (GLfloat)v[3]));
884095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul}
885095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
886095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul/* GL_FLOAT attributes */
887095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
888095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paulstatic void GLAPIENTRY VertexAttrib1fvARB(GLuint index, const GLfloat *v)
889095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul{
890095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul   CALL_VertexAttrib1fvARB(GET_DISPATCH(), (index, v));
891095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul}
892095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
893095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paulstatic void GLAPIENTRY VertexAttrib2fvARB(GLuint index, const GLfloat *v)
894095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul{
895095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul   CALL_VertexAttrib2fvARB(GET_DISPATCH(), (index, v));
896095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul}
897095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
898095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paulstatic void GLAPIENTRY VertexAttrib3fvARB(GLuint index, const GLfloat *v)
899095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul{
900095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul   CALL_VertexAttrib3fvARB(GET_DISPATCH(), (index, v));
901095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul}
902095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
903095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paulstatic void GLAPIENTRY VertexAttrib4fvARB(GLuint index, const GLfloat *v)
904095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul{
905095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul   CALL_VertexAttrib4fvARB(GET_DISPATCH(), (index, v));
906095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul}
907095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
908095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul/* GL_DOUBLE attributes */
909095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
910095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paulstatic void GLAPIENTRY VertexAttrib1dvARB(GLuint index, const GLdouble *v)
911095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul{
912095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul   CALL_VertexAttrib1dvARB(GET_DISPATCH(), (index, v));
913095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul}
914095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
915095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paulstatic void GLAPIENTRY VertexAttrib2dvARB(GLuint index, const GLdouble *v)
916095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul{
917095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul   CALL_VertexAttrib2dvARB(GET_DISPATCH(), (index, v));
918095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul}
919095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
920095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paulstatic void GLAPIENTRY VertexAttrib3dvARB(GLuint index, const GLdouble *v)
921095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul{
922095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul   CALL_VertexAttrib3dvARB(GET_DISPATCH(), (index, v));
923095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul}
924095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
925095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paulstatic void GLAPIENTRY VertexAttrib4dvARB(GLuint index, const GLdouble *v)
926095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul{
927095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul   CALL_VertexAttrib4dvARB(GET_DISPATCH(), (index, v));
928095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul}
929095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
930095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
931095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul/*
932095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul * Array [size][type] of VertexAttrib functions
933095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul */
934095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paulstatic attrib_func AttribFuncsARB[2][4][8] = {
935095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul   {
936095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul      /* non-normalized */
937095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul      {
938095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         /* size 1 */
939095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib1bvARB,
940095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib1ubvARB,
941095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib1svARB,
942095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib1usvARB,
943095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib1ivARB,
944095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib1uivARB,
945095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib1fvARB,
946095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib1dvARB
947095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul      },
948095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul      {
949095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         /* size 2 */
950095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib2bvARB,
951095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib2ubvARB,
952095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib2svARB,
953095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib2usvARB,
954095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib2ivARB,
955095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib2uivARB,
956095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib2fvARB,
957095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib2dvARB
958095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul      },
959095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul      {
960095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         /* size 3 */
961095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib3bvARB,
962095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib3ubvARB,
963095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib3svARB,
964095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib3usvARB,
965095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib3ivARB,
966095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib3uivARB,
967095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib3fvARB,
968095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib3dvARB
969095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul      },
970095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul      {
971095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         /* size 4 */
972095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib4bvARB,
973095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib4ubvARB,
974095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib4svARB,
975095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib4usvARB,
976095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib4ivARB,
977095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib4uivARB,
978095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib4fvARB,
979095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib4dvARB
980095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul      }
981095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul   },
982095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul   {
983095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul      /* normalized (except for float/double) */
984095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul      {
985095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         /* size 1 */
986095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib1NbvARB,
987095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib1NubvARB,
988095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib1NsvARB,
989095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib1NusvARB,
990095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib1NivARB,
991095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib1NuivARB,
992095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib1fvARB,
993095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib1dvARB
994095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul      },
995095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul      {
996095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         /* size 2 */
997095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib2NbvARB,
998095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib2NubvARB,
999095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib2NsvARB,
1000095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib2NusvARB,
1001095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib2NivARB,
1002095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib2NuivARB,
1003095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib2fvARB,
1004095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib2dvARB
1005095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul      },
1006095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul      {
1007095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         /* size 3 */
1008095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib3NbvARB,
1009095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib3NubvARB,
1010095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib3NsvARB,
1011095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib3NusvARB,
1012095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib3NivARB,
1013095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib3NuivARB,
1014095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib3fvARB,
1015095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib3dvARB
1016095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul      },
1017095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul      {
1018095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         /* size 4 */
1019095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib4NbvARB,
1020095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib4NubvARB,
1021095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib4NsvARB,
1022095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib4NusvARB,
1023095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib4NivARB,
1024095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib4NuivARB,
1025095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib4fvARB,
1026095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         (attrib_func) VertexAttrib4dvARB
1027095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul      }
1028095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul   }
1029095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul};
1030095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul
10310d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul/**********************************************************************/
10320d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul
103303c0c2e8aa5e5f1b430c4b3faa1f9ad92b1b71ebBrian Paul
103403c0c2e8aa5e5f1b430c4b3faa1f9ad92b1b71ebBrian PaulGLboolean _ae_create_context( GLcontext *ctx )
103503c0c2e8aa5e5f1b430c4b3faa1f9ad92b1b71ebBrian Paul{
1036ae0eaf93e092ac8e8b1c98f3e986de96940663faKeith Whitwell   if (ctx->aelt_context)
1037ae0eaf93e092ac8e8b1c98f3e986de96940663faKeith Whitwell      return GL_TRUE;
1038ae0eaf93e092ac8e8b1c98f3e986de96940663faKeith Whitwell
10390f1d98c422129b002bd3d90699da7fe8286b3c47Brian Paul   /* These _gloffset_* values may not be compile-time constants */
1040126c89e35fb5179fe077f7593f31ea874c89dd65Ian Romanick   SecondaryColorFuncs[0] = _gloffset_SecondaryColor3bvEXT;
1041126c89e35fb5179fe077f7593f31ea874c89dd65Ian Romanick   SecondaryColorFuncs[1] = _gloffset_SecondaryColor3ubvEXT;
1042126c89e35fb5179fe077f7593f31ea874c89dd65Ian Romanick   SecondaryColorFuncs[2] = _gloffset_SecondaryColor3svEXT;
1043126c89e35fb5179fe077f7593f31ea874c89dd65Ian Romanick   SecondaryColorFuncs[3] = _gloffset_SecondaryColor3usvEXT;
1044126c89e35fb5179fe077f7593f31ea874c89dd65Ian Romanick   SecondaryColorFuncs[4] = _gloffset_SecondaryColor3ivEXT;
1045126c89e35fb5179fe077f7593f31ea874c89dd65Ian Romanick   SecondaryColorFuncs[5] = _gloffset_SecondaryColor3uivEXT;
1046126c89e35fb5179fe077f7593f31ea874c89dd65Ian Romanick   SecondaryColorFuncs[6] = _gloffset_SecondaryColor3fvEXT;
1047126c89e35fb5179fe077f7593f31ea874c89dd65Ian Romanick   SecondaryColorFuncs[7] = _gloffset_SecondaryColor3dvEXT;
1048126c89e35fb5179fe077f7593f31ea874c89dd65Ian Romanick
1049eec33cc310ce2b99164d182719c8d6d54b80a704Brian Paul   FogCoordFuncs[0] = -1;
1050eec33cc310ce2b99164d182719c8d6d54b80a704Brian Paul   FogCoordFuncs[1] = -1;
1051eec33cc310ce2b99164d182719c8d6d54b80a704Brian Paul   FogCoordFuncs[2] = -1;
1052eec33cc310ce2b99164d182719c8d6d54b80a704Brian Paul   FogCoordFuncs[3] = -1;
1053eec33cc310ce2b99164d182719c8d6d54b80a704Brian Paul   FogCoordFuncs[4] = -1;
1054eec33cc310ce2b99164d182719c8d6d54b80a704Brian Paul   FogCoordFuncs[5] = -1;
1055126c89e35fb5179fe077f7593f31ea874c89dd65Ian Romanick   FogCoordFuncs[6] = _gloffset_FogCoordfvEXT;
1056126c89e35fb5179fe077f7593f31ea874c89dd65Ian Romanick   FogCoordFuncs[7] = _gloffset_FogCoorddvEXT;
1057126c89e35fb5179fe077f7593f31ea874c89dd65Ian Romanick
1058b1c102d37bb3c273a2623358cb8ebff00bdfb65eKeith Whitwell   ctx->aelt_context = CALLOC( sizeof(AEcontext) );
10591fb0a43c16190f4d043b8a0918361bee76b37e5fGareth Hughes   if (!ctx->aelt_context)
10604b7d6f216bf768482e07e4d7feb8ca3e1be92d53Keith Whitwell      return GL_FALSE;
10614b7d6f216bf768482e07e4d7feb8ca3e1be92d53Keith Whitwell
10624b7d6f216bf768482e07e4d7feb8ca3e1be92d53Keith Whitwell   AE_CONTEXT(ctx)->NewState = ~0;
10634b7d6f216bf768482e07e4d7feb8ca3e1be92d53Keith Whitwell   return GL_TRUE;
10644b7d6f216bf768482e07e4d7feb8ca3e1be92d53Keith Whitwell}
10654b7d6f216bf768482e07e4d7feb8ca3e1be92d53Keith Whitwell
10664b7d6f216bf768482e07e4d7feb8ca3e1be92d53Keith Whitwell
10674b7d6f216bf768482e07e4d7feb8ca3e1be92d53Keith Whitwellvoid _ae_destroy_context( GLcontext *ctx )
10684b7d6f216bf768482e07e4d7feb8ca3e1be92d53Keith Whitwell{
10694b7d6f216bf768482e07e4d7feb8ca3e1be92d53Keith Whitwell   if ( AE_CONTEXT( ctx ) ) {
10704b7d6f216bf768482e07e4d7feb8ca3e1be92d53Keith Whitwell      FREE( ctx->aelt_context );
1071a0c85249244e1af8dac88076d5f384cf4bd01236Keith Whitwell      ctx->aelt_context = NULL;
10724b7d6f216bf768482e07e4d7feb8ca3e1be92d53Keith Whitwell   }
1073cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell}
1074cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell
1075b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwellstatic void check_vbo( AEcontext *actx,
1076b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell		       struct gl_buffer_object *vbo )
1077b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell{
1078434ec3ada841915a00ffc23f699401eb3e7b37eeBrian Paul   if (_mesa_is_bufferobj(vbo) && !_mesa_bufferobj_mapped(vbo)) {
1079b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell      GLuint i;
1080b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell      for (i = 0; i < actx->nr_vbos; i++)
1081b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell	 if (actx->vbo[i] == vbo)
1082b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell	    return;
1083b72fbcbe63bd53460da07ce840094924f04d38e0Keith Whitwell      assert(actx->nr_vbos < VERT_ATTRIB_MAX);
1084b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell      actx->vbo[actx->nr_vbos++] = vbo;
1085b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell   }
1086b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell}
1087b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell
10884b7d6f216bf768482e07e4d7feb8ca3e1be92d53Keith Whitwell
10890d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul/**
10900d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul * Make a list of per-vertex functions to call for each glArrayElement call.
10911e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul * These functions access the array data (i.e. glVertex, glColor, glNormal,
10921e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul * etc).
10931e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul * Note: this may be called during display list construction.
10940d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul */
10954b7d6f216bf768482e07e4d7feb8ca3e1be92d53Keith Whitwellstatic void _ae_update_state( GLcontext *ctx )
1096cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell{
10974b7d6f216bf768482e07e4d7feb8ca3e1be92d53Keith Whitwell   AEcontext *actx = AE_CONTEXT(ctx);
10984b7d6f216bf768482e07e4d7feb8ca3e1be92d53Keith Whitwell   AEarray *aa = actx->arrays;
10990d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul   AEattrib *at = actx->attribs;
1100db07de057f10ab7ab5be84352b674b200a0a9e22Brian Paul   GLuint i;
1101bf4dfd6563e1ce5cabea415d1e3600ab4abefe81Brian Paul   struct gl_array_object *arrayObj = ctx->Array.ArrayObj;
1102cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell
1103b72fbcbe63bd53460da07ce840094924f04d38e0Keith Whitwell   actx->nr_vbos = 0;
1104b72fbcbe63bd53460da07ce840094924f04d38e0Keith Whitwell
11051e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul   /* conventional vertex arrays */
1106bf4dfd6563e1ce5cabea415d1e3600ab4abefe81Brian Paul   if (arrayObj->Index.Enabled) {
1107bf4dfd6563e1ce5cabea415d1e3600ab4abefe81Brian Paul      aa->array = &arrayObj->Index;
11089bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick      aa->offset = IndexFuncs[TYPE_IDX(aa->array->Type)];
1109b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell      check_vbo(actx, aa->array->BufferObj);
1110cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell      aa++;
1111cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell   }
1112bf4dfd6563e1ce5cabea415d1e3600ab4abefe81Brian Paul   if (arrayObj->EdgeFlag.Enabled) {
1113bf4dfd6563e1ce5cabea415d1e3600ab4abefe81Brian Paul      aa->array = &arrayObj->EdgeFlag;
11149bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick      aa->offset = _gloffset_EdgeFlagv;
1115b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell      check_vbo(actx, aa->array->BufferObj);
1116faaf78aeb0e18c75c9b204a634f296b9c056cf5cRoland Scheidegger      aa++;
1117faaf78aeb0e18c75c9b204a634f296b9c056cf5cRoland Scheidegger   }
1118bf4dfd6563e1ce5cabea415d1e3600ab4abefe81Brian Paul   if (arrayObj->Normal.Enabled) {
1119bf4dfd6563e1ce5cabea415d1e3600ab4abefe81Brian Paul      aa->array = &arrayObj->Normal;
11209bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick      aa->offset = NormalFuncs[TYPE_IDX(aa->array->Type)];
1121b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell      check_vbo(actx, aa->array->BufferObj);
11221e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul      aa++;
11231e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul   }
1124bf4dfd6563e1ce5cabea415d1e3600ab4abefe81Brian Paul   if (arrayObj->Color.Enabled) {
1125bf4dfd6563e1ce5cabea415d1e3600ab4abefe81Brian Paul      aa->array = &arrayObj->Color;
11269bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick      aa->offset = ColorFuncs[aa->array->Size-3][TYPE_IDX(aa->array->Type)];
1127b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell      check_vbo(actx, aa->array->BufferObj);
11281e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul      aa++;
11291e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul   }
1130bf4dfd6563e1ce5cabea415d1e3600ab4abefe81Brian Paul   if (arrayObj->SecondaryColor.Enabled) {
1131bf4dfd6563e1ce5cabea415d1e3600ab4abefe81Brian Paul      aa->array = &arrayObj->SecondaryColor;
11329bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick      aa->offset = SecondaryColorFuncs[TYPE_IDX(aa->array->Type)];
1133b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell      check_vbo(actx, aa->array->BufferObj);
11341e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul      aa++;
11351e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul   }
1136bf4dfd6563e1ce5cabea415d1e3600ab4abefe81Brian Paul   if (arrayObj->FogCoord.Enabled) {
1137bf4dfd6563e1ce5cabea415d1e3600ab4abefe81Brian Paul      aa->array = &arrayObj->FogCoord;
11389bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick      aa->offset = FogCoordFuncs[TYPE_IDX(aa->array->Type)];
1139b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell      check_vbo(actx, aa->array->BufferObj);
11401e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul      aa++;
11411e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul   }
11421e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul   for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) {
1143bf4dfd6563e1ce5cabea415d1e3600ab4abefe81Brian Paul      struct gl_client_array *attribArray = &arrayObj->TexCoord[i];
1144095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul      if (attribArray->Enabled) {
1145095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         /* NOTE: we use generic glVertexAttribNV functions here.
1146095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul          * If we ever remove GL_NV_vertex_program this will have to change.
11471e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul          */
11481e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul         at->array = attribArray;
1149095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         ASSERT(!at->array->Normalized);
1150095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         at->func = AttribFuncsNV[at->array->Normalized]
1151095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul                                 [at->array->Size-1]
1152095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul                                 [TYPE_IDX(at->array->Type)];
11539d1ff8c1bb56b9ba0d3bf4552351d8bff6620ef2Brian Paul         at->index = VERT_ATTRIB_TEX0 + i;
115464920ed10ac702ed9be33d4045faa71f06e05029Keith Whitwell	 check_vbo(actx, at->array->BufferObj);
11551e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul         at++;
11560d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul      }
11571e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul   }
1158cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell
1159b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell   /* generic vertex attribute arrays */
11602a3d118a8e4c048e5d850a29301c02f886ba09d4Brian Paul   for (i = 1; i < Elements(arrayObj->VertexAttrib); i++) {  /* skip zero! */
1161bf4dfd6563e1ce5cabea415d1e3600ab4abefe81Brian Paul      struct gl_client_array *attribArray = &arrayObj->VertexAttrib[i];
1162095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul      if (attribArray->Enabled) {
11630d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul         at->array = attribArray;
11640d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul         /* Note: we can't grab the _glapi_Dispatch->VertexAttrib1fvNV
11650d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul          * function pointer here (for float arrays) since the pointer may
116680630d1fed6cd32e75f5e97e2cd27509be21d093Chia-I Wu          * change from one execution of _ae_ArrayElement() to
11670d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul          * the next.  Doing so caused UT to break.
11680d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul          */
1169095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         if (ctx->VertexProgram._Enabled
1170095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul             && ctx->VertexProgram.Current->IsNVProgram) {
1171095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul            at->func = AttribFuncsNV[at->array->Normalized]
1172095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul                                    [at->array->Size-1]
1173095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul                                    [TYPE_IDX(at->array->Type)];
1174095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         }
1175095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         else {
1176095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul            at->func = AttribFuncsARB[at->array->Normalized]
1177095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul                                     [at->array->Size-1]
1178095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul                                     [TYPE_IDX(at->array->Type)];
1179095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul         }
11801e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul         at->index = i;
118164920ed10ac702ed9be33d4045faa71f06e05029Keith Whitwell	 check_vbo(actx, at->array->BufferObj);
11820d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul         at++;
11830d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul      }
1184faaf78aeb0e18c75c9b204a634f296b9c056cf5cRoland Scheidegger   }
11851e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul
11861e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul   /* finally, vertex position */
1187bf4dfd6563e1ce5cabea415d1e3600ab4abefe81Brian Paul   if (arrayObj->VertexAttrib[0].Enabled) {
11881e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul      /* Use glVertex(v) instead of glVertexAttrib(0, v) to be sure it's
1189095c6699f449ed4803f23e844cc0227743a9c3e1Brian Paul       * issued as the last (provoking) attribute).
11901e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul       */
1191bf4dfd6563e1ce5cabea415d1e3600ab4abefe81Brian Paul      aa->array = &arrayObj->VertexAttrib[0];
11921e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul      assert(aa->array->Size >= 2); /* XXX fix someday? */
11939bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick      aa->offset = VertexFuncs[aa->array->Size-2][TYPE_IDX(aa->array->Type)];
1194b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell      check_vbo(actx, aa->array->BufferObj);
11951e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul      aa++;
11961e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul   }
1197bf4dfd6563e1ce5cabea415d1e3600ab4abefe81Brian Paul   else if (arrayObj->Vertex.Enabled) {
1198bf4dfd6563e1ce5cabea415d1e3600ab4abefe81Brian Paul      aa->array = &arrayObj->Vertex;
11999bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick      aa->offset = VertexFuncs[aa->array->Size-2][TYPE_IDX(aa->array->Type)];
1200b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell      check_vbo(actx, aa->array->BufferObj);
12011e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul      aa++;
12021e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul   }
12031e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul
1204b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell   check_vbo(actx, ctx->Array.ElementArrayBufferObj);
1205b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell
12060d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul   ASSERT(at - actx->attribs <= VERT_ATTRIB_MAX);
12070d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul   ASSERT(aa - actx->arrays < 32);
12080d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul   at->func = NULL;  /* terminate the list */
12099bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick   aa->offset = -1;  /* terminate the list */
1210faaf78aeb0e18c75c9b204a634f296b9c056cf5cRoland Scheidegger
1211cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell   actx->NewState = 0;
1212cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell}
1213cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell
1214b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwellvoid _ae_map_vbos( GLcontext *ctx )
1215b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell{
1216b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell   AEcontext *actx = AE_CONTEXT(ctx);
1217b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell   GLuint i;
1218b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell
1219b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell   if (actx->mapped_vbos)
1220b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell      return;
1221b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell
1222b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell   if (actx->NewState)
1223b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell      _ae_update_state(ctx);
1224b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell
1225b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell   for (i = 0; i < actx->nr_vbos; i++)
1226b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell      ctx->Driver.MapBuffer(ctx,
1227b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell			    GL_ARRAY_BUFFER_ARB,
1228b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell			    GL_DYNAMIC_DRAW_ARB,
1229b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell			    actx->vbo[i]);
1230b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell
1231b1c102d37bb3c273a2623358cb8ebff00bdfb65eKeith Whitwell   if (actx->nr_vbos)
1232b1c102d37bb3c273a2623358cb8ebff00bdfb65eKeith Whitwell      actx->mapped_vbos = GL_TRUE;
1233b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell}
1234b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell
1235b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwellvoid _ae_unmap_vbos( GLcontext *ctx )
1236b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell{
1237b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell   AEcontext *actx = AE_CONTEXT(ctx);
1238b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell   GLuint i;
1239b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell
1240479aca6bf10b9546deb523f42bc3be48b17081cfKeith Whitwell   if (!actx->mapped_vbos)
1241b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell      return;
1242b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell
1243479aca6bf10b9546deb523f42bc3be48b17081cfKeith Whitwell   assert (!actx->NewState);
1244b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell
1245b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell   for (i = 0; i < actx->nr_vbos; i++)
1246b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell      ctx->Driver.UnmapBuffer(ctx,
1247b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell			      GL_ARRAY_BUFFER_ARB,
1248b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell			      actx->vbo[i]);
1249b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell
1250479aca6bf10b9546deb523f42bc3be48b17081cfKeith Whitwell   actx->mapped_vbos = GL_FALSE;
1251b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell}
1252b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell
1253cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell
12541e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul/**
12551e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul * Called via glArrayElement() and glDrawArrays().
12561e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul * Issue the glNormal, glVertex, glColor, glVertexAttrib, etc functions
12571e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul * for all enabled vertex arrays (for elt-th element).
12581e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul * Note: this may be called during display list construction.
12591e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul */
126080630d1fed6cd32e75f5e97e2cd27509be21d093Chia-I Wuvoid GLAPIENTRY _ae_ArrayElement( GLint elt )
1261cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell{
1262cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell   GET_CURRENT_CONTEXT(ctx);
12630d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul   const AEcontext *actx = AE_CONTEXT(ctx);
12640d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul   const AEarray *aa;
12650d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul   const AEattrib *at;
12669bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick   const struct _glapi_table * const disp = GET_DISPATCH();
1267b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell   GLboolean do_map;
12689bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick
1269b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell   if (actx->NewState) {
1270b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell      assert(!actx->mapped_vbos);
12714b7d6f216bf768482e07e4d7feb8ca3e1be92d53Keith Whitwell      _ae_update_state( ctx );
1272b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell   }
1273cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell
1274b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell   do_map = actx->nr_vbos && !actx->mapped_vbos;
1275b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell
1276b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell   /*
1277b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell    */
1278b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell   if (do_map)
1279b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell      _ae_map_vbos(ctx);
1280b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell
12810d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul   /* generic attributes */
12820d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul   for (at = actx->attribs; at->func; at++) {
1283024b5896f09650a599fdf60aa49aaf348941c3e5Brian Paul      const GLubyte *src
1284b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell         = ADD_POINTERS(at->array->BufferObj->Pointer, at->array->Ptr)
1285024b5896f09650a599fdf60aa49aaf348941c3e5Brian Paul         + elt * at->array->StrideB;
12860d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul      at->func( at->index, src );
128753ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul   }
128853ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul
12890d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul   /* conventional arrays */
12909bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick   for (aa = actx->arrays; aa->offset != -1 ; aa++) {
1291024b5896f09650a599fdf60aa49aaf348941c3e5Brian Paul      const GLubyte *src
1292b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell         = ADD_POINTERS(aa->array->BufferObj->Pointer, aa->array->Ptr)
1293024b5896f09650a599fdf60aa49aaf348941c3e5Brian Paul         + elt * aa->array->StrideB;
12949bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick      CALL_by_offset( disp, (array_func), aa->offset,
12959bdfee3a470a535ebe31074651fbacf680bcea6aIan Romanick		      ((const void *) src) );
1296cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell   }
1297b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell
1298b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell   if (do_map)
1299b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell      _ae_unmap_vbos(ctx);
1300cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell}
1301cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell
1302cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell
13034b7d6f216bf768482e07e4d7feb8ca3e1be92d53Keith Whitwellvoid _ae_invalidate_state( GLcontext *ctx, GLuint new_state )
1304cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell{
1305b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell   AEcontext *actx = AE_CONTEXT(ctx);
1306b97947972193b6b004a0ee49da31146230d43dd8Keith Whitwell
130796c0a6de25de2ba8f9601c13f67c22e1aff17b29Keith Whitwell
130896c0a6de25de2ba8f9601c13f67c22e1aff17b29Keith Whitwell   /* Only interested in this subset of mesa state.  Need to prune
130996c0a6de25de2ba8f9601c13f67c22e1aff17b29Keith Whitwell    * this down as both tnl/ and the drivers can raise statechanges
131096c0a6de25de2ba8f9601c13f67c22e1aff17b29Keith Whitwell    * for arcane reasons in the middle of seemingly atomic operations
131196c0a6de25de2ba8f9601c13f67c22e1aff17b29Keith Whitwell    * like DrawElements, over which we'd like to keep a known set of
131296c0a6de25de2ba8f9601c13f67c22e1aff17b29Keith Whitwell    * arrays and vbo's mapped.
131396c0a6de25de2ba8f9601c13f67c22e1aff17b29Keith Whitwell    *
131496c0a6de25de2ba8f9601c13f67c22e1aff17b29Keith Whitwell    * Luckily, neither the drivers nor tnl muck with the state that
131596c0a6de25de2ba8f9601c13f67c22e1aff17b29Keith Whitwell    * concerns us here:
1316b72fbcbe63bd53460da07ce840094924f04d38e0Keith Whitwell    */
131796c0a6de25de2ba8f9601c13f67c22e1aff17b29Keith Whitwell   new_state &= _NEW_ARRAY | _NEW_PROGRAM;
131896c0a6de25de2ba8f9601c13f67c22e1aff17b29Keith Whitwell   if (new_state) {
131996c0a6de25de2ba8f9601c13f67c22e1aff17b29Keith Whitwell      assert(!actx->mapped_vbos);
132096c0a6de25de2ba8f9601c13f67c22e1aff17b29Keith Whitwell      actx->NewState |= new_state;
132196c0a6de25de2ba8f9601c13f67c22e1aff17b29Keith Whitwell   }
1322cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell}
132380630d1fed6cd32e75f5e97e2cd27509be21d093Chia-I Wu
132480630d1fed6cd32e75f5e97e2cd27509be21d093Chia-I Wu
132580630d1fed6cd32e75f5e97e2cd27509be21d093Chia-I Wuvoid _mesa_install_arrayelt_vtxfmt(struct _glapi_table *disp,
132680630d1fed6cd32e75f5e97e2cd27509be21d093Chia-I Wu                                   const GLvertexformat *vfmt)
132780630d1fed6cd32e75f5e97e2cd27509be21d093Chia-I Wu{
132880630d1fed6cd32e75f5e97e2cd27509be21d093Chia-I Wu   SET_ArrayElement(disp, vfmt->ArrayElement);
132980630d1fed6cd32e75f5e97e2cd27509be21d093Chia-I Wu}
133080630d1fed6cd32e75f5e97e2cd27509be21d093Chia-I Wu
133180630d1fed6cd32e75f5e97e2cd27509be21d093Chia-I Wu
133280630d1fed6cd32e75f5e97e2cd27509be21d093Chia-I Wu#endif /* FEATURE_arrayelt */
1333