1bf215546Sopenharmony_ci/* 2bf215546Sopenharmony_ci * Mesa 3-D graphics library 3bf215546Sopenharmony_ci * 4bf215546Sopenharmony_ci * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. 5bf215546Sopenharmony_ci * 6bf215546Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a 7bf215546Sopenharmony_ci * copy of this software and associated documentation files (the "Software"), 8bf215546Sopenharmony_ci * to deal in the Software without restriction, including without limitation 9bf215546Sopenharmony_ci * the rights to use, copy, modify, merge, publish, distribute, sublicense, 10bf215546Sopenharmony_ci * and/or sell copies of the Software, and to permit persons to whom the 11bf215546Sopenharmony_ci * Software is furnished to do so, subject to the following conditions: 12bf215546Sopenharmony_ci * 13bf215546Sopenharmony_ci * The above copyright notice and this permission notice shall be included 14bf215546Sopenharmony_ci * in all copies or substantial portions of the Software. 15bf215546Sopenharmony_ci * 16bf215546Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17bf215546Sopenharmony_ci * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18bf215546Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 19bf215546Sopenharmony_ci * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20bf215546Sopenharmony_ci * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21bf215546Sopenharmony_ci * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22bf215546Sopenharmony_ci * OTHER DEALINGS IN THE SOFTWARE. 23bf215546Sopenharmony_ci */ 24bf215546Sopenharmony_ci 25bf215546Sopenharmony_ci/** 26bf215546Sopenharmony_ci * This file implements the glArrayElement() function. 27bf215546Sopenharmony_ci * It involves looking at the format/type of all the enabled vertex arrays 28bf215546Sopenharmony_ci * and emitting a list of pointers to functions which set the per-vertex 29bf215546Sopenharmony_ci * state for the element/index. 30bf215546Sopenharmony_ci */ 31bf215546Sopenharmony_ci 32bf215546Sopenharmony_ci 33bf215546Sopenharmony_ci/* Author: 34bf215546Sopenharmony_ci * Keith Whitwell <keithw@vmware.com> 35bf215546Sopenharmony_ci */ 36bf215546Sopenharmony_ci 37bf215546Sopenharmony_ci#include "glheader.h" 38bf215546Sopenharmony_ci#include "arrayobj.h" 39bf215546Sopenharmony_ci#include "api_arrayelt.h" 40bf215546Sopenharmony_ci#include "bufferobj.h" 41bf215546Sopenharmony_ci#include "context.h" 42bf215546Sopenharmony_ci 43bf215546Sopenharmony_ci#include "macros.h" 44bf215546Sopenharmony_ci#include "mtypes.h" 45bf215546Sopenharmony_ci#include "main/dispatch.h" 46bf215546Sopenharmony_ci#include "varray.h" 47bf215546Sopenharmony_ci#include "api_exec_decl.h" 48bf215546Sopenharmony_ci 49bf215546Sopenharmony_citypedef void (GLAPIENTRY *attrib_func)( GLuint indx, const void *data ); 50bf215546Sopenharmony_ci 51bf215546Sopenharmony_ci/* 52bf215546Sopenharmony_ci * Convert GL_BYTE, GL_UNSIGNED_BYTE, .. GL_DOUBLE into an integer 53bf215546Sopenharmony_ci * in the range [0, 7]. Luckily these type tokens are sequentially 54bf215546Sopenharmony_ci * numbered in gl.h, except for GL_DOUBLE. 55bf215546Sopenharmony_ci */ 56bf215546Sopenharmony_cistatic inline int 57bf215546Sopenharmony_ciTYPE_IDX(GLenum t) 58bf215546Sopenharmony_ci{ 59bf215546Sopenharmony_ci return t == GL_DOUBLE ? 7 : t & 7; 60bf215546Sopenharmony_ci} 61bf215546Sopenharmony_ci 62bf215546Sopenharmony_ci 63bf215546Sopenharmony_ci/* 64bf215546Sopenharmony_ci * Convert normalized/integer/double to the range [0, 3]. 65bf215546Sopenharmony_ci */ 66bf215546Sopenharmony_cistatic inline int 67bf215546Sopenharmony_civertex_format_to_index(const struct gl_vertex_format *vformat) 68bf215546Sopenharmony_ci{ 69bf215546Sopenharmony_ci if (vformat->Doubles) 70bf215546Sopenharmony_ci return 3; 71bf215546Sopenharmony_ci else if (vformat->Integer) 72bf215546Sopenharmony_ci return 2; 73bf215546Sopenharmony_ci else if (vformat->Normalized) 74bf215546Sopenharmony_ci return 1; 75bf215546Sopenharmony_ci else 76bf215546Sopenharmony_ci return 0; 77bf215546Sopenharmony_ci} 78bf215546Sopenharmony_ci 79bf215546Sopenharmony_ci 80bf215546Sopenharmony_ci#define NUM_TYPES 8 81bf215546Sopenharmony_ci 82bf215546Sopenharmony_cistatic struct _glapi_table * 83bf215546Sopenharmony_ciget_dispatch(void) 84bf215546Sopenharmony_ci{ 85bf215546Sopenharmony_ci GET_CURRENT_CONTEXT(ctx); 86bf215546Sopenharmony_ci return ctx->CurrentServerDispatch; 87bf215546Sopenharmony_ci} 88bf215546Sopenharmony_ci 89bf215546Sopenharmony_ci 90bf215546Sopenharmony_ci/** 91bf215546Sopenharmony_ci ** GL_NV_vertex_program 92bf215546Sopenharmony_ci **/ 93bf215546Sopenharmony_ci 94bf215546Sopenharmony_ci/* GL_BYTE attributes */ 95bf215546Sopenharmony_ci 96bf215546Sopenharmony_cistatic void GLAPIENTRY 97bf215546Sopenharmony_ciVertexAttrib1NbvNV(GLuint index, const GLbyte *v) 98bf215546Sopenharmony_ci{ 99bf215546Sopenharmony_ci CALL_VertexAttrib1fNV(get_dispatch(), (index, BYTE_TO_FLOAT(v[0]))); 100bf215546Sopenharmony_ci} 101bf215546Sopenharmony_ci 102bf215546Sopenharmony_cistatic void GLAPIENTRY 103bf215546Sopenharmony_ciVertexAttrib1bvNV(GLuint index, const GLbyte *v) 104bf215546Sopenharmony_ci{ 105bf215546Sopenharmony_ci CALL_VertexAttrib1fNV(get_dispatch(), (index, (GLfloat)v[0])); 106bf215546Sopenharmony_ci} 107bf215546Sopenharmony_ci 108bf215546Sopenharmony_cistatic void GLAPIENTRY 109bf215546Sopenharmony_ciVertexAttrib2NbvNV(GLuint index, const GLbyte *v) 110bf215546Sopenharmony_ci{ 111bf215546Sopenharmony_ci CALL_VertexAttrib2fNV(get_dispatch(), (index, BYTE_TO_FLOAT(v[0]), BYTE_TO_FLOAT(v[1]))); 112bf215546Sopenharmony_ci} 113bf215546Sopenharmony_ci 114bf215546Sopenharmony_cistatic void GLAPIENTRY 115bf215546Sopenharmony_ciVertexAttrib2bvNV(GLuint index, const GLbyte *v) 116bf215546Sopenharmony_ci{ 117bf215546Sopenharmony_ci CALL_VertexAttrib2fNV(get_dispatch(), (index, (GLfloat)v[0], (GLfloat)v[1])); 118bf215546Sopenharmony_ci} 119bf215546Sopenharmony_ci 120bf215546Sopenharmony_cistatic void GLAPIENTRY 121bf215546Sopenharmony_ciVertexAttrib3NbvNV(GLuint index, const GLbyte *v) 122bf215546Sopenharmony_ci{ 123bf215546Sopenharmony_ci CALL_VertexAttrib3fNV(get_dispatch(), (index, BYTE_TO_FLOAT(v[0]), 124bf215546Sopenharmony_ci BYTE_TO_FLOAT(v[1]), 125bf215546Sopenharmony_ci BYTE_TO_FLOAT(v[2]))); 126bf215546Sopenharmony_ci} 127bf215546Sopenharmony_ci 128bf215546Sopenharmony_cistatic void GLAPIENTRY 129bf215546Sopenharmony_ciVertexAttrib3bvNV(GLuint index, const GLbyte *v) 130bf215546Sopenharmony_ci{ 131bf215546Sopenharmony_ci CALL_VertexAttrib3fNV(get_dispatch(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2])); 132bf215546Sopenharmony_ci} 133bf215546Sopenharmony_ci 134bf215546Sopenharmony_cistatic void GLAPIENTRY 135bf215546Sopenharmony_ciVertexAttrib4NbvNV(GLuint index, const GLbyte *v) 136bf215546Sopenharmony_ci{ 137bf215546Sopenharmony_ci CALL_VertexAttrib4fNV(get_dispatch(), (index, BYTE_TO_FLOAT(v[0]), 138bf215546Sopenharmony_ci BYTE_TO_FLOAT(v[1]), 139bf215546Sopenharmony_ci BYTE_TO_FLOAT(v[2]), 140bf215546Sopenharmony_ci BYTE_TO_FLOAT(v[3]))); 141bf215546Sopenharmony_ci} 142bf215546Sopenharmony_ci 143bf215546Sopenharmony_cistatic void GLAPIENTRY 144bf215546Sopenharmony_ciVertexAttrib4bvNV(GLuint index, const GLbyte *v) 145bf215546Sopenharmony_ci{ 146bf215546Sopenharmony_ci CALL_VertexAttrib4fNV(get_dispatch(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2], (GLfloat)v[3])); 147bf215546Sopenharmony_ci} 148bf215546Sopenharmony_ci 149bf215546Sopenharmony_ci/* GL_UNSIGNED_BYTE attributes */ 150bf215546Sopenharmony_ci 151bf215546Sopenharmony_cistatic void GLAPIENTRY 152bf215546Sopenharmony_ciVertexAttrib1NubvNV(GLuint index, const GLubyte *v) 153bf215546Sopenharmony_ci{ 154bf215546Sopenharmony_ci CALL_VertexAttrib1fNV(get_dispatch(), (index, UBYTE_TO_FLOAT(v[0]))); 155bf215546Sopenharmony_ci} 156bf215546Sopenharmony_ci 157bf215546Sopenharmony_cistatic void GLAPIENTRY 158bf215546Sopenharmony_ciVertexAttrib1ubvNV(GLuint index, const GLubyte *v) 159bf215546Sopenharmony_ci{ 160bf215546Sopenharmony_ci CALL_VertexAttrib1fNV(get_dispatch(), (index, (GLfloat)v[0])); 161bf215546Sopenharmony_ci} 162bf215546Sopenharmony_ci 163bf215546Sopenharmony_cistatic void GLAPIENTRY 164bf215546Sopenharmony_ciVertexAttrib2NubvNV(GLuint index, const GLubyte *v) 165bf215546Sopenharmony_ci{ 166bf215546Sopenharmony_ci CALL_VertexAttrib2fNV(get_dispatch(), (index, UBYTE_TO_FLOAT(v[0]), 167bf215546Sopenharmony_ci UBYTE_TO_FLOAT(v[1]))); 168bf215546Sopenharmony_ci} 169bf215546Sopenharmony_ci 170bf215546Sopenharmony_cistatic void GLAPIENTRY 171bf215546Sopenharmony_ciVertexAttrib2ubvNV(GLuint index, const GLubyte *v) 172bf215546Sopenharmony_ci{ 173bf215546Sopenharmony_ci CALL_VertexAttrib2fNV(get_dispatch(), (index, (GLfloat)v[0], (GLfloat)v[1])); 174bf215546Sopenharmony_ci} 175bf215546Sopenharmony_ci 176bf215546Sopenharmony_cistatic void GLAPIENTRY 177bf215546Sopenharmony_ciVertexAttrib3NubvNV(GLuint index, const GLubyte *v) 178bf215546Sopenharmony_ci{ 179bf215546Sopenharmony_ci CALL_VertexAttrib3fNV(get_dispatch(), (index, UBYTE_TO_FLOAT(v[0]), 180bf215546Sopenharmony_ci UBYTE_TO_FLOAT(v[1]), 181bf215546Sopenharmony_ci UBYTE_TO_FLOAT(v[2]))); 182bf215546Sopenharmony_ci} 183bf215546Sopenharmony_cistatic void GLAPIENTRY 184bf215546Sopenharmony_ciVertexAttrib3ubvNV(GLuint index, const GLubyte *v) 185bf215546Sopenharmony_ci{ 186bf215546Sopenharmony_ci CALL_VertexAttrib3fNV(get_dispatch(), (index, (GLfloat)v[0], 187bf215546Sopenharmony_ci (GLfloat)v[1], (GLfloat)v[2])); 188bf215546Sopenharmony_ci} 189bf215546Sopenharmony_ci 190bf215546Sopenharmony_cistatic void GLAPIENTRY 191bf215546Sopenharmony_ciVertexAttrib4NubvNV(GLuint index, const GLubyte *v) 192bf215546Sopenharmony_ci{ 193bf215546Sopenharmony_ci CALL_VertexAttrib4fNV(get_dispatch(), (index, UBYTE_TO_FLOAT(v[0]), 194bf215546Sopenharmony_ci UBYTE_TO_FLOAT(v[1]), 195bf215546Sopenharmony_ci UBYTE_TO_FLOAT(v[2]), 196bf215546Sopenharmony_ci UBYTE_TO_FLOAT(v[3]))); 197bf215546Sopenharmony_ci} 198bf215546Sopenharmony_ci 199bf215546Sopenharmony_cistatic void GLAPIENTRY 200bf215546Sopenharmony_ciVertexAttrib4ubvNV(GLuint index, const GLubyte *v) 201bf215546Sopenharmony_ci{ 202bf215546Sopenharmony_ci CALL_VertexAttrib4fNV(get_dispatch(), (index, (GLfloat)v[0], 203bf215546Sopenharmony_ci (GLfloat)v[1], (GLfloat)v[2], 204bf215546Sopenharmony_ci (GLfloat)v[3])); 205bf215546Sopenharmony_ci} 206bf215546Sopenharmony_ci 207bf215546Sopenharmony_ci/* GL_SHORT attributes */ 208bf215546Sopenharmony_ci 209bf215546Sopenharmony_cistatic void GLAPIENTRY 210bf215546Sopenharmony_ciVertexAttrib1NsvNV(GLuint index, const GLshort *v) 211bf215546Sopenharmony_ci{ 212bf215546Sopenharmony_ci CALL_VertexAttrib1fNV(get_dispatch(), (index, SHORT_TO_FLOAT(v[0]))); 213bf215546Sopenharmony_ci} 214bf215546Sopenharmony_ci 215bf215546Sopenharmony_cistatic void GLAPIENTRY 216bf215546Sopenharmony_ciVertexAttrib1svNV(GLuint index, const GLshort *v) 217bf215546Sopenharmony_ci{ 218bf215546Sopenharmony_ci CALL_VertexAttrib1fNV(get_dispatch(), (index, (GLfloat)v[0])); 219bf215546Sopenharmony_ci} 220bf215546Sopenharmony_ci 221bf215546Sopenharmony_cistatic void GLAPIENTRY 222bf215546Sopenharmony_ciVertexAttrib2NsvNV(GLuint index, const GLshort *v) 223bf215546Sopenharmony_ci{ 224bf215546Sopenharmony_ci CALL_VertexAttrib2fNV(get_dispatch(), (index, SHORT_TO_FLOAT(v[0]), 225bf215546Sopenharmony_ci SHORT_TO_FLOAT(v[1]))); 226bf215546Sopenharmony_ci} 227bf215546Sopenharmony_ci 228bf215546Sopenharmony_cistatic void GLAPIENTRY 229bf215546Sopenharmony_ciVertexAttrib2svNV(GLuint index, const GLshort *v) 230bf215546Sopenharmony_ci{ 231bf215546Sopenharmony_ci CALL_VertexAttrib2fNV(get_dispatch(), (index, (GLfloat)v[0], (GLfloat)v[1])); 232bf215546Sopenharmony_ci} 233bf215546Sopenharmony_ci 234bf215546Sopenharmony_cistatic void GLAPIENTRY 235bf215546Sopenharmony_ciVertexAttrib3NsvNV(GLuint index, const GLshort *v) 236bf215546Sopenharmony_ci{ 237bf215546Sopenharmony_ci CALL_VertexAttrib3fNV(get_dispatch(), (index, SHORT_TO_FLOAT(v[0]), 238bf215546Sopenharmony_ci SHORT_TO_FLOAT(v[1]), 239bf215546Sopenharmony_ci SHORT_TO_FLOAT(v[2]))); 240bf215546Sopenharmony_ci} 241bf215546Sopenharmony_ci 242bf215546Sopenharmony_cistatic void GLAPIENTRY 243bf215546Sopenharmony_ciVertexAttrib3svNV(GLuint index, const GLshort *v) 244bf215546Sopenharmony_ci{ 245bf215546Sopenharmony_ci CALL_VertexAttrib3fNV(get_dispatch(), (index, (GLfloat)v[0], (GLfloat)v[1], 246bf215546Sopenharmony_ci (GLfloat)v[2])); 247bf215546Sopenharmony_ci} 248bf215546Sopenharmony_ci 249bf215546Sopenharmony_cistatic void GLAPIENTRY 250bf215546Sopenharmony_ciVertexAttrib4NsvNV(GLuint index, const GLshort *v) 251bf215546Sopenharmony_ci{ 252bf215546Sopenharmony_ci CALL_VertexAttrib4fNV(get_dispatch(), (index, SHORT_TO_FLOAT(v[0]), 253bf215546Sopenharmony_ci SHORT_TO_FLOAT(v[1]), 254bf215546Sopenharmony_ci SHORT_TO_FLOAT(v[2]), 255bf215546Sopenharmony_ci SHORT_TO_FLOAT(v[3]))); 256bf215546Sopenharmony_ci} 257bf215546Sopenharmony_ci 258bf215546Sopenharmony_cistatic void GLAPIENTRY 259bf215546Sopenharmony_ciVertexAttrib4svNV(GLuint index, const GLshort *v) 260bf215546Sopenharmony_ci{ 261bf215546Sopenharmony_ci CALL_VertexAttrib4fNV(get_dispatch(), (index, (GLfloat)v[0], (GLfloat)v[1], 262bf215546Sopenharmony_ci (GLfloat)v[2], (GLfloat)v[3])); 263bf215546Sopenharmony_ci} 264bf215546Sopenharmony_ci 265bf215546Sopenharmony_ci/* GL_UNSIGNED_SHORT attributes */ 266bf215546Sopenharmony_ci 267bf215546Sopenharmony_cistatic void GLAPIENTRY 268bf215546Sopenharmony_ciVertexAttrib1NusvNV(GLuint index, const GLushort *v) 269bf215546Sopenharmony_ci{ 270bf215546Sopenharmony_ci CALL_VertexAttrib1fNV(get_dispatch(), (index, USHORT_TO_FLOAT(v[0]))); 271bf215546Sopenharmony_ci} 272bf215546Sopenharmony_ci 273bf215546Sopenharmony_cistatic void GLAPIENTRY 274bf215546Sopenharmony_ciVertexAttrib1usvNV(GLuint index, const GLushort *v) 275bf215546Sopenharmony_ci{ 276bf215546Sopenharmony_ci CALL_VertexAttrib1fNV(get_dispatch(), (index, (GLfloat)v[0])); 277bf215546Sopenharmony_ci} 278bf215546Sopenharmony_ci 279bf215546Sopenharmony_cistatic void GLAPIENTRY 280bf215546Sopenharmony_ciVertexAttrib2NusvNV(GLuint index, const GLushort *v) 281bf215546Sopenharmony_ci{ 282bf215546Sopenharmony_ci CALL_VertexAttrib2fNV(get_dispatch(), (index, USHORT_TO_FLOAT(v[0]), 283bf215546Sopenharmony_ci USHORT_TO_FLOAT(v[1]))); 284bf215546Sopenharmony_ci} 285bf215546Sopenharmony_ci 286bf215546Sopenharmony_cistatic void GLAPIENTRY 287bf215546Sopenharmony_ciVertexAttrib2usvNV(GLuint index, const GLushort *v) 288bf215546Sopenharmony_ci{ 289bf215546Sopenharmony_ci CALL_VertexAttrib2fNV(get_dispatch(), (index, (GLfloat)v[0], 290bf215546Sopenharmony_ci (GLfloat)v[1])); 291bf215546Sopenharmony_ci} 292bf215546Sopenharmony_ci 293bf215546Sopenharmony_cistatic void GLAPIENTRY 294bf215546Sopenharmony_ciVertexAttrib3NusvNV(GLuint index, const GLushort *v) 295bf215546Sopenharmony_ci{ 296bf215546Sopenharmony_ci CALL_VertexAttrib3fNV(get_dispatch(), (index, USHORT_TO_FLOAT(v[0]), 297bf215546Sopenharmony_ci USHORT_TO_FLOAT(v[1]), 298bf215546Sopenharmony_ci USHORT_TO_FLOAT(v[2]))); 299bf215546Sopenharmony_ci} 300bf215546Sopenharmony_ci 301bf215546Sopenharmony_cistatic void GLAPIENTRY 302bf215546Sopenharmony_ciVertexAttrib3usvNV(GLuint index, const GLushort *v) 303bf215546Sopenharmony_ci{ 304bf215546Sopenharmony_ci CALL_VertexAttrib3fNV(get_dispatch(), (index, (GLfloat)v[0], (GLfloat)v[1], 305bf215546Sopenharmony_ci (GLfloat)v[2])); 306bf215546Sopenharmony_ci} 307bf215546Sopenharmony_ci 308bf215546Sopenharmony_cistatic void GLAPIENTRY 309bf215546Sopenharmony_ciVertexAttrib4NusvNV(GLuint index, const GLushort *v) 310bf215546Sopenharmony_ci{ 311bf215546Sopenharmony_ci CALL_VertexAttrib4fNV(get_dispatch(), (index, USHORT_TO_FLOAT(v[0]), 312bf215546Sopenharmony_ci USHORT_TO_FLOAT(v[1]), 313bf215546Sopenharmony_ci USHORT_TO_FLOAT(v[2]), 314bf215546Sopenharmony_ci USHORT_TO_FLOAT(v[3]))); 315bf215546Sopenharmony_ci} 316bf215546Sopenharmony_ci 317bf215546Sopenharmony_cistatic void GLAPIENTRY 318bf215546Sopenharmony_ciVertexAttrib4usvNV(GLuint index, const GLushort *v) 319bf215546Sopenharmony_ci{ 320bf215546Sopenharmony_ci CALL_VertexAttrib4fNV(get_dispatch(), (index, (GLfloat)v[0], (GLfloat)v[1], 321bf215546Sopenharmony_ci (GLfloat)v[2], (GLfloat)v[3])); 322bf215546Sopenharmony_ci} 323bf215546Sopenharmony_ci 324bf215546Sopenharmony_ci/* GL_INT attributes */ 325bf215546Sopenharmony_ci 326bf215546Sopenharmony_cistatic void GLAPIENTRY 327bf215546Sopenharmony_ciVertexAttrib1NivNV(GLuint index, const GLint *v) 328bf215546Sopenharmony_ci{ 329bf215546Sopenharmony_ci CALL_VertexAttrib1fNV(get_dispatch(), (index, INT_TO_FLOAT(v[0]))); 330bf215546Sopenharmony_ci} 331bf215546Sopenharmony_ci 332bf215546Sopenharmony_cistatic void GLAPIENTRY 333bf215546Sopenharmony_ciVertexAttrib1ivNV(GLuint index, const GLint *v) 334bf215546Sopenharmony_ci{ 335bf215546Sopenharmony_ci CALL_VertexAttrib1fNV(get_dispatch(), (index, (GLfloat)v[0])); 336bf215546Sopenharmony_ci} 337bf215546Sopenharmony_ci 338bf215546Sopenharmony_cistatic void GLAPIENTRY 339bf215546Sopenharmony_ciVertexAttrib2NivNV(GLuint index, const GLint *v) 340bf215546Sopenharmony_ci{ 341bf215546Sopenharmony_ci CALL_VertexAttrib2fNV(get_dispatch(), (index, INT_TO_FLOAT(v[0]), 342bf215546Sopenharmony_ci INT_TO_FLOAT(v[1]))); 343bf215546Sopenharmony_ci} 344bf215546Sopenharmony_ci 345bf215546Sopenharmony_cistatic void GLAPIENTRY 346bf215546Sopenharmony_ciVertexAttrib2ivNV(GLuint index, const GLint *v) 347bf215546Sopenharmony_ci{ 348bf215546Sopenharmony_ci CALL_VertexAttrib2fNV(get_dispatch(), (index, (GLfloat)v[0], (GLfloat)v[1])); 349bf215546Sopenharmony_ci} 350bf215546Sopenharmony_ci 351bf215546Sopenharmony_cistatic void GLAPIENTRY 352bf215546Sopenharmony_ciVertexAttrib3NivNV(GLuint index, const GLint *v) 353bf215546Sopenharmony_ci{ 354bf215546Sopenharmony_ci CALL_VertexAttrib3fNV(get_dispatch(), (index, INT_TO_FLOAT(v[0]), 355bf215546Sopenharmony_ci INT_TO_FLOAT(v[1]), 356bf215546Sopenharmony_ci INT_TO_FLOAT(v[2]))); 357bf215546Sopenharmony_ci} 358bf215546Sopenharmony_ci 359bf215546Sopenharmony_cistatic void GLAPIENTRY 360bf215546Sopenharmony_ciVertexAttrib3ivNV(GLuint index, const GLint *v) 361bf215546Sopenharmony_ci{ 362bf215546Sopenharmony_ci CALL_VertexAttrib3fNV(get_dispatch(), (index, (GLfloat)v[0], (GLfloat)v[1], 363bf215546Sopenharmony_ci (GLfloat)v[2])); 364bf215546Sopenharmony_ci} 365bf215546Sopenharmony_ci 366bf215546Sopenharmony_cistatic void GLAPIENTRY 367bf215546Sopenharmony_ciVertexAttrib4NivNV(GLuint index, const GLint *v) 368bf215546Sopenharmony_ci{ 369bf215546Sopenharmony_ci CALL_VertexAttrib4fNV(get_dispatch(), (index, INT_TO_FLOAT(v[0]), 370bf215546Sopenharmony_ci INT_TO_FLOAT(v[1]), 371bf215546Sopenharmony_ci INT_TO_FLOAT(v[2]), 372bf215546Sopenharmony_ci INT_TO_FLOAT(v[3]))); 373bf215546Sopenharmony_ci} 374bf215546Sopenharmony_ci 375bf215546Sopenharmony_cistatic void GLAPIENTRY 376bf215546Sopenharmony_ciVertexAttrib4ivNV(GLuint index, const GLint *v) 377bf215546Sopenharmony_ci{ 378bf215546Sopenharmony_ci CALL_VertexAttrib4fNV(get_dispatch(), (index, (GLfloat)v[0], (GLfloat)v[1], 379bf215546Sopenharmony_ci (GLfloat)v[2], (GLfloat)v[3])); 380bf215546Sopenharmony_ci} 381bf215546Sopenharmony_ci 382bf215546Sopenharmony_ci/* GL_UNSIGNED_INT attributes */ 383bf215546Sopenharmony_ci 384bf215546Sopenharmony_cistatic void GLAPIENTRY 385bf215546Sopenharmony_ciVertexAttrib1NuivNV(GLuint index, const GLuint *v) 386bf215546Sopenharmony_ci{ 387bf215546Sopenharmony_ci CALL_VertexAttrib1fNV(get_dispatch(), (index, UINT_TO_FLOAT(v[0]))); 388bf215546Sopenharmony_ci} 389bf215546Sopenharmony_ci 390bf215546Sopenharmony_cistatic void GLAPIENTRY 391bf215546Sopenharmony_ciVertexAttrib1uivNV(GLuint index, const GLuint *v) 392bf215546Sopenharmony_ci{ 393bf215546Sopenharmony_ci CALL_VertexAttrib1fNV(get_dispatch(), (index, (GLfloat)v[0])); 394bf215546Sopenharmony_ci} 395bf215546Sopenharmony_ci 396bf215546Sopenharmony_cistatic void GLAPIENTRY 397bf215546Sopenharmony_ciVertexAttrib2NuivNV(GLuint index, const GLuint *v) 398bf215546Sopenharmony_ci{ 399bf215546Sopenharmony_ci CALL_VertexAttrib2fNV(get_dispatch(), (index, UINT_TO_FLOAT(v[0]), 400bf215546Sopenharmony_ci UINT_TO_FLOAT(v[1]))); 401bf215546Sopenharmony_ci} 402bf215546Sopenharmony_ci 403bf215546Sopenharmony_cistatic void GLAPIENTRY 404bf215546Sopenharmony_ciVertexAttrib2uivNV(GLuint index, const GLuint *v) 405bf215546Sopenharmony_ci{ 406bf215546Sopenharmony_ci CALL_VertexAttrib2fNV(get_dispatch(), (index, (GLfloat)v[0], 407bf215546Sopenharmony_ci (GLfloat)v[1])); 408bf215546Sopenharmony_ci} 409bf215546Sopenharmony_ci 410bf215546Sopenharmony_cistatic void GLAPIENTRY 411bf215546Sopenharmony_ciVertexAttrib3NuivNV(GLuint index, const GLuint *v) 412bf215546Sopenharmony_ci{ 413bf215546Sopenharmony_ci CALL_VertexAttrib3fNV(get_dispatch(), (index, UINT_TO_FLOAT(v[0]), 414bf215546Sopenharmony_ci UINT_TO_FLOAT(v[1]), 415bf215546Sopenharmony_ci UINT_TO_FLOAT(v[2]))); 416bf215546Sopenharmony_ci} 417bf215546Sopenharmony_ci 418bf215546Sopenharmony_cistatic void GLAPIENTRY 419bf215546Sopenharmony_ciVertexAttrib3uivNV(GLuint index, const GLuint *v) 420bf215546Sopenharmony_ci{ 421bf215546Sopenharmony_ci CALL_VertexAttrib3fNV(get_dispatch(), (index, (GLfloat)v[0], (GLfloat)v[1], 422bf215546Sopenharmony_ci (GLfloat)v[2])); 423bf215546Sopenharmony_ci} 424bf215546Sopenharmony_ci 425bf215546Sopenharmony_cistatic void GLAPIENTRY 426bf215546Sopenharmony_ciVertexAttrib4NuivNV(GLuint index, const GLuint *v) 427bf215546Sopenharmony_ci{ 428bf215546Sopenharmony_ci CALL_VertexAttrib4fNV(get_dispatch(), (index, UINT_TO_FLOAT(v[0]), 429bf215546Sopenharmony_ci UINT_TO_FLOAT(v[1]), 430bf215546Sopenharmony_ci UINT_TO_FLOAT(v[2]), 431bf215546Sopenharmony_ci UINT_TO_FLOAT(v[3]))); 432bf215546Sopenharmony_ci} 433bf215546Sopenharmony_ci 434bf215546Sopenharmony_cistatic void GLAPIENTRY 435bf215546Sopenharmony_ciVertexAttrib4uivNV(GLuint index, const GLuint *v) 436bf215546Sopenharmony_ci{ 437bf215546Sopenharmony_ci CALL_VertexAttrib4fNV(get_dispatch(), (index, (GLfloat)v[0], (GLfloat)v[1], 438bf215546Sopenharmony_ci (GLfloat)v[2], (GLfloat)v[3])); 439bf215546Sopenharmony_ci} 440bf215546Sopenharmony_ci 441bf215546Sopenharmony_ci/* GL_FLOAT attributes */ 442bf215546Sopenharmony_ci 443bf215546Sopenharmony_cistatic void GLAPIENTRY 444bf215546Sopenharmony_ciVertexAttrib1fvNV(GLuint index, const GLfloat *v) 445bf215546Sopenharmony_ci{ 446bf215546Sopenharmony_ci CALL_VertexAttrib1fvNV(get_dispatch(), (index, v)); 447bf215546Sopenharmony_ci} 448bf215546Sopenharmony_ci 449bf215546Sopenharmony_cistatic void GLAPIENTRY 450bf215546Sopenharmony_ciVertexAttrib2fvNV(GLuint index, const GLfloat *v) 451bf215546Sopenharmony_ci{ 452bf215546Sopenharmony_ci CALL_VertexAttrib2fvNV(get_dispatch(), (index, v)); 453bf215546Sopenharmony_ci} 454bf215546Sopenharmony_ci 455bf215546Sopenharmony_cistatic void GLAPIENTRY 456bf215546Sopenharmony_ciVertexAttrib3fvNV(GLuint index, const GLfloat *v) 457bf215546Sopenharmony_ci{ 458bf215546Sopenharmony_ci CALL_VertexAttrib3fvNV(get_dispatch(), (index, v)); 459bf215546Sopenharmony_ci} 460bf215546Sopenharmony_ci 461bf215546Sopenharmony_cistatic void GLAPIENTRY 462bf215546Sopenharmony_ciVertexAttrib4fvNV(GLuint index, const GLfloat *v) 463bf215546Sopenharmony_ci{ 464bf215546Sopenharmony_ci CALL_VertexAttrib4fvNV(get_dispatch(), (index, v)); 465bf215546Sopenharmony_ci} 466bf215546Sopenharmony_ci 467bf215546Sopenharmony_ci/* GL_DOUBLE attributes */ 468bf215546Sopenharmony_ci 469bf215546Sopenharmony_cistatic void GLAPIENTRY 470bf215546Sopenharmony_ciVertexAttrib1dvNV(GLuint index, const GLdouble *v) 471bf215546Sopenharmony_ci{ 472bf215546Sopenharmony_ci CALL_VertexAttrib1dvNV(get_dispatch(), (index, v)); 473bf215546Sopenharmony_ci} 474bf215546Sopenharmony_ci 475bf215546Sopenharmony_cistatic void GLAPIENTRY 476bf215546Sopenharmony_ciVertexAttrib2dvNV(GLuint index, const GLdouble *v) 477bf215546Sopenharmony_ci{ 478bf215546Sopenharmony_ci CALL_VertexAttrib2dvNV(get_dispatch(), (index, v)); 479bf215546Sopenharmony_ci} 480bf215546Sopenharmony_ci 481bf215546Sopenharmony_cistatic void GLAPIENTRY 482bf215546Sopenharmony_ciVertexAttrib3dvNV(GLuint index, const GLdouble *v) 483bf215546Sopenharmony_ci{ 484bf215546Sopenharmony_ci CALL_VertexAttrib3dvNV(get_dispatch(), (index, v)); 485bf215546Sopenharmony_ci} 486bf215546Sopenharmony_ci 487bf215546Sopenharmony_cistatic void GLAPIENTRY 488bf215546Sopenharmony_ciVertexAttrib4dvNV(GLuint index, const GLdouble *v) 489bf215546Sopenharmony_ci{ 490bf215546Sopenharmony_ci CALL_VertexAttrib4dvNV(get_dispatch(), (index, v)); 491bf215546Sopenharmony_ci} 492bf215546Sopenharmony_ci 493bf215546Sopenharmony_ci 494bf215546Sopenharmony_ci/* 495bf215546Sopenharmony_ci * Array [size][type] of VertexAttrib functions 496bf215546Sopenharmony_ci */ 497bf215546Sopenharmony_cistatic const attrib_func AttribFuncsNV[2][4][NUM_TYPES] = { 498bf215546Sopenharmony_ci { 499bf215546Sopenharmony_ci /* non-normalized */ 500bf215546Sopenharmony_ci { 501bf215546Sopenharmony_ci /* size 1 */ 502bf215546Sopenharmony_ci (attrib_func) VertexAttrib1bvNV, 503bf215546Sopenharmony_ci (attrib_func) VertexAttrib1ubvNV, 504bf215546Sopenharmony_ci (attrib_func) VertexAttrib1svNV, 505bf215546Sopenharmony_ci (attrib_func) VertexAttrib1usvNV, 506bf215546Sopenharmony_ci (attrib_func) VertexAttrib1ivNV, 507bf215546Sopenharmony_ci (attrib_func) VertexAttrib1uivNV, 508bf215546Sopenharmony_ci (attrib_func) VertexAttrib1fvNV, 509bf215546Sopenharmony_ci (attrib_func) VertexAttrib1dvNV 510bf215546Sopenharmony_ci }, 511bf215546Sopenharmony_ci { 512bf215546Sopenharmony_ci /* size 2 */ 513bf215546Sopenharmony_ci (attrib_func) VertexAttrib2bvNV, 514bf215546Sopenharmony_ci (attrib_func) VertexAttrib2ubvNV, 515bf215546Sopenharmony_ci (attrib_func) VertexAttrib2svNV, 516bf215546Sopenharmony_ci (attrib_func) VertexAttrib2usvNV, 517bf215546Sopenharmony_ci (attrib_func) VertexAttrib2ivNV, 518bf215546Sopenharmony_ci (attrib_func) VertexAttrib2uivNV, 519bf215546Sopenharmony_ci (attrib_func) VertexAttrib2fvNV, 520bf215546Sopenharmony_ci (attrib_func) VertexAttrib2dvNV 521bf215546Sopenharmony_ci }, 522bf215546Sopenharmony_ci { 523bf215546Sopenharmony_ci /* size 3 */ 524bf215546Sopenharmony_ci (attrib_func) VertexAttrib3bvNV, 525bf215546Sopenharmony_ci (attrib_func) VertexAttrib3ubvNV, 526bf215546Sopenharmony_ci (attrib_func) VertexAttrib3svNV, 527bf215546Sopenharmony_ci (attrib_func) VertexAttrib3usvNV, 528bf215546Sopenharmony_ci (attrib_func) VertexAttrib3ivNV, 529bf215546Sopenharmony_ci (attrib_func) VertexAttrib3uivNV, 530bf215546Sopenharmony_ci (attrib_func) VertexAttrib3fvNV, 531bf215546Sopenharmony_ci (attrib_func) VertexAttrib3dvNV 532bf215546Sopenharmony_ci }, 533bf215546Sopenharmony_ci { 534bf215546Sopenharmony_ci /* size 4 */ 535bf215546Sopenharmony_ci (attrib_func) VertexAttrib4bvNV, 536bf215546Sopenharmony_ci (attrib_func) VertexAttrib4ubvNV, 537bf215546Sopenharmony_ci (attrib_func) VertexAttrib4svNV, 538bf215546Sopenharmony_ci (attrib_func) VertexAttrib4usvNV, 539bf215546Sopenharmony_ci (attrib_func) VertexAttrib4ivNV, 540bf215546Sopenharmony_ci (attrib_func) VertexAttrib4uivNV, 541bf215546Sopenharmony_ci (attrib_func) VertexAttrib4fvNV, 542bf215546Sopenharmony_ci (attrib_func) VertexAttrib4dvNV 543bf215546Sopenharmony_ci } 544bf215546Sopenharmony_ci }, 545bf215546Sopenharmony_ci { 546bf215546Sopenharmony_ci /* normalized (except for float/double) */ 547bf215546Sopenharmony_ci { 548bf215546Sopenharmony_ci /* size 1 */ 549bf215546Sopenharmony_ci (attrib_func) VertexAttrib1NbvNV, 550bf215546Sopenharmony_ci (attrib_func) VertexAttrib1NubvNV, 551bf215546Sopenharmony_ci (attrib_func) VertexAttrib1NsvNV, 552bf215546Sopenharmony_ci (attrib_func) VertexAttrib1NusvNV, 553bf215546Sopenharmony_ci (attrib_func) VertexAttrib1NivNV, 554bf215546Sopenharmony_ci (attrib_func) VertexAttrib1NuivNV, 555bf215546Sopenharmony_ci (attrib_func) VertexAttrib1fvNV, 556bf215546Sopenharmony_ci (attrib_func) VertexAttrib1dvNV 557bf215546Sopenharmony_ci }, 558bf215546Sopenharmony_ci { 559bf215546Sopenharmony_ci /* size 2 */ 560bf215546Sopenharmony_ci (attrib_func) VertexAttrib2NbvNV, 561bf215546Sopenharmony_ci (attrib_func) VertexAttrib2NubvNV, 562bf215546Sopenharmony_ci (attrib_func) VertexAttrib2NsvNV, 563bf215546Sopenharmony_ci (attrib_func) VertexAttrib2NusvNV, 564bf215546Sopenharmony_ci (attrib_func) VertexAttrib2NivNV, 565bf215546Sopenharmony_ci (attrib_func) VertexAttrib2NuivNV, 566bf215546Sopenharmony_ci (attrib_func) VertexAttrib2fvNV, 567bf215546Sopenharmony_ci (attrib_func) VertexAttrib2dvNV 568bf215546Sopenharmony_ci }, 569bf215546Sopenharmony_ci { 570bf215546Sopenharmony_ci /* size 3 */ 571bf215546Sopenharmony_ci (attrib_func) VertexAttrib3NbvNV, 572bf215546Sopenharmony_ci (attrib_func) VertexAttrib3NubvNV, 573bf215546Sopenharmony_ci (attrib_func) VertexAttrib3NsvNV, 574bf215546Sopenharmony_ci (attrib_func) VertexAttrib3NusvNV, 575bf215546Sopenharmony_ci (attrib_func) VertexAttrib3NivNV, 576bf215546Sopenharmony_ci (attrib_func) VertexAttrib3NuivNV, 577bf215546Sopenharmony_ci (attrib_func) VertexAttrib3fvNV, 578bf215546Sopenharmony_ci (attrib_func) VertexAttrib3dvNV 579bf215546Sopenharmony_ci }, 580bf215546Sopenharmony_ci { 581bf215546Sopenharmony_ci /* size 4 */ 582bf215546Sopenharmony_ci (attrib_func) VertexAttrib4NbvNV, 583bf215546Sopenharmony_ci (attrib_func) VertexAttrib4NubvNV, 584bf215546Sopenharmony_ci (attrib_func) VertexAttrib4NsvNV, 585bf215546Sopenharmony_ci (attrib_func) VertexAttrib4NusvNV, 586bf215546Sopenharmony_ci (attrib_func) VertexAttrib4NivNV, 587bf215546Sopenharmony_ci (attrib_func) VertexAttrib4NuivNV, 588bf215546Sopenharmony_ci (attrib_func) VertexAttrib4fvNV, 589bf215546Sopenharmony_ci (attrib_func) VertexAttrib4dvNV 590bf215546Sopenharmony_ci } 591bf215546Sopenharmony_ci } 592bf215546Sopenharmony_ci}; 593bf215546Sopenharmony_ci 594bf215546Sopenharmony_ci 595bf215546Sopenharmony_ci/** 596bf215546Sopenharmony_ci ** GL_ARB_vertex_program 597bf215546Sopenharmony_ci **/ 598bf215546Sopenharmony_ci 599bf215546Sopenharmony_ci/* GL_BYTE attributes */ 600bf215546Sopenharmony_ci 601bf215546Sopenharmony_cistatic void GLAPIENTRY 602bf215546Sopenharmony_ciVertexAttrib1NbvARB(GLuint index, const GLbyte *v) 603bf215546Sopenharmony_ci{ 604bf215546Sopenharmony_ci CALL_VertexAttrib1fARB(get_dispatch(), (index, BYTE_TO_FLOAT(v[0]))); 605bf215546Sopenharmony_ci} 606bf215546Sopenharmony_ci 607bf215546Sopenharmony_cistatic void GLAPIENTRY 608bf215546Sopenharmony_ciVertexAttrib1bvARB(GLuint index, const GLbyte *v) 609bf215546Sopenharmony_ci{ 610bf215546Sopenharmony_ci CALL_VertexAttrib1fARB(get_dispatch(), (index, (GLfloat)v[0])); 611bf215546Sopenharmony_ci} 612bf215546Sopenharmony_ci 613bf215546Sopenharmony_cistatic void GLAPIENTRY 614bf215546Sopenharmony_ciVertexAttrib2NbvARB(GLuint index, const GLbyte *v) 615bf215546Sopenharmony_ci{ 616bf215546Sopenharmony_ci CALL_VertexAttrib2fARB(get_dispatch(), (index, BYTE_TO_FLOAT(v[0]), BYTE_TO_FLOAT(v[1]))); 617bf215546Sopenharmony_ci} 618bf215546Sopenharmony_ci 619bf215546Sopenharmony_cistatic void GLAPIENTRY 620bf215546Sopenharmony_ciVertexAttrib2bvARB(GLuint index, const GLbyte *v) 621bf215546Sopenharmony_ci{ 622bf215546Sopenharmony_ci CALL_VertexAttrib2fARB(get_dispatch(), (index, (GLfloat)v[0], (GLfloat)v[1])); 623bf215546Sopenharmony_ci} 624bf215546Sopenharmony_ci 625bf215546Sopenharmony_cistatic void GLAPIENTRY 626bf215546Sopenharmony_ciVertexAttrib3NbvARB(GLuint index, const GLbyte *v) 627bf215546Sopenharmony_ci{ 628bf215546Sopenharmony_ci CALL_VertexAttrib3fARB(get_dispatch(), (index, BYTE_TO_FLOAT(v[0]), 629bf215546Sopenharmony_ci BYTE_TO_FLOAT(v[1]), 630bf215546Sopenharmony_ci BYTE_TO_FLOAT(v[2]))); 631bf215546Sopenharmony_ci} 632bf215546Sopenharmony_ci 633bf215546Sopenharmony_cistatic void GLAPIENTRY 634bf215546Sopenharmony_ciVertexAttrib3bvARB(GLuint index, const GLbyte *v) 635bf215546Sopenharmony_ci{ 636bf215546Sopenharmony_ci CALL_VertexAttrib3fARB(get_dispatch(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2])); 637bf215546Sopenharmony_ci} 638bf215546Sopenharmony_ci 639bf215546Sopenharmony_cistatic void GLAPIENTRY 640bf215546Sopenharmony_ciVertexAttrib4NbvARB(GLuint index, const GLbyte *v) 641bf215546Sopenharmony_ci{ 642bf215546Sopenharmony_ci CALL_VertexAttrib4fARB(get_dispatch(), (index, BYTE_TO_FLOAT(v[0]), 643bf215546Sopenharmony_ci BYTE_TO_FLOAT(v[1]), 644bf215546Sopenharmony_ci BYTE_TO_FLOAT(v[2]), 645bf215546Sopenharmony_ci BYTE_TO_FLOAT(v[3]))); 646bf215546Sopenharmony_ci} 647bf215546Sopenharmony_ci 648bf215546Sopenharmony_cistatic void GLAPIENTRY 649bf215546Sopenharmony_ciVertexAttrib4bvARB(GLuint index, const GLbyte *v) 650bf215546Sopenharmony_ci{ 651bf215546Sopenharmony_ci CALL_VertexAttrib4fARB(get_dispatch(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2], (GLfloat)v[3])); 652bf215546Sopenharmony_ci} 653bf215546Sopenharmony_ci 654bf215546Sopenharmony_ci/* GL_UNSIGNED_BYTE attributes */ 655bf215546Sopenharmony_ci 656bf215546Sopenharmony_cistatic void GLAPIENTRY 657bf215546Sopenharmony_ciVertexAttrib1NubvARB(GLuint index, const GLubyte *v) 658bf215546Sopenharmony_ci{ 659bf215546Sopenharmony_ci CALL_VertexAttrib1fARB(get_dispatch(), (index, UBYTE_TO_FLOAT(v[0]))); 660bf215546Sopenharmony_ci} 661bf215546Sopenharmony_ci 662bf215546Sopenharmony_cistatic void GLAPIENTRY 663bf215546Sopenharmony_ciVertexAttrib1ubvARB(GLuint index, const GLubyte *v) 664bf215546Sopenharmony_ci{ 665bf215546Sopenharmony_ci CALL_VertexAttrib1fARB(get_dispatch(), (index, (GLfloat)v[0])); 666bf215546Sopenharmony_ci} 667bf215546Sopenharmony_ci 668bf215546Sopenharmony_cistatic void GLAPIENTRY 669bf215546Sopenharmony_ciVertexAttrib2NubvARB(GLuint index, const GLubyte *v) 670bf215546Sopenharmony_ci{ 671bf215546Sopenharmony_ci CALL_VertexAttrib2fARB(get_dispatch(), (index, 672bf215546Sopenharmony_ci UBYTE_TO_FLOAT(v[0]), 673bf215546Sopenharmony_ci UBYTE_TO_FLOAT(v[1]))); 674bf215546Sopenharmony_ci} 675bf215546Sopenharmony_ci 676bf215546Sopenharmony_cistatic void GLAPIENTRY 677bf215546Sopenharmony_ciVertexAttrib2ubvARB(GLuint index, const GLubyte *v) 678bf215546Sopenharmony_ci{ 679bf215546Sopenharmony_ci CALL_VertexAttrib2fARB(get_dispatch(), (index, 680bf215546Sopenharmony_ci (GLfloat)v[0], (GLfloat)v[1])); 681bf215546Sopenharmony_ci} 682bf215546Sopenharmony_ci 683bf215546Sopenharmony_cistatic void GLAPIENTRY 684bf215546Sopenharmony_ciVertexAttrib3NubvARB(GLuint index, const GLubyte *v) 685bf215546Sopenharmony_ci{ 686bf215546Sopenharmony_ci CALL_VertexAttrib3fARB(get_dispatch(), (index, 687bf215546Sopenharmony_ci UBYTE_TO_FLOAT(v[0]), 688bf215546Sopenharmony_ci UBYTE_TO_FLOAT(v[1]), 689bf215546Sopenharmony_ci UBYTE_TO_FLOAT(v[2]))); 690bf215546Sopenharmony_ci} 691bf215546Sopenharmony_cistatic void GLAPIENTRY 692bf215546Sopenharmony_ciVertexAttrib3ubvARB(GLuint index, const GLubyte *v) 693bf215546Sopenharmony_ci{ 694bf215546Sopenharmony_ci CALL_VertexAttrib3fARB(get_dispatch(), (index, 695bf215546Sopenharmony_ci (GLfloat)v[0], 696bf215546Sopenharmony_ci (GLfloat)v[1], 697bf215546Sopenharmony_ci (GLfloat)v[2])); 698bf215546Sopenharmony_ci} 699bf215546Sopenharmony_ci 700bf215546Sopenharmony_cistatic void GLAPIENTRY 701bf215546Sopenharmony_ciVertexAttrib4NubvARB(GLuint index, const GLubyte *v) 702bf215546Sopenharmony_ci{ 703bf215546Sopenharmony_ci CALL_VertexAttrib4fARB(get_dispatch(), 704bf215546Sopenharmony_ci (index, 705bf215546Sopenharmony_ci UBYTE_TO_FLOAT(v[0]), 706bf215546Sopenharmony_ci UBYTE_TO_FLOAT(v[1]), 707bf215546Sopenharmony_ci UBYTE_TO_FLOAT(v[2]), 708bf215546Sopenharmony_ci UBYTE_TO_FLOAT(v[3]))); 709bf215546Sopenharmony_ci} 710bf215546Sopenharmony_ci 711bf215546Sopenharmony_cistatic void GLAPIENTRY 712bf215546Sopenharmony_ciVertexAttrib4ubvARB(GLuint index, const GLubyte *v) 713bf215546Sopenharmony_ci{ 714bf215546Sopenharmony_ci CALL_VertexAttrib4fARB(get_dispatch(), 715bf215546Sopenharmony_ci (index, 716bf215546Sopenharmony_ci (GLfloat)v[0], (GLfloat)v[1], 717bf215546Sopenharmony_ci (GLfloat)v[2], (GLfloat)v[3])); 718bf215546Sopenharmony_ci} 719bf215546Sopenharmony_ci 720bf215546Sopenharmony_ci/* GL_SHORT attributes */ 721bf215546Sopenharmony_ci 722bf215546Sopenharmony_cistatic void GLAPIENTRY 723bf215546Sopenharmony_ciVertexAttrib1NsvARB(GLuint index, const GLshort *v) 724bf215546Sopenharmony_ci{ 725bf215546Sopenharmony_ci CALL_VertexAttrib1fARB(get_dispatch(), (index, SHORT_TO_FLOAT(v[0]))); 726bf215546Sopenharmony_ci} 727bf215546Sopenharmony_ci 728bf215546Sopenharmony_cistatic void GLAPIENTRY 729bf215546Sopenharmony_ciVertexAttrib1svARB(GLuint index, const GLshort *v) 730bf215546Sopenharmony_ci{ 731bf215546Sopenharmony_ci CALL_VertexAttrib1fARB(get_dispatch(), (index, (GLfloat)v[0])); 732bf215546Sopenharmony_ci} 733bf215546Sopenharmony_ci 734bf215546Sopenharmony_cistatic void GLAPIENTRY 735bf215546Sopenharmony_ciVertexAttrib2NsvARB(GLuint index, const GLshort *v) 736bf215546Sopenharmony_ci{ 737bf215546Sopenharmony_ci CALL_VertexAttrib2fARB(get_dispatch(), 738bf215546Sopenharmony_ci (index, SHORT_TO_FLOAT(v[0]), 739bf215546Sopenharmony_ci SHORT_TO_FLOAT(v[1]))); 740bf215546Sopenharmony_ci} 741bf215546Sopenharmony_ci 742bf215546Sopenharmony_cistatic void GLAPIENTRY 743bf215546Sopenharmony_ciVertexAttrib2svARB(GLuint index, const GLshort *v) 744bf215546Sopenharmony_ci{ 745bf215546Sopenharmony_ci CALL_VertexAttrib2fARB(get_dispatch(), 746bf215546Sopenharmony_ci (index, (GLfloat)v[0], (GLfloat)v[1])); 747bf215546Sopenharmony_ci} 748bf215546Sopenharmony_ci 749bf215546Sopenharmony_cistatic void GLAPIENTRY 750bf215546Sopenharmony_ciVertexAttrib3NsvARB(GLuint index, const GLshort *v) 751bf215546Sopenharmony_ci{ 752bf215546Sopenharmony_ci CALL_VertexAttrib3fARB(get_dispatch(), 753bf215546Sopenharmony_ci (index, 754bf215546Sopenharmony_ci SHORT_TO_FLOAT(v[0]), 755bf215546Sopenharmony_ci SHORT_TO_FLOAT(v[1]), 756bf215546Sopenharmony_ci SHORT_TO_FLOAT(v[2]))); 757bf215546Sopenharmony_ci} 758bf215546Sopenharmony_ci 759bf215546Sopenharmony_cistatic void GLAPIENTRY 760bf215546Sopenharmony_ciVertexAttrib3svARB(GLuint index, const GLshort *v) 761bf215546Sopenharmony_ci{ 762bf215546Sopenharmony_ci CALL_VertexAttrib3fARB(get_dispatch(), 763bf215546Sopenharmony_ci (index, 764bf215546Sopenharmony_ci (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2])); 765bf215546Sopenharmony_ci} 766bf215546Sopenharmony_ci 767bf215546Sopenharmony_cistatic void GLAPIENTRY 768bf215546Sopenharmony_ciVertexAttrib4NsvARB(GLuint index, const GLshort *v) 769bf215546Sopenharmony_ci{ 770bf215546Sopenharmony_ci CALL_VertexAttrib4fARB(get_dispatch(), 771bf215546Sopenharmony_ci (index, 772bf215546Sopenharmony_ci SHORT_TO_FLOAT(v[0]), 773bf215546Sopenharmony_ci SHORT_TO_FLOAT(v[1]), 774bf215546Sopenharmony_ci SHORT_TO_FLOAT(v[2]), 775bf215546Sopenharmony_ci SHORT_TO_FLOAT(v[3]))); 776bf215546Sopenharmony_ci} 777bf215546Sopenharmony_ci 778bf215546Sopenharmony_cistatic void GLAPIENTRY 779bf215546Sopenharmony_ciVertexAttrib4svARB(GLuint index, const GLshort *v) 780bf215546Sopenharmony_ci{ 781bf215546Sopenharmony_ci CALL_VertexAttrib4fARB(get_dispatch(), (index, (GLfloat)v[0], (GLfloat)v[1], 782bf215546Sopenharmony_ci (GLfloat)v[2], (GLfloat)v[3])); 783bf215546Sopenharmony_ci} 784bf215546Sopenharmony_ci 785bf215546Sopenharmony_ci/* GL_UNSIGNED_SHORT attributes */ 786bf215546Sopenharmony_ci 787bf215546Sopenharmony_cistatic void GLAPIENTRY 788bf215546Sopenharmony_ciVertexAttrib1NusvARB(GLuint index, const GLushort *v) 789bf215546Sopenharmony_ci{ 790bf215546Sopenharmony_ci CALL_VertexAttrib1fARB(get_dispatch(), (index, USHORT_TO_FLOAT(v[0]))); 791bf215546Sopenharmony_ci} 792bf215546Sopenharmony_ci 793bf215546Sopenharmony_cistatic void GLAPIENTRY 794bf215546Sopenharmony_ciVertexAttrib1usvARB(GLuint index, const GLushort *v) 795bf215546Sopenharmony_ci{ 796bf215546Sopenharmony_ci CALL_VertexAttrib1fARB(get_dispatch(), (index, (GLfloat)v[0])); 797bf215546Sopenharmony_ci} 798bf215546Sopenharmony_ci 799bf215546Sopenharmony_cistatic void GLAPIENTRY 800bf215546Sopenharmony_ciVertexAttrib2NusvARB(GLuint index, const GLushort *v) 801bf215546Sopenharmony_ci{ 802bf215546Sopenharmony_ci CALL_VertexAttrib2fARB(get_dispatch(), (index, USHORT_TO_FLOAT(v[0]), 803bf215546Sopenharmony_ci USHORT_TO_FLOAT(v[1]))); 804bf215546Sopenharmony_ci} 805bf215546Sopenharmony_ci 806bf215546Sopenharmony_cistatic void GLAPIENTRY 807bf215546Sopenharmony_ciVertexAttrib2usvARB(GLuint index, const GLushort *v) 808bf215546Sopenharmony_ci{ 809bf215546Sopenharmony_ci CALL_VertexAttrib2fARB(get_dispatch(), (index, (GLfloat)v[0], 810bf215546Sopenharmony_ci (GLfloat)v[1])); 811bf215546Sopenharmony_ci} 812bf215546Sopenharmony_ci 813bf215546Sopenharmony_cistatic void GLAPIENTRY 814bf215546Sopenharmony_ciVertexAttrib3NusvARB(GLuint index, const GLushort *v) 815bf215546Sopenharmony_ci{ 816bf215546Sopenharmony_ci CALL_VertexAttrib3fARB(get_dispatch(), (index, USHORT_TO_FLOAT(v[0]), 817bf215546Sopenharmony_ci USHORT_TO_FLOAT(v[1]), 818bf215546Sopenharmony_ci USHORT_TO_FLOAT(v[2]))); 819bf215546Sopenharmony_ci} 820bf215546Sopenharmony_ci 821bf215546Sopenharmony_cistatic void GLAPIENTRY 822bf215546Sopenharmony_ciVertexAttrib3usvARB(GLuint index, const GLushort *v) 823bf215546Sopenharmony_ci{ 824bf215546Sopenharmony_ci CALL_VertexAttrib3fARB(get_dispatch(), (index, (GLfloat)v[0], 825bf215546Sopenharmony_ci (GLfloat)v[1], (GLfloat)v[2])); 826bf215546Sopenharmony_ci} 827bf215546Sopenharmony_ci 828bf215546Sopenharmony_cistatic void GLAPIENTRY 829bf215546Sopenharmony_ciVertexAttrib4NusvARB(GLuint index, const GLushort *v) 830bf215546Sopenharmony_ci{ 831bf215546Sopenharmony_ci CALL_VertexAttrib4fARB(get_dispatch(), (index, USHORT_TO_FLOAT(v[0]), 832bf215546Sopenharmony_ci USHORT_TO_FLOAT(v[1]), 833bf215546Sopenharmony_ci USHORT_TO_FLOAT(v[2]), 834bf215546Sopenharmony_ci USHORT_TO_FLOAT(v[3]))); 835bf215546Sopenharmony_ci} 836bf215546Sopenharmony_ci 837bf215546Sopenharmony_cistatic void GLAPIENTRY 838bf215546Sopenharmony_ciVertexAttrib4usvARB(GLuint index, const GLushort *v) 839bf215546Sopenharmony_ci{ 840bf215546Sopenharmony_ci CALL_VertexAttrib4fARB(get_dispatch(), (index, (GLfloat)v[0], (GLfloat)v[1], (GLfloat)v[2], (GLfloat)v[3])); 841bf215546Sopenharmony_ci} 842bf215546Sopenharmony_ci 843bf215546Sopenharmony_ci/* GL_INT attributes */ 844bf215546Sopenharmony_ci 845bf215546Sopenharmony_cistatic void GLAPIENTRY 846bf215546Sopenharmony_ciVertexAttrib1NivARB(GLuint index, const GLint *v) 847bf215546Sopenharmony_ci{ 848bf215546Sopenharmony_ci CALL_VertexAttrib1fARB(get_dispatch(), (index, INT_TO_FLOAT(v[0]))); 849bf215546Sopenharmony_ci} 850bf215546Sopenharmony_ci 851bf215546Sopenharmony_cistatic void GLAPIENTRY 852bf215546Sopenharmony_ciVertexAttrib1ivARB(GLuint index, const GLint *v) 853bf215546Sopenharmony_ci{ 854bf215546Sopenharmony_ci CALL_VertexAttrib1fARB(get_dispatch(), (index, (GLfloat)v[0])); 855bf215546Sopenharmony_ci} 856bf215546Sopenharmony_ci 857bf215546Sopenharmony_cistatic void GLAPIENTRY 858bf215546Sopenharmony_ciVertexAttrib2NivARB(GLuint index, const GLint *v) 859bf215546Sopenharmony_ci{ 860bf215546Sopenharmony_ci CALL_VertexAttrib2fARB(get_dispatch(), (index, INT_TO_FLOAT(v[0]), 861bf215546Sopenharmony_ci INT_TO_FLOAT(v[1]))); 862bf215546Sopenharmony_ci} 863bf215546Sopenharmony_ci 864bf215546Sopenharmony_cistatic void GLAPIENTRY 865bf215546Sopenharmony_ciVertexAttrib2ivARB(GLuint index, const GLint *v) 866bf215546Sopenharmony_ci{ 867bf215546Sopenharmony_ci CALL_VertexAttrib2fARB(get_dispatch(), (index, (GLfloat)v[0], 868bf215546Sopenharmony_ci (GLfloat)v[1])); 869bf215546Sopenharmony_ci} 870bf215546Sopenharmony_ci 871bf215546Sopenharmony_cistatic void GLAPIENTRY 872bf215546Sopenharmony_ciVertexAttrib3NivARB(GLuint index, const GLint *v) 873bf215546Sopenharmony_ci{ 874bf215546Sopenharmony_ci CALL_VertexAttrib3fARB(get_dispatch(), (index, INT_TO_FLOAT(v[0]), 875bf215546Sopenharmony_ci INT_TO_FLOAT(v[1]), 876bf215546Sopenharmony_ci INT_TO_FLOAT(v[2]))); 877bf215546Sopenharmony_ci} 878bf215546Sopenharmony_ci 879bf215546Sopenharmony_cistatic void GLAPIENTRY 880bf215546Sopenharmony_ciVertexAttrib3ivARB(GLuint index, const GLint *v) 881bf215546Sopenharmony_ci{ 882bf215546Sopenharmony_ci CALL_VertexAttrib3fARB(get_dispatch(), (index, (GLfloat)v[0], 883bf215546Sopenharmony_ci (GLfloat)v[1], (GLfloat)v[2])); 884bf215546Sopenharmony_ci} 885bf215546Sopenharmony_ci 886bf215546Sopenharmony_cistatic void GLAPIENTRY 887bf215546Sopenharmony_ciVertexAttrib4NivARB(GLuint index, const GLint *v) 888bf215546Sopenharmony_ci{ 889bf215546Sopenharmony_ci CALL_VertexAttrib4fARB(get_dispatch(), (index, INT_TO_FLOAT(v[0]), 890bf215546Sopenharmony_ci INT_TO_FLOAT(v[1]), 891bf215546Sopenharmony_ci INT_TO_FLOAT(v[2]), 892bf215546Sopenharmony_ci INT_TO_FLOAT(v[3]))); 893bf215546Sopenharmony_ci} 894bf215546Sopenharmony_ci 895bf215546Sopenharmony_cistatic void GLAPIENTRY 896bf215546Sopenharmony_ciVertexAttrib4ivARB(GLuint index, const GLint *v) 897bf215546Sopenharmony_ci{ 898bf215546Sopenharmony_ci CALL_VertexAttrib4fARB(get_dispatch(), (index, (GLfloat)v[0], (GLfloat)v[1], 899bf215546Sopenharmony_ci (GLfloat)v[2], (GLfloat)v[3])); 900bf215546Sopenharmony_ci} 901bf215546Sopenharmony_ci 902bf215546Sopenharmony_ci/* GL_UNSIGNED_INT attributes */ 903bf215546Sopenharmony_ci 904bf215546Sopenharmony_cistatic void GLAPIENTRY 905bf215546Sopenharmony_ciVertexAttrib1NuivARB(GLuint index, const GLuint *v) 906bf215546Sopenharmony_ci{ 907bf215546Sopenharmony_ci CALL_VertexAttrib1fARB(get_dispatch(), (index, UINT_TO_FLOAT(v[0]))); 908bf215546Sopenharmony_ci} 909bf215546Sopenharmony_ci 910bf215546Sopenharmony_cistatic void GLAPIENTRY 911bf215546Sopenharmony_ciVertexAttrib1uivARB(GLuint index, const GLuint *v) 912bf215546Sopenharmony_ci{ 913bf215546Sopenharmony_ci CALL_VertexAttrib1fARB(get_dispatch(), (index, (GLfloat)v[0])); 914bf215546Sopenharmony_ci} 915bf215546Sopenharmony_ci 916bf215546Sopenharmony_cistatic void GLAPIENTRY 917bf215546Sopenharmony_ciVertexAttrib2NuivARB(GLuint index, const GLuint *v) 918bf215546Sopenharmony_ci{ 919bf215546Sopenharmony_ci CALL_VertexAttrib2fARB(get_dispatch(), (index, UINT_TO_FLOAT(v[0]), 920bf215546Sopenharmony_ci UINT_TO_FLOAT(v[1]))); 921bf215546Sopenharmony_ci} 922bf215546Sopenharmony_ci 923bf215546Sopenharmony_cistatic void GLAPIENTRY 924bf215546Sopenharmony_ciVertexAttrib2uivARB(GLuint index, const GLuint *v) 925bf215546Sopenharmony_ci{ 926bf215546Sopenharmony_ci CALL_VertexAttrib2fARB(get_dispatch(), (index, (GLfloat)v[0], 927bf215546Sopenharmony_ci (GLfloat)v[1])); 928bf215546Sopenharmony_ci} 929bf215546Sopenharmony_ci 930bf215546Sopenharmony_cistatic void GLAPIENTRY 931bf215546Sopenharmony_ciVertexAttrib3NuivARB(GLuint index, const GLuint *v) 932bf215546Sopenharmony_ci{ 933bf215546Sopenharmony_ci CALL_VertexAttrib3fARB(get_dispatch(), (index, UINT_TO_FLOAT(v[0]), 934bf215546Sopenharmony_ci UINT_TO_FLOAT(v[1]), 935bf215546Sopenharmony_ci UINT_TO_FLOAT(v[2]))); 936bf215546Sopenharmony_ci} 937bf215546Sopenharmony_ci 938bf215546Sopenharmony_cistatic void GLAPIENTRY 939bf215546Sopenharmony_ciVertexAttrib3uivARB(GLuint index, const GLuint *v) 940bf215546Sopenharmony_ci{ 941bf215546Sopenharmony_ci CALL_VertexAttrib3fARB(get_dispatch(), (index, (GLfloat)v[0], 942bf215546Sopenharmony_ci (GLfloat)v[1], (GLfloat)v[2])); 943bf215546Sopenharmony_ci} 944bf215546Sopenharmony_ci 945bf215546Sopenharmony_cistatic void GLAPIENTRY 946bf215546Sopenharmony_ciVertexAttrib4NuivARB(GLuint index, const GLuint *v) 947bf215546Sopenharmony_ci{ 948bf215546Sopenharmony_ci CALL_VertexAttrib4fARB(get_dispatch(), (index, UINT_TO_FLOAT(v[0]), 949bf215546Sopenharmony_ci UINT_TO_FLOAT(v[1]), 950bf215546Sopenharmony_ci UINT_TO_FLOAT(v[2]), 951bf215546Sopenharmony_ci UINT_TO_FLOAT(v[3]))); 952bf215546Sopenharmony_ci} 953bf215546Sopenharmony_ci 954bf215546Sopenharmony_cistatic void GLAPIENTRY 955bf215546Sopenharmony_ciVertexAttrib4uivARB(GLuint index, const GLuint *v) 956bf215546Sopenharmony_ci{ 957bf215546Sopenharmony_ci CALL_VertexAttrib4fARB(get_dispatch(), (index, (GLfloat)v[0], (GLfloat)v[1], 958bf215546Sopenharmony_ci (GLfloat)v[2], (GLfloat)v[3])); 959bf215546Sopenharmony_ci} 960bf215546Sopenharmony_ci 961bf215546Sopenharmony_ci/* GL_FLOAT attributes */ 962bf215546Sopenharmony_ci 963bf215546Sopenharmony_cistatic void GLAPIENTRY 964bf215546Sopenharmony_ciVertexAttrib1fvARB(GLuint index, const GLfloat *v) 965bf215546Sopenharmony_ci{ 966bf215546Sopenharmony_ci CALL_VertexAttrib1fvARB(get_dispatch(), (index, v)); 967bf215546Sopenharmony_ci} 968bf215546Sopenharmony_ci 969bf215546Sopenharmony_cistatic void GLAPIENTRY 970bf215546Sopenharmony_ciVertexAttrib2fvARB(GLuint index, const GLfloat *v) 971bf215546Sopenharmony_ci{ 972bf215546Sopenharmony_ci CALL_VertexAttrib2fvARB(get_dispatch(), (index, v)); 973bf215546Sopenharmony_ci} 974bf215546Sopenharmony_ci 975bf215546Sopenharmony_cistatic void GLAPIENTRY 976bf215546Sopenharmony_ciVertexAttrib3fvARB(GLuint index, const GLfloat *v) 977bf215546Sopenharmony_ci{ 978bf215546Sopenharmony_ci CALL_VertexAttrib3fvARB(get_dispatch(), (index, v)); 979bf215546Sopenharmony_ci} 980bf215546Sopenharmony_ci 981bf215546Sopenharmony_cistatic void GLAPIENTRY 982bf215546Sopenharmony_ciVertexAttrib4fvARB(GLuint index, const GLfloat *v) 983bf215546Sopenharmony_ci{ 984bf215546Sopenharmony_ci CALL_VertexAttrib4fvARB(get_dispatch(), (index, v)); 985bf215546Sopenharmony_ci} 986bf215546Sopenharmony_ci 987bf215546Sopenharmony_ci/* GL_DOUBLE attributes */ 988bf215546Sopenharmony_ci 989bf215546Sopenharmony_cistatic void GLAPIENTRY 990bf215546Sopenharmony_ciVertexAttrib1dvARB(GLuint index, const GLdouble *v) 991bf215546Sopenharmony_ci{ 992bf215546Sopenharmony_ci CALL_VertexAttrib1dv(get_dispatch(), (index, v)); 993bf215546Sopenharmony_ci} 994bf215546Sopenharmony_ci 995bf215546Sopenharmony_cistatic void GLAPIENTRY 996bf215546Sopenharmony_ciVertexAttrib2dvARB(GLuint index, const GLdouble *v) 997bf215546Sopenharmony_ci{ 998bf215546Sopenharmony_ci CALL_VertexAttrib2dv(get_dispatch(), (index, v)); 999bf215546Sopenharmony_ci} 1000bf215546Sopenharmony_ci 1001bf215546Sopenharmony_cistatic void GLAPIENTRY 1002bf215546Sopenharmony_ciVertexAttrib3dvARB(GLuint index, const GLdouble *v) 1003bf215546Sopenharmony_ci{ 1004bf215546Sopenharmony_ci CALL_VertexAttrib3dv(get_dispatch(), (index, v)); 1005bf215546Sopenharmony_ci} 1006bf215546Sopenharmony_ci 1007bf215546Sopenharmony_cistatic void GLAPIENTRY 1008bf215546Sopenharmony_ciVertexAttrib4dvARB(GLuint index, const GLdouble *v) 1009bf215546Sopenharmony_ci{ 1010bf215546Sopenharmony_ci CALL_VertexAttrib4dv(get_dispatch(), (index, v)); 1011bf215546Sopenharmony_ci} 1012bf215546Sopenharmony_ci 1013bf215546Sopenharmony_ci 1014bf215546Sopenharmony_ci/** 1015bf215546Sopenharmony_ci * Integer-valued attributes 1016bf215546Sopenharmony_ci */ 1017bf215546Sopenharmony_cistatic void GLAPIENTRY 1018bf215546Sopenharmony_ciVertexAttribI1bv(GLuint index, const GLbyte *v) 1019bf215546Sopenharmony_ci{ 1020bf215546Sopenharmony_ci CALL_VertexAttribI1iEXT(get_dispatch(), (index, v[0])); 1021bf215546Sopenharmony_ci} 1022bf215546Sopenharmony_ci 1023bf215546Sopenharmony_cistatic void GLAPIENTRY 1024bf215546Sopenharmony_ciVertexAttribI2bv(GLuint index, const GLbyte *v) 1025bf215546Sopenharmony_ci{ 1026bf215546Sopenharmony_ci CALL_VertexAttribI2iEXT(get_dispatch(), (index, v[0], v[1])); 1027bf215546Sopenharmony_ci} 1028bf215546Sopenharmony_ci 1029bf215546Sopenharmony_cistatic void GLAPIENTRY 1030bf215546Sopenharmony_ciVertexAttribI3bv(GLuint index, const GLbyte *v) 1031bf215546Sopenharmony_ci{ 1032bf215546Sopenharmony_ci CALL_VertexAttribI3iEXT(get_dispatch(), (index, v[0], v[1], v[2])); 1033bf215546Sopenharmony_ci} 1034bf215546Sopenharmony_ci 1035bf215546Sopenharmony_cistatic void GLAPIENTRY 1036bf215546Sopenharmony_ciVertexAttribI4bv(GLuint index, const GLbyte *v) 1037bf215546Sopenharmony_ci{ 1038bf215546Sopenharmony_ci CALL_VertexAttribI4bv(get_dispatch(), (index, v)); 1039bf215546Sopenharmony_ci} 1040bf215546Sopenharmony_ci 1041bf215546Sopenharmony_ci 1042bf215546Sopenharmony_cistatic void GLAPIENTRY 1043bf215546Sopenharmony_ciVertexAttribI1ubv(GLuint index, const GLubyte *v) 1044bf215546Sopenharmony_ci{ 1045bf215546Sopenharmony_ci CALL_VertexAttribI1uiEXT(get_dispatch(), (index, v[0])); 1046bf215546Sopenharmony_ci} 1047bf215546Sopenharmony_ci 1048bf215546Sopenharmony_cistatic void GLAPIENTRY 1049bf215546Sopenharmony_ciVertexAttribI2ubv(GLuint index, const GLubyte *v) 1050bf215546Sopenharmony_ci{ 1051bf215546Sopenharmony_ci CALL_VertexAttribI2uiEXT(get_dispatch(), (index, v[0], v[1])); 1052bf215546Sopenharmony_ci} 1053bf215546Sopenharmony_ci 1054bf215546Sopenharmony_cistatic void GLAPIENTRY 1055bf215546Sopenharmony_ciVertexAttribI3ubv(GLuint index, const GLubyte *v) 1056bf215546Sopenharmony_ci{ 1057bf215546Sopenharmony_ci CALL_VertexAttribI3uiEXT(get_dispatch(), (index, v[0], v[1], v[2])); 1058bf215546Sopenharmony_ci} 1059bf215546Sopenharmony_ci 1060bf215546Sopenharmony_cistatic void GLAPIENTRY 1061bf215546Sopenharmony_ciVertexAttribI4ubv(GLuint index, const GLubyte *v) 1062bf215546Sopenharmony_ci{ 1063bf215546Sopenharmony_ci CALL_VertexAttribI4ubv(get_dispatch(), (index, v)); 1064bf215546Sopenharmony_ci} 1065bf215546Sopenharmony_ci 1066bf215546Sopenharmony_ci 1067bf215546Sopenharmony_ci 1068bf215546Sopenharmony_cistatic void GLAPIENTRY 1069bf215546Sopenharmony_ciVertexAttribI1sv(GLuint index, const GLshort *v) 1070bf215546Sopenharmony_ci{ 1071bf215546Sopenharmony_ci CALL_VertexAttribI1iEXT(get_dispatch(), (index, v[0])); 1072bf215546Sopenharmony_ci} 1073bf215546Sopenharmony_ci 1074bf215546Sopenharmony_cistatic void GLAPIENTRY 1075bf215546Sopenharmony_ciVertexAttribI2sv(GLuint index, const GLshort *v) 1076bf215546Sopenharmony_ci{ 1077bf215546Sopenharmony_ci CALL_VertexAttribI2iEXT(get_dispatch(), (index, v[0], v[1])); 1078bf215546Sopenharmony_ci} 1079bf215546Sopenharmony_ci 1080bf215546Sopenharmony_cistatic void GLAPIENTRY 1081bf215546Sopenharmony_ciVertexAttribI3sv(GLuint index, const GLshort *v) 1082bf215546Sopenharmony_ci{ 1083bf215546Sopenharmony_ci CALL_VertexAttribI3iEXT(get_dispatch(), (index, v[0], v[1], v[2])); 1084bf215546Sopenharmony_ci} 1085bf215546Sopenharmony_ci 1086bf215546Sopenharmony_cistatic void GLAPIENTRY 1087bf215546Sopenharmony_ciVertexAttribI4sv(GLuint index, const GLshort *v) 1088bf215546Sopenharmony_ci{ 1089bf215546Sopenharmony_ci CALL_VertexAttribI4sv(get_dispatch(), (index, v)); 1090bf215546Sopenharmony_ci} 1091bf215546Sopenharmony_ci 1092bf215546Sopenharmony_ci 1093bf215546Sopenharmony_cistatic void GLAPIENTRY 1094bf215546Sopenharmony_ciVertexAttribI1usv(GLuint index, const GLushort *v) 1095bf215546Sopenharmony_ci{ 1096bf215546Sopenharmony_ci CALL_VertexAttribI1uiEXT(get_dispatch(), (index, v[0])); 1097bf215546Sopenharmony_ci} 1098bf215546Sopenharmony_ci 1099bf215546Sopenharmony_cistatic void GLAPIENTRY 1100bf215546Sopenharmony_ciVertexAttribI2usv(GLuint index, const GLushort *v) 1101bf215546Sopenharmony_ci{ 1102bf215546Sopenharmony_ci CALL_VertexAttribI2uiEXT(get_dispatch(), (index, v[0], v[1])); 1103bf215546Sopenharmony_ci} 1104bf215546Sopenharmony_ci 1105bf215546Sopenharmony_cistatic void GLAPIENTRY 1106bf215546Sopenharmony_ciVertexAttribI3usv(GLuint index, const GLushort *v) 1107bf215546Sopenharmony_ci{ 1108bf215546Sopenharmony_ci CALL_VertexAttribI3uiEXT(get_dispatch(), (index, v[0], v[1], v[2])); 1109bf215546Sopenharmony_ci} 1110bf215546Sopenharmony_ci 1111bf215546Sopenharmony_cistatic void GLAPIENTRY 1112bf215546Sopenharmony_ciVertexAttribI4usv(GLuint index, const GLushort *v) 1113bf215546Sopenharmony_ci{ 1114bf215546Sopenharmony_ci CALL_VertexAttribI4usv(get_dispatch(), (index, v)); 1115bf215546Sopenharmony_ci} 1116bf215546Sopenharmony_ci 1117bf215546Sopenharmony_ci 1118bf215546Sopenharmony_ci 1119bf215546Sopenharmony_cistatic void GLAPIENTRY 1120bf215546Sopenharmony_ciVertexAttribI1iv(GLuint index, const GLint *v) 1121bf215546Sopenharmony_ci{ 1122bf215546Sopenharmony_ci CALL_VertexAttribI1iEXT(get_dispatch(), (index, v[0])); 1123bf215546Sopenharmony_ci} 1124bf215546Sopenharmony_ci 1125bf215546Sopenharmony_cistatic void GLAPIENTRY 1126bf215546Sopenharmony_ciVertexAttribI2iv(GLuint index, const GLint *v) 1127bf215546Sopenharmony_ci{ 1128bf215546Sopenharmony_ci CALL_VertexAttribI2iEXT(get_dispatch(), (index, v[0], v[1])); 1129bf215546Sopenharmony_ci} 1130bf215546Sopenharmony_ci 1131bf215546Sopenharmony_cistatic void GLAPIENTRY 1132bf215546Sopenharmony_ciVertexAttribI3iv(GLuint index, const GLint *v) 1133bf215546Sopenharmony_ci{ 1134bf215546Sopenharmony_ci CALL_VertexAttribI3iEXT(get_dispatch(), (index, v[0], v[1], v[2])); 1135bf215546Sopenharmony_ci} 1136bf215546Sopenharmony_ci 1137bf215546Sopenharmony_cistatic void GLAPIENTRY 1138bf215546Sopenharmony_ciVertexAttribI4iv(GLuint index, const GLint *v) 1139bf215546Sopenharmony_ci{ 1140bf215546Sopenharmony_ci CALL_VertexAttribI4ivEXT(get_dispatch(), (index, v)); 1141bf215546Sopenharmony_ci} 1142bf215546Sopenharmony_ci 1143bf215546Sopenharmony_ci 1144bf215546Sopenharmony_cistatic void GLAPIENTRY 1145bf215546Sopenharmony_ciVertexAttribI1uiv(GLuint index, const GLuint *v) 1146bf215546Sopenharmony_ci{ 1147bf215546Sopenharmony_ci CALL_VertexAttribI1uiEXT(get_dispatch(), (index, v[0])); 1148bf215546Sopenharmony_ci} 1149bf215546Sopenharmony_ci 1150bf215546Sopenharmony_cistatic void GLAPIENTRY 1151bf215546Sopenharmony_ciVertexAttribI2uiv(GLuint index, const GLuint *v) 1152bf215546Sopenharmony_ci{ 1153bf215546Sopenharmony_ci CALL_VertexAttribI2uiEXT(get_dispatch(), (index, v[0], v[1])); 1154bf215546Sopenharmony_ci} 1155bf215546Sopenharmony_ci 1156bf215546Sopenharmony_cistatic void GLAPIENTRY 1157bf215546Sopenharmony_ciVertexAttribI3uiv(GLuint index, const GLuint *v) 1158bf215546Sopenharmony_ci{ 1159bf215546Sopenharmony_ci CALL_VertexAttribI3uiEXT(get_dispatch(), (index, v[0], v[1], v[2])); 1160bf215546Sopenharmony_ci} 1161bf215546Sopenharmony_ci 1162bf215546Sopenharmony_cistatic void GLAPIENTRY 1163bf215546Sopenharmony_ciVertexAttribI4uiv(GLuint index, const GLuint *v) 1164bf215546Sopenharmony_ci{ 1165bf215546Sopenharmony_ci CALL_VertexAttribI4uivEXT(get_dispatch(), (index, v)); 1166bf215546Sopenharmony_ci} 1167bf215546Sopenharmony_ci 1168bf215546Sopenharmony_ci/* GL_DOUBLE unconverted attributes */ 1169bf215546Sopenharmony_ci 1170bf215546Sopenharmony_cistatic void GLAPIENTRY 1171bf215546Sopenharmony_ciVertexAttribL1dv(GLuint index, const GLdouble *v) 1172bf215546Sopenharmony_ci{ 1173bf215546Sopenharmony_ci CALL_VertexAttribL1dv(get_dispatch(), (index, v)); 1174bf215546Sopenharmony_ci} 1175bf215546Sopenharmony_ci 1176bf215546Sopenharmony_cistatic void GLAPIENTRY 1177bf215546Sopenharmony_ciVertexAttribL2dv(GLuint index, const GLdouble *v) 1178bf215546Sopenharmony_ci{ 1179bf215546Sopenharmony_ci CALL_VertexAttribL2dv(get_dispatch(), (index, v)); 1180bf215546Sopenharmony_ci} 1181bf215546Sopenharmony_ci 1182bf215546Sopenharmony_cistatic void GLAPIENTRY 1183bf215546Sopenharmony_ciVertexAttribL3dv(GLuint index, const GLdouble *v) 1184bf215546Sopenharmony_ci{ 1185bf215546Sopenharmony_ci CALL_VertexAttribL3dv(get_dispatch(), (index, v)); 1186bf215546Sopenharmony_ci} 1187bf215546Sopenharmony_ci 1188bf215546Sopenharmony_cistatic void GLAPIENTRY 1189bf215546Sopenharmony_ciVertexAttribL4dv(GLuint index, const GLdouble *v) 1190bf215546Sopenharmony_ci{ 1191bf215546Sopenharmony_ci CALL_VertexAttribL4dv(get_dispatch(), (index, v)); 1192bf215546Sopenharmony_ci} 1193bf215546Sopenharmony_ci 1194bf215546Sopenharmony_ci/* 1195bf215546Sopenharmony_ci * Array [unnormalized/normalized/integer][size][type] of VertexAttrib 1196bf215546Sopenharmony_ci * functions 1197bf215546Sopenharmony_ci */ 1198bf215546Sopenharmony_cistatic const attrib_func AttribFuncsARB[4][4][NUM_TYPES] = { 1199bf215546Sopenharmony_ci { 1200bf215546Sopenharmony_ci /* non-normalized */ 1201bf215546Sopenharmony_ci { 1202bf215546Sopenharmony_ci /* size 1 */ 1203bf215546Sopenharmony_ci (attrib_func) VertexAttrib1bvARB, 1204bf215546Sopenharmony_ci (attrib_func) VertexAttrib1ubvARB, 1205bf215546Sopenharmony_ci (attrib_func) VertexAttrib1svARB, 1206bf215546Sopenharmony_ci (attrib_func) VertexAttrib1usvARB, 1207bf215546Sopenharmony_ci (attrib_func) VertexAttrib1ivARB, 1208bf215546Sopenharmony_ci (attrib_func) VertexAttrib1uivARB, 1209bf215546Sopenharmony_ci (attrib_func) VertexAttrib1fvARB, 1210bf215546Sopenharmony_ci (attrib_func) VertexAttrib1dvARB 1211bf215546Sopenharmony_ci }, 1212bf215546Sopenharmony_ci { 1213bf215546Sopenharmony_ci /* size 2 */ 1214bf215546Sopenharmony_ci (attrib_func) VertexAttrib2bvARB, 1215bf215546Sopenharmony_ci (attrib_func) VertexAttrib2ubvARB, 1216bf215546Sopenharmony_ci (attrib_func) VertexAttrib2svARB, 1217bf215546Sopenharmony_ci (attrib_func) VertexAttrib2usvARB, 1218bf215546Sopenharmony_ci (attrib_func) VertexAttrib2ivARB, 1219bf215546Sopenharmony_ci (attrib_func) VertexAttrib2uivARB, 1220bf215546Sopenharmony_ci (attrib_func) VertexAttrib2fvARB, 1221bf215546Sopenharmony_ci (attrib_func) VertexAttrib2dvARB 1222bf215546Sopenharmony_ci }, 1223bf215546Sopenharmony_ci { 1224bf215546Sopenharmony_ci /* size 3 */ 1225bf215546Sopenharmony_ci (attrib_func) VertexAttrib3bvARB, 1226bf215546Sopenharmony_ci (attrib_func) VertexAttrib3ubvARB, 1227bf215546Sopenharmony_ci (attrib_func) VertexAttrib3svARB, 1228bf215546Sopenharmony_ci (attrib_func) VertexAttrib3usvARB, 1229bf215546Sopenharmony_ci (attrib_func) VertexAttrib3ivARB, 1230bf215546Sopenharmony_ci (attrib_func) VertexAttrib3uivARB, 1231bf215546Sopenharmony_ci (attrib_func) VertexAttrib3fvARB, 1232bf215546Sopenharmony_ci (attrib_func) VertexAttrib3dvARB 1233bf215546Sopenharmony_ci }, 1234bf215546Sopenharmony_ci { 1235bf215546Sopenharmony_ci /* size 4 */ 1236bf215546Sopenharmony_ci (attrib_func) VertexAttrib4bvARB, 1237bf215546Sopenharmony_ci (attrib_func) VertexAttrib4ubvARB, 1238bf215546Sopenharmony_ci (attrib_func) VertexAttrib4svARB, 1239bf215546Sopenharmony_ci (attrib_func) VertexAttrib4usvARB, 1240bf215546Sopenharmony_ci (attrib_func) VertexAttrib4ivARB, 1241bf215546Sopenharmony_ci (attrib_func) VertexAttrib4uivARB, 1242bf215546Sopenharmony_ci (attrib_func) VertexAttrib4fvARB, 1243bf215546Sopenharmony_ci (attrib_func) VertexAttrib4dvARB 1244bf215546Sopenharmony_ci } 1245bf215546Sopenharmony_ci }, 1246bf215546Sopenharmony_ci { 1247bf215546Sopenharmony_ci /* normalized (except for float/double) */ 1248bf215546Sopenharmony_ci { 1249bf215546Sopenharmony_ci /* size 1 */ 1250bf215546Sopenharmony_ci (attrib_func) VertexAttrib1NbvARB, 1251bf215546Sopenharmony_ci (attrib_func) VertexAttrib1NubvARB, 1252bf215546Sopenharmony_ci (attrib_func) VertexAttrib1NsvARB, 1253bf215546Sopenharmony_ci (attrib_func) VertexAttrib1NusvARB, 1254bf215546Sopenharmony_ci (attrib_func) VertexAttrib1NivARB, 1255bf215546Sopenharmony_ci (attrib_func) VertexAttrib1NuivARB, 1256bf215546Sopenharmony_ci (attrib_func) VertexAttrib1fvARB, 1257bf215546Sopenharmony_ci (attrib_func) VertexAttrib1dvARB 1258bf215546Sopenharmony_ci }, 1259bf215546Sopenharmony_ci { 1260bf215546Sopenharmony_ci /* size 2 */ 1261bf215546Sopenharmony_ci (attrib_func) VertexAttrib2NbvARB, 1262bf215546Sopenharmony_ci (attrib_func) VertexAttrib2NubvARB, 1263bf215546Sopenharmony_ci (attrib_func) VertexAttrib2NsvARB, 1264bf215546Sopenharmony_ci (attrib_func) VertexAttrib2NusvARB, 1265bf215546Sopenharmony_ci (attrib_func) VertexAttrib2NivARB, 1266bf215546Sopenharmony_ci (attrib_func) VertexAttrib2NuivARB, 1267bf215546Sopenharmony_ci (attrib_func) VertexAttrib2fvARB, 1268bf215546Sopenharmony_ci (attrib_func) VertexAttrib2dvARB 1269bf215546Sopenharmony_ci }, 1270bf215546Sopenharmony_ci { 1271bf215546Sopenharmony_ci /* size 3 */ 1272bf215546Sopenharmony_ci (attrib_func) VertexAttrib3NbvARB, 1273bf215546Sopenharmony_ci (attrib_func) VertexAttrib3NubvARB, 1274bf215546Sopenharmony_ci (attrib_func) VertexAttrib3NsvARB, 1275bf215546Sopenharmony_ci (attrib_func) VertexAttrib3NusvARB, 1276bf215546Sopenharmony_ci (attrib_func) VertexAttrib3NivARB, 1277bf215546Sopenharmony_ci (attrib_func) VertexAttrib3NuivARB, 1278bf215546Sopenharmony_ci (attrib_func) VertexAttrib3fvARB, 1279bf215546Sopenharmony_ci (attrib_func) VertexAttrib3dvARB 1280bf215546Sopenharmony_ci }, 1281bf215546Sopenharmony_ci { 1282bf215546Sopenharmony_ci /* size 4 */ 1283bf215546Sopenharmony_ci (attrib_func) VertexAttrib4NbvARB, 1284bf215546Sopenharmony_ci (attrib_func) VertexAttrib4NubvARB, 1285bf215546Sopenharmony_ci (attrib_func) VertexAttrib4NsvARB, 1286bf215546Sopenharmony_ci (attrib_func) VertexAttrib4NusvARB, 1287bf215546Sopenharmony_ci (attrib_func) VertexAttrib4NivARB, 1288bf215546Sopenharmony_ci (attrib_func) VertexAttrib4NuivARB, 1289bf215546Sopenharmony_ci (attrib_func) VertexAttrib4fvARB, 1290bf215546Sopenharmony_ci (attrib_func) VertexAttrib4dvARB 1291bf215546Sopenharmony_ci } 1292bf215546Sopenharmony_ci }, 1293bf215546Sopenharmony_ci 1294bf215546Sopenharmony_ci { 1295bf215546Sopenharmony_ci /* integer-valued */ 1296bf215546Sopenharmony_ci { 1297bf215546Sopenharmony_ci /* size 1 */ 1298bf215546Sopenharmony_ci (attrib_func) VertexAttribI1bv, 1299bf215546Sopenharmony_ci (attrib_func) VertexAttribI1ubv, 1300bf215546Sopenharmony_ci (attrib_func) VertexAttribI1sv, 1301bf215546Sopenharmony_ci (attrib_func) VertexAttribI1usv, 1302bf215546Sopenharmony_ci (attrib_func) VertexAttribI1iv, 1303bf215546Sopenharmony_ci (attrib_func) VertexAttribI1uiv, 1304bf215546Sopenharmony_ci NULL, /* GL_FLOAT */ 1305bf215546Sopenharmony_ci NULL /* GL_DOUBLE */ 1306bf215546Sopenharmony_ci }, 1307bf215546Sopenharmony_ci { 1308bf215546Sopenharmony_ci /* size 2 */ 1309bf215546Sopenharmony_ci (attrib_func) VertexAttribI2bv, 1310bf215546Sopenharmony_ci (attrib_func) VertexAttribI2ubv, 1311bf215546Sopenharmony_ci (attrib_func) VertexAttribI2sv, 1312bf215546Sopenharmony_ci (attrib_func) VertexAttribI2usv, 1313bf215546Sopenharmony_ci (attrib_func) VertexAttribI2iv, 1314bf215546Sopenharmony_ci (attrib_func) VertexAttribI2uiv, 1315bf215546Sopenharmony_ci NULL, /* GL_FLOAT */ 1316bf215546Sopenharmony_ci NULL /* GL_DOUBLE */ 1317bf215546Sopenharmony_ci }, 1318bf215546Sopenharmony_ci { 1319bf215546Sopenharmony_ci /* size 3 */ 1320bf215546Sopenharmony_ci (attrib_func) VertexAttribI3bv, 1321bf215546Sopenharmony_ci (attrib_func) VertexAttribI3ubv, 1322bf215546Sopenharmony_ci (attrib_func) VertexAttribI3sv, 1323bf215546Sopenharmony_ci (attrib_func) VertexAttribI3usv, 1324bf215546Sopenharmony_ci (attrib_func) VertexAttribI3iv, 1325bf215546Sopenharmony_ci (attrib_func) VertexAttribI3uiv, 1326bf215546Sopenharmony_ci NULL, /* GL_FLOAT */ 1327bf215546Sopenharmony_ci NULL /* GL_DOUBLE */ 1328bf215546Sopenharmony_ci }, 1329bf215546Sopenharmony_ci { 1330bf215546Sopenharmony_ci /* size 4 */ 1331bf215546Sopenharmony_ci (attrib_func) VertexAttribI4bv, 1332bf215546Sopenharmony_ci (attrib_func) VertexAttribI4ubv, 1333bf215546Sopenharmony_ci (attrib_func) VertexAttribI4sv, 1334bf215546Sopenharmony_ci (attrib_func) VertexAttribI4usv, 1335bf215546Sopenharmony_ci (attrib_func) VertexAttribI4iv, 1336bf215546Sopenharmony_ci (attrib_func) VertexAttribI4uiv, 1337bf215546Sopenharmony_ci NULL, /* GL_FLOAT */ 1338bf215546Sopenharmony_ci NULL /* GL_DOUBLE */ 1339bf215546Sopenharmony_ci } 1340bf215546Sopenharmony_ci }, 1341bf215546Sopenharmony_ci { 1342bf215546Sopenharmony_ci /* double-valued */ 1343bf215546Sopenharmony_ci { 1344bf215546Sopenharmony_ci /* size 1 */ 1345bf215546Sopenharmony_ci NULL, 1346bf215546Sopenharmony_ci NULL, 1347bf215546Sopenharmony_ci NULL, 1348bf215546Sopenharmony_ci NULL, 1349bf215546Sopenharmony_ci NULL, 1350bf215546Sopenharmony_ci NULL, 1351bf215546Sopenharmony_ci NULL, 1352bf215546Sopenharmony_ci (attrib_func) VertexAttribL1dv, 1353bf215546Sopenharmony_ci }, 1354bf215546Sopenharmony_ci { 1355bf215546Sopenharmony_ci /* size 2 */ 1356bf215546Sopenharmony_ci NULL, 1357bf215546Sopenharmony_ci NULL, 1358bf215546Sopenharmony_ci NULL, 1359bf215546Sopenharmony_ci NULL, 1360bf215546Sopenharmony_ci NULL, 1361bf215546Sopenharmony_ci NULL, 1362bf215546Sopenharmony_ci NULL, 1363bf215546Sopenharmony_ci (attrib_func) VertexAttribL2dv, 1364bf215546Sopenharmony_ci }, 1365bf215546Sopenharmony_ci { 1366bf215546Sopenharmony_ci /* size 3 */ 1367bf215546Sopenharmony_ci NULL, 1368bf215546Sopenharmony_ci NULL, 1369bf215546Sopenharmony_ci NULL, 1370bf215546Sopenharmony_ci NULL, 1371bf215546Sopenharmony_ci NULL, 1372bf215546Sopenharmony_ci NULL, 1373bf215546Sopenharmony_ci NULL, 1374bf215546Sopenharmony_ci (attrib_func) VertexAttribL3dv, 1375bf215546Sopenharmony_ci }, 1376bf215546Sopenharmony_ci { 1377bf215546Sopenharmony_ci /* size 4 */ 1378bf215546Sopenharmony_ci NULL, 1379bf215546Sopenharmony_ci NULL, 1380bf215546Sopenharmony_ci NULL, 1381bf215546Sopenharmony_ci NULL, 1382bf215546Sopenharmony_ci NULL, 1383bf215546Sopenharmony_ci NULL, 1384bf215546Sopenharmony_ci NULL, 1385bf215546Sopenharmony_ci (attrib_func) VertexAttribL4dv, 1386bf215546Sopenharmony_ci } 1387bf215546Sopenharmony_ci } 1388bf215546Sopenharmony_ci 1389bf215546Sopenharmony_ci}; 1390bf215546Sopenharmony_ci 1391bf215546Sopenharmony_ci 1392bf215546Sopenharmony_ci/* 1393bf215546Sopenharmony_ci * Return VertexAttrib*NV function pointer matching the provided vertex format. 1394bf215546Sopenharmony_ci */ 1395bf215546Sopenharmony_cistatic inline attrib_func 1396bf215546Sopenharmony_cifunc_nv(const struct gl_vertex_format *vformat) 1397bf215546Sopenharmony_ci{ 1398bf215546Sopenharmony_ci return AttribFuncsNV[vformat->Normalized][vformat->Size-1] 1399bf215546Sopenharmony_ci [TYPE_IDX(vformat->Type)]; 1400bf215546Sopenharmony_ci} 1401bf215546Sopenharmony_ci 1402bf215546Sopenharmony_ci 1403bf215546Sopenharmony_ci/* 1404bf215546Sopenharmony_ci * Return VertexAttrib*ARB function pointer matching the provided vertex format. 1405bf215546Sopenharmony_ci */ 1406bf215546Sopenharmony_cistatic inline attrib_func 1407bf215546Sopenharmony_cifunc_arb(const struct gl_vertex_format *vformat) 1408bf215546Sopenharmony_ci{ 1409bf215546Sopenharmony_ci return AttribFuncsARB[vertex_format_to_index(vformat)][vformat->Size-1] 1410bf215546Sopenharmony_ci [TYPE_IDX(vformat->Type)]; 1411bf215546Sopenharmony_ci} 1412bf215546Sopenharmony_ci 1413bf215546Sopenharmony_ci 1414bf215546Sopenharmony_ci/* 1415bf215546Sopenharmony_ci * Return the address of the array attribute array at elt in the 1416bf215546Sopenharmony_ci * vertex array object vao. 1417bf215546Sopenharmony_ci */ 1418bf215546Sopenharmony_cistatic inline const void * 1419bf215546Sopenharmony_ciattrib_src(const struct gl_vertex_array_object *vao, 1420bf215546Sopenharmony_ci const struct gl_array_attributes *array, GLint elt) 1421bf215546Sopenharmony_ci{ 1422bf215546Sopenharmony_ci const struct gl_vertex_buffer_binding *binding = 1423bf215546Sopenharmony_ci &vao->BufferBinding[array->BufferBindingIndex]; 1424bf215546Sopenharmony_ci const GLubyte *src = _mesa_vertex_attrib_address(array, binding); 1425bf215546Sopenharmony_ci 1426bf215546Sopenharmony_ci if (binding->BufferObj) { 1427bf215546Sopenharmony_ci src = ADD_POINTERS(binding->BufferObj->Mappings[MAP_INTERNAL].Pointer, 1428bf215546Sopenharmony_ci src); 1429bf215546Sopenharmony_ci } 1430bf215546Sopenharmony_ci 1431bf215546Sopenharmony_ci return src + elt * binding->Stride; 1432bf215546Sopenharmony_ci} 1433bf215546Sopenharmony_ci 1434bf215546Sopenharmony_ci 1435bf215546Sopenharmony_civoid 1436bf215546Sopenharmony_ci_mesa_array_element(struct gl_context *ctx, GLint elt) 1437bf215546Sopenharmony_ci{ 1438bf215546Sopenharmony_ci const struct gl_vertex_array_object *vao = ctx->Array.VAO; 1439bf215546Sopenharmony_ci GLbitfield mask; 1440bf215546Sopenharmony_ci 1441bf215546Sopenharmony_ci /* emit conventional arrays elements */ 1442bf215546Sopenharmony_ci mask = (VERT_BIT_FF_ALL & ~VERT_BIT_POS) & vao->Enabled; 1443bf215546Sopenharmony_ci while (mask) { 1444bf215546Sopenharmony_ci const gl_vert_attrib attrib = u_bit_scan(&mask); 1445bf215546Sopenharmony_ci const struct gl_array_attributes *array = &vao->VertexAttrib[attrib]; 1446bf215546Sopenharmony_ci const void *src = attrib_src(vao, array, elt); 1447bf215546Sopenharmony_ci func_nv(&array->Format)(attrib, src); 1448bf215546Sopenharmony_ci } 1449bf215546Sopenharmony_ci 1450bf215546Sopenharmony_ci /* emit generic attribute elements */ 1451bf215546Sopenharmony_ci mask = (VERT_BIT_GENERIC_ALL & ~VERT_BIT_GENERIC0) & vao->Enabled; 1452bf215546Sopenharmony_ci while (mask) { 1453bf215546Sopenharmony_ci const gl_vert_attrib attrib = u_bit_scan(&mask); 1454bf215546Sopenharmony_ci const struct gl_array_attributes *array = &vao->VertexAttrib[attrib]; 1455bf215546Sopenharmony_ci const void *src = attrib_src(vao, array, elt); 1456bf215546Sopenharmony_ci func_arb(&array->Format)(attrib - VERT_ATTRIB_GENERIC0, src); 1457bf215546Sopenharmony_ci } 1458bf215546Sopenharmony_ci 1459bf215546Sopenharmony_ci /* finally, vertex position */ 1460bf215546Sopenharmony_ci if (vao->Enabled & VERT_BIT_GENERIC0) { 1461bf215546Sopenharmony_ci const gl_vert_attrib attrib = VERT_ATTRIB_GENERIC0; 1462bf215546Sopenharmony_ci const struct gl_array_attributes *array = &vao->VertexAttrib[attrib]; 1463bf215546Sopenharmony_ci const void *src = attrib_src(vao, array, elt); 1464bf215546Sopenharmony_ci func_arb(&array->Format)(0, src); 1465bf215546Sopenharmony_ci } else if (vao->Enabled & VERT_BIT_POS) { 1466bf215546Sopenharmony_ci const gl_vert_attrib attrib = VERT_ATTRIB_POS; 1467bf215546Sopenharmony_ci const struct gl_array_attributes *array = &vao->VertexAttrib[attrib]; 1468bf215546Sopenharmony_ci const void *src = attrib_src(vao, array, elt); 1469bf215546Sopenharmony_ci func_nv(&array->Format)(0, src); 1470bf215546Sopenharmony_ci } 1471bf215546Sopenharmony_ci} 1472bf215546Sopenharmony_ci 1473bf215546Sopenharmony_ci 1474bf215546Sopenharmony_ci/** 1475bf215546Sopenharmony_ci * Called via glArrayElement() and glDrawArrays(). 1476bf215546Sopenharmony_ci * Issue the glNormal, glVertex, glColor, glVertexAttrib, etc functions 1477bf215546Sopenharmony_ci * for all enabled vertex arrays (for elt-th element). 1478bf215546Sopenharmony_ci * Note: this may be called during display list construction. 1479bf215546Sopenharmony_ci */ 1480bf215546Sopenharmony_civoid GLAPIENTRY 1481bf215546Sopenharmony_ci_mesa_ArrayElement(GLint elt) 1482bf215546Sopenharmony_ci{ 1483bf215546Sopenharmony_ci GET_CURRENT_CONTEXT(ctx); 1484bf215546Sopenharmony_ci struct gl_vertex_array_object *vao; 1485bf215546Sopenharmony_ci 1486bf215546Sopenharmony_ci /* If PrimitiveRestart is enabled and the index is the RestartIndex 1487bf215546Sopenharmony_ci * then we call PrimitiveRestartNV and return. 1488bf215546Sopenharmony_ci */ 1489bf215546Sopenharmony_ci if (ctx->Array.PrimitiveRestart && (elt == ctx->Array.RestartIndex)) { 1490bf215546Sopenharmony_ci CALL_PrimitiveRestartNV(ctx->CurrentServerDispatch, ()); 1491bf215546Sopenharmony_ci return; 1492bf215546Sopenharmony_ci } 1493bf215546Sopenharmony_ci 1494bf215546Sopenharmony_ci vao = ctx->Array.VAO; 1495bf215546Sopenharmony_ci _mesa_vao_map_arrays(ctx, vao, GL_MAP_READ_BIT); 1496bf215546Sopenharmony_ci 1497bf215546Sopenharmony_ci _mesa_array_element(ctx, elt); 1498bf215546Sopenharmony_ci 1499bf215546Sopenharmony_ci _mesa_vao_unmap_arrays(ctx, vao); 1500bf215546Sopenharmony_ci} 1501