/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.1
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
static int SecondaryColorFuncs[8];
static int FogCoordFuncs[8];
-/**********************************************************************/
+
+/**
+ ** GL_NV_vertex_program
+ **/
/* GL_BYTE attributes */
}
};
+
+/**
+ ** GL_ARB_vertex_program
+ **/
+
+/* GL_BYTE attributes */
+
+static void GLAPIENTRY VertexAttrib1NbvARB(GLuint index, const GLbyte *v)
+{
+ CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, BYTE_TO_FLOAT(v[0])));
+}
+
+static void GLAPIENTRY VertexAttrib1bvARB(GLuint index, const GLbyte *v)
+{
+ CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, v[0]));
+}
+
+static void GLAPIENTRY VertexAttrib2NbvARB(GLuint index, const GLbyte *v)
+{
+ CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, BYTE_TO_FLOAT(v[0]), BYTE_TO_FLOAT(v[1])));
+}
+
+static void GLAPIENTRY VertexAttrib2bvARB(GLuint index, const GLbyte *v)
+{
+ CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, v[0], v[1]));
+}
+
+static void GLAPIENTRY VertexAttrib3NbvARB(GLuint index, const GLbyte *v)
+{
+ CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, BYTE_TO_FLOAT(v[0]),
+ BYTE_TO_FLOAT(v[1]),
+ BYTE_TO_FLOAT(v[2])));
+}
+
+static void GLAPIENTRY VertexAttrib3bvARB(GLuint index, const GLbyte *v)
+{
+ CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, v[0], v[1], v[2]));
+}
+
+static void GLAPIENTRY VertexAttrib4NbvARB(GLuint index, const GLbyte *v)
+{
+ CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, BYTE_TO_FLOAT(v[0]),
+ BYTE_TO_FLOAT(v[1]),
+ BYTE_TO_FLOAT(v[2]),
+ BYTE_TO_FLOAT(v[3])));
+}
+
+static void GLAPIENTRY VertexAttrib4bvARB(GLuint index, const GLbyte *v)
+{
+ CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, v[0], v[1], v[2], v[3]));
+}
+
+/* GL_UNSIGNED_BYTE attributes */
+
+static void GLAPIENTRY VertexAttrib1NubvARB(GLuint index, const GLubyte *v)
+{
+ CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, UBYTE_TO_FLOAT(v[0])));
+}
+
+static void GLAPIENTRY VertexAttrib1ubvARB(GLuint index, const GLubyte *v)
+{
+ CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, v[0]));
+}
+
+static void GLAPIENTRY VertexAttrib2NubvARB(GLuint index, const GLubyte *v)
+{
+ CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, UBYTE_TO_FLOAT(v[0]),
+ UBYTE_TO_FLOAT(v[1])));
+}
+
+static void GLAPIENTRY VertexAttrib2ubvARB(GLuint index, const GLubyte *v)
+{
+ CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, v[0], v[1]));
+}
+
+static void GLAPIENTRY VertexAttrib3NubvARB(GLuint index, const GLubyte *v)
+{
+ CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, UBYTE_TO_FLOAT(v[0]),
+ UBYTE_TO_FLOAT(v[1]),
+ UBYTE_TO_FLOAT(v[2])));
+}
+static void GLAPIENTRY VertexAttrib3ubvARB(GLuint index, const GLubyte *v)
+{
+ CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, v[0], v[1], v[2]));
+}
+
+static void GLAPIENTRY VertexAttrib4NubvARB(GLuint index, const GLubyte *v)
+{
+ CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, UBYTE_TO_FLOAT(v[0]),
+ UBYTE_TO_FLOAT(v[1]),
+ UBYTE_TO_FLOAT(v[2]),
+ UBYTE_TO_FLOAT(v[3])));
+}
+
+static void GLAPIENTRY VertexAttrib4ubvARB(GLuint index, const GLubyte *v)
+{
+ CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, v[0], v[1], v[2], v[3]));
+}
+
+/* GL_SHORT attributes */
+
+static void GLAPIENTRY VertexAttrib1NsvARB(GLuint index, const GLshort *v)
+{
+ CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, SHORT_TO_FLOAT(v[0])));
+}
+
+static void GLAPIENTRY VertexAttrib1svARB(GLuint index, const GLshort *v)
+{
+ CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, v[0]));
+}
+
+static void GLAPIENTRY VertexAttrib2NsvARB(GLuint index, const GLshort *v)
+{
+ CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, SHORT_TO_FLOAT(v[0]),
+ SHORT_TO_FLOAT(v[1])));
+}
+
+static void GLAPIENTRY VertexAttrib2svARB(GLuint index, const GLshort *v)
+{
+ CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, v[0], v[1]));
+}
+
+static void GLAPIENTRY VertexAttrib3NsvARB(GLuint index, const GLshort *v)
+{
+ CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, SHORT_TO_FLOAT(v[0]),
+ SHORT_TO_FLOAT(v[1]),
+ SHORT_TO_FLOAT(v[2])));
+}
+
+static void GLAPIENTRY VertexAttrib3svARB(GLuint index, const GLshort *v)
+{
+ CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, v[0], v[1], v[2]));
+}
+
+static void GLAPIENTRY VertexAttrib4NsvARB(GLuint index, const GLshort *v)
+{
+ CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, SHORT_TO_FLOAT(v[0]),
+ SHORT_TO_FLOAT(v[1]),
+ SHORT_TO_FLOAT(v[2]),
+ SHORT_TO_FLOAT(v[3])));
+}
+
+static void GLAPIENTRY VertexAttrib4svARB(GLuint index, const GLshort *v)
+{
+ CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, v[0], v[1], v[2], v[3]));
+}
+
+/* GL_UNSIGNED_SHORT attributes */
+
+static void GLAPIENTRY VertexAttrib1NusvARB(GLuint index, const GLushort *v)
+{
+ CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, USHORT_TO_FLOAT(v[0])));
+}
+
+static void GLAPIENTRY VertexAttrib1usvARB(GLuint index, const GLushort *v)
+{
+ CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, v[0]));
+}
+
+static void GLAPIENTRY VertexAttrib2NusvARB(GLuint index, const GLushort *v)
+{
+ CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, USHORT_TO_FLOAT(v[0]),
+ USHORT_TO_FLOAT(v[1])));
+}
+
+static void GLAPIENTRY VertexAttrib2usvARB(GLuint index, const GLushort *v)
+{
+ CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, v[0], v[1]));
+}
+
+static void GLAPIENTRY VertexAttrib3NusvARB(GLuint index, const GLushort *v)
+{
+ CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, USHORT_TO_FLOAT(v[0]),
+ USHORT_TO_FLOAT(v[1]),
+ USHORT_TO_FLOAT(v[2])));
+}
+
+static void GLAPIENTRY VertexAttrib3usvARB(GLuint index, const GLushort *v)
+{
+ CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, v[0], v[1], v[2]));
+}
+
+static void GLAPIENTRY VertexAttrib4NusvARB(GLuint index, const GLushort *v)
+{
+ CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, USHORT_TO_FLOAT(v[0]),
+ USHORT_TO_FLOAT(v[1]),
+ USHORT_TO_FLOAT(v[2]),
+ USHORT_TO_FLOAT(v[3])));
+}
+
+static void GLAPIENTRY VertexAttrib4usvARB(GLuint index, const GLushort *v)
+{
+ CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, v[0], v[1], v[2], v[3]));
+}
+
+/* GL_INT attributes */
+
+static void GLAPIENTRY VertexAttrib1NivARB(GLuint index, const GLint *v)
+{
+ CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, INT_TO_FLOAT(v[0])));
+}
+
+static void GLAPIENTRY VertexAttrib1ivARB(GLuint index, const GLint *v)
+{
+ CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, v[0]));
+}
+
+static void GLAPIENTRY VertexAttrib2NivARB(GLuint index, const GLint *v)
+{
+ CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, INT_TO_FLOAT(v[0]),
+ INT_TO_FLOAT(v[1])));
+}
+
+static void GLAPIENTRY VertexAttrib2ivARB(GLuint index, const GLint *v)
+{
+ CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, v[0], v[1]));
+}
+
+static void GLAPIENTRY VertexAttrib3NivARB(GLuint index, const GLint *v)
+{
+ CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, INT_TO_FLOAT(v[0]),
+ INT_TO_FLOAT(v[1]),
+ INT_TO_FLOAT(v[2])));
+}
+
+static void GLAPIENTRY VertexAttrib3ivARB(GLuint index, const GLint *v)
+{
+ CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, v[0], v[1], v[2]));
+}
+
+static void GLAPIENTRY VertexAttrib4NivARB(GLuint index, const GLint *v)
+{
+ CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, INT_TO_FLOAT(v[0]),
+ INT_TO_FLOAT(v[1]),
+ INT_TO_FLOAT(v[2]),
+ INT_TO_FLOAT(v[3])));
+}
+
+static void GLAPIENTRY VertexAttrib4ivARB(GLuint index, const GLint *v)
+{
+ CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, v[0], v[1], v[2], v[3]));
+}
+
+/* GL_UNSIGNED_INT attributes */
+
+static void GLAPIENTRY VertexAttrib1NuivARB(GLuint index, const GLuint *v)
+{
+ CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, UINT_TO_FLOAT(v[0])));
+}
+
+static void GLAPIENTRY VertexAttrib1uivARB(GLuint index, const GLuint *v)
+{
+ CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, v[0]));
+}
+
+static void GLAPIENTRY VertexAttrib2NuivARB(GLuint index, const GLuint *v)
+{
+ CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, UINT_TO_FLOAT(v[0]),
+ UINT_TO_FLOAT(v[1])));
+}
+
+static void GLAPIENTRY VertexAttrib2uivARB(GLuint index, const GLuint *v)
+{
+ CALL_VertexAttrib2fARB(GET_DISPATCH(), (index, v[0], v[1]));
+}
+
+static void GLAPIENTRY VertexAttrib3NuivARB(GLuint index, const GLuint *v)
+{
+ CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, UINT_TO_FLOAT(v[0]),
+ UINT_TO_FLOAT(v[1]),
+ UINT_TO_FLOAT(v[2])));
+}
+
+static void GLAPIENTRY VertexAttrib3uivARB(GLuint index, const GLuint *v)
+{
+ CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, v[0], v[1], v[2]));
+}
+
+static void GLAPIENTRY VertexAttrib4NuivARB(GLuint index, const GLuint *v)
+{
+ CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, UINT_TO_FLOAT(v[0]),
+ UINT_TO_FLOAT(v[1]),
+ UINT_TO_FLOAT(v[2]),
+ UINT_TO_FLOAT(v[3])));
+}
+
+static void GLAPIENTRY VertexAttrib4uivARB(GLuint index, const GLuint *v)
+{
+ CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, v[0], v[1], v[2], v[3]));
+}
+
+/* GL_FLOAT attributes */
+
+static void GLAPIENTRY VertexAttrib1fvARB(GLuint index, const GLfloat *v)
+{
+ CALL_VertexAttrib1fvARB(GET_DISPATCH(), (index, v));
+}
+
+static void GLAPIENTRY VertexAttrib2fvARB(GLuint index, const GLfloat *v)
+{
+ CALL_VertexAttrib2fvARB(GET_DISPATCH(), (index, v));
+}
+
+static void GLAPIENTRY VertexAttrib3fvARB(GLuint index, const GLfloat *v)
+{
+ CALL_VertexAttrib3fvARB(GET_DISPATCH(), (index, v));
+}
+
+static void GLAPIENTRY VertexAttrib4fvARB(GLuint index, const GLfloat *v)
+{
+ CALL_VertexAttrib4fvARB(GET_DISPATCH(), (index, v));
+}
+
+/* GL_DOUBLE attributes */
+
+static void GLAPIENTRY VertexAttrib1dvARB(GLuint index, const GLdouble *v)
+{
+ CALL_VertexAttrib1dvARB(GET_DISPATCH(), (index, v));
+}
+
+static void GLAPIENTRY VertexAttrib2dvARB(GLuint index, const GLdouble *v)
+{
+ CALL_VertexAttrib2dvARB(GET_DISPATCH(), (index, v));
+}
+
+static void GLAPIENTRY VertexAttrib3dvARB(GLuint index, const GLdouble *v)
+{
+ CALL_VertexAttrib3dvARB(GET_DISPATCH(), (index, v));
+}
+
+static void GLAPIENTRY VertexAttrib4dvARB(GLuint index, const GLdouble *v)
+{
+ CALL_VertexAttrib4dvARB(GET_DISPATCH(), (index, v));
+}
+
+
+/*
+ * Array [size][type] of VertexAttrib functions
+ */
+static attrib_func AttribFuncsARB[2][4][8] = {
+ {
+ /* non-normalized */
+ {
+ /* size 1 */
+ (attrib_func) VertexAttrib1bvARB,
+ (attrib_func) VertexAttrib1ubvARB,
+ (attrib_func) VertexAttrib1svARB,
+ (attrib_func) VertexAttrib1usvARB,
+ (attrib_func) VertexAttrib1ivARB,
+ (attrib_func) VertexAttrib1uivARB,
+ (attrib_func) VertexAttrib1fvARB,
+ (attrib_func) VertexAttrib1dvARB
+ },
+ {
+ /* size 2 */
+ (attrib_func) VertexAttrib2bvARB,
+ (attrib_func) VertexAttrib2ubvARB,
+ (attrib_func) VertexAttrib2svARB,
+ (attrib_func) VertexAttrib2usvARB,
+ (attrib_func) VertexAttrib2ivARB,
+ (attrib_func) VertexAttrib2uivARB,
+ (attrib_func) VertexAttrib2fvARB,
+ (attrib_func) VertexAttrib2dvARB
+ },
+ {
+ /* size 3 */
+ (attrib_func) VertexAttrib3bvARB,
+ (attrib_func) VertexAttrib3ubvARB,
+ (attrib_func) VertexAttrib3svARB,
+ (attrib_func) VertexAttrib3usvARB,
+ (attrib_func) VertexAttrib3ivARB,
+ (attrib_func) VertexAttrib3uivARB,
+ (attrib_func) VertexAttrib3fvARB,
+ (attrib_func) VertexAttrib3dvARB
+ },
+ {
+ /* size 4 */
+ (attrib_func) VertexAttrib4bvARB,
+ (attrib_func) VertexAttrib4ubvARB,
+ (attrib_func) VertexAttrib4svARB,
+ (attrib_func) VertexAttrib4usvARB,
+ (attrib_func) VertexAttrib4ivARB,
+ (attrib_func) VertexAttrib4uivARB,
+ (attrib_func) VertexAttrib4fvARB,
+ (attrib_func) VertexAttrib4dvARB
+ }
+ },
+ {
+ /* normalized (except for float/double) */
+ {
+ /* size 1 */
+ (attrib_func) VertexAttrib1NbvARB,
+ (attrib_func) VertexAttrib1NubvARB,
+ (attrib_func) VertexAttrib1NsvARB,
+ (attrib_func) VertexAttrib1NusvARB,
+ (attrib_func) VertexAttrib1NivARB,
+ (attrib_func) VertexAttrib1NuivARB,
+ (attrib_func) VertexAttrib1fvARB,
+ (attrib_func) VertexAttrib1dvARB
+ },
+ {
+ /* size 2 */
+ (attrib_func) VertexAttrib2NbvARB,
+ (attrib_func) VertexAttrib2NubvARB,
+ (attrib_func) VertexAttrib2NsvARB,
+ (attrib_func) VertexAttrib2NusvARB,
+ (attrib_func) VertexAttrib2NivARB,
+ (attrib_func) VertexAttrib2NuivARB,
+ (attrib_func) VertexAttrib2fvARB,
+ (attrib_func) VertexAttrib2dvARB
+ },
+ {
+ /* size 3 */
+ (attrib_func) VertexAttrib3NbvARB,
+ (attrib_func) VertexAttrib3NubvARB,
+ (attrib_func) VertexAttrib3NsvARB,
+ (attrib_func) VertexAttrib3NusvARB,
+ (attrib_func) VertexAttrib3NivARB,
+ (attrib_func) VertexAttrib3NuivARB,
+ (attrib_func) VertexAttrib3fvARB,
+ (attrib_func) VertexAttrib3dvARB
+ },
+ {
+ /* size 4 */
+ (attrib_func) VertexAttrib4NbvARB,
+ (attrib_func) VertexAttrib4NubvARB,
+ (attrib_func) VertexAttrib4NsvARB,
+ (attrib_func) VertexAttrib4NusvARB,
+ (attrib_func) VertexAttrib4NivARB,
+ (attrib_func) VertexAttrib4NuivARB,
+ (attrib_func) VertexAttrib4fvARB,
+ (attrib_func) VertexAttrib4dvARB
+ }
+ }
+};
+
/**********************************************************************/
aa++;
}
for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) {
- if (ctx->Array.TexCoord[i].Enabled) {
- /* NOTE: we use generic glVertexAttrib functions here.
- * If we ever de-alias conventional/generic vertex attribs this
- * will have to change.
+ struct gl_client_array *attribArray = &ctx->Array.TexCoord[i];
+ if (attribArray->Enabled) {
+ /* NOTE: we use generic glVertexAttribNV functions here.
+ * If we ever remove GL_NV_vertex_program this will have to change.
*/
- struct gl_client_array *attribArray = &ctx->Array.TexCoord[i];
at->array = attribArray;
- at->func = AttribFuncsNV[at->array->Normalized][at->array->Size-1][TYPE_IDX(at->array->Type)];
+ ASSERT(!at->array->Normalized);
+ at->func = AttribFuncsNV[at->array->Normalized]
+ [at->array->Size-1]
+ [TYPE_IDX(at->array->Type)];
at->index = VERT_ATTRIB_TEX0 + i;
at++;
}
/* generic vertex attribute arrays */
for (i = 1; i < VERT_ATTRIB_MAX; i++) { /* skip zero! */
- if (ctx->Array.VertexAttrib[i].Enabled) {
- struct gl_client_array *attribArray = &ctx->Array.VertexAttrib[i];
+ struct gl_client_array *attribArray = &ctx->Array.VertexAttrib[i];
+ if (attribArray->Enabled) {
at->array = attribArray;
/* Note: we can't grab the _glapi_Dispatch->VertexAttrib1fvNV
* function pointer here (for float arrays) since the pointer may
* change from one execution of _ae_loopback_array_elt() to
* the next. Doing so caused UT to break.
*/
- at->func = AttribFuncsNV[at->array->Normalized][at->array->Size-1][TYPE_IDX(at->array->Type)];
+ if (ctx->VertexProgram._Enabled
+ && ctx->VertexProgram.Current->IsNVProgram) {
+ at->func = AttribFuncsNV[at->array->Normalized]
+ [at->array->Size-1]
+ [TYPE_IDX(at->array->Type)];
+ }
+ else {
+ at->func = AttribFuncsARB[at->array->Normalized]
+ [at->array->Size-1]
+ [TYPE_IDX(at->array->Type)];
+ }
at->index = i;
at++;
}
/* finally, vertex position */
if (ctx->Array.VertexAttrib[0].Enabled) {
/* Use glVertex(v) instead of glVertexAttrib(0, v) to be sure it's
- * issued as the last (proviking) attribute).
+ * issued as the last (provoking) attribute).
*/
aa->array = &ctx->Array.VertexAttrib[0];
assert(aa->array->Size >= 2); /* XXX fix someday? */
void (GLAPIENTRYP CallLists)( GLsizei, GLenum, const GLvoid * ); /* NOTE */
void (GLAPIENTRYP Begin)( GLenum );
void (GLAPIENTRYP End)( void );
+ /* GL_NV_vertex_program */
void (GLAPIENTRYP VertexAttrib1fNV)( GLuint index, GLfloat x );
void (GLAPIENTRYP VertexAttrib1fvNV)( GLuint index, const GLfloat *v );
void (GLAPIENTRYP VertexAttrib2fNV)( GLuint index, GLfloat x, GLfloat y );
void (GLAPIENTRYP VertexAttrib3fvNV)( GLuint index, const GLfloat *v );
void (GLAPIENTRYP VertexAttrib4fNV)( GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w );
void (GLAPIENTRYP VertexAttrib4fvNV)( GLuint index, const GLfloat *v );
+#if FEATURE_ARB_vertex_program
void (GLAPIENTRYP VertexAttrib1fARB)( GLuint index, GLfloat x );
void (GLAPIENTRYP VertexAttrib1fvARB)( GLuint index, const GLfloat *v );
void (GLAPIENTRYP VertexAttrib2fARB)( GLuint index, GLfloat x, GLfloat y );
void (GLAPIENTRYP VertexAttrib3fvARB)( GLuint index, const GLfloat *v );
void (GLAPIENTRYP VertexAttrib4fARB)( GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w );
void (GLAPIENTRYP VertexAttrib4fvARB)( GLuint index, const GLfloat *v );
+#endif
/*@}*/
/*
struct gl_current_attrib
{
/**
- * \name Values valid only when FLUSH_VERTICES has been called.
+ * \name Current vertex attributes.
+ * \note Values are valid only after FLUSH_VERTICES has been called.
*/
/*@{*/
- GLfloat Attrib[VERT_ATTRIB_MAX][4]; /**< Current vertex attributes
- * indexed by VERT_ATTRIB_* */
- GLfloat Index; /**< Current color index */
- GLboolean EdgeFlag; /**< Current edge flag */
+ GLfloat Attrib[VERT_ATTRIB_MAX][4]; /**< Position, color, texcoords, etc */
+ GLfloat Index; /**< Current color index */
+ GLboolean EdgeFlag; /**< Current edge flag */
/*@}*/
/**
- * \name Values are always valid.
- *
- * \note BTW, note how similar this set of attributes is to the SWvertex
- * data type in the software rasterizer...
+ * \name Current raster position attributes (always valid).
+ * \note This set of attributes is very similar to the SWvertex struct.
*/
/*@{*/
- GLfloat RasterPos[4]; /**< Current raster position */
- GLfloat RasterDistance; /**< Current raster distance */
- GLfloat RasterColor[4]; /**< Current raster color */
- GLfloat RasterSecondaryColor[4]; /**< Current raster secondary color */
- GLfloat RasterIndex; /**< Current raster index */
+ GLfloat RasterPos[4];
+ GLfloat RasterDistance;
+ GLfloat RasterColor[4];
+ GLfloat RasterSecondaryColor[4];
+ GLfloat RasterIndex;
GLfloat RasterTexCoords[MAX_TEXTURE_COORD_UNITS][4];
- GLboolean RasterPosValid; /**< Raster pos valid flag */
+ GLboolean RasterPosValid;
/*@}*/
};
*/
struct gl_array_attrib
{
- struct gl_client_array Vertex; /**< client data descriptors */
+ /** Conventional vertex arrays */
+ /*@{*/
+ struct gl_client_array Vertex;
struct gl_client_array Normal;
struct gl_client_array Color;
struct gl_client_array SecondaryColor;
struct gl_client_array Index;
struct gl_client_array TexCoord[MAX_TEXTURE_COORD_UNITS];
struct gl_client_array EdgeFlag;
+ /*@}*/
- struct gl_client_array VertexAttrib[VERT_ATTRIB_MAX]; /**< GL_NV_vertex_program */
+ /** Generic arrays for vertex programs/shaders; */
+ struct gl_client_array VertexAttrib[VERT_ATTRIB_MAX];
GLint ActiveTexture; /**< Client Active Texture */
GLuint LockFirst; /**< GL_EXT_compiled_vertex_array */
GLuint LockCount; /**< GL_EXT_compiled_vertex_array */
- GLbitfield _Enabled; /**< _NEW_ARRAY_* - bit set if array enabled */
- GLbitfield NewState; /**< _NEW_ARRAY_* */
+ GLbitfield _Enabled; /**< mask of _NEW_ARRAY_* values */
+ GLbitfield NewState; /**< mask of _NEW_ARRAY_* values */
#if FEATURE_ARB_vertex_buffer_object
struct gl_buffer_object *NullBufferObj;
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.1
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
#include "context.h"
#include "enable.h"
#include "enums.h"
-#include "dlist.h"
-#include "texstate.h"
#include "mtypes.h"
#include "varray.h"
#include "dispatch.h"
*/
static void
update_array(GLcontext *ctx, struct gl_client_array *array,
- GLuint dirtyFlag, GLsizei elementSize,
+ GLbitfield dirtyFlag, GLsizei elementSize,
GLint size, GLenum type,
GLsizei stride, GLboolean normalized, const GLvoid *ptr)
{
_mesa_VertexAttribPointerNV(GLuint index, GLint size, GLenum type,
GLsizei stride, const GLvoid *ptr)
{
+ const GLboolean normalized = GL_FALSE;
GLsizei elementSize;
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
}
update_array(ctx, &ctx->Array.VertexAttrib[index], _NEW_ARRAY_ATTRIB(index),
- elementSize, size, type, stride, GL_FALSE, ptr);
+ elementSize, size, type, stride, normalized, ptr);
if (ctx->Driver.VertexAttribPointer)
ctx->Driver.VertexAttribPointer( ctx, index, size, type, stride, ptr );
_mesa_DisableClientState( GL_EDGE_FLAG_ARRAY );
_mesa_DisableClientState( GL_INDEX_ARRAY );
+ /* XXX also disable secondary color and generic arrays? */
/* Texcoords */
if (tflag) {
}
-/**********************************************************************/
-/***** Initialization *****/
-/**********************************************************************/
-
+/**
+ * Initialize vertex array state for given context.
+ */
void
-_mesa_init_varray( GLcontext * ctx )
+_mesa_init_varray(GLcontext *ctx)
{
GLuint i;
ctx->Array.EdgeFlag.Ptr = NULL;
ctx->Array.EdgeFlag.Enabled = GL_FALSE;
ctx->Array.EdgeFlag.Flags = CA_CLIENT_DATA;
- ctx->Array.ActiveTexture = 0; /* GL_ARB_multitexture */
for (i = 0; i < VERT_ATTRIB_MAX; i++) {
ctx->Array.VertexAttrib[i].Size = 4;
ctx->Array.VertexAttrib[i].Type = GL_FLOAT;
ctx->Array.VertexAttrib[i].StrideB = 0;
ctx->Array.VertexAttrib[i].Ptr = NULL;
ctx->Array.VertexAttrib[i].Enabled = GL_FALSE;
+ ctx->Array.VertexAttrib[i].Normalized = GL_FALSE;
ctx->Array.VertexAttrib[i].Flags = CA_CLIENT_DATA;
}
+
+ ctx->Array.ActiveTexture = 0; /* GL_ARB_multitexture */
}
#include "vtxfmt_tmp.h"
-
+/**
+ * Use the per-vertex functions found in <vfmt> to initialze the given
+ * API dispatch table.
+ */
static void
install_vtxfmt( struct _glapi_table *tab, const GLvertexformat *vfmt )
{
SET_CallLists(tab, vfmt->CallLists);
SET_Begin(tab, vfmt->Begin);
SET_End(tab, vfmt->End);
+ SET_Rectf(tab, vfmt->Rectf);
+ SET_DrawArrays(tab, vfmt->DrawArrays);
+ SET_DrawElements(tab, vfmt->DrawElements);
+ SET_DrawRangeElements(tab, vfmt->DrawRangeElements);
+ SET_EvalMesh1(tab, vfmt->EvalMesh1);
+ SET_EvalMesh2(tab, vfmt->EvalMesh2);
+ ASSERT(tab->EvalMesh2);
+
+ /* GL_NV_vertex_program */
SET_VertexAttrib1fNV(tab, vfmt->VertexAttrib1fNV);
SET_VertexAttrib1fvNV(tab, vfmt->VertexAttrib1fvNV);
SET_VertexAttrib2fNV(tab, vfmt->VertexAttrib2fNV);
SET_VertexAttrib3fvNV(tab, vfmt->VertexAttrib3fvNV);
SET_VertexAttrib4fNV(tab, vfmt->VertexAttrib4fNV);
SET_VertexAttrib4fvNV(tab, vfmt->VertexAttrib4fvNV);
+#if FEATURE_ARB_vertex_program
SET_VertexAttrib1fARB(tab, vfmt->VertexAttrib1fARB);
SET_VertexAttrib1fvARB(tab, vfmt->VertexAttrib1fvARB);
SET_VertexAttrib2fARB(tab, vfmt->VertexAttrib2fARB);
SET_VertexAttrib3fvARB(tab, vfmt->VertexAttrib3fvARB);
SET_VertexAttrib4fARB(tab, vfmt->VertexAttrib4fARB);
SET_VertexAttrib4fvARB(tab, vfmt->VertexAttrib4fvARB);
- SET_Rectf(tab, vfmt->Rectf);
- SET_DrawArrays(tab, vfmt->DrawArrays);
- SET_DrawElements(tab, vfmt->DrawElements);
- SET_DrawRangeElements(tab, vfmt->DrawRangeElements);
- SET_EvalMesh1(tab, vfmt->EvalMesh1);
- SET_EvalMesh2(tab, vfmt->EvalMesh2);
- ASSERT(tab->EvalMesh2);
+#endif
}
GLuint attrib;
if (!parse_generic_attrib_num(ctx, inst, Program, &attrib)) {
*is_generic = 1;
- *inputReg = attrib;
+ /* Add VERT_ATTRIB_GENERIC0 here because ARB_vertex_program's
+ * attributes do not alias the conventional vertex
+ * attributes.
+ */
+ if (attrib > 0)
+ *inputReg = attrib + VERT_ATTRIB_GENERIC0;
}
}
break;
#define _TNL_ATTRIB_TEX(u) (_TNL_ATTRIB_TEX0 + (u))
#define _TNL_ATTRIB_ATTRIBUTE(n) (_TNL_ATTRIB_ATTRIBUTE0 + (n))
+/* special index used for handing invalid glVertexAttribute() indices */
+#define _TNL_ATTRIB_ERROR (_TNL_ATTRIB_ATTRIBUTE15 + 1)
+
/* Define bit ranges instead of bit masks.
*/
#define _TNL_FIRST_PROG _TNL_ATTRIB_WEIGHT
struct _tnl_dynfn *(*Attribute[4])( GLcontext *ctx, int key );
};
-#define _TNL_MAX_ATTR_CODEGEN 16
+#define _TNL_MAX_ATTR_CODEGEN 32
-/* The assembly of vertices in immediate mode is separated from
+/**
+ * The assembly of vertices in immediate mode is separated from
* display list compilation. This allows a simpler immediate mode
* treatment and a display list compiler better suited to
* hardware-acceleration.
GLuint counter, initial_counter;
struct tnl_copied_vtx copied;
- tnl_attrfv_func tabfv[_TNL_MAX_ATTR_CODEGEN+1][4]; /* plus 1 for ERROR_ATTRIB */
+ /** Note extra space for error handler: */
+ tnl_attrfv_func tabfv[_TNL_ATTRIB_ERROR+1][4];
struct _tnl_dynfn_lists cache;
struct _tnl_dynfn_generators gen;
static void reset_attrfv( TNLcontext *tnl );
-static tnl_attrfv_func choose[_TNL_MAX_ATTR_CODEGEN+1][4]; /* +1 for ERROR_ATTRIB */
+/** Note extra space for error index: */
+static tnl_attrfv_func choose[_TNL_ATTRIB_ERROR+1][4];
static tnl_attrfv_func generic_attr_func[_TNL_MAX_ATTR_CODEGEN][4];
/* Edgeflag requires additional treatment:
*/
- tnl->vtx.CurrentFloatEdgeFlag =
- (GLfloat)ctx->Current.EdgeFlag;
+ tnl->vtx.CurrentFloatEdgeFlag = (GLfloat) ctx->Current.EdgeFlag;
for (i = _TNL_ATTRIB_POS+1 ; i < _TNL_ATTRIB_MAX ; i++)
switch (tnl->vtx.attrsz[i]) {
if (!tnl->vtx.tabfv[attr][sz-1])
tnl->vtx.tabfv[attr][sz-1] = generic_attr_func[attr][sz-1];
+ ASSERT(tnl->vtx.tabfv[attr][sz-1]);
return tnl->vtx.tabfv[attr][sz-1];
}
static void choose_##ATTR##_##N( const GLfloat *v ) \
{ \
tnl_attrfv_func f = do_choose(ATTR, N); \
+ ASSERT(f); \
f( v ); \
}
#define INIT_CHOOSERS(ATTR) \
+ ASSERT(ATTR <= _TNL_ATTRIB_ERROR);\
choose[ATTR][0] = choose_##ATTR##_1; \
choose[ATTR][1] = choose_##ATTR##_2; \
choose[ATTR][2] = choose_##ATTR##_3; \
choose[ATTR][3] = choose_##ATTR##_4;
+/* conventional attributes */
CHOOSERS( 0 )
CHOOSERS( 1 )
CHOOSERS( 2 )
CHOOSERS( 14 )
CHOOSERS( 15 )
+/* generic attributes */
+CHOOSERS( 16 )
+CHOOSERS( 17 )
+CHOOSERS( 18 )
+CHOOSERS( 19 )
+CHOOSERS( 20 )
+CHOOSERS( 21 )
+CHOOSERS( 22 )
+CHOOSERS( 23 )
+CHOOSERS( 24 )
+CHOOSERS( 25 )
+CHOOSERS( 26 )
+CHOOSERS( 27 )
+CHOOSERS( 28 )
+CHOOSERS( 29 )
+CHOOSERS( 30 )
+CHOOSERS( 31 )
/**
if (firsttime) {
firsttime = 0;
+ /* conventional attributes */
INIT_CHOOSERS( 0 );
INIT_CHOOSERS( 1 );
INIT_CHOOSERS( 2 );
INIT_CHOOSERS( 14 );
INIT_CHOOSERS( 15 );
- choose[ERROR_ATTRIB][0] = error_attrib;
- choose[ERROR_ATTRIB][1] = error_attrib;
- choose[ERROR_ATTRIB][2] = error_attrib;
- choose[ERROR_ATTRIB][3] = error_attrib;
+ /* generic attributes */
+ INIT_CHOOSERS( 16 );
+ INIT_CHOOSERS( 17 );
+ INIT_CHOOSERS( 18 );
+ INIT_CHOOSERS( 19 );
+ INIT_CHOOSERS( 20 );
+ INIT_CHOOSERS( 21 );
+ INIT_CHOOSERS( 22 );
+ INIT_CHOOSERS( 23 );
+ INIT_CHOOSERS( 24 );
+ INIT_CHOOSERS( 25 );
+ INIT_CHOOSERS( 26 );
+ INIT_CHOOSERS( 27 );
+ INIT_CHOOSERS( 28 );
+ INIT_CHOOSERS( 29 );
+ INIT_CHOOSERS( 30 );
+ INIT_CHOOSERS( 31 );
+
+ choose[_TNL_ATTRIB_ERROR][0] = error_attrib;
+ choose[_TNL_ATTRIB_ERROR][1] = error_attrib;
+ choose[_TNL_ATTRIB_ERROR][2] = error_attrib;
+ choose[_TNL_ATTRIB_ERROR][3] = error_attrib;
#ifdef USE_X86_ASM
if (tnl->AllowCodegen) {
#include "t_context.h"
-#define ERROR_ATTRIB 16
-
-
/* t_vtx_api.c:
*/
ATTRFV( ATTRIB, 3 ) \
ATTRFV( ATTRIB, 4 )
+/* conventional attribs */
ATTRS( 0 )
ATTRS( 1 )
ATTRS( 2 )
ATTRS( 14 )
ATTRS( 15 )
+/* generic attribs */
+ATTRS( 16 )
+ATTRS( 17 )
+ATTRS( 18 )
+ATTRS( 19 )
+ATTRS( 20 )
+ATTRS( 21 )
+ATTRS( 22 )
+ATTRS( 23 )
+ATTRS( 24 )
+ATTRS( 25 )
+ATTRS( 26 )
+ATTRS( 27 )
+ATTRS( 28 )
+ATTRS( 29 )
+ATTRS( 30 )
+ATTRS( 31 )
+
+
void _tnl_generic_attr_table_init( tnl_attrfv_func (*tab)[4] )
{
+ /* conventional attribs */
INIT( tab, 0 );
INIT( tab, 1 );
INIT( tab, 2 );
INIT( tab, 13 );
INIT( tab, 14 );
INIT( tab, 15 );
+
+ /* generic attribs */
+ INIT( tab, 16 );
+ INIT( tab, 17 );
+ INIT( tab, 18 );
+ INIT( tab, 19 );
+ INIT( tab, 20 );
+ INIT( tab, 21 );
+ INIT( tab, 22 );
+ INIT( tab, 23 );
+ INIT( tab, 24 );
+ INIT( tab, 25 );
+ INIT( tab, 26 );
+ INIT( tab, 27 );
+ INIT( tab, 28 );
+ INIT( tab, 29 );
+ INIT( tab, 30 );
+ INIT( tab, 31 );
}
/* These can be made efficient with codegen. Further, by adding more
DISPATCH_ATTR1F( attr, x );
}
-static void GLAPIENTRY _tnl_MultiTexCoord1fv( GLenum target,
- const GLfloat *v )
+static void GLAPIENTRY _tnl_MultiTexCoord1fv( GLenum target, const GLfloat *v )
{
GLuint attr = (target & 0x7) + _TNL_ATTRIB_TEX0;
DISPATCH_ATTR1FV( attr, v );
}
-static void GLAPIENTRY _tnl_MultiTexCoord2f( GLenum target, GLfloat x,
- GLfloat y )
+static void GLAPIENTRY _tnl_MultiTexCoord2f( GLenum target, GLfloat x, GLfloat y )
{
GLuint attr = (target & 0x7) + _TNL_ATTRIB_TEX0;
DISPATCH_ATTR2F( attr, x, y );
}
-static void GLAPIENTRY _tnl_MultiTexCoord2fv( GLenum target,
- const GLfloat *v )
+static void GLAPIENTRY _tnl_MultiTexCoord2fv( GLenum target, const GLfloat *v )
{
GLuint attr = (target & 0x7) + _TNL_ATTRIB_TEX0;
DISPATCH_ATTR2FV( attr, v );
DISPATCH_ATTR3F( attr, x, y, z );
}
-static void GLAPIENTRY _tnl_MultiTexCoord3fv( GLenum target,
- const GLfloat *v )
+static void GLAPIENTRY _tnl_MultiTexCoord3fv( GLenum target, const GLfloat *v )
{
GLuint attr = (target & 0x7) + _TNL_ATTRIB_TEX0;
DISPATCH_ATTR3FV( attr, v );
DISPATCH_ATTR4F( attr, x, y, z, w );
}
-static void GLAPIENTRY _tnl_MultiTexCoord4fv( GLenum target,
- const GLfloat *v )
+static void GLAPIENTRY _tnl_MultiTexCoord4fv( GLenum target, const GLfloat *v )
{
GLuint attr = (target & 0x7) + _TNL_ATTRIB_TEX0;
DISPATCH_ATTR4FV( attr, v );
}
+/**
+ * GL_NV_vertex_program Vertex Attributes
+ * Note that these attributes DO alias the conventional attributes.
+ * Also, calling glVertexAttribNV(0, xxx) is equivalent to glVertex(xxx).
+ */
+
static void GLAPIENTRY _tnl_VertexAttrib1fNV( GLuint index, GLfloat x )
{
- if (index >= MAX_VERTEX_PROGRAM_ATTRIBS) index = ERROR_ATTRIB;
+ if (index >= MAX_VERTEX_PROGRAM_ATTRIBS)
+ index = _TNL_ATTRIB_ERROR;
DISPATCH_ATTR1F( index, x );
}
-static void GLAPIENTRY _tnl_VertexAttrib1fvNV( GLuint index,
- const GLfloat *v )
+static void GLAPIENTRY _tnl_VertexAttrib1fvNV( GLuint index, const GLfloat *v )
{
- if (index >= MAX_VERTEX_PROGRAM_ATTRIBS) index = ERROR_ATTRIB;
+ if (index >= MAX_VERTEX_PROGRAM_ATTRIBS)
+ index = _TNL_ATTRIB_ERROR;
DISPATCH_ATTR1FV( index, v );
}
-static void GLAPIENTRY _tnl_VertexAttrib2fNV( GLuint index, GLfloat x,
- GLfloat y )
+static void GLAPIENTRY _tnl_VertexAttrib2fNV(GLuint index, GLfloat x, GLfloat y)
{
- if (index >= MAX_VERTEX_PROGRAM_ATTRIBS) index = ERROR_ATTRIB;
+ if (index >= MAX_VERTEX_PROGRAM_ATTRIBS)
+ index = _TNL_ATTRIB_ERROR;
DISPATCH_ATTR2F( index, x, y );
}
-static void GLAPIENTRY _tnl_VertexAttrib2fvNV( GLuint index,
- const GLfloat *v )
+static void GLAPIENTRY _tnl_VertexAttrib2fvNV( GLuint index, const GLfloat *v )
{
- if (index >= MAX_VERTEX_PROGRAM_ATTRIBS) index = ERROR_ATTRIB;
+ if (index >= MAX_VERTEX_PROGRAM_ATTRIBS)
+ index = _TNL_ATTRIB_ERROR;
DISPATCH_ATTR2FV( index, v );
}
static void GLAPIENTRY _tnl_VertexAttrib3fNV( GLuint index, GLfloat x,
GLfloat y, GLfloat z )
{
- if (index >= MAX_VERTEX_PROGRAM_ATTRIBS) index = ERROR_ATTRIB;
+ if (index >= MAX_VERTEX_PROGRAM_ATTRIBS)
+ index = _TNL_ATTRIB_ERROR;
DISPATCH_ATTR3F( index, x, y, z );
}
-static void GLAPIENTRY _tnl_VertexAttrib3fvNV( GLuint index,
- const GLfloat *v )
+static void GLAPIENTRY _tnl_VertexAttrib3fvNV( GLuint index, const GLfloat *v )
{
- if (index >= MAX_VERTEX_PROGRAM_ATTRIBS) index = ERROR_ATTRIB;
+ if (index >= MAX_VERTEX_PROGRAM_ATTRIBS)
+ index = _TNL_ATTRIB_ERROR;
DISPATCH_ATTR3FV( index, v );
}
GLfloat y, GLfloat z,
GLfloat w )
{
- if (index >= MAX_VERTEX_PROGRAM_ATTRIBS) index = ERROR_ATTRIB;
+ if (index >= MAX_VERTEX_PROGRAM_ATTRIBS)
+ index = _TNL_ATTRIB_ERROR;
DISPATCH_ATTR4F( index, x, y, z, w );
}
-static void GLAPIENTRY _tnl_VertexAttrib4fvNV( GLuint index,
- const GLfloat *v )
+static void GLAPIENTRY _tnl_VertexAttrib4fvNV( GLuint index, const GLfloat *v )
{
- if (index >= MAX_VERTEX_PROGRAM_ATTRIBS) index = ERROR_ATTRIB;
+ if (index >= MAX_VERTEX_PROGRAM_ATTRIBS)
+ index = _TNL_ATTRIB_ERROR;
DISPATCH_ATTR4FV( index, v );
}
+
+
+/**
+ * GL_ARB_vertex_program Vertex Attributes
+ * Note that these attributes do NOT alias the conventional attributes.
+ * Also, calling glVertexAttribARB(0, xxx) is equivalent to glVertex(xxx).
+ */
+
static void GLAPIENTRY _tnl_VertexAttrib1fARB( GLuint index, GLfloat x )
{
if (index >= MAX_VERTEX_ATTRIBS)
- index = ERROR_ATTRIB;
- else
+ index = _TNL_ATTRIB_ERROR;
+ else if (index > 0)
index += VERT_ATTRIB_GENERIC0;
DISPATCH_ATTR1F( index, x );
}
-static void GLAPIENTRY _tnl_VertexAttrib1fvARB( GLuint index,
- const GLfloat *v )
+static void GLAPIENTRY _tnl_VertexAttrib1fvARB(GLuint index, const GLfloat *v)
{
if (index >= MAX_VERTEX_ATTRIBS)
- index = ERROR_ATTRIB;
- else
+ index = _TNL_ATTRIB_ERROR;
+ else if (index > 0)
index += VERT_ATTRIB_GENERIC0;
DISPATCH_ATTR1FV( index, v );
}
GLfloat y )
{
if (index >= MAX_VERTEX_ATTRIBS)
- index = ERROR_ATTRIB;
- else
+ index = _TNL_ATTRIB_ERROR;
+ else if (index > 0)
index += VERT_ATTRIB_GENERIC0;
DISPATCH_ATTR2F( index, x, y );
}
-static void GLAPIENTRY _tnl_VertexAttrib2fvARB( GLuint index,
- const GLfloat *v )
+static void GLAPIENTRY _tnl_VertexAttrib2fvARB(GLuint index, const GLfloat *v)
{
if (index >= MAX_VERTEX_ATTRIBS)
- index = ERROR_ATTRIB;
- else
+ index = _TNL_ATTRIB_ERROR;
+ else if (index > 0)
index += VERT_ATTRIB_GENERIC0;
DISPATCH_ATTR2FV( index, v );
}
-static void GLAPIENTRY _tnl_VertexAttrib3fARB( GLuint index, GLfloat x,
- GLfloat y, GLfloat z )
+static void GLAPIENTRY _tnl_VertexAttrib3fARB(GLuint index, GLfloat x,
+ GLfloat y, GLfloat z)
{
if (index >= MAX_VERTEX_ATTRIBS)
- index = ERROR_ATTRIB;
- else
+ index = _TNL_ATTRIB_ERROR;
+ else if (index > 0)
index += VERT_ATTRIB_GENERIC0;
DISPATCH_ATTR3F( index, x, y, z );
}
-static void GLAPIENTRY _tnl_VertexAttrib3fvARB( GLuint index,
- const GLfloat *v )
+static void GLAPIENTRY _tnl_VertexAttrib3fvARB(GLuint index, const GLfloat *v)
{
if (index >= MAX_VERTEX_ATTRIBS)
- index = ERROR_ATTRIB;
- else
+ index = _TNL_ATTRIB_ERROR;
+ else if (index > 0)
index += VERT_ATTRIB_GENERIC0;
DISPATCH_ATTR3FV( index, v );
}
-static void GLAPIENTRY _tnl_VertexAttrib4fARB( GLuint index, GLfloat x,
- GLfloat y, GLfloat z,
- GLfloat w )
+static void GLAPIENTRY _tnl_VertexAttrib4fARB(GLuint index, GLfloat x,
+ GLfloat y, GLfloat z, GLfloat w)
{
if (index >= MAX_VERTEX_ATTRIBS)
- index = ERROR_ATTRIB;
- else
+ index = _TNL_ATTRIB_ERROR;
+ else if (index > 0)
index += VERT_ATTRIB_GENERIC0;
DISPATCH_ATTR4F( index, x, y, z, w );
}
-static void GLAPIENTRY _tnl_VertexAttrib4fvARB( GLuint index,
- const GLfloat *v )
+static void GLAPIENTRY _tnl_VertexAttrib4fvARB(GLuint index, const GLfloat *v)
{
if (index >= MAX_VERTEX_ATTRIBS)
- index = ERROR_ATTRIB;
- else
+ index = _TNL_ATTRIB_ERROR;
+ else if (index > 0)
index += VERT_ATTRIB_GENERIC0;
DISPATCH_ATTR4FV( index, v );
}