17117f1b4Smrg/* 27117f1b4Smrg * Mesa 3-D graphics library 37117f1b4Smrg * 47117f1b4Smrg * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. 57117f1b4Smrg * 67117f1b4Smrg * Permission is hereby granted, free of charge, to any person obtaining a 77117f1b4Smrg * copy of this software and associated documentation files (the "Software"), 87117f1b4Smrg * to deal in the Software without restriction, including without limitation 97117f1b4Smrg * the rights to use, copy, modify, merge, publish, distribute, sublicense, 107117f1b4Smrg * and/or sell copies of the Software, and to permit persons to whom the 117117f1b4Smrg * Software is furnished to do so, subject to the following conditions: 127117f1b4Smrg * 137117f1b4Smrg * The above copyright notice and this permission notice shall be included 147117f1b4Smrg * in all copies or substantial portions of the Software. 157117f1b4Smrg * 167117f1b4Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 177117f1b4Smrg * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 187117f1b4Smrg * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 19af69d88dSmrg * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20af69d88dSmrg * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21af69d88dSmrg * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22af69d88dSmrg * OTHER DEALINGS IN THE SOFTWARE. 237117f1b4Smrg */ 247117f1b4Smrg 253464ebd5Sriastradh/** 263464ebd5Sriastradh * This file implements the glArrayElement() function. 273464ebd5Sriastradh * It involves looking at the format/type of all the enabled vertex arrays 283464ebd5Sriastradh * and emitting a list of pointers to functions which set the per-vertex 293464ebd5Sriastradh * state for the element/index. 303464ebd5Sriastradh */ 313464ebd5Sriastradh 323464ebd5Sriastradh 337117f1b4Smrg/* Author: 34af69d88dSmrg * Keith Whitwell <keithw@vmware.com> 357117f1b4Smrg */ 367117f1b4Smrg 377117f1b4Smrg#include "glheader.h" 38af69d88dSmrg#include "arrayobj.h" 397117f1b4Smrg#include "api_arrayelt.h" 404a49301eSmrg#include "bufferobj.h" 417117f1b4Smrg#include "context.h" 427ec681f3Smrg 437117f1b4Smrg#include "macros.h" 443464ebd5Sriastradh#include "mtypes.h" 45cdc920a0Smrg#include "main/dispatch.h" 46af69d88dSmrg#include "varray.h" 477117f1b4Smrg 487117f1b4Smrgtypedef void (GLAPIENTRY *attrib_func)( GLuint indx, const void *data ); 497117f1b4Smrg 507117f1b4Smrg/* 517117f1b4Smrg * Convert GL_BYTE, GL_UNSIGNED_BYTE, .. GL_DOUBLE into an integer 527117f1b4Smrg * in the range [0, 7]. Luckily these type tokens are sequentially 537117f1b4Smrg * numbered in gl.h, except for GL_DOUBLE. 547117f1b4Smrg */ 5501e04c3fSmrgstatic inline int 56af69d88dSmrgTYPE_IDX(GLenum t) 57af69d88dSmrg{ 58af69d88dSmrg return t == GL_DOUBLE ? 7 : t & 7; 59af69d88dSmrg} 603464ebd5Sriastradh 614a49301eSmrg 62a8bb7a65Smaya/* 63a8bb7a65Smaya * Convert normalized/integer/double to the range [0, 3]. 64a8bb7a65Smaya */ 65a8bb7a65Smayastatic inline int 66a8bb7a65Smayavertex_format_to_index(const struct gl_vertex_format *vformat) 6701e04c3fSmrg{ 68a8bb7a65Smaya if (vformat->Doubles) 69a8bb7a65Smaya return 3; 70a8bb7a65Smaya else if (vformat->Integer) 71a8bb7a65Smaya return 2; 72a8bb7a65Smaya else if (vformat->Normalized) 73a8bb7a65Smaya return 1; 74a8bb7a65Smaya else 75a8bb7a65Smaya return 0; 7601e04c3fSmrg} 7701e04c3fSmrg 7801e04c3fSmrg 79af69d88dSmrg#define NUM_TYPES 8 804a49301eSmrg 817ec681f3Smrgstatic struct _glapi_table * 827ec681f3Smrgget_dispatch(void) 837ec681f3Smrg{ 847ec681f3Smrg GET_CURRENT_CONTEXT(ctx); 857ec681f3Smrg return ctx->CurrentServerDispatch; 867ec681f3Smrg} 877ec681f3Smrg 884a49301eSmrg 897117f1b4Smrg/** 907117f1b4Smrg ** GL_NV_vertex_program 917117f1b4Smrg **/ 927117f1b4Smrg 937117f1b4Smrg/* GL_BYTE attributes */ 947117f1b4Smrg 953464ebd5Sriastradhstatic void GLAPIENTRY 963464ebd5SriastradhVertexAttrib1NbvNV(GLuint index, const GLbyte *v) 977117f1b4Smrg{ 987ec681f3Smrg CALL_VertexAttrib1fNV(get_dispatch(), (index, BYTE_TO_FLOAT(v[0]))); 997117f1b4Smrg} 1007117f1b4Smrg 1013464ebd5Sriastradhstatic void GLAPIENTRY 1023464ebd5SriastradhVertexAttrib1bvNV(GLuint index, const GLbyte *v) 1037117f1b4Smrg{ 1047ec681f3Smrg CALL_VertexAttrib1fNV(get_dispatch(), (index, (GLfloat)v[0])); 1057117f1b4Smrg} 1067117f1b4Smrg 1073464ebd5Sriastradhstatic void GLAPIENTRY 1083464ebd5SriastradhVertexAttrib2NbvNV(GLuint index, const GLbyte *v) 1097117f1b4Smrg{ 1107ec681f3Smrg CALL_VertexAttrib2fNV(get_dispatch(), (index, BYTE_TO_FLOAT(v[0]), BYTE_TO_FLOAT(v[1]))); 1117117f1b4Smrg} 1127117f1b4Smrg 1133464ebd5Sriastradhstatic void GLAPIENTRY 1143464ebd5SriastradhVertexAttrib2bvNV(GLuint index, const GLbyte *v) 1157117f1b4Smrg{ 1167ec681f3Smrg CALL_VertexAttrib2fNV(get_dispatch(), (index, (GLfloat)v[0], (GLfloat)v[1])); 1177117f1b4Smrg} 1187117f1b4Smrg 1193464ebd5Sriastradhstatic void GLAPIENTRY 1203464ebd5SriastradhVertexAttrib3NbvNV(GLuint index, const GLbyte *v) 1217117f1b4Smrg{ 1227ec681f3Smrg CALL_VertexAttrib3fNV(get_dispatch(), (index, BYTE_TO_FLOAT(v[0]), 1237117f1b4Smrg BYTE_TO_FLOAT(v[1]), 1247117f1b4Smrg BYTE_TO_FLOAT(v[2]))); 1257117f1b4Smrg} 1267117f1b4Smrg 1273464ebd5Sriastradhstatic void GLAPIENTRY 1283464ebd5SriastradhVertexAttrib3bvNV(GLuint index, const GLbyte *v) 1297117f1b4Smrg{ 1307ec681f3Smrg CALL_VertexAttrib3fNV(get_dispatch(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2])); 1317117f1b4Smrg} 1327117f1b4Smrg 1333464ebd5Sriastradhstatic void GLAPIENTRY 1343464ebd5SriastradhVertexAttrib4NbvNV(GLuint index, const GLbyte *v) 1357117f1b4Smrg{ 1367ec681f3Smrg CALL_VertexAttrib4fNV(get_dispatch(), (index, BYTE_TO_FLOAT(v[0]), 1377117f1b4Smrg BYTE_TO_FLOAT(v[1]), 1387117f1b4Smrg BYTE_TO_FLOAT(v[2]), 1397117f1b4Smrg BYTE_TO_FLOAT(v[3]))); 1407117f1b4Smrg} 1417117f1b4Smrg 1423464ebd5Sriastradhstatic void GLAPIENTRY 1433464ebd5SriastradhVertexAttrib4bvNV(GLuint index, const GLbyte *v) 1447117f1b4Smrg{ 1457ec681f3Smrg CALL_VertexAttrib4fNV(get_dispatch(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2], (GLfloat)v[3])); 1467117f1b4Smrg} 1477117f1b4Smrg 1487117f1b4Smrg/* GL_UNSIGNED_BYTE attributes */ 1497117f1b4Smrg 1503464ebd5Sriastradhstatic void GLAPIENTRY 1513464ebd5SriastradhVertexAttrib1NubvNV(GLuint index, const GLubyte *v) 1527117f1b4Smrg{ 1537ec681f3Smrg CALL_VertexAttrib1fNV(get_dispatch(), (index, UBYTE_TO_FLOAT(v[0]))); 1547117f1b4Smrg} 1557117f1b4Smrg 1563464ebd5Sriastradhstatic void GLAPIENTRY 1573464ebd5SriastradhVertexAttrib1ubvNV(GLuint index, const GLubyte *v) 1587117f1b4Smrg{ 1597ec681f3Smrg CALL_VertexAttrib1fNV(get_dispatch(), (index, (GLfloat)v[0])); 1607117f1b4Smrg} 1617117f1b4Smrg 1623464ebd5Sriastradhstatic void GLAPIENTRY 1633464ebd5SriastradhVertexAttrib2NubvNV(GLuint index, const GLubyte *v) 1647117f1b4Smrg{ 1657ec681f3Smrg CALL_VertexAttrib2fNV(get_dispatch(), (index, UBYTE_TO_FLOAT(v[0]), 1663464ebd5Sriastradh UBYTE_TO_FLOAT(v[1]))); 1677117f1b4Smrg} 1687117f1b4Smrg 1693464ebd5Sriastradhstatic void GLAPIENTRY 1703464ebd5SriastradhVertexAttrib2ubvNV(GLuint index, const GLubyte *v) 1717117f1b4Smrg{ 1727ec681f3Smrg CALL_VertexAttrib2fNV(get_dispatch(), (index, (GLfloat)v[0], (GLfloat)v[1])); 1737117f1b4Smrg} 1747117f1b4Smrg 1753464ebd5Sriastradhstatic void GLAPIENTRY 1763464ebd5SriastradhVertexAttrib3NubvNV(GLuint index, const GLubyte *v) 1777117f1b4Smrg{ 1787ec681f3Smrg CALL_VertexAttrib3fNV(get_dispatch(), (index, UBYTE_TO_FLOAT(v[0]), 1797117f1b4Smrg UBYTE_TO_FLOAT(v[1]), 1807117f1b4Smrg UBYTE_TO_FLOAT(v[2]))); 1817117f1b4Smrg} 1823464ebd5Sriastradhstatic void GLAPIENTRY 1833464ebd5SriastradhVertexAttrib3ubvNV(GLuint index, const GLubyte *v) 1847117f1b4Smrg{ 1857ec681f3Smrg CALL_VertexAttrib3fNV(get_dispatch(), (index, (GLfloat)v[0], 1863464ebd5Sriastradh (GLfloat)v[1], (GLfloat)v[2])); 1877117f1b4Smrg} 1887117f1b4Smrg 1893464ebd5Sriastradhstatic void GLAPIENTRY 1903464ebd5SriastradhVertexAttrib4NubvNV(GLuint index, const GLubyte *v) 1917117f1b4Smrg{ 1927ec681f3Smrg CALL_VertexAttrib4fNV(get_dispatch(), (index, UBYTE_TO_FLOAT(v[0]), 1933464ebd5Sriastradh UBYTE_TO_FLOAT(v[1]), 1943464ebd5Sriastradh UBYTE_TO_FLOAT(v[2]), 1953464ebd5Sriastradh UBYTE_TO_FLOAT(v[3]))); 1967117f1b4Smrg} 1977117f1b4Smrg 1983464ebd5Sriastradhstatic void GLAPIENTRY 1993464ebd5SriastradhVertexAttrib4ubvNV(GLuint index, const GLubyte *v) 2007117f1b4Smrg{ 2017ec681f3Smrg CALL_VertexAttrib4fNV(get_dispatch(), (index, (GLfloat)v[0], 2023464ebd5Sriastradh (GLfloat)v[1], (GLfloat)v[2], 2033464ebd5Sriastradh (GLfloat)v[3])); 2047117f1b4Smrg} 2057117f1b4Smrg 2067117f1b4Smrg/* GL_SHORT attributes */ 2077117f1b4Smrg 2083464ebd5Sriastradhstatic void GLAPIENTRY 2093464ebd5SriastradhVertexAttrib1NsvNV(GLuint index, const GLshort *v) 2107117f1b4Smrg{ 2117ec681f3Smrg CALL_VertexAttrib1fNV(get_dispatch(), (index, SHORT_TO_FLOAT(v[0]))); 2127117f1b4Smrg} 2137117f1b4Smrg 2143464ebd5Sriastradhstatic void GLAPIENTRY 2153464ebd5SriastradhVertexAttrib1svNV(GLuint index, const GLshort *v) 2167117f1b4Smrg{ 2177ec681f3Smrg CALL_VertexAttrib1fNV(get_dispatch(), (index, (GLfloat)v[0])); 2187117f1b4Smrg} 2197117f1b4Smrg 2203464ebd5Sriastradhstatic void GLAPIENTRY 2213464ebd5SriastradhVertexAttrib2NsvNV(GLuint index, const GLshort *v) 2227117f1b4Smrg{ 2237ec681f3Smrg CALL_VertexAttrib2fNV(get_dispatch(), (index, SHORT_TO_FLOAT(v[0]), 2243464ebd5Sriastradh SHORT_TO_FLOAT(v[1]))); 2257117f1b4Smrg} 2267117f1b4Smrg 2273464ebd5Sriastradhstatic void GLAPIENTRY 2283464ebd5SriastradhVertexAttrib2svNV(GLuint index, const GLshort *v) 2297117f1b4Smrg{ 2307ec681f3Smrg CALL_VertexAttrib2fNV(get_dispatch(), (index, (GLfloat)v[0], (GLfloat)v[1])); 2317117f1b4Smrg} 2327117f1b4Smrg 2333464ebd5Sriastradhstatic void GLAPIENTRY 2343464ebd5SriastradhVertexAttrib3NsvNV(GLuint index, const GLshort *v) 2357117f1b4Smrg{ 2367ec681f3Smrg CALL_VertexAttrib3fNV(get_dispatch(), (index, SHORT_TO_FLOAT(v[0]), 2377117f1b4Smrg SHORT_TO_FLOAT(v[1]), 2387117f1b4Smrg SHORT_TO_FLOAT(v[2]))); 2397117f1b4Smrg} 2407117f1b4Smrg 2413464ebd5Sriastradhstatic void GLAPIENTRY 2423464ebd5SriastradhVertexAttrib3svNV(GLuint index, const GLshort *v) 2437117f1b4Smrg{ 2447ec681f3Smrg CALL_VertexAttrib3fNV(get_dispatch(), (index, (GLfloat)v[0], (GLfloat)v[1], 2453464ebd5Sriastradh (GLfloat)v[2])); 2467117f1b4Smrg} 2477117f1b4Smrg 2483464ebd5Sriastradhstatic void GLAPIENTRY 2493464ebd5SriastradhVertexAttrib4NsvNV(GLuint index, const GLshort *v) 2507117f1b4Smrg{ 2517ec681f3Smrg CALL_VertexAttrib4fNV(get_dispatch(), (index, SHORT_TO_FLOAT(v[0]), 2527117f1b4Smrg SHORT_TO_FLOAT(v[1]), 2537117f1b4Smrg SHORT_TO_FLOAT(v[2]), 2547117f1b4Smrg SHORT_TO_FLOAT(v[3]))); 2557117f1b4Smrg} 2567117f1b4Smrg 2573464ebd5Sriastradhstatic void GLAPIENTRY 2583464ebd5SriastradhVertexAttrib4svNV(GLuint index, const GLshort *v) 2597117f1b4Smrg{ 2607ec681f3Smrg CALL_VertexAttrib4fNV(get_dispatch(), (index, (GLfloat)v[0], (GLfloat)v[1], 2613464ebd5Sriastradh (GLfloat)v[2], (GLfloat)v[3])); 2627117f1b4Smrg} 2637117f1b4Smrg 2647117f1b4Smrg/* GL_UNSIGNED_SHORT attributes */ 2657117f1b4Smrg 2663464ebd5Sriastradhstatic void GLAPIENTRY 2673464ebd5SriastradhVertexAttrib1NusvNV(GLuint index, const GLushort *v) 2687117f1b4Smrg{ 2697ec681f3Smrg CALL_VertexAttrib1fNV(get_dispatch(), (index, USHORT_TO_FLOAT(v[0]))); 2707117f1b4Smrg} 2717117f1b4Smrg 2723464ebd5Sriastradhstatic void GLAPIENTRY 2733464ebd5SriastradhVertexAttrib1usvNV(GLuint index, const GLushort *v) 2747117f1b4Smrg{ 2757ec681f3Smrg CALL_VertexAttrib1fNV(get_dispatch(), (index, (GLfloat)v[0])); 2767117f1b4Smrg} 2777117f1b4Smrg 2783464ebd5Sriastradhstatic void GLAPIENTRY 2793464ebd5SriastradhVertexAttrib2NusvNV(GLuint index, const GLushort *v) 2807117f1b4Smrg{ 2817ec681f3Smrg CALL_VertexAttrib2fNV(get_dispatch(), (index, USHORT_TO_FLOAT(v[0]), 2827117f1b4Smrg USHORT_TO_FLOAT(v[1]))); 2837117f1b4Smrg} 2847117f1b4Smrg 2853464ebd5Sriastradhstatic void GLAPIENTRY 2863464ebd5SriastradhVertexAttrib2usvNV(GLuint index, const GLushort *v) 2877117f1b4Smrg{ 2887ec681f3Smrg CALL_VertexAttrib2fNV(get_dispatch(), (index, (GLfloat)v[0], 2893464ebd5Sriastradh (GLfloat)v[1])); 2907117f1b4Smrg} 2917117f1b4Smrg 2923464ebd5Sriastradhstatic void GLAPIENTRY 2933464ebd5SriastradhVertexAttrib3NusvNV(GLuint index, const GLushort *v) 2947117f1b4Smrg{ 2957ec681f3Smrg CALL_VertexAttrib3fNV(get_dispatch(), (index, USHORT_TO_FLOAT(v[0]), 2967117f1b4Smrg USHORT_TO_FLOAT(v[1]), 2977117f1b4Smrg USHORT_TO_FLOAT(v[2]))); 2987117f1b4Smrg} 2997117f1b4Smrg 3003464ebd5Sriastradhstatic void GLAPIENTRY 3013464ebd5SriastradhVertexAttrib3usvNV(GLuint index, const GLushort *v) 3027117f1b4Smrg{ 3037ec681f3Smrg CALL_VertexAttrib3fNV(get_dispatch(), (index, (GLfloat)v[0], (GLfloat)v[1], 3043464ebd5Sriastradh (GLfloat)v[2])); 3057117f1b4Smrg} 3067117f1b4Smrg 3073464ebd5Sriastradhstatic void GLAPIENTRY 3083464ebd5SriastradhVertexAttrib4NusvNV(GLuint index, const GLushort *v) 3097117f1b4Smrg{ 3107ec681f3Smrg CALL_VertexAttrib4fNV(get_dispatch(), (index, USHORT_TO_FLOAT(v[0]), 3117117f1b4Smrg USHORT_TO_FLOAT(v[1]), 3127117f1b4Smrg USHORT_TO_FLOAT(v[2]), 3137117f1b4Smrg USHORT_TO_FLOAT(v[3]))); 3147117f1b4Smrg} 3157117f1b4Smrg 3163464ebd5Sriastradhstatic void GLAPIENTRY 3173464ebd5SriastradhVertexAttrib4usvNV(GLuint index, const GLushort *v) 3187117f1b4Smrg{ 3197ec681f3Smrg CALL_VertexAttrib4fNV(get_dispatch(), (index, (GLfloat)v[0], (GLfloat)v[1], 3203464ebd5Sriastradh (GLfloat)v[2], (GLfloat)v[3])); 3217117f1b4Smrg} 3227117f1b4Smrg 3237117f1b4Smrg/* GL_INT attributes */ 3247117f1b4Smrg 3253464ebd5Sriastradhstatic void GLAPIENTRY 3263464ebd5SriastradhVertexAttrib1NivNV(GLuint index, const GLint *v) 3277117f1b4Smrg{ 3287ec681f3Smrg CALL_VertexAttrib1fNV(get_dispatch(), (index, INT_TO_FLOAT(v[0]))); 3297117f1b4Smrg} 3307117f1b4Smrg 3313464ebd5Sriastradhstatic void GLAPIENTRY 3323464ebd5SriastradhVertexAttrib1ivNV(GLuint index, const GLint *v) 3337117f1b4Smrg{ 3347ec681f3Smrg CALL_VertexAttrib1fNV(get_dispatch(), (index, (GLfloat)v[0])); 3357117f1b4Smrg} 3367117f1b4Smrg 3373464ebd5Sriastradhstatic void GLAPIENTRY 3383464ebd5SriastradhVertexAttrib2NivNV(GLuint index, const GLint *v) 3397117f1b4Smrg{ 3407ec681f3Smrg CALL_VertexAttrib2fNV(get_dispatch(), (index, INT_TO_FLOAT(v[0]), 3417117f1b4Smrg INT_TO_FLOAT(v[1]))); 3427117f1b4Smrg} 3437117f1b4Smrg 3443464ebd5Sriastradhstatic void GLAPIENTRY 3453464ebd5SriastradhVertexAttrib2ivNV(GLuint index, const GLint *v) 3467117f1b4Smrg{ 3477ec681f3Smrg CALL_VertexAttrib2fNV(get_dispatch(), (index, (GLfloat)v[0], (GLfloat)v[1])); 3487117f1b4Smrg} 3497117f1b4Smrg 3503464ebd5Sriastradhstatic void GLAPIENTRY 3513464ebd5SriastradhVertexAttrib3NivNV(GLuint index, const GLint *v) 3527117f1b4Smrg{ 3537ec681f3Smrg CALL_VertexAttrib3fNV(get_dispatch(), (index, INT_TO_FLOAT(v[0]), 3547117f1b4Smrg INT_TO_FLOAT(v[1]), 3557117f1b4Smrg INT_TO_FLOAT(v[2]))); 3567117f1b4Smrg} 3577117f1b4Smrg 3583464ebd5Sriastradhstatic void GLAPIENTRY 3593464ebd5SriastradhVertexAttrib3ivNV(GLuint index, const GLint *v) 3607117f1b4Smrg{ 3617ec681f3Smrg CALL_VertexAttrib3fNV(get_dispatch(), (index, (GLfloat)v[0], (GLfloat)v[1], 3623464ebd5Sriastradh (GLfloat)v[2])); 3637117f1b4Smrg} 3647117f1b4Smrg 3653464ebd5Sriastradhstatic void GLAPIENTRY 3663464ebd5SriastradhVertexAttrib4NivNV(GLuint index, const GLint *v) 3677117f1b4Smrg{ 3687ec681f3Smrg CALL_VertexAttrib4fNV(get_dispatch(), (index, INT_TO_FLOAT(v[0]), 3693464ebd5Sriastradh INT_TO_FLOAT(v[1]), 3703464ebd5Sriastradh INT_TO_FLOAT(v[2]), 3713464ebd5Sriastradh INT_TO_FLOAT(v[3]))); 3727117f1b4Smrg} 3737117f1b4Smrg 3743464ebd5Sriastradhstatic void GLAPIENTRY 3753464ebd5SriastradhVertexAttrib4ivNV(GLuint index, const GLint *v) 3767117f1b4Smrg{ 3777ec681f3Smrg CALL_VertexAttrib4fNV(get_dispatch(), (index, (GLfloat)v[0], (GLfloat)v[1], 3783464ebd5Sriastradh (GLfloat)v[2], (GLfloat)v[3])); 3797117f1b4Smrg} 3807117f1b4Smrg 3817117f1b4Smrg/* GL_UNSIGNED_INT attributes */ 3827117f1b4Smrg 3833464ebd5Sriastradhstatic void GLAPIENTRY 3843464ebd5SriastradhVertexAttrib1NuivNV(GLuint index, const GLuint *v) 3857117f1b4Smrg{ 3867ec681f3Smrg CALL_VertexAttrib1fNV(get_dispatch(), (index, UINT_TO_FLOAT(v[0]))); 3877117f1b4Smrg} 3887117f1b4Smrg 3893464ebd5Sriastradhstatic void GLAPIENTRY 3903464ebd5SriastradhVertexAttrib1uivNV(GLuint index, const GLuint *v) 3917117f1b4Smrg{ 3927ec681f3Smrg CALL_VertexAttrib1fNV(get_dispatch(), (index, (GLfloat)v[0])); 3937117f1b4Smrg} 3947117f1b4Smrg 3953464ebd5Sriastradhstatic void GLAPIENTRY 3963464ebd5SriastradhVertexAttrib2NuivNV(GLuint index, const GLuint *v) 3977117f1b4Smrg{ 3987ec681f3Smrg CALL_VertexAttrib2fNV(get_dispatch(), (index, UINT_TO_FLOAT(v[0]), 3993464ebd5Sriastradh UINT_TO_FLOAT(v[1]))); 4007117f1b4Smrg} 4017117f1b4Smrg 4023464ebd5Sriastradhstatic void GLAPIENTRY 4033464ebd5SriastradhVertexAttrib2uivNV(GLuint index, const GLuint *v) 4047117f1b4Smrg{ 4057ec681f3Smrg CALL_VertexAttrib2fNV(get_dispatch(), (index, (GLfloat)v[0], 4063464ebd5Sriastradh (GLfloat)v[1])); 4077117f1b4Smrg} 4087117f1b4Smrg 4093464ebd5Sriastradhstatic void GLAPIENTRY 4103464ebd5SriastradhVertexAttrib3NuivNV(GLuint index, const GLuint *v) 4117117f1b4Smrg{ 4127ec681f3Smrg CALL_VertexAttrib3fNV(get_dispatch(), (index, UINT_TO_FLOAT(v[0]), 4137117f1b4Smrg UINT_TO_FLOAT(v[1]), 4147117f1b4Smrg UINT_TO_FLOAT(v[2]))); 4157117f1b4Smrg} 4167117f1b4Smrg 4173464ebd5Sriastradhstatic void GLAPIENTRY 4183464ebd5SriastradhVertexAttrib3uivNV(GLuint index, const GLuint *v) 4197117f1b4Smrg{ 4207ec681f3Smrg CALL_VertexAttrib3fNV(get_dispatch(), (index, (GLfloat)v[0], (GLfloat)v[1], 4213464ebd5Sriastradh (GLfloat)v[2])); 4227117f1b4Smrg} 4237117f1b4Smrg 4243464ebd5Sriastradhstatic void GLAPIENTRY 4253464ebd5SriastradhVertexAttrib4NuivNV(GLuint index, const GLuint *v) 4267117f1b4Smrg{ 4277ec681f3Smrg CALL_VertexAttrib4fNV(get_dispatch(), (index, UINT_TO_FLOAT(v[0]), 4287117f1b4Smrg UINT_TO_FLOAT(v[1]), 4297117f1b4Smrg UINT_TO_FLOAT(v[2]), 4307117f1b4Smrg UINT_TO_FLOAT(v[3]))); 4317117f1b4Smrg} 4327117f1b4Smrg 4333464ebd5Sriastradhstatic void GLAPIENTRY 4343464ebd5SriastradhVertexAttrib4uivNV(GLuint index, const GLuint *v) 4357117f1b4Smrg{ 4367ec681f3Smrg CALL_VertexAttrib4fNV(get_dispatch(), (index, (GLfloat)v[0], (GLfloat)v[1], 4373464ebd5Sriastradh (GLfloat)v[2], (GLfloat)v[3])); 4387117f1b4Smrg} 4397117f1b4Smrg 4407117f1b4Smrg/* GL_FLOAT attributes */ 4417117f1b4Smrg 4423464ebd5Sriastradhstatic void GLAPIENTRY 4433464ebd5SriastradhVertexAttrib1fvNV(GLuint index, const GLfloat *v) 4447117f1b4Smrg{ 4457ec681f3Smrg CALL_VertexAttrib1fvNV(get_dispatch(), (index, v)); 4467117f1b4Smrg} 4477117f1b4Smrg 4483464ebd5Sriastradhstatic void GLAPIENTRY 4493464ebd5SriastradhVertexAttrib2fvNV(GLuint index, const GLfloat *v) 4507117f1b4Smrg{ 4517ec681f3Smrg CALL_VertexAttrib2fvNV(get_dispatch(), (index, v)); 4527117f1b4Smrg} 4537117f1b4Smrg 4543464ebd5Sriastradhstatic void GLAPIENTRY 4553464ebd5SriastradhVertexAttrib3fvNV(GLuint index, const GLfloat *v) 4567117f1b4Smrg{ 4577ec681f3Smrg CALL_VertexAttrib3fvNV(get_dispatch(), (index, v)); 4587117f1b4Smrg} 4597117f1b4Smrg 4603464ebd5Sriastradhstatic void GLAPIENTRY 4613464ebd5SriastradhVertexAttrib4fvNV(GLuint index, const GLfloat *v) 4627117f1b4Smrg{ 4637ec681f3Smrg CALL_VertexAttrib4fvNV(get_dispatch(), (index, v)); 4647117f1b4Smrg} 4657117f1b4Smrg 4667117f1b4Smrg/* GL_DOUBLE attributes */ 4677117f1b4Smrg 4683464ebd5Sriastradhstatic void GLAPIENTRY 4693464ebd5SriastradhVertexAttrib1dvNV(GLuint index, const GLdouble *v) 4707117f1b4Smrg{ 4717ec681f3Smrg CALL_VertexAttrib1dvNV(get_dispatch(), (index, v)); 4727117f1b4Smrg} 4737117f1b4Smrg 4743464ebd5Sriastradhstatic void GLAPIENTRY 4753464ebd5SriastradhVertexAttrib2dvNV(GLuint index, const GLdouble *v) 4767117f1b4Smrg{ 4777ec681f3Smrg CALL_VertexAttrib2dvNV(get_dispatch(), (index, v)); 4787117f1b4Smrg} 4797117f1b4Smrg 4803464ebd5Sriastradhstatic void GLAPIENTRY 4813464ebd5SriastradhVertexAttrib3dvNV(GLuint index, const GLdouble *v) 4827117f1b4Smrg{ 4837ec681f3Smrg CALL_VertexAttrib3dvNV(get_dispatch(), (index, v)); 4847117f1b4Smrg} 4857117f1b4Smrg 4863464ebd5Sriastradhstatic void GLAPIENTRY 4873464ebd5SriastradhVertexAttrib4dvNV(GLuint index, const GLdouble *v) 4887117f1b4Smrg{ 4897ec681f3Smrg CALL_VertexAttrib4dvNV(get_dispatch(), (index, v)); 4907117f1b4Smrg} 4917117f1b4Smrg 4927117f1b4Smrg 4937117f1b4Smrg/* 4947117f1b4Smrg * Array [size][type] of VertexAttrib functions 4957117f1b4Smrg */ 496a8bb7a65Smayastatic const attrib_func AttribFuncsNV[2][4][NUM_TYPES] = { 4977117f1b4Smrg { 4987117f1b4Smrg /* non-normalized */ 4997117f1b4Smrg { 5007117f1b4Smrg /* size 1 */ 5017117f1b4Smrg (attrib_func) VertexAttrib1bvNV, 5027117f1b4Smrg (attrib_func) VertexAttrib1ubvNV, 5037117f1b4Smrg (attrib_func) VertexAttrib1svNV, 5047117f1b4Smrg (attrib_func) VertexAttrib1usvNV, 5057117f1b4Smrg (attrib_func) VertexAttrib1ivNV, 5067117f1b4Smrg (attrib_func) VertexAttrib1uivNV, 5077117f1b4Smrg (attrib_func) VertexAttrib1fvNV, 5087117f1b4Smrg (attrib_func) VertexAttrib1dvNV 5097117f1b4Smrg }, 5107117f1b4Smrg { 5117117f1b4Smrg /* size 2 */ 5127117f1b4Smrg (attrib_func) VertexAttrib2bvNV, 5137117f1b4Smrg (attrib_func) VertexAttrib2ubvNV, 5147117f1b4Smrg (attrib_func) VertexAttrib2svNV, 5157117f1b4Smrg (attrib_func) VertexAttrib2usvNV, 5167117f1b4Smrg (attrib_func) VertexAttrib2ivNV, 5177117f1b4Smrg (attrib_func) VertexAttrib2uivNV, 5187117f1b4Smrg (attrib_func) VertexAttrib2fvNV, 5197117f1b4Smrg (attrib_func) VertexAttrib2dvNV 5207117f1b4Smrg }, 5217117f1b4Smrg { 5227117f1b4Smrg /* size 3 */ 5237117f1b4Smrg (attrib_func) VertexAttrib3bvNV, 5247117f1b4Smrg (attrib_func) VertexAttrib3ubvNV, 5257117f1b4Smrg (attrib_func) VertexAttrib3svNV, 5267117f1b4Smrg (attrib_func) VertexAttrib3usvNV, 5277117f1b4Smrg (attrib_func) VertexAttrib3ivNV, 5287117f1b4Smrg (attrib_func) VertexAttrib3uivNV, 5297117f1b4Smrg (attrib_func) VertexAttrib3fvNV, 5307117f1b4Smrg (attrib_func) VertexAttrib3dvNV 5317117f1b4Smrg }, 5327117f1b4Smrg { 5337117f1b4Smrg /* size 4 */ 5347117f1b4Smrg (attrib_func) VertexAttrib4bvNV, 5357117f1b4Smrg (attrib_func) VertexAttrib4ubvNV, 5367117f1b4Smrg (attrib_func) VertexAttrib4svNV, 5377117f1b4Smrg (attrib_func) VertexAttrib4usvNV, 5387117f1b4Smrg (attrib_func) VertexAttrib4ivNV, 5397117f1b4Smrg (attrib_func) VertexAttrib4uivNV, 5407117f1b4Smrg (attrib_func) VertexAttrib4fvNV, 5417117f1b4Smrg (attrib_func) VertexAttrib4dvNV 5427117f1b4Smrg } 5437117f1b4Smrg }, 5447117f1b4Smrg { 5457117f1b4Smrg /* normalized (except for float/double) */ 5467117f1b4Smrg { 5477117f1b4Smrg /* size 1 */ 5487117f1b4Smrg (attrib_func) VertexAttrib1NbvNV, 5497117f1b4Smrg (attrib_func) VertexAttrib1NubvNV, 5507117f1b4Smrg (attrib_func) VertexAttrib1NsvNV, 5517117f1b4Smrg (attrib_func) VertexAttrib1NusvNV, 5527117f1b4Smrg (attrib_func) VertexAttrib1NivNV, 5537117f1b4Smrg (attrib_func) VertexAttrib1NuivNV, 5547117f1b4Smrg (attrib_func) VertexAttrib1fvNV, 5557117f1b4Smrg (attrib_func) VertexAttrib1dvNV 5567117f1b4Smrg }, 5577117f1b4Smrg { 5587117f1b4Smrg /* size 2 */ 5597117f1b4Smrg (attrib_func) VertexAttrib2NbvNV, 5607117f1b4Smrg (attrib_func) VertexAttrib2NubvNV, 5617117f1b4Smrg (attrib_func) VertexAttrib2NsvNV, 5627117f1b4Smrg (attrib_func) VertexAttrib2NusvNV, 5637117f1b4Smrg (attrib_func) VertexAttrib2NivNV, 5647117f1b4Smrg (attrib_func) VertexAttrib2NuivNV, 5657117f1b4Smrg (attrib_func) VertexAttrib2fvNV, 5667117f1b4Smrg (attrib_func) VertexAttrib2dvNV 5677117f1b4Smrg }, 5687117f1b4Smrg { 5697117f1b4Smrg /* size 3 */ 5707117f1b4Smrg (attrib_func) VertexAttrib3NbvNV, 5717117f1b4Smrg (attrib_func) VertexAttrib3NubvNV, 5727117f1b4Smrg (attrib_func) VertexAttrib3NsvNV, 5737117f1b4Smrg (attrib_func) VertexAttrib3NusvNV, 5747117f1b4Smrg (attrib_func) VertexAttrib3NivNV, 5757117f1b4Smrg (attrib_func) VertexAttrib3NuivNV, 5767117f1b4Smrg (attrib_func) VertexAttrib3fvNV, 5777117f1b4Smrg (attrib_func) VertexAttrib3dvNV 5787117f1b4Smrg }, 5797117f1b4Smrg { 5807117f1b4Smrg /* size 4 */ 5817117f1b4Smrg (attrib_func) VertexAttrib4NbvNV, 5827117f1b4Smrg (attrib_func) VertexAttrib4NubvNV, 5837117f1b4Smrg (attrib_func) VertexAttrib4NsvNV, 5847117f1b4Smrg (attrib_func) VertexAttrib4NusvNV, 5857117f1b4Smrg (attrib_func) VertexAttrib4NivNV, 5867117f1b4Smrg (attrib_func) VertexAttrib4NuivNV, 5877117f1b4Smrg (attrib_func) VertexAttrib4fvNV, 5887117f1b4Smrg (attrib_func) VertexAttrib4dvNV 5897117f1b4Smrg } 5907117f1b4Smrg } 5917117f1b4Smrg}; 5927117f1b4Smrg 5937117f1b4Smrg 5947117f1b4Smrg/** 5957117f1b4Smrg ** GL_ARB_vertex_program 5967117f1b4Smrg **/ 5977117f1b4Smrg 5987117f1b4Smrg/* GL_BYTE attributes */ 5997117f1b4Smrg 6003464ebd5Sriastradhstatic void GLAPIENTRY 6013464ebd5SriastradhVertexAttrib1NbvARB(GLuint index, const GLbyte *v) 6027117f1b4Smrg{ 6037ec681f3Smrg CALL_VertexAttrib1fARB(get_dispatch(), (index, BYTE_TO_FLOAT(v[0]))); 6047117f1b4Smrg} 6057117f1b4Smrg 6063464ebd5Sriastradhstatic void GLAPIENTRY 6073464ebd5SriastradhVertexAttrib1bvARB(GLuint index, const GLbyte *v) 6087117f1b4Smrg{ 6097ec681f3Smrg CALL_VertexAttrib1fARB(get_dispatch(), (index, (GLfloat)v[0])); 6107117f1b4Smrg} 6117117f1b4Smrg 6123464ebd5Sriastradhstatic void GLAPIENTRY 6133464ebd5SriastradhVertexAttrib2NbvARB(GLuint index, const GLbyte *v) 6147117f1b4Smrg{ 6157ec681f3Smrg CALL_VertexAttrib2fARB(get_dispatch(), (index, BYTE_TO_FLOAT(v[0]), BYTE_TO_FLOAT(v[1]))); 6167117f1b4Smrg} 6177117f1b4Smrg 6183464ebd5Sriastradhstatic void GLAPIENTRY 6193464ebd5SriastradhVertexAttrib2bvARB(GLuint index, const GLbyte *v) 6207117f1b4Smrg{ 6217ec681f3Smrg CALL_VertexAttrib2fARB(get_dispatch(), (index, (GLfloat)v[0], (GLfloat)v[1])); 6227117f1b4Smrg} 6237117f1b4Smrg 6243464ebd5Sriastradhstatic void GLAPIENTRY 6253464ebd5SriastradhVertexAttrib3NbvARB(GLuint index, const GLbyte *v) 6267117f1b4Smrg{ 6277ec681f3Smrg CALL_VertexAttrib3fARB(get_dispatch(), (index, BYTE_TO_FLOAT(v[0]), 6287117f1b4Smrg BYTE_TO_FLOAT(v[1]), 6297117f1b4Smrg BYTE_TO_FLOAT(v[2]))); 6307117f1b4Smrg} 6317117f1b4Smrg 6323464ebd5Sriastradhstatic void GLAPIENTRY 6333464ebd5SriastradhVertexAttrib3bvARB(GLuint index, const GLbyte *v) 6347117f1b4Smrg{ 6357ec681f3Smrg CALL_VertexAttrib3fARB(get_dispatch(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2])); 6367117f1b4Smrg} 6377117f1b4Smrg 6383464ebd5Sriastradhstatic void GLAPIENTRY 6393464ebd5SriastradhVertexAttrib4NbvARB(GLuint index, const GLbyte *v) 6407117f1b4Smrg{ 6417ec681f3Smrg CALL_VertexAttrib4fARB(get_dispatch(), (index, BYTE_TO_FLOAT(v[0]), 6427117f1b4Smrg BYTE_TO_FLOAT(v[1]), 6437117f1b4Smrg BYTE_TO_FLOAT(v[2]), 6447117f1b4Smrg BYTE_TO_FLOAT(v[3]))); 6457117f1b4Smrg} 6467117f1b4Smrg 6473464ebd5Sriastradhstatic void GLAPIENTRY 6483464ebd5SriastradhVertexAttrib4bvARB(GLuint index, const GLbyte *v) 6497117f1b4Smrg{ 6507ec681f3Smrg CALL_VertexAttrib4fARB(get_dispatch(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2], (GLfloat)v[3])); 6517117f1b4Smrg} 6527117f1b4Smrg 6537117f1b4Smrg/* GL_UNSIGNED_BYTE attributes */ 6547117f1b4Smrg 6553464ebd5Sriastradhstatic void GLAPIENTRY 6563464ebd5SriastradhVertexAttrib1NubvARB(GLuint index, const GLubyte *v) 6577117f1b4Smrg{ 6587ec681f3Smrg CALL_VertexAttrib1fARB(get_dispatch(), (index, UBYTE_TO_FLOAT(v[0]))); 6597117f1b4Smrg} 6607117f1b4Smrg 6613464ebd5Sriastradhstatic void GLAPIENTRY 6623464ebd5SriastradhVertexAttrib1ubvARB(GLuint index, const GLubyte *v) 6637117f1b4Smrg{ 6647ec681f3Smrg CALL_VertexAttrib1fARB(get_dispatch(), (index, (GLfloat)v[0])); 6657117f1b4Smrg} 6667117f1b4Smrg 6673464ebd5Sriastradhstatic void GLAPIENTRY 6683464ebd5SriastradhVertexAttrib2NubvARB(GLuint index, const GLubyte *v) 6697117f1b4Smrg{ 6707ec681f3Smrg CALL_VertexAttrib2fARB(get_dispatch(), (index, 6713464ebd5Sriastradh UBYTE_TO_FLOAT(v[0]), 6723464ebd5Sriastradh UBYTE_TO_FLOAT(v[1]))); 6737117f1b4Smrg} 6747117f1b4Smrg 6753464ebd5Sriastradhstatic void GLAPIENTRY 6763464ebd5SriastradhVertexAttrib2ubvARB(GLuint index, const GLubyte *v) 6777117f1b4Smrg{ 6787ec681f3Smrg CALL_VertexAttrib2fARB(get_dispatch(), (index, 6793464ebd5Sriastradh (GLfloat)v[0], (GLfloat)v[1])); 6807117f1b4Smrg} 6817117f1b4Smrg 6823464ebd5Sriastradhstatic void GLAPIENTRY 6833464ebd5SriastradhVertexAttrib3NubvARB(GLuint index, const GLubyte *v) 6847117f1b4Smrg{ 6857ec681f3Smrg CALL_VertexAttrib3fARB(get_dispatch(), (index, 6863464ebd5Sriastradh UBYTE_TO_FLOAT(v[0]), 6873464ebd5Sriastradh UBYTE_TO_FLOAT(v[1]), 6883464ebd5Sriastradh UBYTE_TO_FLOAT(v[2]))); 6897117f1b4Smrg} 6903464ebd5Sriastradhstatic void GLAPIENTRY 6913464ebd5SriastradhVertexAttrib3ubvARB(GLuint index, const GLubyte *v) 6927117f1b4Smrg{ 6937ec681f3Smrg CALL_VertexAttrib3fARB(get_dispatch(), (index, 6943464ebd5Sriastradh (GLfloat)v[0], 6953464ebd5Sriastradh (GLfloat)v[1], 6963464ebd5Sriastradh (GLfloat)v[2])); 6977117f1b4Smrg} 6987117f1b4Smrg 6993464ebd5Sriastradhstatic void GLAPIENTRY 7003464ebd5SriastradhVertexAttrib4NubvARB(GLuint index, const GLubyte *v) 7017117f1b4Smrg{ 7027ec681f3Smrg CALL_VertexAttrib4fARB(get_dispatch(), 7033464ebd5Sriastradh (index, 7043464ebd5Sriastradh UBYTE_TO_FLOAT(v[0]), 7053464ebd5Sriastradh UBYTE_TO_FLOAT(v[1]), 7063464ebd5Sriastradh UBYTE_TO_FLOAT(v[2]), 7073464ebd5Sriastradh UBYTE_TO_FLOAT(v[3]))); 7087117f1b4Smrg} 7097117f1b4Smrg 7103464ebd5Sriastradhstatic void GLAPIENTRY 7113464ebd5SriastradhVertexAttrib4ubvARB(GLuint index, const GLubyte *v) 7127117f1b4Smrg{ 7137ec681f3Smrg CALL_VertexAttrib4fARB(get_dispatch(), 7143464ebd5Sriastradh (index, 7153464ebd5Sriastradh (GLfloat)v[0], (GLfloat)v[1], 7163464ebd5Sriastradh (GLfloat)v[2], (GLfloat)v[3])); 7177117f1b4Smrg} 7187117f1b4Smrg 7197117f1b4Smrg/* GL_SHORT attributes */ 7207117f1b4Smrg 7213464ebd5Sriastradhstatic void GLAPIENTRY 7223464ebd5SriastradhVertexAttrib1NsvARB(GLuint index, const GLshort *v) 7237117f1b4Smrg{ 7247ec681f3Smrg CALL_VertexAttrib1fARB(get_dispatch(), (index, SHORT_TO_FLOAT(v[0]))); 7257117f1b4Smrg} 7267117f1b4Smrg 7273464ebd5Sriastradhstatic void GLAPIENTRY 7283464ebd5SriastradhVertexAttrib1svARB(GLuint index, const GLshort *v) 7297117f1b4Smrg{ 7307ec681f3Smrg CALL_VertexAttrib1fARB(get_dispatch(), (index, (GLfloat)v[0])); 7317117f1b4Smrg} 7327117f1b4Smrg 7333464ebd5Sriastradhstatic void GLAPIENTRY 7343464ebd5SriastradhVertexAttrib2NsvARB(GLuint index, const GLshort *v) 7357117f1b4Smrg{ 7367ec681f3Smrg CALL_VertexAttrib2fARB(get_dispatch(), 7373464ebd5Sriastradh (index, SHORT_TO_FLOAT(v[0]), 7383464ebd5Sriastradh SHORT_TO_FLOAT(v[1]))); 7397117f1b4Smrg} 7407117f1b4Smrg 7413464ebd5Sriastradhstatic void GLAPIENTRY 7423464ebd5SriastradhVertexAttrib2svARB(GLuint index, const GLshort *v) 7437117f1b4Smrg{ 7447ec681f3Smrg CALL_VertexAttrib2fARB(get_dispatch(), 7453464ebd5Sriastradh (index, (GLfloat)v[0], (GLfloat)v[1])); 7467117f1b4Smrg} 7477117f1b4Smrg 7483464ebd5Sriastradhstatic void GLAPIENTRY 7493464ebd5SriastradhVertexAttrib3NsvARB(GLuint index, const GLshort *v) 7507117f1b4Smrg{ 7517ec681f3Smrg CALL_VertexAttrib3fARB(get_dispatch(), 7523464ebd5Sriastradh (index, 7533464ebd5Sriastradh SHORT_TO_FLOAT(v[0]), 7543464ebd5Sriastradh SHORT_TO_FLOAT(v[1]), 7553464ebd5Sriastradh SHORT_TO_FLOAT(v[2]))); 7567117f1b4Smrg} 7577117f1b4Smrg 7583464ebd5Sriastradhstatic void GLAPIENTRY 7593464ebd5SriastradhVertexAttrib3svARB(GLuint index, const GLshort *v) 7607117f1b4Smrg{ 7617ec681f3Smrg CALL_VertexAttrib3fARB(get_dispatch(), 7623464ebd5Sriastradh (index, 7633464ebd5Sriastradh (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2])); 7647117f1b4Smrg} 7657117f1b4Smrg 7663464ebd5Sriastradhstatic void GLAPIENTRY 7673464ebd5SriastradhVertexAttrib4NsvARB(GLuint index, const GLshort *v) 7687117f1b4Smrg{ 7697ec681f3Smrg CALL_VertexAttrib4fARB(get_dispatch(), 7703464ebd5Sriastradh (index, 7713464ebd5Sriastradh SHORT_TO_FLOAT(v[0]), 7723464ebd5Sriastradh SHORT_TO_FLOAT(v[1]), 7733464ebd5Sriastradh SHORT_TO_FLOAT(v[2]), 7743464ebd5Sriastradh SHORT_TO_FLOAT(v[3]))); 7757117f1b4Smrg} 7767117f1b4Smrg 7773464ebd5Sriastradhstatic void GLAPIENTRY 7783464ebd5SriastradhVertexAttrib4svARB(GLuint index, const GLshort *v) 7797117f1b4Smrg{ 7807ec681f3Smrg CALL_VertexAttrib4fARB(get_dispatch(), (index, (GLfloat)v[0], (GLfloat)v[1], 7813464ebd5Sriastradh (GLfloat)v[2], (GLfloat)v[3])); 7827117f1b4Smrg} 7837117f1b4Smrg 7847117f1b4Smrg/* GL_UNSIGNED_SHORT attributes */ 7857117f1b4Smrg 7863464ebd5Sriastradhstatic void GLAPIENTRY 7873464ebd5SriastradhVertexAttrib1NusvARB(GLuint index, const GLushort *v) 7887117f1b4Smrg{ 7897ec681f3Smrg CALL_VertexAttrib1fARB(get_dispatch(), (index, USHORT_TO_FLOAT(v[0]))); 7907117f1b4Smrg} 7917117f1b4Smrg 7923464ebd5Sriastradhstatic void GLAPIENTRY 7933464ebd5SriastradhVertexAttrib1usvARB(GLuint index, const GLushort *v) 7947117f1b4Smrg{ 7957ec681f3Smrg CALL_VertexAttrib1fARB(get_dispatch(), (index, (GLfloat)v[0])); 7967117f1b4Smrg} 7977117f1b4Smrg 7983464ebd5Sriastradhstatic void GLAPIENTRY 7993464ebd5SriastradhVertexAttrib2NusvARB(GLuint index, const GLushort *v) 8007117f1b4Smrg{ 8017ec681f3Smrg CALL_VertexAttrib2fARB(get_dispatch(), (index, USHORT_TO_FLOAT(v[0]), 8027117f1b4Smrg USHORT_TO_FLOAT(v[1]))); 8037117f1b4Smrg} 8047117f1b4Smrg 8053464ebd5Sriastradhstatic void GLAPIENTRY 8063464ebd5SriastradhVertexAttrib2usvARB(GLuint index, const GLushort *v) 8077117f1b4Smrg{ 8087ec681f3Smrg CALL_VertexAttrib2fARB(get_dispatch(), (index, (GLfloat)v[0], 8093464ebd5Sriastradh (GLfloat)v[1])); 8107117f1b4Smrg} 8117117f1b4Smrg 8123464ebd5Sriastradhstatic void GLAPIENTRY 8133464ebd5SriastradhVertexAttrib3NusvARB(GLuint index, const GLushort *v) 8147117f1b4Smrg{ 8157ec681f3Smrg CALL_VertexAttrib3fARB(get_dispatch(), (index, USHORT_TO_FLOAT(v[0]), 8167117f1b4Smrg USHORT_TO_FLOAT(v[1]), 8177117f1b4Smrg USHORT_TO_FLOAT(v[2]))); 8187117f1b4Smrg} 8197117f1b4Smrg 8203464ebd5Sriastradhstatic void GLAPIENTRY 8213464ebd5SriastradhVertexAttrib3usvARB(GLuint index, const GLushort *v) 8227117f1b4Smrg{ 8237ec681f3Smrg CALL_VertexAttrib3fARB(get_dispatch(), (index, (GLfloat)v[0], 8243464ebd5Sriastradh (GLfloat)v[1], (GLfloat)v[2])); 8257117f1b4Smrg} 8267117f1b4Smrg 8273464ebd5Sriastradhstatic void GLAPIENTRY 8283464ebd5SriastradhVertexAttrib4NusvARB(GLuint index, const GLushort *v) 8297117f1b4Smrg{ 8307ec681f3Smrg CALL_VertexAttrib4fARB(get_dispatch(), (index, USHORT_TO_FLOAT(v[0]), 8317117f1b4Smrg USHORT_TO_FLOAT(v[1]), 8327117f1b4Smrg USHORT_TO_FLOAT(v[2]), 8337117f1b4Smrg USHORT_TO_FLOAT(v[3]))); 8347117f1b4Smrg} 8357117f1b4Smrg 8363464ebd5Sriastradhstatic void GLAPIENTRY 8373464ebd5SriastradhVertexAttrib4usvARB(GLuint index, const GLushort *v) 8387117f1b4Smrg{ 8397ec681f3Smrg CALL_VertexAttrib4fARB(get_dispatch(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2], (GLfloat)v[3])); 8407117f1b4Smrg} 8417117f1b4Smrg 8427117f1b4Smrg/* GL_INT attributes */ 8437117f1b4Smrg 8443464ebd5Sriastradhstatic void GLAPIENTRY 8453464ebd5SriastradhVertexAttrib1NivARB(GLuint index, const GLint *v) 8467117f1b4Smrg{ 8477ec681f3Smrg CALL_VertexAttrib1fARB(get_dispatch(), (index, INT_TO_FLOAT(v[0]))); 8487117f1b4Smrg} 8497117f1b4Smrg 8503464ebd5Sriastradhstatic void GLAPIENTRY 8513464ebd5SriastradhVertexAttrib1ivARB(GLuint index, const GLint *v) 8527117f1b4Smrg{ 8537ec681f3Smrg CALL_VertexAttrib1fARB(get_dispatch(), (index, (GLfloat)v[0])); 8547117f1b4Smrg} 8557117f1b4Smrg 8563464ebd5Sriastradhstatic void GLAPIENTRY 8573464ebd5SriastradhVertexAttrib2NivARB(GLuint index, const GLint *v) 8587117f1b4Smrg{ 8597ec681f3Smrg CALL_VertexAttrib2fARB(get_dispatch(), (index, INT_TO_FLOAT(v[0]), 8607117f1b4Smrg INT_TO_FLOAT(v[1]))); 8617117f1b4Smrg} 8627117f1b4Smrg 8633464ebd5Sriastradhstatic void GLAPIENTRY 8643464ebd5SriastradhVertexAttrib2ivARB(GLuint index, const GLint *v) 8657117f1b4Smrg{ 8667ec681f3Smrg CALL_VertexAttrib2fARB(get_dispatch(), (index, (GLfloat)v[0], 8673464ebd5Sriastradh (GLfloat)v[1])); 8687117f1b4Smrg} 8697117f1b4Smrg 8703464ebd5Sriastradhstatic void GLAPIENTRY 8713464ebd5SriastradhVertexAttrib3NivARB(GLuint index, const GLint *v) 8727117f1b4Smrg{ 8737ec681f3Smrg CALL_VertexAttrib3fARB(get_dispatch(), (index, INT_TO_FLOAT(v[0]), 8747117f1b4Smrg INT_TO_FLOAT(v[1]), 8757117f1b4Smrg INT_TO_FLOAT(v[2]))); 8767117f1b4Smrg} 8777117f1b4Smrg 8783464ebd5Sriastradhstatic void GLAPIENTRY 8793464ebd5SriastradhVertexAttrib3ivARB(GLuint index, const GLint *v) 8807117f1b4Smrg{ 8817ec681f3Smrg CALL_VertexAttrib3fARB(get_dispatch(), (index, (GLfloat)v[0], 8823464ebd5Sriastradh (GLfloat)v[1], (GLfloat)v[2])); 8837117f1b4Smrg} 8847117f1b4Smrg 8853464ebd5Sriastradhstatic void GLAPIENTRY 8863464ebd5SriastradhVertexAttrib4NivARB(GLuint index, const GLint *v) 8877117f1b4Smrg{ 8887ec681f3Smrg CALL_VertexAttrib4fARB(get_dispatch(), (index, INT_TO_FLOAT(v[0]), 8897117f1b4Smrg INT_TO_FLOAT(v[1]), 8907117f1b4Smrg INT_TO_FLOAT(v[2]), 8917117f1b4Smrg INT_TO_FLOAT(v[3]))); 8927117f1b4Smrg} 8937117f1b4Smrg 8943464ebd5Sriastradhstatic void GLAPIENTRY 8953464ebd5SriastradhVertexAttrib4ivARB(GLuint index, const GLint *v) 8967117f1b4Smrg{ 8977ec681f3Smrg CALL_VertexAttrib4fARB(get_dispatch(), (index, (GLfloat)v[0], (GLfloat)v[1], 8983464ebd5Sriastradh (GLfloat)v[2], (GLfloat)v[3])); 8997117f1b4Smrg} 9007117f1b4Smrg 9017117f1b4Smrg/* GL_UNSIGNED_INT attributes */ 9027117f1b4Smrg 9033464ebd5Sriastradhstatic void GLAPIENTRY 9043464ebd5SriastradhVertexAttrib1NuivARB(GLuint index, const GLuint *v) 9057117f1b4Smrg{ 9067ec681f3Smrg CALL_VertexAttrib1fARB(get_dispatch(), (index, UINT_TO_FLOAT(v[0]))); 9077117f1b4Smrg} 9087117f1b4Smrg 9093464ebd5Sriastradhstatic void GLAPIENTRY 9103464ebd5SriastradhVertexAttrib1uivARB(GLuint index, const GLuint *v) 9117117f1b4Smrg{ 9127ec681f3Smrg CALL_VertexAttrib1fARB(get_dispatch(), (index, (GLfloat)v[0])); 9137117f1b4Smrg} 9147117f1b4Smrg 9153464ebd5Sriastradhstatic void GLAPIENTRY 9163464ebd5SriastradhVertexAttrib2NuivARB(GLuint index, const GLuint *v) 9177117f1b4Smrg{ 9187ec681f3Smrg CALL_VertexAttrib2fARB(get_dispatch(), (index, UINT_TO_FLOAT(v[0]), 9193464ebd5Sriastradh UINT_TO_FLOAT(v[1]))); 9207117f1b4Smrg} 9217117f1b4Smrg 9223464ebd5Sriastradhstatic void GLAPIENTRY 9233464ebd5SriastradhVertexAttrib2uivARB(GLuint index, const GLuint *v) 9247117f1b4Smrg{ 9257ec681f3Smrg CALL_VertexAttrib2fARB(get_dispatch(), (index, (GLfloat)v[0], 9263464ebd5Sriastradh (GLfloat)v[1])); 9277117f1b4Smrg} 9287117f1b4Smrg 9293464ebd5Sriastradhstatic void GLAPIENTRY 9303464ebd5SriastradhVertexAttrib3NuivARB(GLuint index, const GLuint *v) 9317117f1b4Smrg{ 9327ec681f3Smrg CALL_VertexAttrib3fARB(get_dispatch(), (index, UINT_TO_FLOAT(v[0]), 9333464ebd5Sriastradh UINT_TO_FLOAT(v[1]), 9343464ebd5Sriastradh UINT_TO_FLOAT(v[2]))); 9357117f1b4Smrg} 9367117f1b4Smrg 9373464ebd5Sriastradhstatic void GLAPIENTRY 9383464ebd5SriastradhVertexAttrib3uivARB(GLuint index, const GLuint *v) 9397117f1b4Smrg{ 9407ec681f3Smrg CALL_VertexAttrib3fARB(get_dispatch(), (index, (GLfloat)v[0], 9413464ebd5Sriastradh (GLfloat)v[1], (GLfloat)v[2])); 9427117f1b4Smrg} 9437117f1b4Smrg 9443464ebd5Sriastradhstatic void GLAPIENTRY 9453464ebd5SriastradhVertexAttrib4NuivARB(GLuint index, const GLuint *v) 9467117f1b4Smrg{ 9477ec681f3Smrg CALL_VertexAttrib4fARB(get_dispatch(), (index, UINT_TO_FLOAT(v[0]), 9483464ebd5Sriastradh UINT_TO_FLOAT(v[1]), 9493464ebd5Sriastradh UINT_TO_FLOAT(v[2]), 9503464ebd5Sriastradh UINT_TO_FLOAT(v[3]))); 9517117f1b4Smrg} 9527117f1b4Smrg 9533464ebd5Sriastradhstatic void GLAPIENTRY 9543464ebd5SriastradhVertexAttrib4uivARB(GLuint index, const GLuint *v) 9557117f1b4Smrg{ 9567ec681f3Smrg CALL_VertexAttrib4fARB(get_dispatch(), (index, (GLfloat)v[0], (GLfloat)v[1], 9573464ebd5Sriastradh (GLfloat)v[2], (GLfloat)v[3])); 9587117f1b4Smrg} 9597117f1b4Smrg 9607117f1b4Smrg/* GL_FLOAT attributes */ 9617117f1b4Smrg 9623464ebd5Sriastradhstatic void GLAPIENTRY 9633464ebd5SriastradhVertexAttrib1fvARB(GLuint index, const GLfloat *v) 9647117f1b4Smrg{ 9657ec681f3Smrg CALL_VertexAttrib1fvARB(get_dispatch(), (index, v)); 9667117f1b4Smrg} 9677117f1b4Smrg 9683464ebd5Sriastradhstatic void GLAPIENTRY 9693464ebd5SriastradhVertexAttrib2fvARB(GLuint index, const GLfloat *v) 9707117f1b4Smrg{ 9717ec681f3Smrg CALL_VertexAttrib2fvARB(get_dispatch(), (index, v)); 9727117f1b4Smrg} 9737117f1b4Smrg 9743464ebd5Sriastradhstatic void GLAPIENTRY 9753464ebd5SriastradhVertexAttrib3fvARB(GLuint index, const GLfloat *v) 9767117f1b4Smrg{ 9777ec681f3Smrg CALL_VertexAttrib3fvARB(get_dispatch(), (index, v)); 9787117f1b4Smrg} 9797117f1b4Smrg 9803464ebd5Sriastradhstatic void GLAPIENTRY 9813464ebd5SriastradhVertexAttrib4fvARB(GLuint index, const GLfloat *v) 9827117f1b4Smrg{ 9837ec681f3Smrg CALL_VertexAttrib4fvARB(get_dispatch(), (index, v)); 9847117f1b4Smrg} 9857117f1b4Smrg 9867117f1b4Smrg/* GL_DOUBLE attributes */ 9877117f1b4Smrg 9883464ebd5Sriastradhstatic void GLAPIENTRY 9893464ebd5SriastradhVertexAttrib1dvARB(GLuint index, const GLdouble *v) 9907117f1b4Smrg{ 9917ec681f3Smrg CALL_VertexAttrib1dv(get_dispatch(), (index, v)); 9927117f1b4Smrg} 9937117f1b4Smrg 9943464ebd5Sriastradhstatic void GLAPIENTRY 9953464ebd5SriastradhVertexAttrib2dvARB(GLuint index, const GLdouble *v) 9967117f1b4Smrg{ 9977ec681f3Smrg CALL_VertexAttrib2dv(get_dispatch(), (index, v)); 9987117f1b4Smrg} 9997117f1b4Smrg 10003464ebd5Sriastradhstatic void GLAPIENTRY 10013464ebd5SriastradhVertexAttrib3dvARB(GLuint index, const GLdouble *v) 10027117f1b4Smrg{ 10037ec681f3Smrg CALL_VertexAttrib3dv(get_dispatch(), (index, v)); 10047117f1b4Smrg} 10057117f1b4Smrg 10063464ebd5Sriastradhstatic void GLAPIENTRY 10073464ebd5SriastradhVertexAttrib4dvARB(GLuint index, const GLdouble *v) 10087117f1b4Smrg{ 10097ec681f3Smrg CALL_VertexAttrib4dv(get_dispatch(), (index, v)); 10107117f1b4Smrg} 10117117f1b4Smrg 10127117f1b4Smrg 10133464ebd5Sriastradh/** 10143464ebd5Sriastradh * Integer-valued attributes 10153464ebd5Sriastradh */ 10163464ebd5Sriastradhstatic void GLAPIENTRY 10173464ebd5SriastradhVertexAttribI1bv(GLuint index, const GLbyte *v) 10183464ebd5Sriastradh{ 10197ec681f3Smrg CALL_VertexAttribI1iEXT(get_dispatch(), (index, v[0])); 10203464ebd5Sriastradh} 10213464ebd5Sriastradh 10223464ebd5Sriastradhstatic void GLAPIENTRY 10233464ebd5SriastradhVertexAttribI2bv(GLuint index, const GLbyte *v) 10243464ebd5Sriastradh{ 10257ec681f3Smrg CALL_VertexAttribI2iEXT(get_dispatch(), (index, v[0], v[1])); 10263464ebd5Sriastradh} 10273464ebd5Sriastradh 10283464ebd5Sriastradhstatic void GLAPIENTRY 10293464ebd5SriastradhVertexAttribI3bv(GLuint index, const GLbyte *v) 10303464ebd5Sriastradh{ 10317ec681f3Smrg CALL_VertexAttribI3iEXT(get_dispatch(), (index, v[0], v[1], v[2])); 10323464ebd5Sriastradh} 10333464ebd5Sriastradh 10343464ebd5Sriastradhstatic void GLAPIENTRY 10353464ebd5SriastradhVertexAttribI4bv(GLuint index, const GLbyte *v) 10363464ebd5Sriastradh{ 10377ec681f3Smrg CALL_VertexAttribI4bv(get_dispatch(), (index, v)); 10383464ebd5Sriastradh} 10393464ebd5Sriastradh 10403464ebd5Sriastradh 10413464ebd5Sriastradhstatic void GLAPIENTRY 10423464ebd5SriastradhVertexAttribI1ubv(GLuint index, const GLubyte *v) 10433464ebd5Sriastradh{ 10447ec681f3Smrg CALL_VertexAttribI1uiEXT(get_dispatch(), (index, v[0])); 10453464ebd5Sriastradh} 10463464ebd5Sriastradh 10473464ebd5Sriastradhstatic void GLAPIENTRY 10483464ebd5SriastradhVertexAttribI2ubv(GLuint index, const GLubyte *v) 10493464ebd5Sriastradh{ 10507ec681f3Smrg CALL_VertexAttribI2uiEXT(get_dispatch(), (index, v[0], v[1])); 10513464ebd5Sriastradh} 10523464ebd5Sriastradh 10533464ebd5Sriastradhstatic void GLAPIENTRY 10543464ebd5SriastradhVertexAttribI3ubv(GLuint index, const GLubyte *v) 10553464ebd5Sriastradh{ 10567ec681f3Smrg CALL_VertexAttribI3uiEXT(get_dispatch(), (index, v[0], v[1], v[2])); 10573464ebd5Sriastradh} 10583464ebd5Sriastradh 10593464ebd5Sriastradhstatic void GLAPIENTRY 10603464ebd5SriastradhVertexAttribI4ubv(GLuint index, const GLubyte *v) 10613464ebd5Sriastradh{ 10627ec681f3Smrg CALL_VertexAttribI4ubv(get_dispatch(), (index, v)); 10633464ebd5Sriastradh} 10643464ebd5Sriastradh 10653464ebd5Sriastradh 10663464ebd5Sriastradh 10673464ebd5Sriastradhstatic void GLAPIENTRY 10683464ebd5SriastradhVertexAttribI1sv(GLuint index, const GLshort *v) 10693464ebd5Sriastradh{ 10707ec681f3Smrg CALL_VertexAttribI1iEXT(get_dispatch(), (index, v[0])); 10713464ebd5Sriastradh} 10723464ebd5Sriastradh 10733464ebd5Sriastradhstatic void GLAPIENTRY 10743464ebd5SriastradhVertexAttribI2sv(GLuint index, const GLshort *v) 10753464ebd5Sriastradh{ 10767ec681f3Smrg CALL_VertexAttribI2iEXT(get_dispatch(), (index, v[0], v[1])); 10773464ebd5Sriastradh} 10783464ebd5Sriastradh 10793464ebd5Sriastradhstatic void GLAPIENTRY 10803464ebd5SriastradhVertexAttribI3sv(GLuint index, const GLshort *v) 10813464ebd5Sriastradh{ 10827ec681f3Smrg CALL_VertexAttribI3iEXT(get_dispatch(), (index, v[0], v[1], v[2])); 10833464ebd5Sriastradh} 10843464ebd5Sriastradh 10853464ebd5Sriastradhstatic void GLAPIENTRY 10863464ebd5SriastradhVertexAttribI4sv(GLuint index, const GLshort *v) 10873464ebd5Sriastradh{ 10887ec681f3Smrg CALL_VertexAttribI4sv(get_dispatch(), (index, v)); 10893464ebd5Sriastradh} 10903464ebd5Sriastradh 10913464ebd5Sriastradh 10923464ebd5Sriastradhstatic void GLAPIENTRY 10933464ebd5SriastradhVertexAttribI1usv(GLuint index, const GLushort *v) 10943464ebd5Sriastradh{ 10957ec681f3Smrg CALL_VertexAttribI1uiEXT(get_dispatch(), (index, v[0])); 10963464ebd5Sriastradh} 10973464ebd5Sriastradh 10983464ebd5Sriastradhstatic void GLAPIENTRY 10993464ebd5SriastradhVertexAttribI2usv(GLuint index, const GLushort *v) 11003464ebd5Sriastradh{ 11017ec681f3Smrg CALL_VertexAttribI2uiEXT(get_dispatch(), (index, v[0], v[1])); 11023464ebd5Sriastradh} 11033464ebd5Sriastradh 11043464ebd5Sriastradhstatic void GLAPIENTRY 11053464ebd5SriastradhVertexAttribI3usv(GLuint index, const GLushort *v) 11063464ebd5Sriastradh{ 11077ec681f3Smrg CALL_VertexAttribI3uiEXT(get_dispatch(), (index, v[0], v[1], v[2])); 11083464ebd5Sriastradh} 11093464ebd5Sriastradh 11103464ebd5Sriastradhstatic void GLAPIENTRY 11113464ebd5SriastradhVertexAttribI4usv(GLuint index, const GLushort *v) 11123464ebd5Sriastradh{ 11137ec681f3Smrg CALL_VertexAttribI4usv(get_dispatch(), (index, v)); 11143464ebd5Sriastradh} 11153464ebd5Sriastradh 11163464ebd5Sriastradh 11173464ebd5Sriastradh 11183464ebd5Sriastradhstatic void GLAPIENTRY 11193464ebd5SriastradhVertexAttribI1iv(GLuint index, const GLint *v) 11203464ebd5Sriastradh{ 11217ec681f3Smrg CALL_VertexAttribI1iEXT(get_dispatch(), (index, v[0])); 11223464ebd5Sriastradh} 11233464ebd5Sriastradh 11243464ebd5Sriastradhstatic void GLAPIENTRY 11253464ebd5SriastradhVertexAttribI2iv(GLuint index, const GLint *v) 11263464ebd5Sriastradh{ 11277ec681f3Smrg CALL_VertexAttribI2iEXT(get_dispatch(), (index, v[0], v[1])); 11283464ebd5Sriastradh} 11293464ebd5Sriastradh 11303464ebd5Sriastradhstatic void GLAPIENTRY 11313464ebd5SriastradhVertexAttribI3iv(GLuint index, const GLint *v) 11323464ebd5Sriastradh{ 11337ec681f3Smrg CALL_VertexAttribI3iEXT(get_dispatch(), (index, v[0], v[1], v[2])); 11343464ebd5Sriastradh} 11353464ebd5Sriastradh 11363464ebd5Sriastradhstatic void GLAPIENTRY 11373464ebd5SriastradhVertexAttribI4iv(GLuint index, const GLint *v) 11383464ebd5Sriastradh{ 11397ec681f3Smrg CALL_VertexAttribI4ivEXT(get_dispatch(), (index, v)); 11403464ebd5Sriastradh} 11413464ebd5Sriastradh 11423464ebd5Sriastradh 11433464ebd5Sriastradhstatic void GLAPIENTRY 11443464ebd5SriastradhVertexAttribI1uiv(GLuint index, const GLuint *v) 11453464ebd5Sriastradh{ 11467ec681f3Smrg CALL_VertexAttribI1uiEXT(get_dispatch(), (index, v[0])); 11473464ebd5Sriastradh} 11483464ebd5Sriastradh 11493464ebd5Sriastradhstatic void GLAPIENTRY 11503464ebd5SriastradhVertexAttribI2uiv(GLuint index, const GLuint *v) 11513464ebd5Sriastradh{ 11527ec681f3Smrg CALL_VertexAttribI2uiEXT(get_dispatch(), (index, v[0], v[1])); 11533464ebd5Sriastradh} 11543464ebd5Sriastradh 11553464ebd5Sriastradhstatic void GLAPIENTRY 11563464ebd5SriastradhVertexAttribI3uiv(GLuint index, const GLuint *v) 11573464ebd5Sriastradh{ 11587ec681f3Smrg CALL_VertexAttribI3uiEXT(get_dispatch(), (index, v[0], v[1], v[2])); 11593464ebd5Sriastradh} 11603464ebd5Sriastradh 11613464ebd5Sriastradhstatic void GLAPIENTRY 11623464ebd5SriastradhVertexAttribI4uiv(GLuint index, const GLuint *v) 11633464ebd5Sriastradh{ 11647ec681f3Smrg CALL_VertexAttribI4uivEXT(get_dispatch(), (index, v)); 11653464ebd5Sriastradh} 11663464ebd5Sriastradh 116701e04c3fSmrg/* GL_DOUBLE unconverted attributes */ 116801e04c3fSmrg 116901e04c3fSmrgstatic void GLAPIENTRY 117001e04c3fSmrgVertexAttribL1dv(GLuint index, const GLdouble *v) 117101e04c3fSmrg{ 11727ec681f3Smrg CALL_VertexAttribL1dv(get_dispatch(), (index, v)); 117301e04c3fSmrg} 117401e04c3fSmrg 117501e04c3fSmrgstatic void GLAPIENTRY 117601e04c3fSmrgVertexAttribL2dv(GLuint index, const GLdouble *v) 117701e04c3fSmrg{ 11787ec681f3Smrg CALL_VertexAttribL2dv(get_dispatch(), (index, v)); 117901e04c3fSmrg} 118001e04c3fSmrg 118101e04c3fSmrgstatic void GLAPIENTRY 118201e04c3fSmrgVertexAttribL3dv(GLuint index, const GLdouble *v) 118301e04c3fSmrg{ 11847ec681f3Smrg CALL_VertexAttribL3dv(get_dispatch(), (index, v)); 118501e04c3fSmrg} 118601e04c3fSmrg 118701e04c3fSmrgstatic void GLAPIENTRY 118801e04c3fSmrgVertexAttribL4dv(GLuint index, const GLdouble *v) 118901e04c3fSmrg{ 11907ec681f3Smrg CALL_VertexAttribL4dv(get_dispatch(), (index, v)); 119101e04c3fSmrg} 11923464ebd5Sriastradh 11937117f1b4Smrg/* 11943464ebd5Sriastradh * Array [unnormalized/normalized/integer][size][type] of VertexAttrib 11953464ebd5Sriastradh * functions 11967117f1b4Smrg */ 119701e04c3fSmrgstatic const attrib_func AttribFuncsARB[4][4][NUM_TYPES] = { 11987117f1b4Smrg { 11997117f1b4Smrg /* non-normalized */ 12007117f1b4Smrg { 12017117f1b4Smrg /* size 1 */ 12027117f1b4Smrg (attrib_func) VertexAttrib1bvARB, 12037117f1b4Smrg (attrib_func) VertexAttrib1ubvARB, 12047117f1b4Smrg (attrib_func) VertexAttrib1svARB, 12057117f1b4Smrg (attrib_func) VertexAttrib1usvARB, 12067117f1b4Smrg (attrib_func) VertexAttrib1ivARB, 12077117f1b4Smrg (attrib_func) VertexAttrib1uivARB, 12087117f1b4Smrg (attrib_func) VertexAttrib1fvARB, 12097117f1b4Smrg (attrib_func) VertexAttrib1dvARB 12107117f1b4Smrg }, 12117117f1b4Smrg { 12127117f1b4Smrg /* size 2 */ 12137117f1b4Smrg (attrib_func) VertexAttrib2bvARB, 12147117f1b4Smrg (attrib_func) VertexAttrib2ubvARB, 12157117f1b4Smrg (attrib_func) VertexAttrib2svARB, 12167117f1b4Smrg (attrib_func) VertexAttrib2usvARB, 12177117f1b4Smrg (attrib_func) VertexAttrib2ivARB, 12187117f1b4Smrg (attrib_func) VertexAttrib2uivARB, 12197117f1b4Smrg (attrib_func) VertexAttrib2fvARB, 12207117f1b4Smrg (attrib_func) VertexAttrib2dvARB 12217117f1b4Smrg }, 12227117f1b4Smrg { 12237117f1b4Smrg /* size 3 */ 12247117f1b4Smrg (attrib_func) VertexAttrib3bvARB, 12257117f1b4Smrg (attrib_func) VertexAttrib3ubvARB, 12267117f1b4Smrg (attrib_func) VertexAttrib3svARB, 12277117f1b4Smrg (attrib_func) VertexAttrib3usvARB, 12287117f1b4Smrg (attrib_func) VertexAttrib3ivARB, 12297117f1b4Smrg (attrib_func) VertexAttrib3uivARB, 12307117f1b4Smrg (attrib_func) VertexAttrib3fvARB, 12317117f1b4Smrg (attrib_func) VertexAttrib3dvARB 12327117f1b4Smrg }, 12337117f1b4Smrg { 12347117f1b4Smrg /* size 4 */ 12357117f1b4Smrg (attrib_func) VertexAttrib4bvARB, 12367117f1b4Smrg (attrib_func) VertexAttrib4ubvARB, 12377117f1b4Smrg (attrib_func) VertexAttrib4svARB, 12387117f1b4Smrg (attrib_func) VertexAttrib4usvARB, 12397117f1b4Smrg (attrib_func) VertexAttrib4ivARB, 12407117f1b4Smrg (attrib_func) VertexAttrib4uivARB, 12417117f1b4Smrg (attrib_func) VertexAttrib4fvARB, 12427117f1b4Smrg (attrib_func) VertexAttrib4dvARB 12437117f1b4Smrg } 12447117f1b4Smrg }, 12457117f1b4Smrg { 12467117f1b4Smrg /* normalized (except for float/double) */ 12477117f1b4Smrg { 12487117f1b4Smrg /* size 1 */ 12497117f1b4Smrg (attrib_func) VertexAttrib1NbvARB, 12507117f1b4Smrg (attrib_func) VertexAttrib1NubvARB, 12517117f1b4Smrg (attrib_func) VertexAttrib1NsvARB, 12527117f1b4Smrg (attrib_func) VertexAttrib1NusvARB, 12537117f1b4Smrg (attrib_func) VertexAttrib1NivARB, 12547117f1b4Smrg (attrib_func) VertexAttrib1NuivARB, 12557117f1b4Smrg (attrib_func) VertexAttrib1fvARB, 12567117f1b4Smrg (attrib_func) VertexAttrib1dvARB 12577117f1b4Smrg }, 12587117f1b4Smrg { 12597117f1b4Smrg /* size 2 */ 12607117f1b4Smrg (attrib_func) VertexAttrib2NbvARB, 12617117f1b4Smrg (attrib_func) VertexAttrib2NubvARB, 12627117f1b4Smrg (attrib_func) VertexAttrib2NsvARB, 12637117f1b4Smrg (attrib_func) VertexAttrib2NusvARB, 12647117f1b4Smrg (attrib_func) VertexAttrib2NivARB, 12657117f1b4Smrg (attrib_func) VertexAttrib2NuivARB, 12667117f1b4Smrg (attrib_func) VertexAttrib2fvARB, 12677117f1b4Smrg (attrib_func) VertexAttrib2dvARB 12687117f1b4Smrg }, 12697117f1b4Smrg { 12707117f1b4Smrg /* size 3 */ 12717117f1b4Smrg (attrib_func) VertexAttrib3NbvARB, 12727117f1b4Smrg (attrib_func) VertexAttrib3NubvARB, 12737117f1b4Smrg (attrib_func) VertexAttrib3NsvARB, 12747117f1b4Smrg (attrib_func) VertexAttrib3NusvARB, 12757117f1b4Smrg (attrib_func) VertexAttrib3NivARB, 12767117f1b4Smrg (attrib_func) VertexAttrib3NuivARB, 12777117f1b4Smrg (attrib_func) VertexAttrib3fvARB, 12787117f1b4Smrg (attrib_func) VertexAttrib3dvARB 12797117f1b4Smrg }, 12807117f1b4Smrg { 12817117f1b4Smrg /* size 4 */ 12827117f1b4Smrg (attrib_func) VertexAttrib4NbvARB, 12837117f1b4Smrg (attrib_func) VertexAttrib4NubvARB, 12847117f1b4Smrg (attrib_func) VertexAttrib4NsvARB, 12857117f1b4Smrg (attrib_func) VertexAttrib4NusvARB, 12867117f1b4Smrg (attrib_func) VertexAttrib4NivARB, 12877117f1b4Smrg (attrib_func) VertexAttrib4NuivARB, 12887117f1b4Smrg (attrib_func) VertexAttrib4fvARB, 12897117f1b4Smrg (attrib_func) VertexAttrib4dvARB 12907117f1b4Smrg } 12913464ebd5Sriastradh }, 12923464ebd5Sriastradh 12933464ebd5Sriastradh { 12943464ebd5Sriastradh /* integer-valued */ 12953464ebd5Sriastradh { 12963464ebd5Sriastradh /* size 1 */ 12973464ebd5Sriastradh (attrib_func) VertexAttribI1bv, 12983464ebd5Sriastradh (attrib_func) VertexAttribI1ubv, 12993464ebd5Sriastradh (attrib_func) VertexAttribI1sv, 13003464ebd5Sriastradh (attrib_func) VertexAttribI1usv, 13013464ebd5Sriastradh (attrib_func) VertexAttribI1iv, 13023464ebd5Sriastradh (attrib_func) VertexAttribI1uiv, 13033464ebd5Sriastradh NULL, /* GL_FLOAT */ 13043464ebd5Sriastradh NULL /* GL_DOUBLE */ 13053464ebd5Sriastradh }, 13063464ebd5Sriastradh { 13073464ebd5Sriastradh /* size 2 */ 13083464ebd5Sriastradh (attrib_func) VertexAttribI2bv, 13093464ebd5Sriastradh (attrib_func) VertexAttribI2ubv, 13103464ebd5Sriastradh (attrib_func) VertexAttribI2sv, 13113464ebd5Sriastradh (attrib_func) VertexAttribI2usv, 13123464ebd5Sriastradh (attrib_func) VertexAttribI2iv, 13133464ebd5Sriastradh (attrib_func) VertexAttribI2uiv, 13143464ebd5Sriastradh NULL, /* GL_FLOAT */ 13153464ebd5Sriastradh NULL /* GL_DOUBLE */ 13163464ebd5Sriastradh }, 13173464ebd5Sriastradh { 13183464ebd5Sriastradh /* size 3 */ 13193464ebd5Sriastradh (attrib_func) VertexAttribI3bv, 13203464ebd5Sriastradh (attrib_func) VertexAttribI3ubv, 13213464ebd5Sriastradh (attrib_func) VertexAttribI3sv, 13223464ebd5Sriastradh (attrib_func) VertexAttribI3usv, 13233464ebd5Sriastradh (attrib_func) VertexAttribI3iv, 13243464ebd5Sriastradh (attrib_func) VertexAttribI3uiv, 13253464ebd5Sriastradh NULL, /* GL_FLOAT */ 13263464ebd5Sriastradh NULL /* GL_DOUBLE */ 13273464ebd5Sriastradh }, 13283464ebd5Sriastradh { 13293464ebd5Sriastradh /* size 4 */ 13303464ebd5Sriastradh (attrib_func) VertexAttribI4bv, 13313464ebd5Sriastradh (attrib_func) VertexAttribI4ubv, 13323464ebd5Sriastradh (attrib_func) VertexAttribI4sv, 13333464ebd5Sriastradh (attrib_func) VertexAttribI4usv, 13343464ebd5Sriastradh (attrib_func) VertexAttribI4iv, 13353464ebd5Sriastradh (attrib_func) VertexAttribI4uiv, 13363464ebd5Sriastradh NULL, /* GL_FLOAT */ 13373464ebd5Sriastradh NULL /* GL_DOUBLE */ 13383464ebd5Sriastradh } 133901e04c3fSmrg }, 134001e04c3fSmrg { 134101e04c3fSmrg /* double-valued */ 134201e04c3fSmrg { 134301e04c3fSmrg /* size 1 */ 134401e04c3fSmrg NULL, 134501e04c3fSmrg NULL, 134601e04c3fSmrg NULL, 134701e04c3fSmrg NULL, 134801e04c3fSmrg NULL, 134901e04c3fSmrg NULL, 135001e04c3fSmrg NULL, 135101e04c3fSmrg (attrib_func) VertexAttribL1dv, 135201e04c3fSmrg }, 135301e04c3fSmrg { 135401e04c3fSmrg /* size 2 */ 135501e04c3fSmrg NULL, 135601e04c3fSmrg NULL, 135701e04c3fSmrg NULL, 135801e04c3fSmrg NULL, 135901e04c3fSmrg NULL, 136001e04c3fSmrg NULL, 136101e04c3fSmrg NULL, 136201e04c3fSmrg (attrib_func) VertexAttribL2dv, 136301e04c3fSmrg }, 136401e04c3fSmrg { 136501e04c3fSmrg /* size 3 */ 136601e04c3fSmrg NULL, 136701e04c3fSmrg NULL, 136801e04c3fSmrg NULL, 136901e04c3fSmrg NULL, 137001e04c3fSmrg NULL, 137101e04c3fSmrg NULL, 137201e04c3fSmrg NULL, 137301e04c3fSmrg (attrib_func) VertexAttribL3dv, 137401e04c3fSmrg }, 137501e04c3fSmrg { 137601e04c3fSmrg /* size 4 */ 137701e04c3fSmrg NULL, 137801e04c3fSmrg NULL, 137901e04c3fSmrg NULL, 138001e04c3fSmrg NULL, 138101e04c3fSmrg NULL, 138201e04c3fSmrg NULL, 138301e04c3fSmrg NULL, 138401e04c3fSmrg (attrib_func) VertexAttribL4dv, 138501e04c3fSmrg } 13867117f1b4Smrg } 138701e04c3fSmrg 13887117f1b4Smrg}; 13897117f1b4Smrg 13907117f1b4Smrg 1391a8bb7a65Smaya/* 1392a8bb7a65Smaya * Return VertexAttrib*NV function pointer matching the provided vertex format. 1393af69d88dSmrg */ 1394a8bb7a65Smayastatic inline attrib_func 1395a8bb7a65Smayafunc_nv(const struct gl_vertex_format *vformat) 1396a8bb7a65Smaya{ 1397a8bb7a65Smaya return AttribFuncsNV[vformat->Normalized][vformat->Size-1] 1398a8bb7a65Smaya [TYPE_IDX(vformat->Type)]; 13997117f1b4Smrg} 14007117f1b4Smrg 14017117f1b4Smrg 1402a8bb7a65Smaya/* 1403a8bb7a65Smaya * Return VertexAttrib*ARB function pointer matching the provided vertex format. 14047117f1b4Smrg */ 1405a8bb7a65Smayastatic inline attrib_func 1406a8bb7a65Smayafunc_arb(const struct gl_vertex_format *vformat) 1407a8bb7a65Smaya{ 1408a8bb7a65Smaya return AttribFuncsARB[vertex_format_to_index(vformat)][vformat->Size-1] 1409a8bb7a65Smaya [TYPE_IDX(vformat->Type)]; 14107117f1b4Smrg} 14117117f1b4Smrg 1412af69d88dSmrg 1413a8bb7a65Smaya/* 1414a8bb7a65Smaya * Return the address of the array attribute array at elt in the 1415a8bb7a65Smaya * vertex array object vao. 1416af69d88dSmrg */ 1417a8bb7a65Smayastatic inline const void * 1418a8bb7a65Smayaattrib_src(const struct gl_vertex_array_object *vao, 1419a8bb7a65Smaya const struct gl_array_attributes *array, GLint elt) 14207117f1b4Smrg{ 1421a8bb7a65Smaya const struct gl_vertex_buffer_binding *binding = 1422a8bb7a65Smaya &vao->BufferBinding[array->BufferBindingIndex]; 14237ec681f3Smrg const GLubyte *src = _mesa_vertex_attrib_address(array, binding); 14247ec681f3Smrg 14257ec681f3Smrg if (binding->BufferObj) { 14267ec681f3Smrg src = ADD_POINTERS(binding->BufferObj->Mappings[MAP_INTERNAL].Pointer, 14277ec681f3Smrg src); 14287ec681f3Smrg } 14297ec681f3Smrg 14307ec681f3Smrg return src + elt * binding->Stride; 14317117f1b4Smrg} 14327117f1b4Smrg 1433af69d88dSmrg 1434af69d88dSmrgvoid 1435a8bb7a65Smaya_mesa_array_element(struct gl_context *ctx, GLint elt) 14367117f1b4Smrg{ 1437a8bb7a65Smaya const struct gl_vertex_array_object *vao = ctx->Array.VAO; 1438a8bb7a65Smaya GLbitfield mask; 14397117f1b4Smrg 1440a8bb7a65Smaya /* emit conventional arrays elements */ 1441a8bb7a65Smaya mask = (VERT_BIT_FF_ALL & ~VERT_BIT_POS) & vao->Enabled; 1442a8bb7a65Smaya while (mask) { 1443a8bb7a65Smaya const gl_vert_attrib attrib = u_bit_scan(&mask); 1444a8bb7a65Smaya const struct gl_array_attributes *array = &vao->VertexAttrib[attrib]; 1445a8bb7a65Smaya const void *src = attrib_src(vao, array, elt); 1446a8bb7a65Smaya func_nv(&array->Format)(attrib, src); 1447a8bb7a65Smaya } 14487117f1b4Smrg 1449a8bb7a65Smaya /* emit generic attribute elements */ 1450a8bb7a65Smaya mask = (VERT_BIT_GENERIC_ALL & ~VERT_BIT_GENERIC0) & vao->Enabled; 1451a8bb7a65Smaya while (mask) { 1452a8bb7a65Smaya const gl_vert_attrib attrib = u_bit_scan(&mask); 1453a8bb7a65Smaya const struct gl_array_attributes *array = &vao->VertexAttrib[attrib]; 1454a8bb7a65Smaya const void *src = attrib_src(vao, array, elt); 1455a8bb7a65Smaya func_arb(&array->Format)(attrib - VERT_ATTRIB_GENERIC0, src); 1456a8bb7a65Smaya } 14577117f1b4Smrg 1458a8bb7a65Smaya /* finally, vertex position */ 1459a8bb7a65Smaya if (vao->Enabled & VERT_BIT_GENERIC0) { 1460a8bb7a65Smaya const gl_vert_attrib attrib = VERT_ATTRIB_GENERIC0; 1461a8bb7a65Smaya const struct gl_array_attributes *array = &vao->VertexAttrib[attrib]; 1462a8bb7a65Smaya const void *src = attrib_src(vao, array, elt); 1463a8bb7a65Smaya func_arb(&array->Format)(0, src); 1464a8bb7a65Smaya } else if (vao->Enabled & VERT_BIT_POS) { 1465a8bb7a65Smaya const gl_vert_attrib attrib = VERT_ATTRIB_POS; 1466a8bb7a65Smaya const struct gl_array_attributes *array = &vao->VertexAttrib[attrib]; 1467a8bb7a65Smaya const void *src = attrib_src(vao, array, elt); 1468a8bb7a65Smaya func_nv(&array->Format)(0, src); 1469a8bb7a65Smaya } 14707117f1b4Smrg} 14717117f1b4Smrg 14727117f1b4Smrg 14737117f1b4Smrg/** 14747117f1b4Smrg * Called via glArrayElement() and glDrawArrays(). 14757117f1b4Smrg * Issue the glNormal, glVertex, glColor, glVertexAttrib, etc functions 14767117f1b4Smrg * for all enabled vertex arrays (for elt-th element). 14777117f1b4Smrg * Note: this may be called during display list construction. 14787117f1b4Smrg */ 1479af69d88dSmrgvoid GLAPIENTRY 1480af69d88dSmrg_ae_ArrayElement(GLint elt) 14817117f1b4Smrg{ 14827117f1b4Smrg GET_CURRENT_CONTEXT(ctx); 1483a8bb7a65Smaya struct gl_vertex_array_object *vao; 14847117f1b4Smrg 1485af69d88dSmrg /* If PrimitiveRestart is enabled and the index is the RestartIndex 1486af69d88dSmrg * then we call PrimitiveRestartNV and return. 1487af69d88dSmrg */ 1488af69d88dSmrg if (ctx->Array.PrimitiveRestart && (elt == ctx->Array.RestartIndex)) { 14897ec681f3Smrg CALL_PrimitiveRestartNV(ctx->CurrentServerDispatch, ()); 1490af69d88dSmrg return; 1491af69d88dSmrg } 1492af69d88dSmrg 1493a8bb7a65Smaya vao = ctx->Array.VAO; 1494a8bb7a65Smaya _mesa_vao_map_arrays(ctx, vao, GL_MAP_READ_BIT); 14957117f1b4Smrg 1496a8bb7a65Smaya _mesa_array_element(ctx, elt); 149701e04c3fSmrg 1498a8bb7a65Smaya _mesa_vao_unmap_arrays(ctx, vao); 14997117f1b4Smrg} 15004a49301eSmrg 15014a49301eSmrg 1502af69d88dSmrgvoid 1503af69d88dSmrg_mesa_install_arrayelt_vtxfmt(struct _glapi_table *disp, 1504af69d88dSmrg const GLvertexformat *vfmt) 15054a49301eSmrg{ 15064a49301eSmrg SET_ArrayElement(disp, vfmt->ArrayElement); 15074a49301eSmrg} 1508