Gareth Hughes | 22144ab | 2001-03-12 00:48:37 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Mesa 3-D graphics library |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 3 | * Version: 6.3 |
Gareth Hughes | 22144ab | 2001-03-12 00:48:37 +0000 | [diff] [blame] | 4 | * |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 5 | * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. |
Gareth Hughes | 22144ab | 2001-03-12 00:48:37 +0000 | [diff] [blame] | 6 | * |
| 7 | * Permission is hereby granted, free of charge, to any person obtaining a |
| 8 | * copy of this software and associated documentation files (the "Software"), |
| 9 | * to deal in the Software without restriction, including without limitation |
| 10 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 11 | * and/or sell copies of the Software, and to permit persons to whom the |
| 12 | * Software is furnished to do so, subject to the following conditions: |
| 13 | * |
| 14 | * The above copyright notice and this permission notice shall be included |
| 15 | * in all copies or substantial portions of the Software. |
| 16 | * |
| 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
| 18 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 20 | * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN |
| 21 | * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 23 | */ |
| 24 | |
Keith Whitwell | fc00cbe | 2001-12-20 15:30:45 +0000 | [diff] [blame] | 25 | /* Author: |
Brian Paul | 05a4b37 | 2002-10-29 20:28:36 +0000 | [diff] [blame] | 26 | * Keith Whitwell <keith@tungstengraphics.com> |
Keith Whitwell | fc00cbe | 2001-12-20 15:30:45 +0000 | [diff] [blame] | 27 | */ |
| 28 | |
Keith Whitwell | cab974c | 2000-12-26 05:09:27 +0000 | [diff] [blame] | 29 | #include "glheader.h" |
Keith Whitwell | 4b7d6f2 | 2001-06-01 22:22:10 +0000 | [diff] [blame] | 30 | #include "api_arrayelt.h" |
Keith Whitwell | cab974c | 2000-12-26 05:09:27 +0000 | [diff] [blame] | 31 | #include "context.h" |
Keith Whitwell | fc00cbe | 2001-12-20 15:30:45 +0000 | [diff] [blame] | 32 | #include "glapi.h" |
Brian Paul | 3c63452 | 2002-10-24 23:57:19 +0000 | [diff] [blame] | 33 | #include "imports.h" |
Keith Whitwell | cab974c | 2000-12-26 05:09:27 +0000 | [diff] [blame] | 34 | #include "macros.h" |
Keith Whitwell | cab974c | 2000-12-26 05:09:27 +0000 | [diff] [blame] | 35 | #include "mtypes.h" |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 36 | #include "glapioffsets.h" |
| 37 | #include "dispatch.h" |
Keith Whitwell | cab974c | 2000-12-26 05:09:27 +0000 | [diff] [blame] | 38 | |
Karl Schultz | b72902e | 2004-01-28 22:24:12 +0000 | [diff] [blame] | 39 | typedef void (GLAPIENTRY *array_func)( const void * ); |
Keith Whitwell | cab974c | 2000-12-26 05:09:27 +0000 | [diff] [blame] | 40 | |
| 41 | typedef struct { |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 42 | const struct gl_client_array *array; |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 43 | int offset; |
Keith Whitwell | 4b7d6f2 | 2001-06-01 22:22:10 +0000 | [diff] [blame] | 44 | } AEarray; |
Keith Whitwell | cab974c | 2000-12-26 05:09:27 +0000 | [diff] [blame] | 45 | |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 46 | typedef void (GLAPIENTRY *attrib_func)( GLuint indx, const void *data ); |
| 47 | |
Keith Whitwell | cab974c | 2000-12-26 05:09:27 +0000 | [diff] [blame] | 48 | typedef struct { |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 49 | const struct gl_client_array *array; |
| 50 | attrib_func func; |
| 51 | GLuint index; |
| 52 | } AEattrib; |
| 53 | |
| 54 | typedef struct { |
Brian Paul | 53ad036 | 2004-02-09 00:24:48 +0000 | [diff] [blame] | 55 | AEarray arrays[32]; |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 56 | AEattrib attribs[VERT_ATTRIB_MAX + 1]; |
Keith Whitwell | cab974c | 2000-12-26 05:09:27 +0000 | [diff] [blame] | 57 | GLuint NewState; |
Keith Whitwell | 4b7d6f2 | 2001-06-01 22:22:10 +0000 | [diff] [blame] | 58 | } AEcontext; |
Keith Whitwell | cab974c | 2000-12-26 05:09:27 +0000 | [diff] [blame] | 59 | |
Keith Whitwell | 4b7d6f2 | 2001-06-01 22:22:10 +0000 | [diff] [blame] | 60 | #define AE_CONTEXT(ctx) ((AEcontext *)(ctx)->aelt_context) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 61 | |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 62 | |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 63 | /* |
| 64 | * Convert GL_BYTE, GL_UNSIGNED_BYTE, .. GL_DOUBLE into an integer |
| 65 | * in the range [0, 7]. Luckily these type tokens are sequentially |
Brian Paul | f2f3350 | 2004-04-23 17:58:06 +0000 | [diff] [blame] | 66 | * numbered in gl.h, except for GL_DOUBLE. |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 67 | */ |
Brian Paul | f2f3350 | 2004-04-23 17:58:06 +0000 | [diff] [blame] | 68 | #define TYPE_IDX(t) ( (t) == GL_DOUBLE ? 7 : (t) & 7 ) |
Keith Whitwell | cab974c | 2000-12-26 05:09:27 +0000 | [diff] [blame] | 69 | |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 70 | static const int ColorFuncs[2][8] = { |
Adam Jackson | 94987be | 2004-10-24 02:05:40 +0000 | [diff] [blame] | 71 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 72 | _gloffset_Color3bv, |
| 73 | _gloffset_Color3ubv, |
| 74 | _gloffset_Color3sv, |
| 75 | _gloffset_Color3usv, |
| 76 | _gloffset_Color3iv, |
| 77 | _gloffset_Color3uiv, |
| 78 | _gloffset_Color3fv, |
| 79 | _gloffset_Color3dv, |
Adam Jackson | 94987be | 2004-10-24 02:05:40 +0000 | [diff] [blame] | 80 | }, |
| 81 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 82 | _gloffset_Color4bv, |
| 83 | _gloffset_Color4ubv, |
| 84 | _gloffset_Color4sv, |
| 85 | _gloffset_Color4usv, |
| 86 | _gloffset_Color4iv, |
| 87 | _gloffset_Color4uiv, |
| 88 | _gloffset_Color4fv, |
| 89 | _gloffset_Color4dv, |
Adam Jackson | 94987be | 2004-10-24 02:05:40 +0000 | [diff] [blame] | 90 | }, |
Brian Paul | 53ad036 | 2004-02-09 00:24:48 +0000 | [diff] [blame] | 91 | }; |
| 92 | |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 93 | static const int VertexFuncs[3][8] = { |
Adam Jackson | 94987be | 2004-10-24 02:05:40 +0000 | [diff] [blame] | 94 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 95 | -1, |
| 96 | -1, |
| 97 | _gloffset_Vertex2sv, |
| 98 | -1, |
| 99 | _gloffset_Vertex2iv, |
| 100 | -1, |
| 101 | _gloffset_Vertex2fv, |
| 102 | _gloffset_Vertex2dv, |
Adam Jackson | 94987be | 2004-10-24 02:05:40 +0000 | [diff] [blame] | 103 | }, |
| 104 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 105 | -1, |
| 106 | -1, |
| 107 | _gloffset_Vertex3sv, |
| 108 | -1, |
| 109 | _gloffset_Vertex3iv, |
| 110 | -1, |
| 111 | _gloffset_Vertex3fv, |
| 112 | _gloffset_Vertex3dv, |
Adam Jackson | 94987be | 2004-10-24 02:05:40 +0000 | [diff] [blame] | 113 | }, |
| 114 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 115 | -1, |
| 116 | -1, |
| 117 | _gloffset_Vertex4sv, |
| 118 | -1, |
| 119 | _gloffset_Vertex4iv, |
| 120 | -1, |
| 121 | _gloffset_Vertex4fv, |
| 122 | _gloffset_Vertex4dv, |
Adam Jackson | 94987be | 2004-10-24 02:05:40 +0000 | [diff] [blame] | 123 | }, |
Brian Paul | 53ad036 | 2004-02-09 00:24:48 +0000 | [diff] [blame] | 124 | }; |
| 125 | |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 126 | static const int IndexFuncs[8] = { |
| 127 | -1, |
| 128 | _gloffset_Indexubv, |
| 129 | _gloffset_Indexsv, |
| 130 | -1, |
| 131 | _gloffset_Indexiv, |
| 132 | -1, |
| 133 | _gloffset_Indexfv, |
| 134 | _gloffset_Indexdv, |
Keith Whitwell | cab974c | 2000-12-26 05:09:27 +0000 | [diff] [blame] | 135 | }; |
| 136 | |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 137 | static const int NormalFuncs[8] = { |
| 138 | _gloffset_Normal3bv, |
| 139 | -1, |
| 140 | _gloffset_Normal3sv, |
| 141 | -1, |
| 142 | _gloffset_Normal3iv, |
| 143 | -1, |
| 144 | _gloffset_Normal3fv, |
| 145 | _gloffset_Normal3dv, |
Adam Jackson | 94987be | 2004-10-24 02:05:40 +0000 | [diff] [blame] | 146 | }; |
Brian Paul | 53ad036 | 2004-02-09 00:24:48 +0000 | [diff] [blame] | 147 | |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 148 | static const int SecondaryColorFuncs[8] = { |
| 149 | _gloffset_SecondaryColor3bvEXT, |
| 150 | _gloffset_SecondaryColor3ubvEXT, |
| 151 | _gloffset_SecondaryColor3svEXT, |
| 152 | _gloffset_SecondaryColor3usvEXT, |
| 153 | _gloffset_SecondaryColor3ivEXT, |
| 154 | _gloffset_SecondaryColor3uivEXT, |
| 155 | _gloffset_SecondaryColor3fvEXT, |
| 156 | _gloffset_SecondaryColor3dvEXT, |
Brian Paul | 53ad036 | 2004-02-09 00:24:48 +0000 | [diff] [blame] | 157 | }; |
| 158 | |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 159 | static const int FogCoordFuncs[8] = { |
| 160 | -1, |
| 161 | -1, |
| 162 | -1, |
| 163 | -1, |
| 164 | -1, |
| 165 | -1, |
| 166 | _gloffset_FogCoordfvEXT, |
| 167 | _gloffset_FogCoorddvEXT |
Brian Paul | 53ad036 | 2004-02-09 00:24:48 +0000 | [diff] [blame] | 168 | }; |
| 169 | |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 170 | /**********************************************************************/ |
| 171 | |
| 172 | /* GL_BYTE attributes */ |
| 173 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 174 | static void GLAPIENTRY VertexAttrib1NbvNV(GLuint index, const GLbyte *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 175 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 176 | CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, BYTE_TO_FLOAT(v[0]))); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 177 | } |
| 178 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 179 | static void GLAPIENTRY VertexAttrib1bvNV(GLuint index, const GLbyte *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 180 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 181 | CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, v[0])); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 182 | } |
| 183 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 184 | static void GLAPIENTRY VertexAttrib2NbvNV(GLuint index, const GLbyte *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 185 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 186 | CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, BYTE_TO_FLOAT(v[0]), BYTE_TO_FLOAT(v[1]))); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 187 | } |
| 188 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 189 | static void GLAPIENTRY VertexAttrib2bvNV(GLuint index, const GLbyte *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 190 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 191 | CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, v[0], v[1])); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 192 | } |
| 193 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 194 | static void GLAPIENTRY VertexAttrib3NbvNV(GLuint index, const GLbyte *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 195 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 196 | CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, BYTE_TO_FLOAT(v[0]), |
| 197 | BYTE_TO_FLOAT(v[1]), |
| 198 | BYTE_TO_FLOAT(v[2]))); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 199 | } |
| 200 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 201 | static void GLAPIENTRY VertexAttrib3bvNV(GLuint index, const GLbyte *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 202 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 203 | CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, v[0], v[1], v[2])); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 204 | } |
| 205 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 206 | static void GLAPIENTRY VertexAttrib4NbvNV(GLuint index, const GLbyte *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 207 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 208 | CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, BYTE_TO_FLOAT(v[0]), |
| 209 | BYTE_TO_FLOAT(v[1]), |
| 210 | BYTE_TO_FLOAT(v[2]), |
| 211 | BYTE_TO_FLOAT(v[3]))); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 212 | } |
| 213 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 214 | static void GLAPIENTRY VertexAttrib4bvNV(GLuint index, const GLbyte *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 215 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 216 | CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, v[0], v[1], v[2], v[3])); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 217 | } |
| 218 | |
| 219 | /* GL_UNSIGNED_BYTE attributes */ |
| 220 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 221 | static void GLAPIENTRY VertexAttrib1NubvNV(GLuint index, const GLubyte *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 222 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 223 | CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, UBYTE_TO_FLOAT(v[0]))); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 224 | } |
| 225 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 226 | static void GLAPIENTRY VertexAttrib1ubvNV(GLuint index, const GLubyte *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 227 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 228 | CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, v[0])); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 229 | } |
| 230 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 231 | static void GLAPIENTRY VertexAttrib2NubvNV(GLuint index, const GLubyte *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 232 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 233 | CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, UBYTE_TO_FLOAT(v[0]), |
| 234 | UBYTE_TO_FLOAT(v[1]))); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 235 | } |
| 236 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 237 | static void GLAPIENTRY VertexAttrib2ubvNV(GLuint index, const GLubyte *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 238 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 239 | CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, v[0], v[1])); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 240 | } |
| 241 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 242 | static void GLAPIENTRY VertexAttrib3NubvNV(GLuint index, const GLubyte *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 243 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 244 | CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, UBYTE_TO_FLOAT(v[0]), |
| 245 | UBYTE_TO_FLOAT(v[1]), |
| 246 | UBYTE_TO_FLOAT(v[2]))); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 247 | } |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 248 | static void GLAPIENTRY VertexAttrib3ubvNV(GLuint index, const GLubyte *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 249 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 250 | CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, v[0], v[1], v[2])); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 251 | } |
| 252 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 253 | static void GLAPIENTRY VertexAttrib4NubvNV(GLuint index, const GLubyte *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 254 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 255 | CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, UBYTE_TO_FLOAT(v[0]), |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 256 | UBYTE_TO_FLOAT(v[1]), |
| 257 | UBYTE_TO_FLOAT(v[2]), |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 258 | UBYTE_TO_FLOAT(v[3]))); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 259 | } |
| 260 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 261 | static void GLAPIENTRY VertexAttrib4ubvNV(GLuint index, const GLubyte *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 262 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 263 | CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, v[0], v[1], v[2], v[3])); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 264 | } |
| 265 | |
| 266 | /* GL_SHORT attributes */ |
| 267 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 268 | static void GLAPIENTRY VertexAttrib1NsvNV(GLuint index, const GLshort *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 269 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 270 | CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, SHORT_TO_FLOAT(v[0]))); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 271 | } |
| 272 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 273 | static void GLAPIENTRY VertexAttrib1svNV(GLuint index, const GLshort *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 274 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 275 | CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, v[0])); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 276 | } |
| 277 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 278 | static void GLAPIENTRY VertexAttrib2NsvNV(GLuint index, const GLshort *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 279 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 280 | CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, SHORT_TO_FLOAT(v[0]), |
| 281 | SHORT_TO_FLOAT(v[1]))); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 282 | } |
| 283 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 284 | static void GLAPIENTRY VertexAttrib2svNV(GLuint index, const GLshort *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 285 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 286 | CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, v[0], v[1])); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 287 | } |
| 288 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 289 | static void GLAPIENTRY VertexAttrib3NsvNV(GLuint index, const GLshort *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 290 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 291 | CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, SHORT_TO_FLOAT(v[0]), |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 292 | SHORT_TO_FLOAT(v[1]), |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 293 | SHORT_TO_FLOAT(v[2]))); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 294 | } |
| 295 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 296 | static void GLAPIENTRY VertexAttrib3svNV(GLuint index, const GLshort *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 297 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 298 | CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, v[0], v[1], v[2])); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 299 | } |
| 300 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 301 | static void GLAPIENTRY VertexAttrib4NsvNV(GLuint index, const GLshort *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 302 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 303 | CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, SHORT_TO_FLOAT(v[0]), |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 304 | SHORT_TO_FLOAT(v[1]), |
| 305 | SHORT_TO_FLOAT(v[2]), |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 306 | SHORT_TO_FLOAT(v[3]))); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 307 | } |
| 308 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 309 | static void GLAPIENTRY VertexAttrib4svNV(GLuint index, const GLshort *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 310 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 311 | CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, v[0], v[1], v[2], v[3])); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 312 | } |
| 313 | |
| 314 | /* GL_UNSIGNED_SHORT attributes */ |
| 315 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 316 | static void GLAPIENTRY VertexAttrib1NusvNV(GLuint index, const GLushort *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 317 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 318 | CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, USHORT_TO_FLOAT(v[0]))); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 319 | } |
| 320 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 321 | static void GLAPIENTRY VertexAttrib1usvNV(GLuint index, const GLushort *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 322 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 323 | CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, v[0])); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 324 | } |
| 325 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 326 | static void GLAPIENTRY VertexAttrib2NusvNV(GLuint index, const GLushort *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 327 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 328 | CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, USHORT_TO_FLOAT(v[0]), |
| 329 | USHORT_TO_FLOAT(v[1]))); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 330 | } |
| 331 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 332 | static void GLAPIENTRY VertexAttrib2usvNV(GLuint index, const GLushort *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 333 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 334 | CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, v[0], v[1])); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 335 | } |
| 336 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 337 | static void GLAPIENTRY VertexAttrib3NusvNV(GLuint index, const GLushort *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 338 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 339 | CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, USHORT_TO_FLOAT(v[0]), |
| 340 | USHORT_TO_FLOAT(v[1]), |
| 341 | USHORT_TO_FLOAT(v[2]))); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 342 | } |
| 343 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 344 | static void GLAPIENTRY VertexAttrib3usvNV(GLuint index, const GLushort *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 345 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 346 | CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, v[0], v[1], v[2])); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 347 | } |
| 348 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 349 | static void GLAPIENTRY VertexAttrib4NusvNV(GLuint index, const GLushort *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 350 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 351 | CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, USHORT_TO_FLOAT(v[0]), |
| 352 | USHORT_TO_FLOAT(v[1]), |
| 353 | USHORT_TO_FLOAT(v[2]), |
| 354 | USHORT_TO_FLOAT(v[3]))); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 355 | } |
| 356 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 357 | static void GLAPIENTRY VertexAttrib4usvNV(GLuint index, const GLushort *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 358 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 359 | CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, v[0], v[1], v[2], v[3])); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 360 | } |
| 361 | |
| 362 | /* GL_INT attributes */ |
| 363 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 364 | static void GLAPIENTRY VertexAttrib1NivNV(GLuint index, const GLint *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 365 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 366 | CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, INT_TO_FLOAT(v[0]))); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 367 | } |
| 368 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 369 | static void GLAPIENTRY VertexAttrib1ivNV(GLuint index, const GLint *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 370 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 371 | CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, v[0])); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 372 | } |
| 373 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 374 | static void GLAPIENTRY VertexAttrib2NivNV(GLuint index, const GLint *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 375 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 376 | CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, INT_TO_FLOAT(v[0]), |
| 377 | INT_TO_FLOAT(v[1]))); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 378 | } |
| 379 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 380 | static void GLAPIENTRY VertexAttrib2ivNV(GLuint index, const GLint *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 381 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 382 | CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, v[0], v[1])); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 383 | } |
| 384 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 385 | static void GLAPIENTRY VertexAttrib3NivNV(GLuint index, const GLint *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 386 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 387 | CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, INT_TO_FLOAT(v[0]), |
| 388 | INT_TO_FLOAT(v[1]), |
| 389 | INT_TO_FLOAT(v[2]))); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 390 | } |
| 391 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 392 | static void GLAPIENTRY VertexAttrib3ivNV(GLuint index, const GLint *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 393 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 394 | CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, v[0], v[1], v[2])); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 395 | } |
| 396 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 397 | static void GLAPIENTRY VertexAttrib4NivNV(GLuint index, const GLint *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 398 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 399 | CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, INT_TO_FLOAT(v[0]), |
| 400 | INT_TO_FLOAT(v[1]), |
| 401 | INT_TO_FLOAT(v[2]), |
| 402 | INT_TO_FLOAT(v[3]))); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 403 | } |
| 404 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 405 | static void GLAPIENTRY VertexAttrib4ivNV(GLuint index, const GLint *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 406 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 407 | CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, v[0], v[1], v[2], v[3])); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 408 | } |
| 409 | |
| 410 | /* GL_UNSIGNED_INT attributes */ |
| 411 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 412 | static void GLAPIENTRY VertexAttrib1NuivNV(GLuint index, const GLuint *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 413 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 414 | CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, UINT_TO_FLOAT(v[0]))); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 415 | } |
| 416 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 417 | static void GLAPIENTRY VertexAttrib1uivNV(GLuint index, const GLuint *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 418 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 419 | CALL_VertexAttrib1fNV(GET_DISPATCH(), (index, v[0])); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 420 | } |
| 421 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 422 | static void GLAPIENTRY VertexAttrib2NuivNV(GLuint index, const GLuint *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 423 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 424 | CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, UINT_TO_FLOAT(v[0]), |
| 425 | UINT_TO_FLOAT(v[1]))); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 426 | } |
| 427 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 428 | static void GLAPIENTRY VertexAttrib2uivNV(GLuint index, const GLuint *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 429 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 430 | CALL_VertexAttrib2fNV(GET_DISPATCH(), (index, v[0], v[1])); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 431 | } |
| 432 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 433 | static void GLAPIENTRY VertexAttrib3NuivNV(GLuint index, const GLuint *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 434 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 435 | CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, UINT_TO_FLOAT(v[0]), |
| 436 | UINT_TO_FLOAT(v[1]), |
| 437 | UINT_TO_FLOAT(v[2]))); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 438 | } |
| 439 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 440 | static void GLAPIENTRY VertexAttrib3uivNV(GLuint index, const GLuint *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 441 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 442 | CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, v[0], v[1], v[2])); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 443 | } |
| 444 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 445 | static void GLAPIENTRY VertexAttrib4NuivNV(GLuint index, const GLuint *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 446 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 447 | CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, UINT_TO_FLOAT(v[0]), |
| 448 | UINT_TO_FLOAT(v[1]), |
| 449 | UINT_TO_FLOAT(v[2]), |
| 450 | UINT_TO_FLOAT(v[3]))); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 451 | } |
| 452 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 453 | static void GLAPIENTRY VertexAttrib4uivNV(GLuint index, const GLuint *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 454 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 455 | CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, v[0], v[1], v[2], v[3])); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 456 | } |
| 457 | |
| 458 | /* GL_FLOAT attributes */ |
| 459 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 460 | static void GLAPIENTRY VertexAttrib1fvNV(GLuint index, const GLfloat *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 461 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 462 | CALL_VertexAttrib1fvNV(GET_DISPATCH(), (index, v)); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 463 | } |
| 464 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 465 | static void GLAPIENTRY VertexAttrib2fvNV(GLuint index, const GLfloat *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 466 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 467 | CALL_VertexAttrib2fvNV(GET_DISPATCH(), (index, v)); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 468 | } |
| 469 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 470 | static void GLAPIENTRY VertexAttrib3fvNV(GLuint index, const GLfloat *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 471 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 472 | CALL_VertexAttrib3fvNV(GET_DISPATCH(), (index, v)); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 473 | } |
| 474 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 475 | static void GLAPIENTRY VertexAttrib4fvNV(GLuint index, const GLfloat *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 476 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 477 | CALL_VertexAttrib4fvNV(GET_DISPATCH(), (index, v)); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 478 | } |
| 479 | |
| 480 | /* GL_DOUBLE attributes */ |
| 481 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 482 | static void GLAPIENTRY VertexAttrib1dvNV(GLuint index, const GLdouble *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 483 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 484 | CALL_VertexAttrib1dvNV(GET_DISPATCH(), (index, v)); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 485 | } |
| 486 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 487 | static void GLAPIENTRY VertexAttrib2dvNV(GLuint index, const GLdouble *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 488 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 489 | CALL_VertexAttrib2dvNV(GET_DISPATCH(), (index, v)); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 490 | } |
| 491 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 492 | static void GLAPIENTRY VertexAttrib3dvNV(GLuint index, const GLdouble *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 493 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 494 | CALL_VertexAttrib3dvNV(GET_DISPATCH(), (index, v)); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 495 | } |
| 496 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 497 | static void GLAPIENTRY VertexAttrib4dvNV(GLuint index, const GLdouble *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 498 | { |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 499 | CALL_VertexAttrib4dvNV(GET_DISPATCH(), (index, v)); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 500 | } |
| 501 | |
| 502 | |
| 503 | /* |
| 504 | * Array [size][type] of VertexAttrib functions |
| 505 | */ |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 506 | static attrib_func AttribFuncsNV[2][4][8] = { |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 507 | { |
| 508 | /* non-normalized */ |
| 509 | { |
| 510 | /* size 1 */ |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 511 | (attrib_func) VertexAttrib1bvNV, |
| 512 | (attrib_func) VertexAttrib1ubvNV, |
| 513 | (attrib_func) VertexAttrib1svNV, |
| 514 | (attrib_func) VertexAttrib1usvNV, |
| 515 | (attrib_func) VertexAttrib1ivNV, |
| 516 | (attrib_func) VertexAttrib1uivNV, |
| 517 | (attrib_func) VertexAttrib1fvNV, |
| 518 | (attrib_func) VertexAttrib1dvNV |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 519 | }, |
| 520 | { |
| 521 | /* size 2 */ |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 522 | (attrib_func) VertexAttrib2bvNV, |
| 523 | (attrib_func) VertexAttrib2ubvNV, |
| 524 | (attrib_func) VertexAttrib2svNV, |
| 525 | (attrib_func) VertexAttrib2usvNV, |
| 526 | (attrib_func) VertexAttrib2ivNV, |
| 527 | (attrib_func) VertexAttrib2uivNV, |
| 528 | (attrib_func) VertexAttrib2fvNV, |
| 529 | (attrib_func) VertexAttrib2dvNV |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 530 | }, |
| 531 | { |
| 532 | /* size 3 */ |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 533 | (attrib_func) VertexAttrib3bvNV, |
| 534 | (attrib_func) VertexAttrib3ubvNV, |
| 535 | (attrib_func) VertexAttrib3svNV, |
| 536 | (attrib_func) VertexAttrib3usvNV, |
| 537 | (attrib_func) VertexAttrib3ivNV, |
| 538 | (attrib_func) VertexAttrib3uivNV, |
| 539 | (attrib_func) VertexAttrib3fvNV, |
| 540 | (attrib_func) VertexAttrib3dvNV |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 541 | }, |
| 542 | { |
| 543 | /* size 4 */ |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 544 | (attrib_func) VertexAttrib4bvNV, |
| 545 | (attrib_func) VertexAttrib4ubvNV, |
| 546 | (attrib_func) VertexAttrib4svNV, |
| 547 | (attrib_func) VertexAttrib4usvNV, |
| 548 | (attrib_func) VertexAttrib4ivNV, |
| 549 | (attrib_func) VertexAttrib4uivNV, |
| 550 | (attrib_func) VertexAttrib4fvNV, |
| 551 | (attrib_func) VertexAttrib4dvNV |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 552 | } |
| 553 | }, |
| 554 | { |
| 555 | /* normalized (except for float/double) */ |
| 556 | { |
| 557 | /* size 1 */ |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 558 | (attrib_func) VertexAttrib1NbvNV, |
| 559 | (attrib_func) VertexAttrib1NubvNV, |
| 560 | (attrib_func) VertexAttrib1NsvNV, |
| 561 | (attrib_func) VertexAttrib1NusvNV, |
| 562 | (attrib_func) VertexAttrib1NivNV, |
| 563 | (attrib_func) VertexAttrib1NuivNV, |
| 564 | (attrib_func) VertexAttrib1fvNV, |
| 565 | (attrib_func) VertexAttrib1dvNV |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 566 | }, |
| 567 | { |
| 568 | /* size 2 */ |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 569 | (attrib_func) VertexAttrib2NbvNV, |
| 570 | (attrib_func) VertexAttrib2NubvNV, |
| 571 | (attrib_func) VertexAttrib2NsvNV, |
| 572 | (attrib_func) VertexAttrib2NusvNV, |
| 573 | (attrib_func) VertexAttrib2NivNV, |
| 574 | (attrib_func) VertexAttrib2NuivNV, |
| 575 | (attrib_func) VertexAttrib2fvNV, |
| 576 | (attrib_func) VertexAttrib2dvNV |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 577 | }, |
| 578 | { |
| 579 | /* size 3 */ |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 580 | (attrib_func) VertexAttrib3NbvNV, |
| 581 | (attrib_func) VertexAttrib3NubvNV, |
| 582 | (attrib_func) VertexAttrib3NsvNV, |
| 583 | (attrib_func) VertexAttrib3NusvNV, |
| 584 | (attrib_func) VertexAttrib3NivNV, |
| 585 | (attrib_func) VertexAttrib3NuivNV, |
| 586 | (attrib_func) VertexAttrib3fvNV, |
| 587 | (attrib_func) VertexAttrib3dvNV |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 588 | }, |
| 589 | { |
| 590 | /* size 4 */ |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 591 | (attrib_func) VertexAttrib4NbvNV, |
| 592 | (attrib_func) VertexAttrib4NubvNV, |
| 593 | (attrib_func) VertexAttrib4NsvNV, |
| 594 | (attrib_func) VertexAttrib4NusvNV, |
| 595 | (attrib_func) VertexAttrib4NivNV, |
| 596 | (attrib_func) VertexAttrib4NuivNV, |
| 597 | (attrib_func) VertexAttrib4fvNV, |
| 598 | (attrib_func) VertexAttrib4dvNV |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 599 | } |
| 600 | } |
| 601 | }; |
| 602 | |
| 603 | /**********************************************************************/ |
| 604 | |
Keith Whitwell | 4b7d6f2 | 2001-06-01 22:22:10 +0000 | [diff] [blame] | 605 | |
| 606 | GLboolean _ae_create_context( GLcontext *ctx ) |
Keith Whitwell | cab974c | 2000-12-26 05:09:27 +0000 | [diff] [blame] | 607 | { |
Keith Whitwell | ae0eaf9 | 2003-11-24 15:23:18 +0000 | [diff] [blame] | 608 | if (ctx->aelt_context) |
| 609 | return GL_TRUE; |
| 610 | |
Keith Whitwell | 4b7d6f2 | 2001-06-01 22:22:10 +0000 | [diff] [blame] | 611 | ctx->aelt_context = MALLOC( sizeof(AEcontext) ); |
Gareth Hughes | 1fb0a43 | 2001-12-28 06:28:10 +0000 | [diff] [blame] | 612 | if (!ctx->aelt_context) |
Keith Whitwell | 4b7d6f2 | 2001-06-01 22:22:10 +0000 | [diff] [blame] | 613 | return GL_FALSE; |
| 614 | |
| 615 | AE_CONTEXT(ctx)->NewState = ~0; |
| 616 | return GL_TRUE; |
Keith Whitwell | cab974c | 2000-12-26 05:09:27 +0000 | [diff] [blame] | 617 | } |
| 618 | |
Keith Whitwell | 4b7d6f2 | 2001-06-01 22:22:10 +0000 | [diff] [blame] | 619 | |
| 620 | void _ae_destroy_context( GLcontext *ctx ) |
Keith Whitwell | cab974c | 2000-12-26 05:09:27 +0000 | [diff] [blame] | 621 | { |
Keith Whitwell | 4b7d6f2 | 2001-06-01 22:22:10 +0000 | [diff] [blame] | 622 | if ( AE_CONTEXT( ctx ) ) { |
| 623 | FREE( ctx->aelt_context ); |
Keith Whitwell | a0c8524 | 2005-02-11 09:34:05 +0000 | [diff] [blame] | 624 | ctx->aelt_context = NULL; |
Keith Whitwell | 4b7d6f2 | 2001-06-01 22:22:10 +0000 | [diff] [blame] | 625 | } |
| 626 | } |
| 627 | |
| 628 | |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 629 | /** |
| 630 | * Make a list of per-vertex functions to call for each glArrayElement call. |
Brian Paul | 1e3d868 | 2004-02-24 02:49:43 +0000 | [diff] [blame] | 631 | * These functions access the array data (i.e. glVertex, glColor, glNormal, |
| 632 | * etc). |
| 633 | * Note: this may be called during display list construction. |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 634 | */ |
Keith Whitwell | 4b7d6f2 | 2001-06-01 22:22:10 +0000 | [diff] [blame] | 635 | static void _ae_update_state( GLcontext *ctx ) |
| 636 | { |
| 637 | AEcontext *actx = AE_CONTEXT(ctx); |
Keith Whitwell | 4b7d6f2 | 2001-06-01 22:22:10 +0000 | [diff] [blame] | 638 | AEarray *aa = actx->arrays; |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 639 | AEattrib *at = actx->attribs; |
Brian Paul | db07de0 | 2002-04-19 00:23:08 +0000 | [diff] [blame] | 640 | GLuint i; |
Keith Whitwell | cab974c | 2000-12-26 05:09:27 +0000 | [diff] [blame] | 641 | |
Brian Paul | 1e3d868 | 2004-02-24 02:49:43 +0000 | [diff] [blame] | 642 | /* conventional vertex arrays */ |
| 643 | if (ctx->Array.Index.Enabled) { |
Keith Whitwell | cab974c | 2000-12-26 05:09:27 +0000 | [diff] [blame] | 644 | aa->array = &ctx->Array.Index; |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 645 | aa->offset = IndexFuncs[TYPE_IDX(aa->array->Type)]; |
Keith Whitwell | cab974c | 2000-12-26 05:09:27 +0000 | [diff] [blame] | 646 | aa++; |
| 647 | } |
Keith Whitwell | cab974c | 2000-12-26 05:09:27 +0000 | [diff] [blame] | 648 | if (ctx->Array.EdgeFlag.Enabled) { |
Keith Whitwell | 4b7d6f2 | 2001-06-01 22:22:10 +0000 | [diff] [blame] | 649 | aa->array = &ctx->Array.EdgeFlag; |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 650 | aa->offset = _gloffset_EdgeFlagv; |
Keith Whitwell | cab974c | 2000-12-26 05:09:27 +0000 | [diff] [blame] | 651 | aa++; |
| 652 | } |
Brian Paul | 1e3d868 | 2004-02-24 02:49:43 +0000 | [diff] [blame] | 653 | if (ctx->Array.Normal.Enabled) { |
| 654 | aa->array = &ctx->Array.Normal; |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 655 | aa->offset = NormalFuncs[TYPE_IDX(aa->array->Type)]; |
Brian Paul | 1e3d868 | 2004-02-24 02:49:43 +0000 | [diff] [blame] | 656 | aa++; |
| 657 | } |
| 658 | if (ctx->Array.Color.Enabled) { |
| 659 | aa->array = &ctx->Array.Color; |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 660 | aa->offset = ColorFuncs[aa->array->Size-3][TYPE_IDX(aa->array->Type)]; |
Brian Paul | 1e3d868 | 2004-02-24 02:49:43 +0000 | [diff] [blame] | 661 | aa++; |
| 662 | } |
| 663 | if (ctx->Array.SecondaryColor.Enabled) { |
| 664 | aa->array = &ctx->Array.SecondaryColor; |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 665 | aa->offset = SecondaryColorFuncs[TYPE_IDX(aa->array->Type)]; |
Brian Paul | 1e3d868 | 2004-02-24 02:49:43 +0000 | [diff] [blame] | 666 | aa++; |
| 667 | } |
| 668 | if (ctx->Array.FogCoord.Enabled) { |
| 669 | aa->array = &ctx->Array.FogCoord; |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 670 | aa->offset = FogCoordFuncs[TYPE_IDX(aa->array->Type)]; |
Brian Paul | 1e3d868 | 2004-02-24 02:49:43 +0000 | [diff] [blame] | 671 | aa++; |
| 672 | } |
| 673 | for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) { |
| 674 | if (ctx->Array.TexCoord[i].Enabled) { |
| 675 | /* NOTE: we use generic glVertexAttrib functions here. |
| 676 | * If we ever de-alias conventional/generic vertex attribs this |
| 677 | * will have to change. |
| 678 | */ |
| 679 | struct gl_client_array *attribArray = &ctx->Array.TexCoord[i]; |
| 680 | at->array = attribArray; |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 681 | at->func = AttribFuncsNV[at->array->Normalized][at->array->Size-1][TYPE_IDX(at->array->Type)]; |
Brian Paul | 9d1ff8c | 2004-02-24 14:59:26 +0000 | [diff] [blame] | 682 | at->index = VERT_ATTRIB_TEX0 + i; |
Brian Paul | 1e3d868 | 2004-02-24 02:49:43 +0000 | [diff] [blame] | 683 | at++; |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 684 | } |
Brian Paul | 1e3d868 | 2004-02-24 02:49:43 +0000 | [diff] [blame] | 685 | } |
Roland Scheidegger | faaf78a | 2004-02-11 01:06:03 +0000 | [diff] [blame] | 686 | |
Brian Paul | 1e3d868 | 2004-02-24 02:49:43 +0000 | [diff] [blame] | 687 | /* generic vertex attribute arrays */ |
| 688 | for (i = 1; i < VERT_ATTRIB_MAX; i++) { /* skip zero! */ |
| 689 | if (ctx->Array.VertexAttrib[i].Enabled) { |
| 690 | struct gl_client_array *attribArray = &ctx->Array.VertexAttrib[i]; |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 691 | at->array = attribArray; |
| 692 | /* Note: we can't grab the _glapi_Dispatch->VertexAttrib1fvNV |
| 693 | * function pointer here (for float arrays) since the pointer may |
| 694 | * change from one execution of _ae_loopback_array_elt() to |
| 695 | * the next. Doing so caused UT to break. |
| 696 | */ |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 697 | at->func = AttribFuncsNV[at->array->Normalized][at->array->Size-1][TYPE_IDX(at->array->Type)]; |
Brian Paul | 1e3d868 | 2004-02-24 02:49:43 +0000 | [diff] [blame] | 698 | at->index = i; |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 699 | at++; |
| 700 | } |
Roland Scheidegger | faaf78a | 2004-02-11 01:06:03 +0000 | [diff] [blame] | 701 | } |
Brian Paul | 1e3d868 | 2004-02-24 02:49:43 +0000 | [diff] [blame] | 702 | |
| 703 | /* finally, vertex position */ |
| 704 | if (ctx->Array.VertexAttrib[0].Enabled) { |
| 705 | /* Use glVertex(v) instead of glVertexAttrib(0, v) to be sure it's |
| 706 | * issued as the last (proviking) attribute). |
| 707 | */ |
| 708 | aa->array = &ctx->Array.VertexAttrib[0]; |
| 709 | assert(aa->array->Size >= 2); /* XXX fix someday? */ |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 710 | aa->offset = VertexFuncs[aa->array->Size-2][TYPE_IDX(aa->array->Type)]; |
Brian Paul | 1e3d868 | 2004-02-24 02:49:43 +0000 | [diff] [blame] | 711 | aa++; |
| 712 | } |
| 713 | else if (ctx->Array.Vertex.Enabled) { |
| 714 | aa->array = &ctx->Array.Vertex; |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 715 | aa->offset = VertexFuncs[aa->array->Size-2][TYPE_IDX(aa->array->Type)]; |
Brian Paul | 1e3d868 | 2004-02-24 02:49:43 +0000 | [diff] [blame] | 716 | aa++; |
| 717 | } |
| 718 | |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 719 | ASSERT(at - actx->attribs <= VERT_ATTRIB_MAX); |
| 720 | ASSERT(aa - actx->arrays < 32); |
| 721 | at->func = NULL; /* terminate the list */ |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 722 | aa->offset = -1; /* terminate the list */ |
Roland Scheidegger | faaf78a | 2004-02-11 01:06:03 +0000 | [diff] [blame] | 723 | |
Keith Whitwell | cab974c | 2000-12-26 05:09:27 +0000 | [diff] [blame] | 724 | actx->NewState = 0; |
| 725 | } |
| 726 | |
| 727 | |
Brian Paul | 1e3d868 | 2004-02-24 02:49:43 +0000 | [diff] [blame] | 728 | /** |
| 729 | * Called via glArrayElement() and glDrawArrays(). |
| 730 | * Issue the glNormal, glVertex, glColor, glVertexAttrib, etc functions |
| 731 | * for all enabled vertex arrays (for elt-th element). |
| 732 | * Note: this may be called during display list construction. |
| 733 | */ |
Karl Schultz | d674569 | 2003-12-04 20:23:44 +0000 | [diff] [blame] | 734 | void GLAPIENTRY _ae_loopback_array_elt( GLint elt ) |
Keith Whitwell | cab974c | 2000-12-26 05:09:27 +0000 | [diff] [blame] | 735 | { |
| 736 | GET_CURRENT_CONTEXT(ctx); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 737 | const AEcontext *actx = AE_CONTEXT(ctx); |
| 738 | const AEarray *aa; |
| 739 | const AEattrib *at; |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 740 | const struct _glapi_table * const disp = GET_DISPATCH(); |
| 741 | |
Keith Whitwell | 4b7d6f2 | 2001-06-01 22:22:10 +0000 | [diff] [blame] | 742 | |
| 743 | if (actx->NewState) |
| 744 | _ae_update_state( ctx ); |
Keith Whitwell | cab974c | 2000-12-26 05:09:27 +0000 | [diff] [blame] | 745 | |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 746 | /* generic attributes */ |
| 747 | for (at = actx->attribs; at->func; at++) { |
| 748 | const GLubyte *src = at->array->BufferObj->Data |
Karl Schultz | 6258b76 | 2005-05-05 21:08:07 +0000 | [diff] [blame] | 749 | + (uintptr_t) at->array->Ptr |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 750 | + elt * at->array->StrideB; |
| 751 | at->func( at->index, src ); |
Brian Paul | 53ad036 | 2004-02-09 00:24:48 +0000 | [diff] [blame] | 752 | } |
| 753 | |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 754 | /* conventional arrays */ |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 755 | for (aa = actx->arrays; aa->offset != -1 ; aa++) { |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 756 | const GLubyte *src = aa->array->BufferObj->Data |
Karl Schultz | 6258b76 | 2005-05-05 21:08:07 +0000 | [diff] [blame] | 757 | + (uintptr_t) aa->array->Ptr |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 758 | + elt * aa->array->StrideB; |
Ian Romanick | 9bdfee3 | 2005-07-18 12:31:24 +0000 | [diff] [blame^] | 759 | fprintf( stderr, "[%s,%u] aa->offset = %d\n", __func__, __LINE__, |
| 760 | aa->offset ); |
| 761 | CALL_by_offset( disp, (array_func), aa->offset, |
| 762 | ((const void *) src) ); |
Keith Whitwell | cab974c | 2000-12-26 05:09:27 +0000 | [diff] [blame] | 763 | } |
Keith Whitwell | cab974c | 2000-12-26 05:09:27 +0000 | [diff] [blame] | 764 | } |
| 765 | |
| 766 | |
Keith Whitwell | 4b7d6f2 | 2001-06-01 22:22:10 +0000 | [diff] [blame] | 767 | void _ae_invalidate_state( GLcontext *ctx, GLuint new_state ) |
Keith Whitwell | cab974c | 2000-12-26 05:09:27 +0000 | [diff] [blame] | 768 | { |
Keith Whitwell | 4b7d6f2 | 2001-06-01 22:22:10 +0000 | [diff] [blame] | 769 | AE_CONTEXT(ctx)->NewState |= new_state; |
Keith Whitwell | cab974c | 2000-12-26 05:09:27 +0000 | [diff] [blame] | 770 | } |