summaryrefslogtreecommitdiffstats
path: root/src/mesa/tnl/t_vtx_generic.c
diff options
context:
space:
mode:
authorMichal Krol <[email protected]>2006-04-11 11:41:11 +0000
committerMichal Krol <[email protected]>2006-04-11 11:41:11 +0000
commitbb38cadb1c5f2dc13096a091bdaf61dc3e3cfa4d (patch)
tree8474881f1f529e1217d3442a98defb1a667b8403 /src/mesa/tnl/t_vtx_generic.c
parentd90ad3fd876860b7a2ba763c031e46f76e4c47c6 (diff)
More GLSL code:
- use macros to access and modify render inputs bit-field; - un-alias generic vertex attributes for ARB vertex calls; - use MAX_VERTEX_PROGRAM_ATTRIBS (NV code) or MAX_VERTEX_ATTRIBS (ARB code) in place of VERT_ATTRIB_MAX; - define VERT_ATTRIB_GENERIC0..15 for un-aliased vertex attributes for ARB_vertex_shader; - fix generic attribute index range check in arbprogparse.c; - interface GLSL varyings between vertex and fragment shader; - use 64-bit optimised bitset (bitset.h) for render inputs;
Diffstat (limited to 'src/mesa/tnl/t_vtx_generic.c')
-rw-r--r--src/mesa/tnl/t_vtx_generic.c61
1 files changed, 40 insertions, 21 deletions
diff --git a/src/mesa/tnl/t_vtx_generic.c b/src/mesa/tnl/t_vtx_generic.c
index 0422fcd45dc..d59ce90c6d7 100644
--- a/src/mesa/tnl/t_vtx_generic.c
+++ b/src/mesa/tnl/t_vtx_generic.c
@@ -364,42 +364,42 @@ static void GLAPIENTRY _tnl_MultiTexCoord4fv( GLenum target,
static void GLAPIENTRY _tnl_VertexAttrib1fNV( GLuint index, GLfloat x )
{
- if (index >= VERT_ATTRIB_MAX) index = ERROR_ATTRIB;
+ if (index >= MAX_VERTEX_PROGRAM_ATTRIBS) index = ERROR_ATTRIB;
DISPATCH_ATTR1F( index, x );
}
static void GLAPIENTRY _tnl_VertexAttrib1fvNV( GLuint index,
const GLfloat *v )
{
- if (index >= VERT_ATTRIB_MAX) index = ERROR_ATTRIB;
+ if (index >= MAX_VERTEX_PROGRAM_ATTRIBS) index = ERROR_ATTRIB;
DISPATCH_ATTR1FV( index, v );
}
static void GLAPIENTRY _tnl_VertexAttrib2fNV( GLuint index, GLfloat x,
GLfloat y )
{
- if (index >= VERT_ATTRIB_MAX) index = ERROR_ATTRIB;
+ if (index >= MAX_VERTEX_PROGRAM_ATTRIBS) index = ERROR_ATTRIB;
DISPATCH_ATTR2F( index, x, y );
}
static void GLAPIENTRY _tnl_VertexAttrib2fvNV( GLuint index,
const GLfloat *v )
{
- if (index >= VERT_ATTRIB_MAX) index = ERROR_ATTRIB;
+ if (index >= MAX_VERTEX_PROGRAM_ATTRIBS) index = ERROR_ATTRIB;
DISPATCH_ATTR2FV( index, v );
}
static void GLAPIENTRY _tnl_VertexAttrib3fNV( GLuint index, GLfloat x,
GLfloat y, GLfloat z )
{
- if (index >= VERT_ATTRIB_MAX) index = ERROR_ATTRIB;
+ if (index >= MAX_VERTEX_PROGRAM_ATTRIBS) index = ERROR_ATTRIB;
DISPATCH_ATTR3F( index, x, y, z );
}
static void GLAPIENTRY _tnl_VertexAttrib3fvNV( GLuint index,
const GLfloat *v )
{
- if (index >= VERT_ATTRIB_MAX) index = ERROR_ATTRIB;
+ if (index >= MAX_VERTEX_PROGRAM_ATTRIBS) index = ERROR_ATTRIB;
DISPATCH_ATTR3FV( index, v );
}
@@ -407,60 +407,73 @@ static void GLAPIENTRY _tnl_VertexAttrib4fNV( GLuint index, GLfloat x,
GLfloat y, GLfloat z,
GLfloat w )
{
- if (index >= VERT_ATTRIB_MAX) index = ERROR_ATTRIB;
+ if (index >= MAX_VERTEX_PROGRAM_ATTRIBS) index = ERROR_ATTRIB;
DISPATCH_ATTR4F( index, x, y, z, w );
}
static void GLAPIENTRY _tnl_VertexAttrib4fvNV( GLuint index,
const GLfloat *v )
{
- if (index >= VERT_ATTRIB_MAX) index = ERROR_ATTRIB;
+ if (index >= MAX_VERTEX_PROGRAM_ATTRIBS) index = ERROR_ATTRIB;
DISPATCH_ATTR4FV( index, v );
}
-
-/*
- * XXX adjust index
- */
-
static void GLAPIENTRY _tnl_VertexAttrib1fARB( GLuint index, GLfloat x )
{
- if (index >= VERT_ATTRIB_MAX) index = ERROR_ATTRIB;
+ if (index >= MAX_VERTEX_ATTRIBS)
+ index = ERROR_ATTRIB;
+ else
+ index += VERT_ATTRIB_GENERIC0;
DISPATCH_ATTR1F( index, x );
}
static void GLAPIENTRY _tnl_VertexAttrib1fvARB( GLuint index,
const GLfloat *v )
{
- if (index >= VERT_ATTRIB_MAX) index = ERROR_ATTRIB;
+ if (index >= MAX_VERTEX_ATTRIBS)
+ index = ERROR_ATTRIB;
+ else
+ index += VERT_ATTRIB_GENERIC0;
DISPATCH_ATTR1FV( index, v );
}
static void GLAPIENTRY _tnl_VertexAttrib2fARB( GLuint index, GLfloat x,
GLfloat y )
{
- if (index >= VERT_ATTRIB_MAX) index = ERROR_ATTRIB;
+ if (index >= MAX_VERTEX_ATTRIBS)
+ index = ERROR_ATTRIB;
+ else
+ index += VERT_ATTRIB_GENERIC0;
DISPATCH_ATTR2F( index, x, y );
}
static void GLAPIENTRY _tnl_VertexAttrib2fvARB( GLuint index,
const GLfloat *v )
{
- if (index >= VERT_ATTRIB_MAX) index = ERROR_ATTRIB;
+ if (index >= MAX_VERTEX_ATTRIBS)
+ index = ERROR_ATTRIB;
+ else
+ index += VERT_ATTRIB_GENERIC0;
DISPATCH_ATTR2FV( index, v );
}
static void GLAPIENTRY _tnl_VertexAttrib3fARB( GLuint index, GLfloat x,
GLfloat y, GLfloat z )
{
- if (index >= VERT_ATTRIB_MAX) index = ERROR_ATTRIB;
+ if (index >= MAX_VERTEX_ATTRIBS)
+ index = ERROR_ATTRIB;
+ else
+ index += VERT_ATTRIB_GENERIC0;
DISPATCH_ATTR3F( index, x, y, z );
}
static void GLAPIENTRY _tnl_VertexAttrib3fvARB( GLuint index,
const GLfloat *v )
{
- if (index >= VERT_ATTRIB_MAX) index = ERROR_ATTRIB;
+ if (index >= MAX_VERTEX_ATTRIBS)
+ index = ERROR_ATTRIB;
+ else
+ index += VERT_ATTRIB_GENERIC0;
DISPATCH_ATTR3FV( index, v );
}
@@ -468,14 +481,20 @@ static void GLAPIENTRY _tnl_VertexAttrib4fARB( GLuint index, GLfloat x,
GLfloat y, GLfloat z,
GLfloat w )
{
- if (index >= VERT_ATTRIB_MAX) index = ERROR_ATTRIB;
+ if (index >= MAX_VERTEX_ATTRIBS)
+ index = ERROR_ATTRIB;
+ else
+ index += VERT_ATTRIB_GENERIC0;
DISPATCH_ATTR4F( index, x, y, z, w );
}
static void GLAPIENTRY _tnl_VertexAttrib4fvARB( GLuint index,
const GLfloat *v )
{
- if (index >= VERT_ATTRIB_MAX) index = ERROR_ATTRIB;
+ if (index >= MAX_VERTEX_ATTRIBS)
+ index = ERROR_ATTRIB;
+ else
+ index += VERT_ATTRIB_GENERIC0;
DISPATCH_ATTR4FV( index, v );
}