api_arrayelt.c revision c1d455f5827e7044dcb316dadc755a6f91299906
122144ab7552f0799bcfca506bf4ffa7f70a06649Gareth Hughes/* 222144ab7552f0799bcfca506bf4ffa7f70a06649Gareth Hughes * Mesa 3-D graphics library 30d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul * Version: 6.1 422144ab7552f0799bcfca506bf4ffa7f70a06649Gareth Hughes * 50d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul * Copyright (C) 1999-2004 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" 31cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell#include "context.h" 32fc00cbe8d1ac48faf345e41a13757a8a1e2e5ebeKeith Whitwell#include "glapi.h" 333c63452e64df7e10aa073c6c3b9492b1d7dabbb8Brian Paul#include "imports.h" 34cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell#include "macros.h" 35cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell#include "mtypes.h" 36cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell 37faaf78aeb0e18c75c9b204a634f296b9c056cf5cRoland Scheideggertypedef void (GLAPIENTRY *array_func)( const void * ); 380aa8a1062a06616fad18a1901afb5fa67fdcf82aBrian Paul 39cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwelltypedef struct { 400d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul const struct gl_client_array *array; 41faaf78aeb0e18c75c9b204a634f296b9c056cf5cRoland Scheidegger array_func func; 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; 564b7d6f216bf768482e07e4d7feb8ca3e1be92d53Keith Whitwell} AEcontext; 574b7d6f216bf768482e07e4d7feb8ca3e1be92d53Keith Whitwell 584b7d6f216bf768482e07e4d7feb8ca3e1be92d53Keith Whitwell#define AE_CONTEXT(ctx) ((AEcontext *)(ctx)->aelt_context) 590d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 600d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul/* 610d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul * Convert GL_BYTE, GL_UNSIGNED_BYTE, .. GL_DOUBLE into an integer 620d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul * in the range [0, 7]. Luckily these type tokens are sequentially 63f2f33507748260fe766742a0ed8b02c49d548bd8Brian Paul * numbered in gl.h, except for GL_DOUBLE. 640d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul */ 65f2f33507748260fe766742a0ed8b02c49d548bd8Brian Paul#define TYPE_IDX(t) ( (t) == GL_DOUBLE ? 7 : (t) & 7 ) 66cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell 670d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 682615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic array_func ColorFuncs[2][8] = { 6953ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul { (array_func)glColor3bv, 7053ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul (array_func)glColor3ubv, 7153ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul (array_func)glColor3sv, 7253ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul (array_func)glColor3usv, 7353ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul (array_func)glColor3iv, 7453ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul (array_func)glColor3uiv, 7553ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul (array_func)glColor3fv, 7653ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul (array_func)glColor3dv }, 7753ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul 7853ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul { (array_func)glColor4bv, 7953ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul (array_func)glColor4ubv, 8053ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul (array_func)glColor4sv, 8153ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul (array_func)glColor4usv, 8253ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul (array_func)glColor4iv, 8353ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul (array_func)glColor4uiv, 8453ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul (array_func)glColor4fv, 8553ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul (array_func)glColor4dv } 8653ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul}; 8753ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul 882615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic array_func VertexFuncs[3][8] = { 8953ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul { 0, 9053ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul 0, 9153ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul (array_func)glVertex2sv, 9253ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul 0, 9353ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul (array_func)glVertex2iv, 9453ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul 0, 9553ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul (array_func)glVertex2fv, 9653ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul (array_func)glVertex2dv }, 9753ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul 9853ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul { 0, 9953ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul 0, 10053ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul (array_func)glVertex3sv, 10153ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul 0, 10253ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul (array_func)glVertex3iv, 10353ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul 0, 10453ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul (array_func)glVertex3fv, 10553ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul (array_func)glVertex3dv }, 10653ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul 10753ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul { 0, 10853ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul 0, 10953ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul (array_func)glVertex4sv, 11053ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul 0, 11153ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul (array_func)glVertex4iv, 11253ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul 0, 11353ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul (array_func)glVertex4fv, 11453ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul (array_func)glVertex4dv } 11553ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul}; 11653ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul 1172615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic array_func IndexFuncs[8] = { 1184b7d6f216bf768482e07e4d7feb8ca3e1be92d53Keith Whitwell 0, 1191fb0a43c16190f4d043b8a0918361bee76b37e5fGareth Hughes (array_func)glIndexubv, 1201fb0a43c16190f4d043b8a0918361bee76b37e5fGareth Hughes (array_func)glIndexsv, 1214b7d6f216bf768482e07e4d7feb8ca3e1be92d53Keith Whitwell 0, 1221fb0a43c16190f4d043b8a0918361bee76b37e5fGareth Hughes (array_func)glIndexiv, 1234b7d6f216bf768482e07e4d7feb8ca3e1be92d53Keith Whitwell 0, 1241fb0a43c16190f4d043b8a0918361bee76b37e5fGareth Hughes (array_func)glIndexfv, 1251fb0a43c16190f4d043b8a0918361bee76b37e5fGareth Hughes (array_func)glIndexdv 126cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell}; 127cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell 1282615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic array_func NormalFuncs[8] = { 12953ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul (array_func)glNormal3bv, 13053ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul 0, 13153ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul (array_func)glNormal3sv, 13253ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul 0, 13353ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul (array_func)glNormal3iv, 13453ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul 0, 13553ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul (array_func)glNormal3fv, 13653ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul (array_func)glNormal3dv, 13753ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul}; 13853ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul 13953ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul 14053ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul/* Wrapper functions in case glSecondaryColor*EXT doesn't exist */ 1412615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY SecondaryColor3bvEXT(const GLbyte *c) 14253ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul{ 143c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(SecondaryColor3bvEXT)(c); 14453ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul} 14553ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul 1462615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY SecondaryColor3ubvEXT(const GLubyte *c) 14753ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul{ 148c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(SecondaryColor3ubvEXT)(c); 14953ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul} 15053ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul 1512615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY SecondaryColor3svEXT(const GLshort *c) 15253ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul{ 153c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(SecondaryColor3svEXT)(c); 15453ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul} 15553ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul 1562615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY SecondaryColor3usvEXT(const GLushort *c) 15753ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul{ 158c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(SecondaryColor3usvEXT)(c); 15953ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul} 16053ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul 1612615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY SecondaryColor3ivEXT(const GLint *c) 16253ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul{ 163c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(SecondaryColor3ivEXT)(c); 16453ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul} 16553ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul 1662615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY SecondaryColor3uivEXT(const GLuint *c) 16753ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul{ 168c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(SecondaryColor3uivEXT)(c); 16953ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul} 17053ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul 1712615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY SecondaryColor3fvEXT(const GLfloat *c) 17253ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul{ 173c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(SecondaryColor3fvEXT)(c); 17453ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul} 17553ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul 1762615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY SecondaryColor3dvEXT(const GLdouble *c) 17753ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul{ 178c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(SecondaryColor3dvEXT)(c); 17953ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul} 18053ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul 1812615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic array_func SecondaryColorFuncs[8] = { 18253ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul (array_func) SecondaryColor3bvEXT, 18353ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul (array_func) SecondaryColor3ubvEXT, 18453ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul (array_func) SecondaryColor3svEXT, 18553ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul (array_func) SecondaryColor3usvEXT, 18653ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul (array_func) SecondaryColor3ivEXT, 18753ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul (array_func) SecondaryColor3uivEXT, 18853ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul (array_func) SecondaryColor3fvEXT, 18953ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul (array_func) SecondaryColor3dvEXT, 19053ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul}; 19153ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul 19253ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul 19353ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul/* Again, wrapper functions in case glSecondaryColor*EXT doesn't exist */ 1942615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY FogCoordfvEXT(const GLfloat *f) 19553ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul{ 196c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(FogCoordfvEXT)(f); 19753ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul} 19853ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul 1992615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY FogCoorddvEXT(const GLdouble *f) 20053ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul{ 201c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(FogCoorddvEXT)(f); 20253ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul} 20353ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul 2042615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic array_func FogCoordFuncs[8] = { 20553ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul 0, 20653ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul 0, 20753ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul 0, 20853ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul 0, 20953ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul 0, 21053ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul 0, 21153ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul (array_func) FogCoordfvEXT, 21253ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul (array_func) FogCoorddvEXT 21353ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul}; 21453ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul 215cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell 2160d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul/**********************************************************************/ 2170d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 2180d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul/* GL_BYTE attributes */ 2190d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 2202615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY VertexAttrib1Nbv(GLuint index, const GLbyte *v) 2210d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{ 222c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(VertexAttrib1fNV)(index, BYTE_TO_FLOAT(v[0])); 2230d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul} 2240d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 2252615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY VertexAttrib1bv(GLuint index, const GLbyte *v) 2260d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{ 227c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(VertexAttrib1fNV)(index, v[0]); 2280d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul} 2290d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 2302615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY VertexAttrib2Nbv(GLuint index, const GLbyte *v) 2310d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{ 232c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(VertexAttrib2fNV)(index, BYTE_TO_FLOAT(v[0]), BYTE_TO_FLOAT(v[1])); 2330d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul} 2340d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 2352615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY VertexAttrib2bv(GLuint index, const GLbyte *v) 2360d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{ 237c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(VertexAttrib2fNV)(index, v[0], v[1]); 2380d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul} 2390d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 2402615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY VertexAttrib3Nbv(GLuint index, const GLbyte *v) 2410d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{ 242c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(VertexAttrib3fNV)(index, BYTE_TO_FLOAT(v[0]), 243c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick BYTE_TO_FLOAT(v[1]), 244c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick BYTE_TO_FLOAT(v[2])); 2450d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul} 2460d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 2472615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY VertexAttrib3bv(GLuint index, const GLbyte *v) 2480d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{ 249c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(VertexAttrib3fNV)(index, v[0], v[1], v[2]); 2500d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul} 2510d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 2522615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY VertexAttrib4Nbv(GLuint index, const GLbyte *v) 2530d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{ 254c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(VertexAttrib4fNV)(index, BYTE_TO_FLOAT(v[0]), 255c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick BYTE_TO_FLOAT(v[1]), 256c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick BYTE_TO_FLOAT(v[2]), 257c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick BYTE_TO_FLOAT(v[3])); 2580d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul} 2590d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 2602615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY VertexAttrib4bv(GLuint index, const GLbyte *v) 2610d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{ 262c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(VertexAttrib4fNV)(index, v[0], v[1], v[2], v[3]); 2630d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul} 2640d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 2650d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul/* GL_UNSIGNED_BYTE attributes */ 2660d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 2672615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY VertexAttrib1Nubv(GLuint index, const GLubyte *v) 2680d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{ 269c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(VertexAttrib1fNV)(index, UBYTE_TO_FLOAT(v[0])); 2700d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul} 2710d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 2722615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY VertexAttrib1ubv(GLuint index, const GLubyte *v) 2730d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{ 274c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(VertexAttrib1fNV)(index, v[0]); 2750d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul} 2760d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 2772615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY VertexAttrib2Nubv(GLuint index, const GLubyte *v) 2780d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{ 279c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(VertexAttrib2fNV)(index, UBYTE_TO_FLOAT(v[0]), 280c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick UBYTE_TO_FLOAT(v[1])); 2810d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul} 2820d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 2832615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY VertexAttrib2ubv(GLuint index, const GLubyte *v) 2840d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{ 285c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(VertexAttrib2fNV)(index, v[0], v[1]); 2860d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul} 2870d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 2882615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY VertexAttrib3Nubv(GLuint index, const GLubyte *v) 2890d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{ 290c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(VertexAttrib3fNV)(index, UBYTE_TO_FLOAT(v[0]), 291c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick UBYTE_TO_FLOAT(v[1]), 292c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick UBYTE_TO_FLOAT(v[2])); 2930d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul} 2942615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY VertexAttrib3ubv(GLuint index, const GLubyte *v) 2950d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{ 296c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(VertexAttrib3fNV)(index, v[0], v[1], v[2]); 2970d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul} 2980d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 2992615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY VertexAttrib4Nubv(GLuint index, const GLubyte *v) 3000d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{ 301c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(VertexAttrib4fNV)(index, UBYTE_TO_FLOAT(v[0]), 3020d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul UBYTE_TO_FLOAT(v[1]), 3030d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul UBYTE_TO_FLOAT(v[2]), 3040d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul UBYTE_TO_FLOAT(v[3])); 3050d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul} 3060d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 3072615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY VertexAttrib4ubv(GLuint index, const GLubyte *v) 3080d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{ 309c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(VertexAttrib4fNV)(index, v[0], v[1], v[2], v[3]); 3100d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul} 3110d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 3120d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul/* GL_SHORT attributes */ 3130d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 3142615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY VertexAttrib1Nsv(GLuint index, const GLshort *v) 3150d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{ 316c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(VertexAttrib1fNV)(index, SHORT_TO_FLOAT(v[0])); 3170d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul} 3180d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 3192615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY VertexAttrib1sv(GLuint index, const GLshort *v) 3200d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{ 321c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(VertexAttrib1fNV)(index, v[0]); 3220d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul} 3230d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 3242615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY VertexAttrib2Nsv(GLuint index, const GLshort *v) 3250d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{ 326c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(VertexAttrib2fNV)(index, SHORT_TO_FLOAT(v[0]), 327c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick SHORT_TO_FLOAT(v[1])); 3280d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul} 3290d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 3302615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY VertexAttrib2sv(GLuint index, const GLshort *v) 3310d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{ 332c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(VertexAttrib2fNV)(index, v[0], v[1]); 3330d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul} 3340d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 3352615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY VertexAttrib3Nsv(GLuint index, const GLshort *v) 3360d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{ 337c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(VertexAttrib3fNV)(index, SHORT_TO_FLOAT(v[0]), 338c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick SHORT_TO_FLOAT(v[1]), 339c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick SHORT_TO_FLOAT(v[2])); 3400d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul} 3410d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 3422615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY VertexAttrib3sv(GLuint index, const GLshort *v) 3430d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{ 344c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(VertexAttrib3fNV)(index, v[0], v[1], v[2]); 3450d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul} 3460d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 3472615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY VertexAttrib4Nsv(GLuint index, const GLshort *v) 3480d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{ 349c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(VertexAttrib4fNV)(index, SHORT_TO_FLOAT(v[0]), 350c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick SHORT_TO_FLOAT(v[1]), 351c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick SHORT_TO_FLOAT(v[2]), 352c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick SHORT_TO_FLOAT(v[3])); 3530d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul} 3540d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 3552615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY VertexAttrib4sv(GLuint index, const GLshort *v) 3560d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{ 357c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(VertexAttrib4fNV)(index, v[0], v[1], v[2], v[3]); 3580d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul} 3590d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 3600d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul/* GL_UNSIGNED_SHORT attributes */ 3610d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 3622615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY VertexAttrib1Nusv(GLuint index, const GLushort *v) 3630d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{ 364c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(VertexAttrib1fNV)(index, USHORT_TO_FLOAT(v[0])); 3650d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul} 3660d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 3672615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY VertexAttrib1usv(GLuint index, const GLushort *v) 3680d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{ 369c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(VertexAttrib1fNV)(index, v[0]); 3700d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul} 3710d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 3722615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY VertexAttrib2Nusv(GLuint index, const GLushort *v) 3730d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{ 374c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(VertexAttrib2fNV)(index, USHORT_TO_FLOAT(v[0]), 375c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick USHORT_TO_FLOAT(v[1])); 3760d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul} 3770d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 3782615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY VertexAttrib2usv(GLuint index, const GLushort *v) 3790d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{ 380c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(VertexAttrib2fNV)(index, v[0], v[1]); 3810d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul} 3820d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 3832615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY VertexAttrib3Nusv(GLuint index, const GLushort *v) 3840d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{ 385c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(VertexAttrib3fNV)(index, USHORT_TO_FLOAT(v[0]), 386c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick USHORT_TO_FLOAT(v[1]), 387c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick USHORT_TO_FLOAT(v[2])); 3880d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul} 3890d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 3902615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY VertexAttrib3usv(GLuint index, const GLushort *v) 3910d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{ 392c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(VertexAttrib3fNV)(index, v[0], v[1], v[2]); 3930d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul} 3940d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 3952615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY VertexAttrib4Nusv(GLuint index, const GLushort *v) 3960d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{ 397c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(VertexAttrib4fNV)(index, USHORT_TO_FLOAT(v[0]), 398c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick USHORT_TO_FLOAT(v[1]), 399c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick USHORT_TO_FLOAT(v[2]), 400c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick USHORT_TO_FLOAT(v[3])); 4010d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul} 4020d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 4032615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY VertexAttrib4usv(GLuint index, const GLushort *v) 4040d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{ 405c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(VertexAttrib4fNV)(index, v[0], v[1], v[2], v[3]); 4060d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul} 4070d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 4080d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul/* GL_INT attributes */ 4090d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 4102615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY VertexAttrib1Niv(GLuint index, const GLint *v) 4110d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{ 412c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(VertexAttrib1fNV)(index, INT_TO_FLOAT(v[0])); 4130d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul} 4140d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 4152615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY VertexAttrib1iv(GLuint index, const GLint *v) 4160d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{ 417c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(VertexAttrib1fNV)(index, v[0]); 4180d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul} 4190d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 4202615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY VertexAttrib2Niv(GLuint index, const GLint *v) 4210d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{ 422c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(VertexAttrib2fNV)(index, INT_TO_FLOAT(v[0]), 423c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick INT_TO_FLOAT(v[1])); 4240d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul} 4250d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 4262615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY VertexAttrib2iv(GLuint index, const GLint *v) 4270d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{ 428c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(VertexAttrib2fNV)(index, v[0], v[1]); 4290d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul} 4300d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 4312615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY VertexAttrib3Niv(GLuint index, const GLint *v) 4320d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{ 433c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(VertexAttrib3fNV)(index, INT_TO_FLOAT(v[0]), 434c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick INT_TO_FLOAT(v[1]), 435c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick INT_TO_FLOAT(v[2])); 4360d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul} 4370d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 4382615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY VertexAttrib3iv(GLuint index, const GLint *v) 4390d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{ 440c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(VertexAttrib3fNV)(index, v[0], v[1], v[2]); 4410d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul} 4420d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 4432615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY VertexAttrib4Niv(GLuint index, const GLint *v) 4440d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{ 445c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(VertexAttrib4fNV)(index, INT_TO_FLOAT(v[0]), 446c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick INT_TO_FLOAT(v[1]), 447c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick INT_TO_FLOAT(v[2]), 448c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick INT_TO_FLOAT(v[3])); 4490d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul} 4500d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 4512615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY VertexAttrib4iv(GLuint index, const GLint *v) 4520d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{ 453c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(VertexAttrib4fNV)(index, v[0], v[1], v[2], v[3]); 4540d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul} 4550d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 4560d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul/* GL_UNSIGNED_INT attributes */ 4570d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 4582615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY VertexAttrib1Nuiv(GLuint index, const GLuint *v) 4590d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{ 460c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(VertexAttrib1fNV)(index, UINT_TO_FLOAT(v[0])); 4610d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul} 4620d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 4632615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY VertexAttrib1uiv(GLuint index, const GLuint *v) 4640d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{ 465c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(VertexAttrib1fNV)(index, v[0]); 4660d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul} 4670d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 4682615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY VertexAttrib2Nuiv(GLuint index, const GLuint *v) 4690d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{ 470c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(VertexAttrib2fNV)(index, UINT_TO_FLOAT(v[0]), 471c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick UINT_TO_FLOAT(v[1])); 4720d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul} 4730d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 4742615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY VertexAttrib2uiv(GLuint index, const GLuint *v) 4750d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{ 476c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(VertexAttrib2fNV)(index, v[0], v[1]); 4770d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul} 4780d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 4792615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY VertexAttrib3Nuiv(GLuint index, const GLuint *v) 4800d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{ 481c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(VertexAttrib3fNV)(index, UINT_TO_FLOAT(v[0]), 482c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick UINT_TO_FLOAT(v[1]), 483c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick UINT_TO_FLOAT(v[2])); 4840d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul} 4850d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 4862615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY VertexAttrib3uiv(GLuint index, const GLuint *v) 4870d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{ 488c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(VertexAttrib3fNV)(index, v[0], v[1], v[2]); 4890d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul} 4900d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 4912615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY VertexAttrib4Nuiv(GLuint index, const GLuint *v) 4920d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{ 493c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(VertexAttrib4fNV)(index, UINT_TO_FLOAT(v[0]), 494c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick UINT_TO_FLOAT(v[1]), 495c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick UINT_TO_FLOAT(v[2]), 496c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick UINT_TO_FLOAT(v[3])); 4970d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul} 4980d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 4992615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY VertexAttrib4uiv(GLuint index, const GLuint *v) 5000d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{ 501c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(VertexAttrib4fNV)(index, v[0], v[1], v[2], v[3]); 5020d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul} 5030d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 5040d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul/* GL_FLOAT attributes */ 5050d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 5062615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY VertexAttrib1fv(GLuint index, const GLfloat *v) 5070d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{ 508c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(VertexAttrib1fvNV)(index, v); 5090d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul} 5100d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 5112615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY VertexAttrib2fv(GLuint index, const GLfloat *v) 5120d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{ 513c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(VertexAttrib2fvNV)(index, v); 5140d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul} 5150d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 5162615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY VertexAttrib3fv(GLuint index, const GLfloat *v) 5170d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{ 518c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(VertexAttrib3fvNV)(index, v); 5190d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul} 5200d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 5212615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY VertexAttrib4fv(GLuint index, const GLfloat *v) 5220d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{ 523c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(VertexAttrib4fvNV)(index, v); 5240d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul} 5250d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 5260d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul/* GL_DOUBLE attributes */ 5270d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 5282615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY VertexAttrib1dv(GLuint index, const GLdouble *v) 5290d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{ 530c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(VertexAttrib1dvNV)(index, v); 5310d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul} 5320d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 5332615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY VertexAttrib2dv(GLuint index, const GLdouble *v) 5340d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{ 535c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(VertexAttrib2dvNV)(index, v); 5360d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul} 5370d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 5382615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY VertexAttrib3dv(GLuint index, const GLdouble *v) 5390d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{ 540c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(VertexAttrib3dvNV)(index, v); 5410d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul} 5420d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 5432615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic void GLAPIENTRY VertexAttrib4dv(GLuint index, const GLdouble *v) 5440d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul{ 545c1d455f5827e7044dcb316dadc755a6f91299906Ian Romanick GL_CALL(VertexAttrib4dvNV)(index, v); 5460d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul} 5470d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 5480d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 5490d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul/* 5500d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul * Array [size][type] of VertexAttrib functions 5510d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul */ 5522615e81620bf91cc642b3373c41353b440242feeBrian Paulstatic attrib_func AttribFuncs[2][4][8] = { 5530d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul { 5540d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul /* non-normalized */ 5550d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul { 5560d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul /* size 1 */ 5570d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib1bv, 5580d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib1ubv, 5590d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib1sv, 5600d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib1usv, 5610d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib1iv, 5620d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib1uiv, 5630d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib1fv, 5640d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib1dv 5650d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul }, 5660d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul { 5670d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul /* size 2 */ 5680d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib2bv, 5690d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib2ubv, 5700d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib2sv, 5710d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib2usv, 5720d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib2iv, 5730d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib2uiv, 5740d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib2fv, 5750d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib2dv 5760d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul }, 5770d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul { 5780d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul /* size 3 */ 5790d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib3bv, 5800d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib3ubv, 5810d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib3sv, 5820d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib3usv, 5830d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib3iv, 5840d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib3uiv, 5850d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib3fv, 5860d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib3dv 5870d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul }, 5880d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul { 5890d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul /* size 4 */ 5900d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib4bv, 5910d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib4ubv, 5920d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib4sv, 5930d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib4usv, 5940d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib4iv, 5950d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib4uiv, 5960d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib4fv, 5970d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib4dv 5980d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul } 5990d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul }, 6000d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul { 6010d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul /* normalized (except for float/double) */ 6020d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul { 6030d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul /* size 1 */ 6040d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib1Nbv, 6050d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib1Nubv, 6060d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib1Nsv, 6070d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib1Nusv, 6080d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib1Niv, 6090d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib1Nuiv, 6100d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib1fv, 6110d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib1dv 6120d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul }, 6130d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul { 6140d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul /* size 2 */ 6150d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib2Nbv, 6160d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib2Nubv, 6170d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib2Nsv, 6180d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib2Nusv, 6190d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib2Niv, 6200d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib2Nuiv, 6210d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib2fv, 6220d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib2dv 6230d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul }, 6240d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul { 6250d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul /* size 3 */ 6260d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib3Nbv, 6270d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib3Nubv, 6280d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib3Nsv, 6290d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib3Nusv, 6300d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib3Niv, 6310d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib3Nuiv, 6320d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib3fv, 6330d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib3dv 6340d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul }, 6350d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul { 6360d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul /* size 4 */ 6370d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib4Nbv, 6380d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib4Nubv, 6390d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib4Nsv, 6400d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib4Nusv, 6410d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib4Niv, 6420d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib4Nuiv, 6430d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib4fv, 6440d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul (attrib_func) VertexAttrib4dv 6450d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul } 6460d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul } 6470d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul}; 6480d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 6490d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul/**********************************************************************/ 6500d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul 65103c0c2e8aa5e5f1b430c4b3faa1f9ad92b1b71ebBrian Paul 65203c0c2e8aa5e5f1b430c4b3faa1f9ad92b1b71ebBrian PaulGLboolean _ae_create_context( GLcontext *ctx ) 65303c0c2e8aa5e5f1b430c4b3faa1f9ad92b1b71ebBrian Paul{ 654ae0eaf93e092ac8e8b1c98f3e986de96940663faKeith Whitwell if (ctx->aelt_context) 655ae0eaf93e092ac8e8b1c98f3e986de96940663faKeith Whitwell return GL_TRUE; 656ae0eaf93e092ac8e8b1c98f3e986de96940663faKeith Whitwell 6574b7d6f216bf768482e07e4d7feb8ca3e1be92d53Keith Whitwell ctx->aelt_context = MALLOC( sizeof(AEcontext) ); 6581fb0a43c16190f4d043b8a0918361bee76b37e5fGareth Hughes if (!ctx->aelt_context) 6594b7d6f216bf768482e07e4d7feb8ca3e1be92d53Keith Whitwell return GL_FALSE; 6604b7d6f216bf768482e07e4d7feb8ca3e1be92d53Keith Whitwell 6614b7d6f216bf768482e07e4d7feb8ca3e1be92d53Keith Whitwell AE_CONTEXT(ctx)->NewState = ~0; 6624b7d6f216bf768482e07e4d7feb8ca3e1be92d53Keith Whitwell return GL_TRUE; 6634b7d6f216bf768482e07e4d7feb8ca3e1be92d53Keith Whitwell} 6644b7d6f216bf768482e07e4d7feb8ca3e1be92d53Keith Whitwell 6654b7d6f216bf768482e07e4d7feb8ca3e1be92d53Keith Whitwell 6664b7d6f216bf768482e07e4d7feb8ca3e1be92d53Keith Whitwellvoid _ae_destroy_context( GLcontext *ctx ) 6674b7d6f216bf768482e07e4d7feb8ca3e1be92d53Keith Whitwell{ 6684b7d6f216bf768482e07e4d7feb8ca3e1be92d53Keith Whitwell if ( AE_CONTEXT( ctx ) ) { 6694b7d6f216bf768482e07e4d7feb8ca3e1be92d53Keith Whitwell FREE( ctx->aelt_context ); 6704b7d6f216bf768482e07e4d7feb8ca3e1be92d53Keith Whitwell ctx->aelt_context = 0; 6714b7d6f216bf768482e07e4d7feb8ca3e1be92d53Keith Whitwell } 672cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell} 673cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell 6744b7d6f216bf768482e07e4d7feb8ca3e1be92d53Keith Whitwell 6750d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul/** 6760d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul * Make a list of per-vertex functions to call for each glArrayElement call. 6771e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul * These functions access the array data (i.e. glVertex, glColor, glNormal, 6781e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul * etc). 6791e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul * Note: this may be called during display list construction. 6800d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul */ 6814b7d6f216bf768482e07e4d7feb8ca3e1be92d53Keith Whitwellstatic void _ae_update_state( GLcontext *ctx ) 682cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell{ 6834b7d6f216bf768482e07e4d7feb8ca3e1be92d53Keith Whitwell AEcontext *actx = AE_CONTEXT(ctx); 6844b7d6f216bf768482e07e4d7feb8ca3e1be92d53Keith Whitwell AEarray *aa = actx->arrays; 6850d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul AEattrib *at = actx->attribs; 686db07de057f10ab7ab5be84352b674b200a0a9e22Brian Paul GLuint i; 687cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell 6881e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul /* conventional vertex arrays */ 6891e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul if (ctx->Array.Index.Enabled) { 690cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell aa->array = &ctx->Array.Index; 6912615e81620bf91cc642b3373c41353b440242feeBrian Paul aa->func = IndexFuncs[TYPE_IDX(aa->array->Type)]; 692cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell aa++; 693cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell } 694cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell if (ctx->Array.EdgeFlag.Enabled) { 6954b7d6f216bf768482e07e4d7feb8ca3e1be92d53Keith Whitwell aa->array = &ctx->Array.EdgeFlag; 6960d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul aa->func = (array_func) glEdgeFlagv; 697faaf78aeb0e18c75c9b204a634f296b9c056cf5cRoland Scheidegger aa++; 698faaf78aeb0e18c75c9b204a634f296b9c056cf5cRoland Scheidegger } 6991e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul if (ctx->Array.Normal.Enabled) { 7001e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul aa->array = &ctx->Array.Normal; 7012615e81620bf91cc642b3373c41353b440242feeBrian Paul aa->func = NormalFuncs[TYPE_IDX(aa->array->Type)]; 7021e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul aa++; 7031e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul } 7041e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul if (ctx->Array.Color.Enabled) { 7051e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul aa->array = &ctx->Array.Color; 7062615e81620bf91cc642b3373c41353b440242feeBrian Paul aa->func = ColorFuncs[aa->array->Size-3][TYPE_IDX(aa->array->Type)]; 7071e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul aa++; 7081e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul } 7091e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul if (ctx->Array.SecondaryColor.Enabled) { 7101e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul aa->array = &ctx->Array.SecondaryColor; 7112615e81620bf91cc642b3373c41353b440242feeBrian Paul aa->func = SecondaryColorFuncs[TYPE_IDX(aa->array->Type)]; 7121e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul aa++; 7131e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul } 7141e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul if (ctx->Array.FogCoord.Enabled) { 7151e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul aa->array = &ctx->Array.FogCoord; 7162615e81620bf91cc642b3373c41353b440242feeBrian Paul aa->func = FogCoordFuncs[TYPE_IDX(aa->array->Type)]; 7171e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul aa++; 7181e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul } 7191e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) { 7201e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul if (ctx->Array.TexCoord[i].Enabled) { 7211e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul /* NOTE: we use generic glVertexAttrib functions here. 7221e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul * If we ever de-alias conventional/generic vertex attribs this 7231e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul * will have to change. 7241e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul */ 7251e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul struct gl_client_array *attribArray = &ctx->Array.TexCoord[i]; 7261e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul at->array = attribArray; 7272615e81620bf91cc642b3373c41353b440242feeBrian Paul at->func = AttribFuncs[at->array->Normalized][at->array->Size-1][TYPE_IDX(at->array->Type)]; 7289d1ff8c1bb56b9ba0d3bf4552351d8bff6620ef2Brian Paul at->index = VERT_ATTRIB_TEX0 + i; 7291e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul at++; 7300d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul } 7311e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul } 732cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell 7331e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul /* generic vertex attribute arrays */ 7341e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul for (i = 1; i < VERT_ATTRIB_MAX; i++) { /* skip zero! */ 7351e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul if (ctx->Array.VertexAttrib[i].Enabled) { 7361e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul struct gl_client_array *attribArray = &ctx->Array.VertexAttrib[i]; 7370d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul at->array = attribArray; 7380d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul /* Note: we can't grab the _glapi_Dispatch->VertexAttrib1fvNV 7390d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul * function pointer here (for float arrays) since the pointer may 7400d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul * change from one execution of _ae_loopback_array_elt() to 7410d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul * the next. Doing so caused UT to break. 7420d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul */ 7432615e81620bf91cc642b3373c41353b440242feeBrian Paul at->func = AttribFuncs[at->array->Normalized][at->array->Size-1][TYPE_IDX(at->array->Type)]; 7441e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul at->index = i; 7450d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul at++; 7460d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul } 747faaf78aeb0e18c75c9b204a634f296b9c056cf5cRoland Scheidegger } 7481e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul 7491e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul /* finally, vertex position */ 7501e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul if (ctx->Array.VertexAttrib[0].Enabled) { 7511e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul /* Use glVertex(v) instead of glVertexAttrib(0, v) to be sure it's 7521e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul * issued as the last (proviking) attribute). 7531e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul */ 7541e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul aa->array = &ctx->Array.VertexAttrib[0]; 7551e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul assert(aa->array->Size >= 2); /* XXX fix someday? */ 7562615e81620bf91cc642b3373c41353b440242feeBrian Paul aa->func = VertexFuncs[aa->array->Size-2][TYPE_IDX(aa->array->Type)]; 7571e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul aa++; 7581e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul } 7591e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul else if (ctx->Array.Vertex.Enabled) { 7601e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul aa->array = &ctx->Array.Vertex; 7612615e81620bf91cc642b3373c41353b440242feeBrian Paul aa->func = VertexFuncs[aa->array->Size-2][TYPE_IDX(aa->array->Type)]; 7621e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul aa++; 7631e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul } 7641e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul 7650d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul ASSERT(at - actx->attribs <= VERT_ATTRIB_MAX); 7660d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul ASSERT(aa - actx->arrays < 32); 7670d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul at->func = NULL; /* terminate the list */ 7680d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul aa->func = NULL; /* terminate the list */ 769faaf78aeb0e18c75c9b204a634f296b9c056cf5cRoland Scheidegger 770cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell actx->NewState = 0; 771cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell} 772cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell 773cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell 7741e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul/** 7751e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul * Called via glArrayElement() and glDrawArrays(). 7761e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul * Issue the glNormal, glVertex, glColor, glVertexAttrib, etc functions 7771e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul * for all enabled vertex arrays (for elt-th element). 7781e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul * Note: this may be called during display list construction. 7791e3d868ffbec46eecb85b4aaf6990d9ad69e830fBrian Paul */ 780d6745697b625a6a5b7d6e3d7dd5f5510f96e277aKarl Schultzvoid GLAPIENTRY _ae_loopback_array_elt( GLint elt ) 781cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell{ 782cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell GET_CURRENT_CONTEXT(ctx); 7830d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul const AEcontext *actx = AE_CONTEXT(ctx); 7840d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul const AEarray *aa; 7850d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul const AEattrib *at; 7864b7d6f216bf768482e07e4d7feb8ca3e1be92d53Keith Whitwell 7874b7d6f216bf768482e07e4d7feb8ca3e1be92d53Keith Whitwell if (actx->NewState) 7884b7d6f216bf768482e07e4d7feb8ca3e1be92d53Keith Whitwell _ae_update_state( ctx ); 789cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell 7900d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul /* generic attributes */ 7910d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul for (at = actx->attribs; at->func; at++) { 7920d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul const GLubyte *src = at->array->BufferObj->Data 79379b372b92a42aeee11f0500fefe8fc92126e39e3Brian Paul + (unsigned long) at->array->Ptr 7940d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul + elt * at->array->StrideB; 7950d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul at->func( at->index, src ); 79653ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul } 79753ad0369721966c67bf6edad59c74e9ba7891fa5Brian Paul 7980d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul /* conventional arrays */ 7990d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul for (aa = actx->arrays; aa->func ; aa++) { 8000d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul const GLubyte *src = aa->array->BufferObj->Data 80179b372b92a42aeee11f0500fefe8fc92126e39e3Brian Paul + (unsigned long) aa->array->Ptr 8020d4393a38a2237bb65fbd38b8da73ac328a967d0Brian Paul + elt * aa->array->StrideB; 8030aa8a1062a06616fad18a1901afb5fa67fdcf82aBrian Paul aa->func( src ); 804cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell } 805cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell} 806cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell 807cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell 808cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell 8094b7d6f216bf768482e07e4d7feb8ca3e1be92d53Keith Whitwellvoid _ae_invalidate_state( GLcontext *ctx, GLuint new_state ) 810cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell{ 8114b7d6f216bf768482e07e4d7feb8ca3e1be92d53Keith Whitwell AE_CONTEXT(ctx)->NewState |= new_state; 812cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290Keith Whitwell} 813