summaryrefslogtreecommitdiff
path: root/src/mesa/main/api_noop.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2001-12-14 02:50:01 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2001-12-14 02:50:01 +0000
commit86b842790b720cd6b1499ce8edca8a4e9c8dc029 (patch)
treeabb453fefb2beb047768c7077edc449f1d58fcef /src/mesa/main/api_noop.c
parent680522f74c8b7bf982eab1bc127269521c48a632 (diff)
vertex program check-in
Diffstat (limited to 'src/mesa/main/api_noop.c')
-rw-r--r--src/mesa/main/api_noop.c87
1 files changed, 53 insertions, 34 deletions
diff --git a/src/mesa/main/api_noop.c b/src/mesa/main/api_noop.c
index 58a6e7d771..b603b74f5e 100644
--- a/src/mesa/main/api_noop.c
+++ b/src/mesa/main/api_noop.c
@@ -1,8 +1,8 @@
-/* $Id: api_noop.c,v 1.8 2001/04/28 08:39:17 keithw Exp $ */
+/* $Id: api_noop.c,v 1.9 2001/12/14 02:50:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
@@ -58,13 +58,13 @@ void _mesa_noop_EdgeFlagv( const GLboolean *b )
void _mesa_noop_FogCoordfEXT( GLfloat a )
{
GET_CURRENT_CONTEXT(ctx);
- ctx->Current.FogCoord = a;
+ ctx->Current.Attrib[VERT_ATTRIB_FOG][0] = a;
}
void _mesa_noop_FogCoordfvEXT( const GLfloat *v )
{
GET_CURRENT_CONTEXT(ctx);
- ctx->Current.FogCoord = *v;
+ ctx->Current.Attrib[VERT_ATTRIB_FOG][0] = *v;
}
void _mesa_noop_Indexi( GLint i )
@@ -82,7 +82,7 @@ void _mesa_noop_Indexiv( const GLint *v )
void _mesa_noop_Normal3f( GLfloat a, GLfloat b, GLfloat c )
{
GET_CURRENT_CONTEXT(ctx);
- GLfloat *dest = ctx->Current.Normal;
+ GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_NORMAL];
COPY_FLOAT(dest[0], a);
COPY_FLOAT(dest[1], b);
COPY_FLOAT(dest[2], c);
@@ -91,7 +91,7 @@ void _mesa_noop_Normal3f( GLfloat a, GLfloat b, GLfloat c )
void _mesa_noop_Normal3fv( const GLfloat *v )
{
GET_CURRENT_CONTEXT(ctx);
- GLfloat *dest = ctx->Current.Normal;
+ GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_NORMAL];
COPY_FLOAT(dest[0], v[0]);
COPY_FLOAT(dest[1], v[1]);
COPY_FLOAT(dest[2], v[2]);
@@ -155,7 +155,7 @@ void _mesa_noop_Materialfv( GLenum face, GLenum pname, const GLfloat *params )
void _mesa_noop_Color4ub( GLubyte a, GLubyte b, GLubyte c, GLubyte d )
{
GET_CURRENT_CONTEXT(ctx);
- GLfloat *color = ctx->Current.Color;
+ GLfloat *color = ctx->Current.Attrib[VERT_ATTRIB_COLOR0];
color[0] = UBYTE_TO_FLOAT(a);
color[1] = UBYTE_TO_FLOAT(b);
color[2] = UBYTE_TO_FLOAT(c);
@@ -165,7 +165,7 @@ void _mesa_noop_Color4ub( GLubyte a, GLubyte b, GLubyte c, GLubyte d )
void _mesa_noop_Color4ubv( const GLubyte *v )
{
GET_CURRENT_CONTEXT(ctx);
- GLfloat *color = ctx->Current.Color;
+ GLfloat *color = ctx->Current.Attrib[VERT_ATTRIB_COLOR0];
color[0] = UBYTE_TO_FLOAT(v[0]);
color[1] = UBYTE_TO_FLOAT(v[1]);
color[2] = UBYTE_TO_FLOAT(v[2]);
@@ -175,7 +175,7 @@ void _mesa_noop_Color4ubv( const GLubyte *v )
void _mesa_noop_Color4f( GLfloat a, GLfloat b, GLfloat c, GLfloat d )
{
GET_CURRENT_CONTEXT(ctx);
- GLfloat *color = ctx->Current.Color;
+ GLfloat *color = ctx->Current.Attrib[VERT_ATTRIB_COLOR0];
color[0] = a;
color[1] = b;
color[2] = c;
@@ -185,7 +185,7 @@ void _mesa_noop_Color4f( GLfloat a, GLfloat b, GLfloat c, GLfloat d )
void _mesa_noop_Color4fv( const GLfloat *v )
{
GET_CURRENT_CONTEXT(ctx);
- GLfloat *color = ctx->Current.Color;
+ GLfloat *color = ctx->Current.Attrib[VERT_ATTRIB_COLOR0];
color[0] = v[0];
color[1] = v[1];
color[2] = v[2];
@@ -195,7 +195,7 @@ void _mesa_noop_Color4fv( const GLfloat *v )
void _mesa_noop_Color3ub( GLubyte a, GLubyte b, GLubyte c )
{
GET_CURRENT_CONTEXT(ctx);
- GLfloat *color = ctx->Current.Color;
+ GLfloat *color = ctx->Current.Attrib[VERT_ATTRIB_COLOR0];
color[0] = UBYTE_TO_FLOAT(a);
color[1] = UBYTE_TO_FLOAT(b);
color[2] = UBYTE_TO_FLOAT(c);
@@ -205,7 +205,7 @@ void _mesa_noop_Color3ub( GLubyte a, GLubyte b, GLubyte c )
void _mesa_noop_Color3ubv( const GLubyte *v )
{
GET_CURRENT_CONTEXT(ctx);
- GLfloat *color = ctx->Current.Color;
+ GLfloat *color = ctx->Current.Attrib[VERT_ATTRIB_COLOR0];
color[0] = UBYTE_TO_FLOAT(v[0]);
color[1] = UBYTE_TO_FLOAT(v[1]);
color[2] = UBYTE_TO_FLOAT(v[2]);
@@ -215,7 +215,7 @@ void _mesa_noop_Color3ubv( const GLubyte *v )
void _mesa_noop_Color3f( GLfloat a, GLfloat b, GLfloat c )
{
GET_CURRENT_CONTEXT(ctx);
- GLfloat *color = ctx->Current.Color;
+ GLfloat *color = ctx->Current.Attrib[VERT_ATTRIB_COLOR0];
color[0] = a;
color[1] = b;
color[2] = c;
@@ -225,7 +225,7 @@ void _mesa_noop_Color3f( GLfloat a, GLfloat b, GLfloat c )
void _mesa_noop_Color3fv( const GLfloat *v )
{
GET_CURRENT_CONTEXT(ctx);
- GLfloat *color = ctx->Current.Color;
+ GLfloat *color = ctx->Current.Attrib[VERT_ATTRIB_COLOR0];
color[0] = v[0];
color[1] = v[1];
color[2] = v[2];
@@ -241,7 +241,7 @@ void _mesa_noop_MultiTexCoord1fARB( GLenum target, GLfloat a )
*/
if (unit < MAX_TEXTURE_UNITS)
{
- GLfloat *dest = ctx->Current.Texcoord[unit];
+ GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit];
COPY_FLOAT(dest[0], a);
dest[1] = 0;
dest[2] = 0;
@@ -258,7 +258,7 @@ void _mesa_noop_MultiTexCoord1fvARB( GLenum target, GLfloat *v )
*/
if (unit < MAX_TEXTURE_UNITS)
{
- GLfloat *dest = ctx->Current.Texcoord[unit];
+ GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit];
COPY_FLOAT(dest[0], v[0]);
dest[1] = 0;
dest[2] = 0;
@@ -275,7 +275,7 @@ void _mesa_noop_MultiTexCoord2fARB( GLenum target, GLfloat a, GLfloat b )
*/
if (unit < MAX_TEXTURE_UNITS)
{
- GLfloat *dest = ctx->Current.Texcoord[unit];
+ GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit];
COPY_FLOAT(dest[0], a);
COPY_FLOAT(dest[1], b);
dest[2] = 0;
@@ -292,7 +292,7 @@ void _mesa_noop_MultiTexCoord2fvARB( GLenum target, GLfloat *v )
*/
if (unit < MAX_TEXTURE_UNITS)
{
- GLfloat *dest = ctx->Current.Texcoord[unit];
+ GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit];
COPY_FLOAT(dest[0], v[0]);
COPY_FLOAT(dest[1], v[1]);
dest[2] = 0;
@@ -309,7 +309,7 @@ void _mesa_noop_MultiTexCoord3fARB( GLenum target, GLfloat a, GLfloat b, GLfloat
*/
if (unit < MAX_TEXTURE_UNITS)
{
- GLfloat *dest = ctx->Current.Texcoord[unit];
+ GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit];
COPY_FLOAT(dest[0], a);
COPY_FLOAT(dest[1], b);
COPY_FLOAT(dest[2], c);
@@ -326,7 +326,7 @@ void _mesa_noop_MultiTexCoord3fvARB( GLenum target, GLfloat *v )
*/
if (unit < MAX_TEXTURE_UNITS)
{
- GLfloat *dest = ctx->Current.Texcoord[unit];
+ GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit];
COPY_FLOAT(dest[0], v[0]);
COPY_FLOAT(dest[1], v[1]);
COPY_FLOAT(dest[2], v[2]);
@@ -344,7 +344,7 @@ void _mesa_noop_MultiTexCoord4fARB( GLenum target, GLfloat a, GLfloat b,
*/
if (unit < MAX_TEXTURE_UNITS)
{
- GLfloat *dest = ctx->Current.Texcoord[unit];
+ GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit];
COPY_FLOAT(dest[0], a);
COPY_FLOAT(dest[1], b);
COPY_FLOAT(dest[2], c);
@@ -361,7 +361,7 @@ void _mesa_noop_MultiTexCoord4fvARB( GLenum target, GLfloat *v )
*/
if (unit < MAX_TEXTURE_UNITS)
{
- GLfloat *dest = ctx->Current.Texcoord[unit];
+ GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit];
COPY_FLOAT(dest[0], v[0]);
COPY_FLOAT(dest[1], v[1]);
COPY_FLOAT(dest[2], v[2]);
@@ -372,7 +372,7 @@ void _mesa_noop_MultiTexCoord4fvARB( GLenum target, GLfloat *v )
void _mesa_noop_SecondaryColor3ubEXT( GLubyte a, GLubyte b, GLubyte c )
{
GET_CURRENT_CONTEXT(ctx);
- GLfloat *color = ctx->Current.SecondaryColor;
+ GLfloat *color = ctx->Current.Attrib[VERT_ATTRIB_COLOR1];
color[0] = UBYTE_TO_FLOAT(a);
color[1] = UBYTE_TO_FLOAT(b);
color[2] = UBYTE_TO_FLOAT(c);
@@ -382,7 +382,7 @@ void _mesa_noop_SecondaryColor3ubEXT( GLubyte a, GLubyte b, GLubyte c )
void _mesa_noop_SecondaryColor3ubvEXT( const GLubyte *v )
{
GET_CURRENT_CONTEXT(ctx);
- GLfloat *color = ctx->Current.SecondaryColor;
+ GLfloat *color = ctx->Current.Attrib[VERT_ATTRIB_COLOR1];
color[0] = UBYTE_TO_FLOAT(v[0]);
color[1] = UBYTE_TO_FLOAT(v[1]);
color[2] = UBYTE_TO_FLOAT(v[2]);
@@ -392,7 +392,7 @@ void _mesa_noop_SecondaryColor3ubvEXT( const GLubyte *v )
void _mesa_noop_SecondaryColor3fEXT( GLfloat a, GLfloat b, GLfloat c )
{
GET_CURRENT_CONTEXT(ctx);
- GLfloat *color = ctx->Current.SecondaryColor;
+ GLfloat *color = ctx->Current.Attrib[VERT_ATTRIB_COLOR1];
color[0] = a;
color[1] = b;
color[2] = c;
@@ -402,7 +402,7 @@ void _mesa_noop_SecondaryColor3fEXT( GLfloat a, GLfloat b, GLfloat c )
void _mesa_noop_SecondaryColor3fvEXT( const GLfloat *v )
{
GET_CURRENT_CONTEXT(ctx);
- GLfloat *color = ctx->Current.SecondaryColor;
+ GLfloat *color = ctx->Current.Attrib[VERT_ATTRIB_COLOR1];
color[0] = v[0];
color[1] = v[1];
color[2] = v[2];
@@ -412,7 +412,7 @@ void _mesa_noop_SecondaryColor3fvEXT( const GLfloat *v )
void _mesa_noop_TexCoord1f( GLfloat a )
{
GET_CURRENT_CONTEXT(ctx);
- GLfloat *dest = ctx->Current.Texcoord[0];
+ GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0];
COPY_FLOAT(dest[0], a);
dest[1] = 0;
dest[2] = 0;
@@ -422,7 +422,7 @@ void _mesa_noop_TexCoord1f( GLfloat a )
void _mesa_noop_TexCoord1fv( GLfloat *v )
{
GET_CURRENT_CONTEXT(ctx);
- GLfloat *dest = ctx->Current.Texcoord[0];
+ GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0];
COPY_FLOAT(dest[0], v[0]);
dest[1] = 0;
dest[2] = 0;
@@ -432,7 +432,7 @@ void _mesa_noop_TexCoord1fv( GLfloat *v )
void _mesa_noop_TexCoord2f( GLfloat a, GLfloat b )
{
GET_CURRENT_CONTEXT(ctx);
- GLfloat *dest = ctx->Current.Texcoord[0];
+ GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0];
COPY_FLOAT(dest[0], a);
COPY_FLOAT(dest[1], b);
dest[2] = 0;
@@ -442,7 +442,7 @@ void _mesa_noop_TexCoord2f( GLfloat a, GLfloat b )
void _mesa_noop_TexCoord2fv( GLfloat *v )
{
GET_CURRENT_CONTEXT(ctx);
- GLfloat *dest = ctx->Current.Texcoord[0];
+ GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0];
COPY_FLOAT(dest[0], v[0]);
COPY_FLOAT(dest[1], v[1]);
dest[2] = 0;
@@ -452,7 +452,7 @@ void _mesa_noop_TexCoord2fv( GLfloat *v )
void _mesa_noop_TexCoord3f( GLfloat a, GLfloat b, GLfloat c )
{
GET_CURRENT_CONTEXT(ctx);
- GLfloat *dest = ctx->Current.Texcoord[0];
+ GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0];
COPY_FLOAT(dest[0], a);
COPY_FLOAT(dest[1], b);
COPY_FLOAT(dest[2], c);
@@ -462,7 +462,7 @@ void _mesa_noop_TexCoord3f( GLfloat a, GLfloat b, GLfloat c )
void _mesa_noop_TexCoord3fv( GLfloat *v )
{
GET_CURRENT_CONTEXT(ctx);
- GLfloat *dest = ctx->Current.Texcoord[0];
+ GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0];
COPY_FLOAT(dest[0], v[0]);
COPY_FLOAT(dest[1], v[1]);
COPY_FLOAT(dest[2], v[2]);
@@ -472,7 +472,7 @@ void _mesa_noop_TexCoord3fv( GLfloat *v )
void _mesa_noop_TexCoord4f( GLfloat a, GLfloat b, GLfloat c, GLfloat d )
{
GET_CURRENT_CONTEXT(ctx);
- GLfloat *dest = ctx->Current.Texcoord[0];
+ GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0];
COPY_FLOAT(dest[0], a);
COPY_FLOAT(dest[1], b);
COPY_FLOAT(dest[2], c);
@@ -482,13 +482,32 @@ void _mesa_noop_TexCoord4f( GLfloat a, GLfloat b, GLfloat c, GLfloat d )
void _mesa_noop_TexCoord4fv( GLfloat *v )
{
GET_CURRENT_CONTEXT(ctx);
- GLfloat *dest = ctx->Current.Texcoord[0];
+ GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0];
COPY_FLOAT(dest[0], v[0]);
COPY_FLOAT(dest[1], v[1]);
COPY_FLOAT(dest[2], v[2]);
COPY_FLOAT(dest[3], v[3]);
}
+void _mesa_noop_VertexAttrib4fNV( GLuint index, GLfloat x,
+ GLfloat y, GLfloat z, GLfloat w )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ if (index < 16) {
+ ASSIGN_4V(ctx->Current.Attrib[index], x, y, z, w);
+ }
+}
+
+void _mesa_noop_VertexAttrib4fvNV( GLuint index, const GLfloat *v )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ if (index < 16) {
+ ASSIGN_4V(ctx->Current.Attrib[index], v[0], v[1], v[2], v[3]);
+ }
+}
+
+
+
/* Execute a glRectf() function. This is not suitable for GL_COMPILE
* modes (as the test for outside begin/end is not compiled),
* but may be useful for drivers in circumstances which exclude