From b5b8d22c4ee921dff99b898a5907023b20670a27 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 27 Nov 2004 20:07:08 +0000 Subject: Change the dispatch offsets for the VertexAttrib*NV functions so they don't alias with the corresponding ARB functions. GL_ARB_vertex_shader (and OpenGL 2.0's) VertexAttrib functions don't alias with conventional vertex attributes, as GL_NV_vertex_program does. So, the ARB and NV version of VertexAttrib need to be distinct. --- src/mesa/tnl/t_vtx_generic.c | 70 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) (limited to 'src/mesa/tnl/t_vtx_generic.c') diff --git a/src/mesa/tnl/t_vtx_generic.c b/src/mesa/tnl/t_vtx_generic.c index daa7deace37..0422fcd45dc 100644 --- a/src/mesa/tnl/t_vtx_generic.c +++ b/src/mesa/tnl/t_vtx_generic.c @@ -361,6 +361,7 @@ static void GLAPIENTRY _tnl_MultiTexCoord4fv( GLenum target, DISPATCH_ATTR4FV( attr, v ); } + static void GLAPIENTRY _tnl_VertexAttrib1fNV( GLuint index, GLfloat x ) { if (index >= VERT_ATTRIB_MAX) index = ERROR_ATTRIB; @@ -418,6 +419,67 @@ static void GLAPIENTRY _tnl_VertexAttrib4fvNV( GLuint index, } +/* + * XXX adjust index + */ + +static void GLAPIENTRY _tnl_VertexAttrib1fARB( GLuint index, GLfloat x ) +{ + if (index >= VERT_ATTRIB_MAX) index = ERROR_ATTRIB; + DISPATCH_ATTR1F( index, x ); +} + +static void GLAPIENTRY _tnl_VertexAttrib1fvARB( GLuint index, + const GLfloat *v ) +{ + if (index >= VERT_ATTRIB_MAX) index = ERROR_ATTRIB; + DISPATCH_ATTR1FV( index, v ); +} + +static void GLAPIENTRY _tnl_VertexAttrib2fARB( GLuint index, GLfloat x, + GLfloat y ) +{ + if (index >= VERT_ATTRIB_MAX) index = ERROR_ATTRIB; + DISPATCH_ATTR2F( index, x, y ); +} + +static void GLAPIENTRY _tnl_VertexAttrib2fvARB( GLuint index, + const GLfloat *v ) +{ + if (index >= VERT_ATTRIB_MAX) index = ERROR_ATTRIB; + 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; + DISPATCH_ATTR3F( index, x, y, z ); +} + +static void GLAPIENTRY _tnl_VertexAttrib3fvARB( GLuint index, + const GLfloat *v ) +{ + if (index >= VERT_ATTRIB_MAX) index = ERROR_ATTRIB; + DISPATCH_ATTR3FV( index, v ); +} + +static void GLAPIENTRY _tnl_VertexAttrib4fARB( GLuint index, GLfloat x, + GLfloat y, GLfloat z, + GLfloat w ) +{ + if (index >= VERT_ATTRIB_MAX) index = ERROR_ATTRIB; + 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; + DISPATCH_ATTR4FV( index, v ); +} + + /* Install the generic versions of the 2nd level dispatch * functions. Some of these have a codegen alternative. */ @@ -465,4 +527,12 @@ void _tnl_generic_exec_vtxfmt_init( GLcontext *ctx ) vfmt->VertexAttrib3fvNV = _tnl_VertexAttrib3fvNV; vfmt->VertexAttrib4fNV = _tnl_VertexAttrib4fNV; vfmt->VertexAttrib4fvNV = _tnl_VertexAttrib4fvNV; + vfmt->VertexAttrib1fARB = _tnl_VertexAttrib1fARB; + vfmt->VertexAttrib1fvARB = _tnl_VertexAttrib1fvARB; + vfmt->VertexAttrib2fARB = _tnl_VertexAttrib2fARB; + vfmt->VertexAttrib2fvARB = _tnl_VertexAttrib2fvARB; + vfmt->VertexAttrib3fARB = _tnl_VertexAttrib3fARB; + vfmt->VertexAttrib3fvARB = _tnl_VertexAttrib3fvARB; + vfmt->VertexAttrib4fARB = _tnl_VertexAttrib4fARB; + vfmt->VertexAttrib4fvARB = _tnl_VertexAttrib4fvARB; } -- cgit v1.2.3