vertex program check-in

This commit is contained in:
Brian Paul 2001-12-14 02:50:01 +00:00
parent 680522f74c
commit 86b842790b
56 changed files with 6837 additions and 2818 deletions

View file

@ -1,4 +1,4 @@
# $Id: Makefile.X11,v 1.59 2001/11/23 20:44:12 brianp Exp $
# $Id: Makefile.X11,v 1.60 2001/12/14 02:55:08 brianp Exp $
# Mesa 3-D graphics library
# Version: 4.1
@ -21,9 +21,9 @@ LIBDIR = ../lib
CORE_SOURCES = \
swrast_setup/ss_context.c \
swrast_setup/ss_triangle.c \
swrast_setup/ss_vb.c \
vpexec.c \
vpparse.c \
vpstate.c \
api_arrayelt.c \
api_loopback.c \
api_noop.c \
@ -121,6 +121,9 @@ CORE_SOURCES = \
swrast/s_texstore.c \
swrast/s_triangle.c \
swrast/s_zoom.c \
swrast_setup/ss_context.c \
swrast_setup/ss_triangle.c \
swrast_setup/ss_vb.c \
tnl/t_array_api.c \
tnl/t_array_import.c \
tnl/t_context.c \
@ -138,6 +141,7 @@ CORE_SOURCES = \
tnl/t_vb_light.c \
tnl/t_vb_normals.c \
tnl/t_vb_points.c \
tnl/t_vb_program.c \
tnl/t_vb_render.c \
tnl/t_vb_texgen.c \
tnl/t_vb_texmat.c \
@ -337,3 +341,28 @@ dep: $(CORE_SOURCES) $(DRIVER_SOURCES) $(OSMESA_SOURCES)
tags:
etags `find . -name \*.[ch]` `find ../include`
# XXX temporary for NV_vertex_program
VPFILES = \
include/GL/glext.h \
src/Makefile.X11 \
src/vpparse.[ch] \
src/vpexec.[ch] \
src/vpstate.[ch] \
src/attrib.c \
src/context.c \
src/enable.c \
src/extensions.c \
src/get.c \
src/matrix.c \
src/mtypes.h \
src/varray.c \
src/tnl/t_vb_program.c \
tests/vptest1.c \
tests/vptest2.c
vptar:
cd .. ; tar cvf vpfiles.tar $(VPFILES) ; gzip vpfiles.tar

View file

@ -1,4 +1,4 @@
/* $Id: ac_context.c,v 1.5 2001/07/19 15:54:35 brianp Exp $ */
/* $Id: ac_context.c,v 1.6 2001/12/14 02:50:57 brianp Exp $ */
/*
* Mesa 3-D graphics library
@ -46,7 +46,7 @@ static void _ac_fallbacks_init( GLcontext *ctx )
cl->Type = GL_FLOAT;
cl->Stride = 0;
cl->StrideB = 0;
cl->Ptr = (void *) ctx->Current.Normal;
cl->Ptr = (void *) ctx->Current.Attrib[VERT_ATTRIB_NORMAL];
cl->Enabled = 1;
cl->Flags = CA_CLIENT_DATA; /* hack */
@ -55,7 +55,7 @@ static void _ac_fallbacks_init( GLcontext *ctx )
cl->Type = GL_FLOAT;
cl->Stride = 0;
cl->StrideB = 0;
cl->Ptr = (void *) ctx->Current.Color;
cl->Ptr = (void *) ctx->Current.Attrib[VERT_ATTRIB_COLOR0];
cl->Enabled = 1;
cl->Flags = CA_CLIENT_DATA; /* hack */
@ -64,7 +64,7 @@ static void _ac_fallbacks_init( GLcontext *ctx )
cl->Type = GL_FLOAT;
cl->Stride = 0;
cl->StrideB = 0;
cl->Ptr = (void *) ctx->Current.SecondaryColor;
cl->Ptr = (void *) ctx->Current.Attrib[VERT_ATTRIB_COLOR1];
cl->Enabled = 1;
cl->Flags = CA_CLIENT_DATA; /* hack */
@ -73,7 +73,7 @@ static void _ac_fallbacks_init( GLcontext *ctx )
cl->Type = GL_FLOAT;
cl->Stride = 0;
cl->StrideB = 0;
cl->Ptr = (void *) &ctx->Current.FogCoord;
cl->Ptr = (void *) &ctx->Current.Attrib[VERT_ATTRIB_FOG];
cl->Enabled = 1;
cl->Flags = CA_CLIENT_DATA; /* hack */
@ -92,7 +92,7 @@ static void _ac_fallbacks_init( GLcontext *ctx )
cl->Type = GL_FLOAT;
cl->Stride = 0;
cl->StrideB = 0;
cl->Ptr = (void *) ctx->Current.Texcoord[i];
cl->Ptr = (void *) ctx->Current.Attrib[VERT_ATTRIB_TEX0 + i];
cl->Enabled = 1;
cl->Flags = CA_CLIENT_DATA; /* hack */
}

View file

@ -1,4 +1,4 @@
/* $Id: ac_import.c,v 1.14 2001/04/28 08:39:18 keithw Exp $ */
/* $Id: ac_import.c,v 1.15 2001/12/14 02:50:57 brianp Exp $ */
/*
* Mesa 3-D graphics library
@ -59,9 +59,9 @@ static void reset_texcoord( GLcontext *ctx, GLuint unit )
else {
ac->Raw.TexCoord[unit] = ac->Fallback.TexCoord[unit];
if (ctx->Current.Texcoord[unit][3] != 1.0)
if (ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit][3] != 1.0)
ac->Raw.TexCoord[unit].Size = 4;
else if (ctx->Current.Texcoord[unit][2] != 0.0)
else if (ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit][2] != 0.0)
ac->Raw.TexCoord[unit].Size = 3;
else
ac->Raw.TexCoord[unit].Size = 2;
@ -104,7 +104,7 @@ static void reset_color( GLcontext *ctx )
ACcontext *ac = AC_CONTEXT(ctx);
if (ctx->Array._Enabled & _NEW_ARRAY_COLOR) {
if (ctx->Array._Enabled & _NEW_ARRAY_COLOR0) {
ac->Raw.Color = ctx->Array.Color;
STRIDE_ARRAY(ac->Raw.Color, ac->start);
}
@ -112,7 +112,7 @@ static void reset_color( GLcontext *ctx )
ac->Raw.Color = ac->Fallback.Color;
ac->IsCached.Color = GL_FALSE;
ac->NewArrayState &= ~_NEW_ARRAY_COLOR;
ac->NewArrayState &= ~_NEW_ARRAY_COLOR0;
}
@ -120,7 +120,7 @@ static void reset_secondarycolor( GLcontext *ctx )
{
ACcontext *ac = AC_CONTEXT(ctx);
if (ctx->Array._Enabled & _NEW_ARRAY_SECONDARYCOLOR) {
if (ctx->Array._Enabled & _NEW_ARRAY_COLOR1) {
ac->Raw.SecondaryColor = ctx->Array.SecondaryColor;
STRIDE_ARRAY(ac->Raw.SecondaryColor, ac->start);
}
@ -128,7 +128,7 @@ static void reset_secondarycolor( GLcontext *ctx )
ac->Raw.SecondaryColor = ac->Fallback.SecondaryColor;
ac->IsCached.SecondaryColor = GL_FALSE;
ac->NewArrayState &= ~_NEW_ARRAY_SECONDARYCOLOR;
ac->NewArrayState &= ~_NEW_ARRAY_COLOR1;
}
@ -533,7 +533,7 @@ struct gl_client_array *_ac_import_color( GLcontext *ctx,
/* Can we keep the existing version?
*/
if (ac->NewArrayState & _NEW_ARRAY_COLOR)
if (ac->NewArrayState & _NEW_ARRAY_COLOR0)
reset_color( ctx );
/* Is the request impossible?
@ -601,7 +601,7 @@ struct gl_client_array *_ac_import_secondarycolor( GLcontext *ctx,
/* Can we keep the existing version?
*/
if (ac->NewArrayState & _NEW_ARRAY_SECONDARYCOLOR)
if (ac->NewArrayState & _NEW_ARRAY_COLOR1)
reset_secondarycolor( ctx );
/* Is the request impossible?

View file

@ -596,5 +596,69 @@
#define _gloffset_WindowPos3fvARB 591
#define _gloffset_WindowPos3ivARB 592
#define _gloffset_WindowPos3svARB 593
#define _gloffset_BindProgramNV 594
#define _gloffset_DeleteProgramsNV 595
#define _gloffset_ExecuteProgramNV 596
#define _gloffset_GenProgramsNV 597
#define _gloffset_AreProgramsResidentNV 598
#define _gloffset_RequestResidentProgramsNV 599
#define _gloffset_GetProgramParameterfvNV 600
#define _gloffset_GetProgramParameterdvNV 601
#define _gloffset_GetProgramivNV 602
#define _gloffset_GetProgramStringNV 603
#define _gloffset_GetTrackMatrixivNV 604
#define _gloffset_GetVertexAttribdvNV 605
#define _gloffset_GetVertexAttribfvNV 606
#define _gloffset_GetVertexAttribivNV 607
#define _gloffset_GetVertexAttribPointervNV 608
#define _gloffset_IsProgramNV 609
#define _gloffset_LoadProgramNV 610
#define _gloffset_ProgramParameter4fNV 611
#define _gloffset_ProgramParameter4dNV 612
#define _gloffset_ProgramParameter4dvNV 613
#define _gloffset_ProgramParameter4fvNV 614
#define _gloffset_ProgramParameters4dvNV 615
#define _gloffset_ProgramParameters4fvNV 616
#define _gloffset_TrackMatrixNV 617
#define _gloffset_VertexAttribPointerNV 618
#define _gloffset_VertexAttrib1sNV 619
#define _gloffset_VertexAttrib1fNV 620
#define _gloffset_VertexAttrib1dNV 621
#define _gloffset_VertexAttrib2sNV 622
#define _gloffset_VertexAttrib2fNV 623
#define _gloffset_VertexAttrib2dNV 624
#define _gloffset_VertexAttrib3sNV 625
#define _gloffset_VertexAttrib3fNV 626
#define _gloffset_VertexAttrib3dNV 627
#define _gloffset_VertexAttrib4sNV 628
#define _gloffset_VertexAttrib4fNV 629
#define _gloffset_VertexAttrib4dNV 630
#define _gloffset_VertexAttrib4ubNV 631
#define _gloffset_VertexAttrib1svNV 632
#define _gloffset_VertexAttrib1fvNV 633
#define _gloffset_VertexAttrib1dvNV 634
#define _gloffset_VertexAttrib2svNV 635
#define _gloffset_VertexAttrib2fvNV 636
#define _gloffset_VertexAttrib2dvNV 637
#define _gloffset_VertexAttrib3svNV 638
#define _gloffset_VertexAttrib3fvNV 639
#define _gloffset_VertexAttrib3dvNV 640
#define _gloffset_VertexAttrib4svNV 641
#define _gloffset_VertexAttrib4fvNV 642
#define _gloffset_VertexAttrib4dvNV 643
#define _gloffset_VertexAttrib4ubvNV 644
#define _gloffset_VertexAttribs1svNV 645
#define _gloffset_VertexAttribs1fvNV 646
#define _gloffset_VertexAttribs1dvNV 647
#define _gloffset_VertexAttribs2svNV 648
#define _gloffset_VertexAttribs2fvNV 649
#define _gloffset_VertexAttribs2dvNV 650
#define _gloffset_VertexAttribs3svNV 651
#define _gloffset_VertexAttribs3fvNV 652
#define _gloffset_VertexAttribs3dvNV 653
#define _gloffset_VertexAttribs4svNV 654
#define _gloffset_VertexAttribs4fvNV 655
#define _gloffset_VertexAttribs4dvNV 656
#define _gloffset_VertexAttribs4ubvNV 657
#endif

View file

@ -600,6 +600,70 @@ struct _glapi_table
void (*WindowPos3fvARB)(const GLfloat * p); /* 591 */
void (*WindowPos3ivARB)(const GLint * p); /* 592 */
void (*WindowPos3svARB)(const GLshort * p); /* 593 */
void (*BindProgramNV)(GLenum target, GLuint id); /* 594 */
void (*DeleteProgramsNV)(GLsizei n, const GLuint * ids); /* 595 */
void (*ExecuteProgramNV)(GLenum target, GLuint id, const GLfloat * params); /* 596 */
void (*GenProgramsNV)(GLsizei n, GLuint * ids); /* 597 */
GLboolean (*AreProgramsResidentNV)(GLsizei n, const GLuint * ids, GLboolean * residences); /* 598 */
void (*RequestResidentProgramsNV)(GLsizei n, const GLuint * ids); /* 599 */
void (*GetProgramParameterfvNV)(GLenum target, GLuint index, GLenum pname, GLfloat * params); /* 600 */
void (*GetProgramParameterdvNV)(GLenum target, GLuint index, GLenum pname, GLdouble * params); /* 601 */
void (*GetProgramivNV)(GLuint id, GLenum pname, GLint * params); /* 602 */
void (*GetProgramStringNV)(GLuint id, GLenum pname, GLubyte * program); /* 603 */
void (*GetTrackMatrixivNV)(GLenum target, GLuint address, GLenum pname, GLint * params); /* 604 */
void (*GetVertexAttribdvNV)(GLuint index, GLenum pname, GLdouble * params); /* 605 */
void (*GetVertexAttribfvNV)(GLuint index, GLenum pname, GLfloat * params); /* 606 */
void (*GetVertexAttribivNV)(GLuint index, GLenum pname, GLint * params); /* 607 */
void (*GetVertexAttribPointervNV)(GLuint index, GLenum pname, GLvoid ** pointer); /* 608 */
GLboolean (*IsProgramNV)(GLuint id); /* 609 */
void (*LoadProgramNV)(GLenum target, GLuint id, GLsizei len, const GLubyte * program); /* 610 */
void (*ProgramParameter4fNV)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 611 */
void (*ProgramParameter4dNV)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 612 */
void (*ProgramParameter4dvNV)(GLenum target, GLuint index, const GLdouble * params); /* 613 */
void (*ProgramParameter4fvNV)(GLenum target, GLuint index, const GLfloat * params); /* 614 */
void (*ProgramParameters4dvNV)(GLenum target, GLuint index, GLuint num, const GLdouble * params); /* 615 */
void (*ProgramParameters4fvNV)(GLenum target, GLuint index, GLuint num, const GLfloat * params); /* 616 */
void (*TrackMatrixNV)(GLenum target, GLuint address, GLenum matrix, GLenum transform); /* 617 */
void (*VertexAttribPointerNV)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 618 */
void (*VertexAttrib1sNV)(GLuint index, GLshort x); /* 619 */
void (*VertexAttrib1fNV)(GLuint index, GLfloat x); /* 620 */
void (*VertexAttrib1dNV)(GLuint index, GLdouble x); /* 621 */
void (*VertexAttrib2sNV)(GLuint index, GLshort x, GLshort y); /* 622 */
void (*VertexAttrib2fNV)(GLuint index, GLfloat x, GLfloat y); /* 623 */
void (*VertexAttrib2dNV)(GLuint index, GLdouble x, GLdouble y); /* 624 */
void (*VertexAttrib3sNV)(GLuint index, GLshort x, GLshort y, GLshort z); /* 625 */
void (*VertexAttrib3fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z); /* 626 */
void (*VertexAttrib3dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z); /* 627 */
void (*VertexAttrib4sNV)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); /* 628 */
void (*VertexAttrib4fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 629 */
void (*VertexAttrib4dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 630 */
void (*VertexAttrib4ubNV)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); /* 631 */
void (*VertexAttrib1svNV)(GLuint index, const GLshort * v); /* 632 */
void (*VertexAttrib1fvNV)(GLuint index, const GLfloat * v); /* 633 */
void (*VertexAttrib1dvNV)(GLuint index, const GLdouble * v); /* 634 */
void (*VertexAttrib2svNV)(GLuint index, const GLshort * v); /* 635 */
void (*VertexAttrib2fvNV)(GLuint index, const GLfloat * v); /* 636 */
void (*VertexAttrib2dvNV)(GLuint index, const GLdouble * v); /* 637 */
void (*VertexAttrib3svNV)(GLuint index, const GLshort * v); /* 638 */
void (*VertexAttrib3fvNV)(GLuint index, const GLfloat * v); /* 639 */
void (*VertexAttrib3dvNV)(GLuint index, const GLdouble * v); /* 640 */
void (*VertexAttrib4svNV)(GLuint index, const GLshort * v); /* 641 */
void (*VertexAttrib4fvNV)(GLuint index, const GLfloat * v); /* 642 */
void (*VertexAttrib4dvNV)(GLuint index, const GLdouble * v); /* 643 */
void (*VertexAttrib4ubvNV)(GLuint index, const GLubyte * v); /* 644 */
void (*VertexAttribs1svNV)(GLuint index, GLsizei n, const GLshort * v); /* 645 */
void (*VertexAttribs1fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 646 */
void (*VertexAttribs1dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 647 */
void (*VertexAttribs2svNV)(GLuint index, GLsizei n, const GLshort * v); /* 648 */
void (*VertexAttribs2fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 649 */
void (*VertexAttribs2dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 650 */
void (*VertexAttribs3svNV)(GLuint index, GLsizei n, const GLshort * v); /* 651 */
void (*VertexAttribs3fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 652 */
void (*VertexAttribs3dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 653 */
void (*VertexAttribs4svNV)(GLuint index, GLsizei n, const GLshort * v); /* 654 */
void (*VertexAttribs4fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 655 */
void (*VertexAttribs4dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 656 */
void (*VertexAttribs4ubvNV)(GLuint index, GLsizei n, const GLubyte * v); /* 657 */
};
#endif

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,4 @@
# $Id: Makefile.X11,v 1.59 2001/11/23 20:44:12 brianp Exp $
# $Id: Makefile.X11,v 1.60 2001/12/14 02:55:08 brianp Exp $
# Mesa 3-D graphics library
# Version: 4.1
@ -21,9 +21,9 @@ LIBDIR = ../lib
CORE_SOURCES = \
swrast_setup/ss_context.c \
swrast_setup/ss_triangle.c \
swrast_setup/ss_vb.c \
vpexec.c \
vpparse.c \
vpstate.c \
api_arrayelt.c \
api_loopback.c \
api_noop.c \
@ -121,6 +121,9 @@ CORE_SOURCES = \
swrast/s_texstore.c \
swrast/s_triangle.c \
swrast/s_zoom.c \
swrast_setup/ss_context.c \
swrast_setup/ss_triangle.c \
swrast_setup/ss_vb.c \
tnl/t_array_api.c \
tnl/t_array_import.c \
tnl/t_context.c \
@ -138,6 +141,7 @@ CORE_SOURCES = \
tnl/t_vb_light.c \
tnl/t_vb_normals.c \
tnl/t_vb_points.c \
tnl/t_vb_program.c \
tnl/t_vb_render.c \
tnl/t_vb_texgen.c \
tnl/t_vb_texmat.c \
@ -337,3 +341,28 @@ dep: $(CORE_SOURCES) $(DRIVER_SOURCES) $(OSMESA_SOURCES)
tags:
etags `find . -name \*.[ch]` `find ../include`
# XXX temporary for NV_vertex_program
VPFILES = \
include/GL/glext.h \
src/Makefile.X11 \
src/vpparse.[ch] \
src/vpexec.[ch] \
src/vpstate.[ch] \
src/attrib.c \
src/context.c \
src/enable.c \
src/extensions.c \
src/get.c \
src/matrix.c \
src/mtypes.h \
src/varray.c \
src/tnl/t_vb_program.c \
tests/vptest1.c \
tests/vptest2.c
vptar:
cd .. ; tar cvf vpfiles.tar $(VPFILES) ; gzip vpfiles.tar

View file

@ -1,4 +1,4 @@
/* $Id: api_eval.c,v 1.1 2001/06/04 13:57:35 keithw Exp $ */
/* $Id: api_eval.c,v 1.2 2001/12/14 02:50:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
@ -281,16 +281,16 @@ void _mesa_EvalCoord1f( GLfloat u )
GLfloat normal[3], texcoord[4], color[4];
GLuint index;
COPY_3FV( normal, ctx->Current.Normal );
COPY_4FV( texcoord, ctx->Current.Texcoord[0] );
COPY_4FV( color, ctx->Current.Color );
COPY_3FV( normal, ctx->Current.Attrib[VERT_ATTRIB_NORMAL] );
COPY_4FV( texcoord, ctx->Current.Attrib[VERT_ATTRIB_TEX0] );
COPY_4FV( color, ctx->Current.Attrib[VERT_ATTRIB_COLOR0] );
index = ctx->Current.Index;
do_EvalCoord1f( ctx, u );
COPY_3FV( ctx->Current.Normal, normal );
COPY_4FV( ctx->Current.Texcoord[0], texcoord );
COPY_4FV( ctx->Current.Color, color );
COPY_3FV( ctx->Current.Attrib[VERT_ATTRIB_NORMAL], normal );
COPY_4FV( ctx->Current.Attrib[VERT_ATTRIB_TEX0], texcoord );
COPY_4FV( ctx->Current.Attrib[VERT_ATTRIB_COLOR0], color );
ctx->Current.Index = index;
}
@ -300,16 +300,16 @@ void _mesa_EvalCoord2f( GLfloat u, GLfloat v )
GLfloat normal[3], texcoord[4], color[4];
GLuint index;
COPY_3FV( normal, ctx->Current.Normal );
COPY_4FV( texcoord, ctx->Current.Texcoord[0] );
COPY_4FV( color, ctx->Current.Color );
COPY_3FV( normal, ctx->Current.Attrib[VERT_ATTRIB_NORMAL] );
COPY_4FV( texcoord, ctx->Current.Attrib[VERT_ATTRIB_TEX0] );
COPY_4FV( color, ctx->Current.Attrib[VERT_ATTRIB_COLOR0] );
index = ctx->Current.Index;
do_EvalCoord2f( ctx, u, v );
COPY_3FV( ctx->Current.Normal, normal );
COPY_4FV( ctx->Current.Texcoord[0], texcoord );
COPY_4FV( ctx->Current.Color, color );
COPY_3FV( ctx->Current.Attrib[VERT_ATTRIB_NORMAL], normal );
COPY_4FV( ctx->Current.Attrib[VERT_ATTRIB_TEX0], texcoord );
COPY_4FV( ctx->Current.Attrib[VERT_ATTRIB_COLOR0], color );
ctx->Current.Index = index;
}

View file

@ -1,4 +1,4 @@
/* $Id: api_loopback.c,v 1.11 2001/12/04 23:43:31 brianp Exp $ */
/* $Id: api_loopback.c,v 1.12 2001/12/14 02:50:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
@ -66,6 +66,7 @@
#define RECTF(a,b,c,d) DRIVER(Rectf)(a,b,c,d)
#define SECONDARYCOLORUB(a,b,c) DRIVER(SecondaryColor3ubEXT)(a,b,c)
#define SECONDARYCOLORF(a,b,c) DRIVER(SecondaryColor3fEXT)(a,b,c)
#define ATTRIB(index, x, y, z, w) DRIVER(VertexAttrib4fNV)(index, x, y, z, w)
static void
@ -1367,6 +1368,267 @@ loopback_SecondaryColor3usvEXT_f( const GLushort *v )
}
/*
* GL_NV_vertex_program
*/
static void
loopback_VertexAttrib1sNV(GLuint index, GLshort x)
{
ATTRIB(index, (GLfloat) x, 0.0F, 0.0F, 1.0F);
}
static void
loopback_VertexAttrib1fNV(GLuint index, GLfloat x)
{
ATTRIB(index, x, 0.0F, 0.0F, 1.0F);
}
static void
loopback_VertexAttrib1dNV(GLuint index, GLdouble x)
{
ATTRIB(index, (GLfloat) x, 0.0F, 0.0F, 1.0F);
}
static void
loopback_VertexAttrib2sNV(GLuint index, GLshort x, GLshort y)
{
ATTRIB(index, (GLfloat) x, y, 0.0F, 1.0F);
}
static void
loopback_VertexAttrib2fNV(GLuint index, GLfloat x, GLfloat y)
{
ATTRIB(index, (GLfloat) x, y, 0.0F, 1.0F);
}
static void
loopback_VertexAttrib2dNV(GLuint index, GLdouble x, GLdouble y)
{
ATTRIB(index, (GLfloat) x, y, 0.0F, 1.0F);
}
static void
loopback_VertexAttrib3sNV(GLuint index, GLshort x, GLshort y, GLshort z)
{
ATTRIB(index, (GLfloat) x, y, z, 1.0F);
}
static void
loopback_VertexAttrib3fNV(GLuint index, GLfloat x, GLfloat y, GLfloat z)
{
ATTRIB(index, x, y, z, 1.0F);
}
static void
loopback_VertexAttrib3dNV(GLuint index, GLdouble x, GLdouble y, GLdouble z)
{
ATTRIB(index, (GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F);
}
static void
loopback_VertexAttrib4sNV(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w)
{
ATTRIB(index, (GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w);
}
static void
loopback_VertexAttrib4dNV(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
{
ATTRIB(index, (GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w);
}
static void
loopback_VertexAttrib4ubNV(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w)
{
ATTRIB(index, UBYTE_TO_FLOAT(x), UBYTE_TO_FLOAT(y),
UBYTE_TO_FLOAT(z), UBYTE_TO_FLOAT(w));
}
static void
loopback_VertexAttrib1svNV(GLuint index, const GLshort *v)
{
ATTRIB(index, (GLfloat) v[0], 0.0F, 0.0F, 1.0F);
}
static void
loopback_VertexAttrib1fvNV(GLuint index, const GLfloat *v)
{
ATTRIB(index, v[0], 0.0F, 0.0F, 1.0F);
}
static void
loopback_VertexAttrib1dvNV(GLuint index, const GLdouble *v)
{
ATTRIB(index, (GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F);
}
static void
loopback_VertexAttrib2svNV(GLuint index, const GLshort *v)
{
ATTRIB(index, (GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F);
}
static void
loopback_VertexAttrib2fvNV(GLuint index, const GLfloat *v)
{
ATTRIB(index, v[0], v[1], 0.0F, 1.0F);
}
static void
loopback_VertexAttrib2dvNV(GLuint index, const GLdouble *v)
{
ATTRIB(index, (GLfloat) v[0], (GLdouble) v[1], 0.0F, 1.0F);
}
static void
loopback_VertexAttrib3svNV(GLuint index, const GLshort *v)
{
ATTRIB(index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F);
}
static void
loopback_VertexAttrib3fvNV(GLuint index, const GLfloat *v)
{
ATTRIB(index, v[0], v[1], v[2], 1.0F);
}
static void
loopback_VertexAttrib3dvNV(GLuint index, const GLdouble *v)
{
ATTRIB(index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F);
}
static void
loopback_VertexAttrib4svNV(GLuint index, const GLshort *v)
{
ATTRIB(index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F);
}
static void
loopback_VertexAttrib4fvNV(GLuint index, const GLfloat *v)
{
ATTRIB(index, v[0], v[1], v[2], v[3]);
}
static void
loopback_VertexAttrib4dvNV(GLuint index, const GLdouble *v)
{
ATTRIB(index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3]);
}
static void
loopback_VertexAttrib4ubvNV(GLuint index, const GLubyte *v)
{
ATTRIB(index, UBYTE_TO_FLOAT(v[0]), UBYTE_TO_FLOAT(v[1]),
UBYTE_TO_FLOAT(v[2]), UBYTE_TO_FLOAT(v[3]));
}
static void
loopback_VertexAttribs1svNV(GLuint index, GLsizei n, const GLshort *v)
{
GLint i;
for (i = n - 1; i >= 0; i--)
loopback_VertexAttrib1svNV(index + i, v + i);
}
static void
loopback_VertexAttribs1fvNV(GLuint index, GLsizei n, const GLfloat *v)
{
GLint i;
for (i = n - 1; i >= 0; i--)
loopback_VertexAttrib1fvNV(index + i, v + i);
}
static void
loopback_VertexAttribs1dvNV(GLuint index, GLsizei n, const GLdouble *v)
{
GLint i;
for (i = n - 1; i >= 0; i--)
loopback_VertexAttrib1dvNV(index + i, v + i);
}
static void
loopback_VertexAttribs2svNV(GLuint index, GLsizei n, const GLshort *v)
{
GLint i;
for (i = n - 1; i >= 0; i--)
loopback_VertexAttrib2svNV(index + i, v + 2 * i);
}
static void
loopback_VertexAttribs2fvNV(GLuint index, GLsizei n, const GLfloat *v)
{
GLint i;
for (i = n - 1; i >= 0; i--)
loopback_VertexAttrib2fvNV(index + i, v + 2 * i);
}
static void
loopback_VertexAttribs2dvNV(GLuint index, GLsizei n, const GLdouble *v)
{
GLint i;
for (i = n - 1; i >= 0; i--)
loopback_VertexAttrib2dvNV(index + i, v + 2 * i);
}
static void
loopback_VertexAttribs3svNV(GLuint index, GLsizei n, const GLshort *v)
{
GLint i;
for (i = n - 1; i >= 0; i--)
loopback_VertexAttrib3svNV(index + i, v + 3 * i);
}
static void
loopback_VertexAttribs3fvNV(GLuint index, GLsizei n, const GLfloat *v)
{
GLint i;
for (i = n - 1; i >= 0; i--)
loopback_VertexAttrib3fvNV(index + i, v + 3 * i);
}
static void
loopback_VertexAttribs3dvNV(GLuint index, GLsizei n, const GLdouble *v)
{
GLint i;
for (i = n - 1; i >= 0; i--)
loopback_VertexAttrib3dvNV(index + i, v + 3 * i);
}
static void
loopback_VertexAttribs4svNV(GLuint index, GLsizei n, const GLshort *v)
{
GLint i;
for (i = n - 1; i >= 0; i--)
loopback_VertexAttrib4svNV(index + i, v + 4 * i);
}
static void
loopback_VertexAttribs4fvNV(GLuint index, GLsizei n, const GLfloat *v)
{
GLint i;
for (i = n - 1; i >= 0; i--)
loopback_VertexAttrib4fvNV(index + i, v + 4 * i);
}
static void
loopback_VertexAttribs4dvNV(GLuint index, GLsizei n, const GLdouble *v)
{
GLint i;
for (i = n - 1; i >= 0; i--)
loopback_VertexAttrib4dvNV(index + i, v + 4 * i);
}
static void
loopback_VertexAttribs4ubvNV(GLuint index, GLsizei n, const GLubyte *v)
{
GLint i;
for (i = n - 1; i >= 0; i--)
loopback_VertexAttrib4ubvNV(index + i, v + 4 * i);
}
void
_mesa_loopback_prefer_float( struct _glapi_table *dest,
@ -1564,4 +1826,45 @@ _mesa_loopback_init_api_table( struct _glapi_table *dest,
dest->Rectsv = loopback_Rectsv;
dest->FogCoorddEXT = loopback_FogCoorddEXT;
dest->FogCoorddvEXT = loopback_FogCoorddvEXT;
dest->VertexAttrib1sNV = loopback_VertexAttrib1sNV;
dest->VertexAttrib1fNV = loopback_VertexAttrib1fNV;
dest->VertexAttrib1dNV = loopback_VertexAttrib1dNV;
dest->VertexAttrib2sNV = loopback_VertexAttrib2sNV;
dest->VertexAttrib2fNV = loopback_VertexAttrib2fNV;
dest->VertexAttrib2dNV = loopback_VertexAttrib2dNV;
dest->VertexAttrib3sNV = loopback_VertexAttrib3sNV;
dest->VertexAttrib3fNV = loopback_VertexAttrib3fNV;
dest->VertexAttrib3dNV = loopback_VertexAttrib3dNV;
dest->VertexAttrib4sNV = loopback_VertexAttrib4sNV;
dest->VertexAttrib4dNV = loopback_VertexAttrib4dNV;
dest->VertexAttrib4ubNV = loopback_VertexAttrib4ubNV;
dest->VertexAttrib1svNV = loopback_VertexAttrib1svNV;
dest->VertexAttrib1fvNV = loopback_VertexAttrib1fvNV;
dest->VertexAttrib1dvNV = loopback_VertexAttrib1dvNV;
dest->VertexAttrib2svNV = loopback_VertexAttrib2svNV;
dest->VertexAttrib2fvNV = loopback_VertexAttrib2fvNV;
dest->VertexAttrib2dvNV = loopback_VertexAttrib2dvNV;
dest->VertexAttrib3svNV = loopback_VertexAttrib3svNV;
dest->VertexAttrib3fvNV = loopback_VertexAttrib3fvNV;
dest->VertexAttrib3dvNV = loopback_VertexAttrib3dvNV;
dest->VertexAttrib4svNV = loopback_VertexAttrib4svNV;
dest->VertexAttrib4fvNV = loopback_VertexAttrib4fvNV;
dest->VertexAttrib4dvNV = loopback_VertexAttrib4dvNV;
dest->VertexAttrib4ubvNV = loopback_VertexAttrib4ubvNV;
dest->VertexAttribs1svNV = loopback_VertexAttribs1svNV;
dest->VertexAttribs1fvNV = loopback_VertexAttribs1fvNV;
dest->VertexAttribs1dvNV = loopback_VertexAttribs1dvNV;
dest->VertexAttribs2svNV = loopback_VertexAttribs2svNV;
dest->VertexAttribs2fvNV = loopback_VertexAttribs2fvNV;
dest->VertexAttribs2dvNV = loopback_VertexAttribs2dvNV;
dest->VertexAttribs3svNV = loopback_VertexAttribs3svNV;
dest->VertexAttribs3fvNV = loopback_VertexAttribs3fvNV;
dest->VertexAttribs3dvNV = loopback_VertexAttribs3dvNV;
dest->VertexAttribs4svNV = loopback_VertexAttribs4svNV;
dest->VertexAttribs4fvNV = loopback_VertexAttribs4fvNV;
dest->VertexAttribs4dvNV = loopback_VertexAttribs4dvNV;
dest->VertexAttribs4ubvNV = loopback_VertexAttribs4ubvNV;
}

View file

@ -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

View file

@ -1,8 +1,8 @@
/* $Id: api_noop.h,v 1.3 2001/03/12 00:48:37 gareth Exp $ */
/* $Id: api_noop.h,v 1.4 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.
*
@ -116,6 +116,12 @@ extern void _mesa_noop_TexCoord4f( GLfloat a, GLfloat b, GLfloat c, GLfloat d );
extern void _mesa_noop_TexCoord4fv( GLfloat *v );
extern void _mesa_noop_VertexAttrib4fNV( GLuint index, GLfloat x,
GLfloat y, GLfloat z, GLfloat w );
extern void _mesa_noop_VertexAttrib4fvNV( GLuint index, const GLfloat *v );
/* Not strictly a noop -- translate Rectf down to Begin/End and
* vertices. Closer to the loopback operations, but doesn't meet the

View file

@ -1,4 +1,4 @@
/* $Id: attrib.c,v 1.57 2001/09/18 15:27:18 kschultz Exp $ */
/* $Id: attrib.c,v 1.58 2001/12/14 02:50:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
@ -240,6 +240,10 @@ _mesa_PushAttrib(GLbitfield mask)
attr->Texture[i] = ctx->Texture.Unit[i].Enabled;
attr->TexGen[i] = ctx->Texture.Unit[i].TexGenEnabled;
}
/* GL_NV_vertex_program */
attr->VertexProgram = ctx->VertexProgram.Enabled;
attr->VertexProgramPointSize = ctx->VertexProgram.PointSizeEnabled;
attr->VertexProgramTwoSide = ctx->VertexProgram.TwoSideEnabled;
newnode = new_attrib_node( GL_ENABLE_BIT );
newnode->data = attr;
newnode->next = head;
@ -537,6 +541,17 @@ pop_enable_group(GLcontext *ctx, const struct gl_enable_attrib *enable)
TEST_AND_UPDATE(ctx->Multisample.SampleCoverageInvert,
enable->SampleCoverageInvert,
GL_SAMPLE_COVERAGE_INVERT_ARB);
/* GL_NV_vertex_program */
TEST_AND_UPDATE(ctx->VertexProgram.Enabled,
enable->VertexProgram,
GL_VERTEX_PROGRAM_NV);
TEST_AND_UPDATE(ctx->VertexProgram.PointSizeEnabled,
enable->VertexProgramPointSize,
GL_VERTEX_PROGRAM_POINT_SIZE_NV);
TEST_AND_UPDATE(ctx->VertexProgram.TwoSideEnabled,
enable->VertexProgramTwoSide,
GL_VERTEX_PROGRAM_TWO_SIDE_NV);
#undef TEST_AND_UPDATE
/* texture unit enables */

View file

@ -1,8 +1,8 @@
/* $Id: context.c,v 1.149 2001/11/06 15:53:00 brianp Exp $ */
/* $Id: context.c,v 1.150 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.
*
@ -53,7 +53,6 @@
#include "mtypes.h"
#include "varray.h"
#include "vtxfmt.h"
#include "math/m_translate.h"
#include "math/m_vertices.h"
#include "math/m_matrix.h"
@ -89,6 +88,8 @@ int MESA_DEBUG_FLAGS = 0
;
#endif
/**********************************************************************/
/***** OpenGL SI-style interface (new in Mesa 3.5) *****/
/**********************************************************************/
@ -477,6 +478,37 @@ one_time_init( void )
}
static void
init_matrix_stack( struct matrix_stack *stack,
GLuint maxDepth, GLuint dirtyFlag )
{
GLuint i;
stack->Depth = 0;
stack->MaxDepth = maxDepth;
stack->DirtyFlag = dirtyFlag;
/* Top matrix */
_math_matrix_ctr( &stack->Top );
_math_matrix_alloc_inv( &stack->Top );
/* The stack */
stack->Stack = MALLOC(maxDepth * sizeof(GLmatrix));
for (i = 0; i < maxDepth; i++) {
_math_matrix_ctr(&stack->Stack[i]);
_math_matrix_alloc_inv(&stack->Stack[i]);
}
}
static void
free_matrix_stack( struct matrix_stack *stack )
{
GLuint i;
_math_matrix_dtr( &stack->Top );
for (i = 0; i < stack->MaxDepth; i++) {
_math_matrix_dtr(&stack->Stack[i]);
}
}
/*
* Allocate and initialize a shared context state structure.
@ -768,6 +800,9 @@ init_attrib_groups( GLcontext *ctx )
_math_matrix_ctr( &ctx->ModelViewStack[i] );
_math_matrix_alloc_inv( &ctx->ModelViewStack[i] );
}
#if 1
init_matrix_stack(&ctx->ModelviewStack, 32, _NEW_MODELVIEW);
#endif
/* Projection matrix - need inv for user clipping in clip space*/
_math_matrix_ctr( &ctx->ProjectionMatrix );
@ -828,10 +863,16 @@ init_attrib_groups( GLcontext *ctx )
ctx->Color.MultiDrawBuffer = GL_FALSE;
/* Current group */
ASSIGN_4V( ctx->Current.Color, 1.0, 1.0, 1.0, 1.0 );
ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_WEIGHT], 0.0, 0.0, 0.0, 0.0 );
ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_NORMAL], 0.0, 0.0, 1.0, 0.0 );
ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_COLOR0], 1.0, 1.0, 1.0, 1.0 );
ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_COLOR1], 0.0, 0.0, 0.0, 0.0 );
ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_FOG], 0.0, 0.0, 0.0, 0.0 );
for (i = 0; i < MAX_TEXTURE_UNITS; i++)
ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_TEX0 + i], 0.0, 0.0, 0.0, 1.0 );
ctx->Current.Index = 1;
for (i=0; i<MAX_TEXTURE_UNITS; i++)
ASSIGN_4V( ctx->Current.Texcoord[i], 0.0, 0.0, 0.0, 1.0 );
ctx->Current.EdgeFlag = GL_TRUE;
ASSIGN_4V( ctx->Current.RasterPos, 0.0, 0.0, 0.0, 1.0 );
ctx->Current.RasterDistance = 0.0;
ASSIGN_4V( ctx->Current.RasterColor, 1.0, 1.0, 1.0, 1.0 );
@ -840,8 +881,6 @@ init_attrib_groups( GLcontext *ctx )
ASSIGN_4V( ctx->Current.RasterMultiTexCoord[i], 0.0, 0.0, 0.0, 1.0 );
ctx->Current.RasterTexCoord = ctx->Current.RasterMultiTexCoord[0];
ctx->Current.RasterPosValid = GL_TRUE;
ctx->Current.EdgeFlag = GL_TRUE;
ASSIGN_3V( ctx->Current.Normal, 0.0, 0.0, 1.0 );
/* Depth buffer group */
@ -1279,6 +1318,17 @@ init_attrib_groups( GLcontext *ctx )
_mesa_init_colortable(&ctx->PostColorMatrixColorTable);
_mesa_init_colortable(&ctx->ProxyPostColorMatrixColorTable);
/* GL_NV_vertex_program */
ctx->VertexProgram.Binding = 0;
ctx->VertexProgram.HashTable = _mesa_NewHashTable();
ctx->VertexProgram.Enabled = GL_FALSE;
ctx->VertexProgram.PointSizeEnabled = GL_FALSE;
ctx->VertexProgram.TwoSideEnabled = GL_FALSE;
for (i = 0; i < VP_NUM_PROG_REGS / 4; i++) {
ctx->VertexProgram.TrackMatrix[i] = GL_NONE;
ctx->VertexProgram.TrackMatrixTransform[i] = GL_IDENTITY_NV;
}
/* Miscellaneous */
ctx->NewState = _NEW_ALL;
ctx->RenderMode = GL_RENDER;
@ -1600,6 +1650,10 @@ _mesa_free_context_data( GLcontext *ctx )
_mesa_make_current(NULL, NULL);
}
#if 1
free_matrix_stack(&ctx->ModelviewStack);
#endif
_math_matrix_dtr( &ctx->ModelView );
for (i = 0; i < MAX_MODELVIEW_STACK_DEPTH - 1; i++) {
_math_matrix_dtr( &ctx->ModelViewStack[i] );
@ -1690,6 +1744,9 @@ _mesa_free_context_data( GLcontext *ctx )
_mesa_extensions_dtr(ctx);
/* GL_NV_vertex_program */
_mesa_DeleteHashTable(ctx->VertexProgram.HashTable);
FREE(ctx->Exec);
FREE(ctx->Save);
}
@ -1970,21 +2027,6 @@ _mesa_warning( const GLcontext *ctx, const char *s )
/*
* Compile an error into current display list.
*/
void
_mesa_compile_error( GLcontext *ctx, GLenum error, const char *s )
{
if (ctx->CompileFlag)
_mesa_save_error( ctx, error, s );
if (ctx->ExecuteFlag)
_mesa_error( ctx, error, s );
}
/*
* This is Mesa's error handler. Normally, all that's done is the updating
* of the current error value. If Mesa is compiled with -DDEBUG or if the

View file

@ -1,8 +1,8 @@
/* $Id: context.h,v 1.27 2001/05/03 14:11:18 brianp Exp $ */
/* $Id: context.h,v 1.28 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.
*
@ -204,9 +204,6 @@ _mesa_warning( const GLcontext *ctx, const char *s );
extern void
_mesa_error( GLcontext *ctx, GLenum error, const char *s );
extern void
_mesa_compile_error( GLcontext *ctx, GLenum error, const char *s );
extern void

View file

@ -1,4 +1,4 @@
/* $Id: dd.h,v 1.64 2001/12/04 23:43:31 brianp Exp $ */
/* $Id: dd.h,v 1.65 2001/12/14 02:50:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
@ -696,6 +696,9 @@ typedef struct {
void (*CallList)( GLuint ); /* NOTE */
void (*Begin)( GLenum );
void (*End)( void );
void (*VertexAttrib4fNV)( GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w );
void (*VertexAttrib4fvNV)( GLuint index, const GLfloat *v );
/* Drivers present a reduced set of the functions possible in
* begin/end objects. Core mesa provides translation stubs for the
* remaining functions to map down to these entrypoints.

View file

@ -1,4 +1,4 @@
/* $Id: dlist.c,v 1.80 2001/12/13 19:58:20 kschultz Exp $ */
/* $Id: dlist.c,v 1.81 2001/12/14 02:50:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
@ -4049,6 +4049,21 @@ _mesa_save_error( GLcontext *ctx, GLenum error, const char *s )
}
/*
* Compile an error into current display list.
*/
void
_mesa_compile_error( GLcontext *ctx, GLenum error, const char *s )
{
if (ctx->CompileFlag)
_mesa_save_error( ctx, error, s );
if (ctx->ExecuteFlag)
_mesa_error( ctx, error, s );
}
static GLboolean
islist(GLcontext *ctx, GLuint list)
{

View file

@ -1,8 +1,8 @@
/* $Id: dlist.h,v 1.16 2001/03/24 06:01:27 gareth Exp $ */
/* $Id: dlist.h,v 1.17 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.
*
@ -83,19 +83,20 @@ extern void _mesa_ListBase( GLuint base );
extern void _mesa_NewList( GLuint list, GLenum mode );
extern void _mesa_init_dlist_table( struct _glapi_table *table, GLuint tableSize );
extern void _mesa_init_dlist_table( struct _glapi_table *table,
GLuint tableSize );
extern void _mesa_save_error( GLcontext *ctx, GLenum error, const char *s );
extern void _mesa_compile_error( GLcontext *ctx, GLenum error, const char *s );
void *
_mesa_alloc_instruction( GLcontext *ctx, int opcode, GLint sz );
int
_mesa_alloc_opcode( GLcontext *ctx, GLuint sz,
void (*execute)( GLcontext *, void * ),
void (*destroy)( GLcontext *, void * ),
void (*print)( GLcontext *, void * ) );
extern void *_mesa_alloc_instruction( GLcontext *ctx, int opcode, GLint sz );
extern int _mesa_alloc_opcode( GLcontext *ctx, GLuint sz,
void (*execute)( GLcontext *, void * ),
void (*destroy)( GLcontext *, void * ),
void (*print)( GLcontext *, void * ) );
extern void _mesa_save_EvalMesh2(GLenum mode, GLint i1, GLint i2,
GLint j1, GLint j2 );

View file

@ -1,4 +1,4 @@
/* $Id: drawpix.c,v 1.57 2001/12/13 19:12:42 brianp Exp $ */
/* $Id: drawpix.c,v 1.58 2001/12/14 02:55:08 brianp Exp $ */
/*
* Mesa 3-D graphics library
@ -71,13 +71,14 @@ _mesa_DrawPixels( GLsizei width, GLsizei height,
&ctx->Unpack, pixels);
}
else if (ctx->RenderMode==GL_FEEDBACK) {
/* Feedback the current raster pos info */
if (ctx->Current.RasterPosValid) {
FLUSH_CURRENT(ctx, 0);
FLUSH_CURRENT( ctx, 0 );
FEEDBACK_TOKEN( ctx, (GLfloat) (GLint) GL_DRAW_PIXEL_TOKEN );
_mesa_feedback_vertex( ctx,
ctx->Current.RasterPos,
ctx->Current.RasterColor,
ctx->Current.RasterIndex,
ctx->Current.RasterIndex,
ctx->Current.RasterTexCoord );
}
}
@ -146,13 +147,13 @@ _mesa_CopyPixels( GLint srcx, GLint srcy, GLsizei width, GLsizei height,
}
else if (ctx->RenderMode == GL_FEEDBACK) {
if (ctx->Current.RasterPosValid) {
FLUSH_CURRENT(ctx, 0);
FLUSH_CURRENT( ctx, 0 );
FEEDBACK_TOKEN( ctx, (GLfloat) (GLint) GL_COPY_PIXEL_TOKEN );
_mesa_feedback_vertex( ctx,
ctx->Current.RasterPos,
ctx->Current.RasterColor,
ctx->Current.RasterIndex,
ctx->Current.RasterTexCoord );
_mesa_feedback_vertex( ctx,
ctx->Current.RasterPos,
ctx->Current.RasterColor,
ctx->Current.RasterIndex,
ctx->Current.RasterTexCoord );
}
}
else if (ctx->RenderMode == GL_SELECT) {

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,4 @@
/* $Id: extensions.c,v 1.67 2001/12/04 23:44:55 brianp Exp $ */
/* $Id: extensions.c,v 1.68 2001/12/14 02:50:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
@ -112,6 +112,7 @@ static struct {
{ ON, "GL_MESA_window_pos", F(MESA_window_pos) },
{ OFF, "GL_NV_blend_square", F(NV_blend_square) },
{ ON, "GL_NV_texgen_reflection", F(NV_texgen_reflection) },
{ OFF, "GL_NV_vertex_program", F(NV_vertex_program) },
{ OFF, "GL_SGI_color_matrix", F(SGI_color_matrix) },
{ OFF, "GL_SGI_color_table", F(SGI_color_table) },
{ OFF, "GL_SGIS_generate_mipmap", F(SGIS_generate_mipmap) },
@ -170,6 +171,7 @@ _mesa_enable_sw_extensions(GLcontext *ctx)
"GL_MESA_resize_buffers",
"GL_NV_blend_square",
"GL_NV_texgen_reflection",
"GL_NV_vertex_program",
"GL_SGI_color_matrix",
"GL_SGI_color_table",
"GL_SGIS_generate_mipmap",

File diff suppressed because it is too large Load diff

View file

@ -688,5 +688,69 @@ static struct name_address_offset static_functions[] = {
{ "glWindowPos3fvARB", (GLvoid *) glWindowPos3fvARB, _gloffset_WindowPos3fvARB },
{ "glWindowPos3ivARB", (GLvoid *) glWindowPos3ivARB, _gloffset_WindowPos3ivARB },
{ "glWindowPos3svARB", (GLvoid *) glWindowPos3svARB, _gloffset_WindowPos3svARB },
{ "glBindProgramNV", (GLvoid *) glBindProgramNV, _gloffset_BindProgramNV },
{ "glDeleteProgramsNV", (GLvoid *) glDeleteProgramsNV, _gloffset_DeleteProgramsNV },
{ "glExecuteProgramNV", (GLvoid *) glExecuteProgramNV, _gloffset_ExecuteProgramNV },
{ "glGenProgramsNV", (GLvoid *) glGenProgramsNV, _gloffset_GenProgramsNV },
{ "glAreProgramsResidentNV", (GLvoid *) glAreProgramsResidentNV, _gloffset_AreProgramsResidentNV },
{ "glRequestResidentProgramsNV", (GLvoid *) glRequestResidentProgramsNV, _gloffset_RequestResidentProgramsNV },
{ "glGetProgramParameterfvNV", (GLvoid *) glGetProgramParameterfvNV, _gloffset_GetProgramParameterfvNV },
{ "glGetProgramParameterdvNV", (GLvoid *) glGetProgramParameterdvNV, _gloffset_GetProgramParameterdvNV },
{ "glGetProgramivNV", (GLvoid *) glGetProgramivNV, _gloffset_GetProgramivNV },
{ "glGetProgramStringNV", (GLvoid *) glGetProgramStringNV, _gloffset_GetProgramStringNV },
{ "glGetTrackMatrixivNV", (GLvoid *) glGetTrackMatrixivNV, _gloffset_GetTrackMatrixivNV },
{ "glGetVertexAttribdvNV", (GLvoid *) glGetVertexAttribdvNV, _gloffset_GetVertexAttribdvNV },
{ "glGetVertexAttribfvNV", (GLvoid *) glGetVertexAttribfvNV, _gloffset_GetVertexAttribfvNV },
{ "glGetVertexAttribivNV", (GLvoid *) glGetVertexAttribivNV, _gloffset_GetVertexAttribivNV },
{ "glGetVertexAttribPointervNV", (GLvoid *) glGetVertexAttribPointervNV, _gloffset_GetVertexAttribPointervNV },
{ "glIsProgramNV", (GLvoid *) glIsProgramNV, _gloffset_IsProgramNV },
{ "glLoadProgramNV", (GLvoid *) glLoadProgramNV, _gloffset_LoadProgramNV },
{ "glProgramParameter4fNV", (GLvoid *) glProgramParameter4fNV, _gloffset_ProgramParameter4fNV },
{ "glProgramParameter4dNV", (GLvoid *) glProgramParameter4dNV, _gloffset_ProgramParameter4dNV },
{ "glProgramParameter4dvNV", (GLvoid *) glProgramParameter4dvNV, _gloffset_ProgramParameter4dvNV },
{ "glProgramParameter4fvNV", (GLvoid *) glProgramParameter4fvNV, _gloffset_ProgramParameter4fvNV },
{ "glProgramParameters4dvNV", (GLvoid *) glProgramParameters4dvNV, _gloffset_ProgramParameters4dvNV },
{ "glProgramParameters4fvNV", (GLvoid *) glProgramParameters4fvNV, _gloffset_ProgramParameters4fvNV },
{ "glTrackMatrixNV", (GLvoid *) glTrackMatrixNV, _gloffset_TrackMatrixNV },
{ "glVertexAttribPointerNV", (GLvoid *) glVertexAttribPointerNV, _gloffset_VertexAttribPointerNV },
{ "glVertexAttrib1sNV", (GLvoid *) glVertexAttrib1sNV, _gloffset_VertexAttrib1sNV },
{ "glVertexAttrib1fNV", (GLvoid *) glVertexAttrib1fNV, _gloffset_VertexAttrib1fNV },
{ "glVertexAttrib1dNV", (GLvoid *) glVertexAttrib1dNV, _gloffset_VertexAttrib1dNV },
{ "glVertexAttrib2sNV", (GLvoid *) glVertexAttrib2sNV, _gloffset_VertexAttrib2sNV },
{ "glVertexAttrib2fNV", (GLvoid *) glVertexAttrib2fNV, _gloffset_VertexAttrib2fNV },
{ "glVertexAttrib2dNV", (GLvoid *) glVertexAttrib2dNV, _gloffset_VertexAttrib2dNV },
{ "glVertexAttrib3sNV", (GLvoid *) glVertexAttrib3sNV, _gloffset_VertexAttrib3sNV },
{ "glVertexAttrib3fNV", (GLvoid *) glVertexAttrib3fNV, _gloffset_VertexAttrib3fNV },
{ "glVertexAttrib3dNV", (GLvoid *) glVertexAttrib3dNV, _gloffset_VertexAttrib3dNV },
{ "glVertexAttrib4sNV", (GLvoid *) glVertexAttrib4sNV, _gloffset_VertexAttrib4sNV },
{ "glVertexAttrib4fNV", (GLvoid *) glVertexAttrib4fNV, _gloffset_VertexAttrib4fNV },
{ "glVertexAttrib4dNV", (GLvoid *) glVertexAttrib4dNV, _gloffset_VertexAttrib4dNV },
{ "glVertexAttrib4ubNV", (GLvoid *) glVertexAttrib4ubNV, _gloffset_VertexAttrib4ubNV },
{ "glVertexAttrib1svNV", (GLvoid *) glVertexAttrib1svNV, _gloffset_VertexAttrib1svNV },
{ "glVertexAttrib1fvNV", (GLvoid *) glVertexAttrib1fvNV, _gloffset_VertexAttrib1fvNV },
{ "glVertexAttrib1dvNV", (GLvoid *) glVertexAttrib1dvNV, _gloffset_VertexAttrib1dvNV },
{ "glVertexAttrib2svNV", (GLvoid *) glVertexAttrib2svNV, _gloffset_VertexAttrib2svNV },
{ "glVertexAttrib2fvNV", (GLvoid *) glVertexAttrib2fvNV, _gloffset_VertexAttrib2fvNV },
{ "glVertexAttrib2dvNV", (GLvoid *) glVertexAttrib2dvNV, _gloffset_VertexAttrib2dvNV },
{ "glVertexAttrib3svNV", (GLvoid *) glVertexAttrib3svNV, _gloffset_VertexAttrib3svNV },
{ "glVertexAttrib3fvNV", (GLvoid *) glVertexAttrib3fvNV, _gloffset_VertexAttrib3fvNV },
{ "glVertexAttrib3dvNV", (GLvoid *) glVertexAttrib3dvNV, _gloffset_VertexAttrib3dvNV },
{ "glVertexAttrib4svNV", (GLvoid *) glVertexAttrib4svNV, _gloffset_VertexAttrib4svNV },
{ "glVertexAttrib4fvNV", (GLvoid *) glVertexAttrib4fvNV, _gloffset_VertexAttrib4fvNV },
{ "glVertexAttrib4dvNV", (GLvoid *) glVertexAttrib4dvNV, _gloffset_VertexAttrib4dvNV },
{ "glVertexAttrib4ubvNV", (GLvoid *) glVertexAttrib4ubvNV, _gloffset_VertexAttrib4ubvNV },
{ "glVertexAttribs1svNV", (GLvoid *) glVertexAttribs1svNV, _gloffset_VertexAttribs1svNV },
{ "glVertexAttribs1fvNV", (GLvoid *) glVertexAttribs1fvNV, _gloffset_VertexAttribs1fvNV },
{ "glVertexAttribs1dvNV", (GLvoid *) glVertexAttribs1dvNV, _gloffset_VertexAttribs1dvNV },
{ "glVertexAttribs2svNV", (GLvoid *) glVertexAttribs2svNV, _gloffset_VertexAttribs2svNV },
{ "glVertexAttribs2fvNV", (GLvoid *) glVertexAttribs2fvNV, _gloffset_VertexAttribs2fvNV },
{ "glVertexAttribs2dvNV", (GLvoid *) glVertexAttribs2dvNV, _gloffset_VertexAttribs2dvNV },
{ "glVertexAttribs3svNV", (GLvoid *) glVertexAttribs3svNV, _gloffset_VertexAttribs3svNV },
{ "glVertexAttribs3fvNV", (GLvoid *) glVertexAttribs3fvNV, _gloffset_VertexAttribs3fvNV },
{ "glVertexAttribs3dvNV", (GLvoid *) glVertexAttribs3dvNV, _gloffset_VertexAttribs3dvNV },
{ "glVertexAttribs4svNV", (GLvoid *) glVertexAttribs4svNV, _gloffset_VertexAttribs4svNV },
{ "glVertexAttribs4fvNV", (GLvoid *) glVertexAttribs4fvNV, _gloffset_VertexAttribs4fvNV },
{ "glVertexAttribs4dvNV", (GLvoid *) glVertexAttribs4dvNV, _gloffset_VertexAttribs4dvNV },
{ "glVertexAttribs4ubvNV", (GLvoid *) glVertexAttribs4ubvNV, _gloffset_VertexAttribs4ubvNV },
{ NULL, NULL } /* end of list marker */
};

View file

@ -1,4 +1,4 @@
/* $Id: light.c,v 1.46 2001/09/18 16:16:21 kschultz Exp $ */
/* $Id: light.c,v 1.47 2001/12/14 02:50:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
@ -881,7 +881,7 @@ _mesa_ColorMaterial( GLenum face, GLenum mode )
if (ctx->Light.ColorMaterialEnabled) {
FLUSH_CURRENT( ctx, 0 );
_mesa_update_color_material( ctx, ctx->Current.Color );
_mesa_update_color_material(ctx,ctx->Current.Attrib[VERT_ATTRIB_COLOR0]);
}
}

View file

@ -1,4 +1,4 @@
/* $Id: matrix.c,v 1.36 2001/09/18 16:16:21 kschultz Exp $ */
/* $Id: matrix.c,v 1.37 2001/12/14 02:50:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
@ -57,25 +57,38 @@
/**********************************************************************/
#define GET_ACTIVE_MATRIX(ctx, mat, flags, where) \
#define GET_ACTIVE_MATRIX(mat, where) \
do { \
GLint n; \
if (MESA_VERBOSE&VERBOSE_API) fprintf(stderr, "%s\n", where); \
switch (ctx->Transform.MatrixMode) { \
case GL_MODELVIEW: \
mat = &ctx->ModelView; \
flags |= _NEW_MODELVIEW; \
ctx->NewState |= _NEW_MODELVIEW; \
break; \
case GL_PROJECTION: \
mat = &ctx->ProjectionMatrix; \
flags |= _NEW_PROJECTION; \
ctx->NewState |= _NEW_PROJECTION; \
break; \
case GL_TEXTURE: \
mat = &ctx->TextureMatrix[ctx->Texture.CurrentUnit]; \
flags |= _NEW_TEXTURE_MATRIX; \
ctx->NewState |= _NEW_TEXTURE_MATRIX; \
break; \
case GL_COLOR: \
mat = &ctx->ColorMatrix; \
flags |= _NEW_COLOR_MATRIX; \
ctx->NewState |= _NEW_COLOR_MATRIX; \
break; \
case GL_MATRIX0_NV: \
case GL_MATRIX1_NV: \
case GL_MATRIX2_NV: \
case GL_MATRIX3_NV: \
case GL_MATRIX4_NV: \
case GL_MATRIX5_NV: \
case GL_MATRIX6_NV: \
case GL_MATRIX7_NV: \
n = ctx->Transform.MatrixMode - GL_MATRIX0_NV; \
mat = &ctx->VertexProgram.Matrix[n]; \
ctx->NewState |= _NEW_TRACK_MATRIX; \
break; \
default: \
_mesa_problem(ctx, where); \
@ -92,7 +105,7 @@ _mesa_Frustum( GLdouble left, GLdouble right,
GLmatrix *mat = 0;
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
GET_ACTIVE_MATRIX( ctx, mat, ctx->NewState, "glFrustrum" );
GET_ACTIVE_MATRIX(mat, "glFrustrum");
if (nearval <= 0.0 ||
farval <= 0.0 ||
@ -119,7 +132,7 @@ _mesa_Ortho( GLdouble left, GLdouble right,
GLmatrix *mat = 0;
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
GET_ACTIVE_MATRIX( ctx, mat, ctx->NewState, "glOrtho" );
GET_ACTIVE_MATRIX(mat, "glOrtho");
if (left == right ||
bottom == top ||
@ -142,6 +155,19 @@ _mesa_MatrixMode( GLenum mode )
ASSERT_OUTSIDE_BEGIN_END(ctx);
switch (mode) {
case GL_MATRIX0_NV:
case GL_MATRIX1_NV:
case GL_MATRIX2_NV:
case GL_MATRIX3_NV:
case GL_MATRIX4_NV:
case GL_MATRIX5_NV:
case GL_MATRIX6_NV:
case GL_MATRIX7_NV:
if (!ctx->Extensions.NV_vertex_program) {
_mesa_error( ctx, GL_INVALID_ENUM, "glMatrixMode" );
return;
}
/* FALL-THROUGH */
case GL_MODELVIEW:
case GL_PROJECTION:
case GL_TEXTURE:
@ -275,7 +301,7 @@ _mesa_LoadIdentity( void )
GET_CURRENT_CONTEXT(ctx);
GLmatrix *mat = 0;
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
GET_ACTIVE_MATRIX(ctx, mat, ctx->NewState, "glLoadIdentity");
GET_ACTIVE_MATRIX(mat, "glLoadIdentity");
_math_matrix_set_identity( mat );
}
@ -286,7 +312,7 @@ _mesa_LoadMatrixf( const GLfloat *m )
GET_CURRENT_CONTEXT(ctx);
GLmatrix *mat = 0;
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
GET_ACTIVE_MATRIX(ctx, mat, ctx->NewState, "glLoadMatrix");
GET_ACTIVE_MATRIX(mat, "glLoadMatrix");
_math_matrix_loadf( mat, m );
}
@ -312,7 +338,7 @@ _mesa_MultMatrixf( const GLfloat *m )
GET_CURRENT_CONTEXT(ctx);
GLmatrix *mat = 0;
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
GET_ACTIVE_MATRIX( ctx, mat, ctx->NewState, "glMultMatrix" );
GET_ACTIVE_MATRIX(mat, "glMultMatrix");
_math_matrix_mul_floats( mat, m );
}
@ -343,7 +369,7 @@ _mesa_Rotatef( GLfloat angle, GLfloat x, GLfloat y, GLfloat z )
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
if (angle != 0.0F) {
GLmatrix *mat = 0;
GET_ACTIVE_MATRIX( ctx, mat, ctx->NewState, "glRotate" );
GET_ACTIVE_MATRIX(mat, "glRotate");
_math_matrix_rotate( mat, angle, x, y, z );
}
}
@ -364,7 +390,7 @@ _mesa_Scalef( GLfloat x, GLfloat y, GLfloat z )
GET_CURRENT_CONTEXT(ctx);
GLmatrix *mat = 0;
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
GET_ACTIVE_MATRIX(ctx, mat, ctx->NewState, "glScale");
GET_ACTIVE_MATRIX(mat, "glScale");
_math_matrix_scale( mat, x, y, z );
}
@ -385,7 +411,7 @@ _mesa_Translatef( GLfloat x, GLfloat y, GLfloat z )
GET_CURRENT_CONTEXT(ctx);
GLmatrix *mat = 0;
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
GET_ACTIVE_MATRIX(ctx, mat, ctx->NewState, "glTranslate");
GET_ACTIVE_MATRIX(mat, "glTranslate");
_math_matrix_translate( mat, x, y, z );
}

View file

@ -1,4 +1,4 @@
/* $Id: mtypes.h,v 1.54 2001/12/04 23:44:56 brianp Exp $ */
/* $Id: mtypes.h,v 1.55 2001/12/14 02:50:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
@ -63,7 +63,7 @@
#define CHAN_MAXF 1.0F
#define CHAN_TYPE GL_FLOAT
#else
#error illegal number of color channel bits
#error "illegal number of color channel bits"
#endif
@ -295,28 +295,46 @@ struct gl_colorbuffer_attrib {
};
/* These define the aliases between numbered vertex attributes and
* conventional OpenGL vertex attributes.
*/
#define VERT_ATTRIB_POS 0
#define VERT_ATTRIB_WEIGHT 1
#define VERT_ATTRIB_NORMAL 2
#define VERT_ATTRIB_COLOR0 3
#define VERT_ATTRIB_COLOR1 4
#define VERT_ATTRIB_FOG 5
#define VERT_ATTRIB_SIX 6
#define VERT_ATTRIB_SEVEN 7
#define VERT_ATTRIB_TEX0 8
#define VERT_ATTRIB_TEX1 9
#define VERT_ATTRIB_TEX2 10
#define VERT_ATTRIB_TEX3 11
#define VERT_ATTRIB_TEX4 12
#define VERT_ATTRIB_TEX5 13
#define VERT_ATTRIB_TEX6 14
#define VERT_ATTRIB_TEX7 15
struct gl_current_attrib {
/* These values valid only when FLUSH_VERTICES has been called.
*/
GLfloat Normal[3]; /* Current vertex normal */
GLfloat Color[4]; /* Current RGBA color */
GLfloat SecondaryColor[4]; /* Current secondary color */
GLfloat FogCoord; /* Current Fog coord */
GLfloat Attrib[8 + MAX_TEXTURE_UNITS][4]; /* Current vertex attributes */
/* indexed by VERT_ATTRIB_* */
GLuint Index; /* Current color index */
GLboolean EdgeFlag; /* Current edge flag */
GLfloat Texcoord[MAX_TEXTURE_UNITS][4]; /* Current texture coords */
/* These values are always valid.
/* These values are always valid. BTW, note how similar this set of
* attributes is to the SWvertex datatype in the software rasterizer...
*/
GLfloat RasterPos[4]; /* Current raster position */
GLfloat RasterDistance; /* Current raster distance */
GLfloat RasterColor[4]; /* Current raster color */
GLfloat RasterSecondaryColor[4]; /* Current rast 2ndary color */
GLuint RasterIndex; /* Current raster index */
GLfloat *RasterTexCoord; /* Current raster texcoord*/
GLuint RasterIndex; /* Current raster index */
GLfloat *RasterTexCoord; /* Current raster texcoord */
GLfloat RasterMultiTexCoord[MAX_TEXTURE_UNITS][4];
GLfloat RasterFogCoord;
GLboolean RasterPosValid; /* Raster po valid flag */
GLboolean RasterPosValid; /* Raster pos valid flag */
};
@ -387,6 +405,10 @@ struct gl_enable_attrib {
GLboolean RasterPositionUnclipped; /* GL_IBM_rasterpos_clip */
GLuint Texture[MAX_TEXTURE_UNITS];
GLuint TexGen[MAX_TEXTURE_UNITS];
/* GL_NV_vertex_program */
GLboolean VertexProgram;
GLboolean VertexProgramPointSize;
GLboolean VertexProgramTwoSide;
};
@ -475,6 +497,11 @@ struct gl_convolution_attrib {
};
#define LIGHT_SPOT 0x1
#define LIGHT_LOCAL_VIEWER 0x2
#define LIGHT_POSITIONAL 0x4
#define LIGHT_NEED_VERTICES (LIGHT_POSITIONAL|LIGHT_LOCAL_VIEWER)
struct gl_light_attrib {
struct gl_light Light[MAX_LIGHTS]; /* Array of lights */
struct gl_lightmodel Model; /* Lighting model */
@ -494,17 +521,11 @@ struct gl_light_attrib {
/* Derived for optimizations: */
GLboolean _NeedVertices; /* Use fast shader? */
GLuint _Flags; /* LIGHT_* flags, see below */
GLuint _Flags; /* LIGHT_* flags, see above */
GLfloat _BaseColor[2][3];
};
#define LIGHT_SPOT 0x1
#define LIGHT_LOCAL_VIEWER 0x2
#define LIGHT_POSITIONAL 0x4
#define LIGHT_NEED_VERTICES (LIGHT_POSITIONAL|LIGHT_LOCAL_VIEWER)
struct gl_line_attrib {
GLboolean SmoothFlag; /* GL_LINE_SMOOTH enabled? */
GLboolean StippleFlag; /* GL_LINE_STIPPLE enabled? */
@ -519,6 +540,7 @@ struct gl_list_attrib {
GLuint ListBase;
};
struct gl_list_opcode {
GLuint size;
void (*execute)( GLcontext *ctx, void *data );
@ -1021,6 +1043,8 @@ struct gl_array_attrib {
struct gl_client_array TexCoord[MAX_TEXTURE_UNITS];
struct gl_client_array EdgeFlag;
struct gl_client_array VertexAttrib[16]; /* GL_NV_vertex_program */
GLint TexCoordInterleaveFactor;
GLint ActiveTexture; /* Client Active Texture */
GLuint LockFirst;
@ -1102,6 +1126,158 @@ struct gl_evaluators {
};
/*
* Vertex program tokens and datatypes
*/
#define VP_MAX_INSTRUCTIONS 128
#define VP_MAX_MATRICES 8
#define VP_MAX_MATRIX_DEPTH 4
#define VP_NUM_INPUT_REGS 16
#define VP_NUM_OUTPUT_REGS 15
#define VP_NUM_TEMP_REGS 12
#define VP_NUM_PROG_REGS 96
#define VP_NUM_TOTAL_REGISTERS (VP_NUM_INPUT_REGS + VP_NUM_OUTPUT_REGS + VP_NUM_TEMP_REGS + VP_NUM_PROG_REGS)
/* Location of register sets within the whole register file */
#define VP_INPUT_REG_START 0
#define VP_INPUT_REG_END (VP_INPUT_REG_START + VP_NUM_INPUT_REGS - 1)
#define VP_OUTPUT_REG_START (VP_INPUT_REG_END + 1)
#define VP_OUTPUT_REG_END (VP_OUTPUT_REG_START + VP_NUM_OUTPUT_REGS - 1)
#define VP_TEMP_REG_START (VP_OUTPUT_REG_END + 1)
#define VP_TEMP_REG_END (VP_TEMP_REG_START + VP_NUM_TEMP_REGS - 1)
#define VP_PROG_REG_START (VP_TEMP_REG_END + 1)
#define VP_PROG_REG_END (VP_PROG_REG_START + VP_NUM_PROG_REGS - 1)
/* Input register names */
#define VP_IN_OPOS (VP_INPUT_REG_START + 0)
#define VP_IN_WGHT (VP_INPUT_REG_START + 1)
#define VP_IN_NRML (VP_INPUT_REG_START + 2)
#define VP_IN_COL0 (VP_INPUT_REG_START + 3)
#define VP_IN_COL1 (VP_INPUT_REG_START + 4)
#define VP_IN_FOGC (VP_INPUT_REG_START + 5)
#define VP_IN_TEX0 (VP_INPUT_REG_START + 8)
#define VP_IN_TEX1 (VP_INPUT_REG_START + 9)
#define VP_IN_TEX2 (VP_INPUT_REG_START + 10)
#define VP_IN_TEX3 (VP_INPUT_REG_START + 11)
#define VP_IN_TEX4 (VP_INPUT_REG_START + 12)
#define VP_IN_TEX5 (VP_INPUT_REG_START + 13)
#define VP_IN_TEX6 (VP_INPUT_REG_START + 14)
#define VP_IN_TEX7 (VP_INPUT_REG_START + 15)
/* Output register names */
#define VP_OUT_HPOS (VP_OUTPUT_REG_START + 0)
#define VP_OUT_COL0 (VP_OUTPUT_REG_START + 1)
#define VP_OUT_COL1 (VP_OUTPUT_REG_START + 2)
#define VP_OUT_BFC0 (VP_OUTPUT_REG_START + 3)
#define VP_OUT_BFC1 (VP_OUTPUT_REG_START + 4)
#define VP_OUT_FOGC (VP_OUTPUT_REG_START + 5)
#define VP_OUT_PSIZ (VP_OUTPUT_REG_START + 6)
#define VP_OUT_TEX0 (VP_OUTPUT_REG_START + 7)
#define VP_OUT_TEX1 (VP_OUTPUT_REG_START + 8)
#define VP_OUT_TEX2 (VP_OUTPUT_REG_START + 9)
#define VP_OUT_TEX3 (VP_OUTPUT_REG_START + 10)
#define VP_OUT_TEX4 (VP_OUTPUT_REG_START + 11)
#define VP_OUT_TEX5 (VP_OUTPUT_REG_START + 12)
#define VP_OUT_TEX6 (VP_OUTPUT_REG_START + 13)
#define VP_OUT_TEX7 (VP_OUTPUT_REG_START + 14)
/* Machine state (i.e. the register file) */
struct vp_machine
{
GLfloat Registers[VP_NUM_TOTAL_REGISTERS][4];
GLint AddressReg; /* might someday be a 4-vector */
};
/* Vertex program opcodes */
enum vp_opcode
{
MOV,
LIT,
RCP,
RSQ,
EXP,
LOG,
MUL,
ADD,
DP3,
DP4,
DST,
MIN,
MAX,
SLT,
SGE,
MAD,
ARL,
END
};
/* Instruction source register */
struct vp_src_register
{
GLint Register; /* or the offset from the address register */
GLuint Swizzle[4];
GLboolean Negate;
GLboolean RelAddr;
};
/* Instruction destination register */
struct vp_dst_register
{
GLint Register;
GLboolean WriteMask[4];
};
/* Vertex program instruction */
struct vp_instruction
{
enum vp_opcode Opcode;
struct vp_src_register SrcReg[3];
struct vp_dst_register DstReg;
};
/* The actual vertex program, stored in the hash table */
struct vp_program
{
GLubyte *String; /* Original user code */
struct vp_instruction *Instructions; /* Compiled instructions */
GLenum Target; /* GL_VERTEX_PROGRAM_NV or GL_VERTEX_STATE_PROGRAM_NV */
GLint ErrorPos;
GLboolean Resident;
};
/*
* State vars for GL_NV_vertex_program
*/
struct gl_vertex_program
{
GLboolean Enabled; /* GL_VERTEX_PROGRAM_NV */
GLboolean PointSizeEnabled; /* GL_VERTEX_PROGRAM_POINT_SIZE_NV */
GLboolean TwoSideEnabled; /* GL_VERTEX_PROGRAM_TWO_SIDE_NV */
GLuint Binding; /* currently bound program */
struct _mesa_HashTable *HashTable; /* all programs */
struct vp_machine Machine; /* machine state */
GLmatrix Matrix[VP_MAX_MATRICES]; /* Tracking matrices */
GLmatrix MatrixStack[VP_MAX_MATRICES][VP_MAX_MATRIX_DEPTH-1]; /* stacks */
GLuint MatrixStackDepth[VP_MAX_MATRICES];
GLenum TrackMatrix[VP_NUM_PROG_REGS / 4];
GLenum TrackMatrixTransform[VP_NUM_PROG_REGS / 4];
};
/*
* State which can be shared by multiple contexts:
*/
@ -1246,6 +1422,7 @@ struct gl_extensions {
GLboolean MESA_sprite_point;
GLboolean NV_blend_square;
GLboolean NV_texgen_reflection;
GLboolean NV_vertex_program;
GLboolean SGI_color_matrix;
GLboolean SGI_color_table;
GLboolean SGIS_generate_mipmap;
@ -1259,6 +1436,16 @@ struct gl_extensions {
};
/* XXX just an idea */
struct matrix_stack
{
GLmatrix Top;
GLmatrix *Stack;
GLuint Depth;
GLuint MaxDepth;
GLuint DirtyFlag; /* _NEW_MODELVIEW or _NEW_PROJECTION, for example */
};
/*
* Bits for image transfer operations (ctx->ImageTransferState).
@ -1319,28 +1506,32 @@ struct gl_extensions {
#define _NEW_RENDERMODE 0x800000 /* RenderMode, Feedback, Select */
#define _NEW_BUFFERS 0x1000000 /* ctx->Visual, ctx->DrawBuffer, */
#define _NEW_MULTISAMPLE 0x2000000 /* ctx->Multisample */
#define _NEW_TRACK_MATRIX 0x4000000 /* ctx->VertexProgram */
#define _NEW_ALL ~0
/* Bits to track array state changes (also used to summarize array enabled)
*/
#define _NEW_ARRAY_VERTEX 0x1
#define _NEW_ARRAY_COLOR 0x2
#define _NEW_ARRAY_NORMAL 0x4
#define _NEW_ARRAY_INDEX 0x8
#define _NEW_ARRAY_EDGEFLAG 0x10
#define _NEW_ARRAY_SECONDARYCOLOR 0x20
#define _NEW_ARRAY_FOGCOORD 0x40
#define _NEW_ARRAY_TEXCOORD_0 0x80
#define _NEW_ARRAY_TEXCOORD_1 0x100
#define _NEW_ARRAY_TEXCOORD_2 0x200
#define _NEW_ARRAY_TEXCOORD_3 0x400
#define _NEW_ARRAY_TEXCOORD_4 0x800
#define _NEW_ARRAY_TEXCOORD_5 0x1000
#define _NEW_ARRAY_TEXCOORD_6 0x2000
#define _NEW_ARRAY_TEXCOORD_7 0x4000
#define _NEW_ARRAY_ALL 0x7fff
#define _NEW_ARRAY_VERTEX (1 << VERT_ATTRIB_POS)
#define _NEW_ARRAY_WEIGHT (1 << VERT_ATTRIB_WEIGHT)
#define _NEW_ARRAY_NORMAL (1 << VERT_ATTRIB_NORMAL)
#define _NEW_ARRAY_COLOR0 (1 << VERT_ATTRIB_COLOR0)
#define _NEW_ARRAY_COLOR1 (1 << VERT_ATTRIB_COLOR1)
#define _NEW_ARRAY_FOGCOORD (1 << VERT_ATTRIB_FOG)
#define _NEW_ARRAY_INDEX (1 << VERT_ATTRIB_SIX)
#define _NEW_ARRAY_EDGEFLAG (1 << VERT_ATTRIB_SEVEN)
#define _NEW_ARRAY_TEXCOORD_0 (1 << VERT_ATTRIB_TEX0)
#define _NEW_ARRAY_TEXCOORD_1 (1 << VERT_ATTRIB_TEX1)
#define _NEW_ARRAY_TEXCOORD_2 (1 << VERT_ATTRIB_TEX2)
#define _NEW_ARRAY_TEXCOORD_3 (1 << VERT_ATTRIB_TEX3)
#define _NEW_ARRAY_TEXCOORD_4 (1 << VERT_ATTRIB_TEX4)
#define _NEW_ARRAY_TEXCOORD_5 (1 << VERT_ATTRIB_TEX5)
#define _NEW_ARRAY_TEXCOORD_6 (1 << VERT_ATTRIB_TEX6)
#define _NEW_ARRAY_TEXCOORD_7 (1 << VERT_ATTRIB_TEX7)
#define _NEW_ARRAY_ALL 0xffff
#define _NEW_ARRAY_VERT_ATTRIB0 0x10000
#define _NEW_ARRAY_TEXCOORD(i) (_NEW_ARRAY_TEXCOORD_0 << (i))
@ -1467,6 +1658,9 @@ struct __GLcontextRec {
GLmatrix ModelView; /* current matrix, not stored on stack */
GLuint ModelViewStackDepth;
GLmatrix ModelViewStack[MAX_MODELVIEW_STACK_DEPTH - 1];
#if 1
struct matrix_stack ModelviewStack;
#endif
/* Projection matrix and stack */
GLmatrix ProjectionMatrix; /* current matrix, not stored on stack */
@ -1551,6 +1745,8 @@ struct __GLcontextRec {
struct gl_color_table PostColorMatrixColorTable;
struct gl_color_table ProxyPostColorMatrixColorTable;
struct gl_vertex_program VertexProgram; /* GL_NV_vertex_program */
GLenum ErrorValue; /* Last error code */
GLenum RenderMode; /* either GL_RENDER, GL_SELECT, GL_FEEDBACK */
GLuint NewState; /* bitwise-or of _NEW_* flags */

View file

@ -1,4 +1,4 @@
/* $Id: rastpos.c,v 1.32 2001/11/18 23:52:38 brianp Exp $ */
/* $Id: rastpos.c,v 1.33 2001/12/14 02:50:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
@ -291,7 +291,7 @@ raster_pos4f(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
/* raster color */
if (ctx->Light.Enabled) {
GLfloat *norm, eyenorm[3];
GLfloat *objnorm = ctx->Current.Normal;
GLfloat *objnorm = ctx->Current.Attrib[VERT_ATTRIB_NORMAL];
if (ctx->_NeedEyeCoords) {
GLfloat *inv = ctx->ModelView.inv;
@ -311,9 +311,10 @@ raster_pos4f(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
else {
/* use current color or index */
if (ctx->Visual.rgbMode) {
COPY_4FV(ctx->Current.RasterColor, ctx->Current.Color);
COPY_4FV(ctx->Current.RasterColor,
ctx->Current.Attrib[VERT_ATTRIB_COLOR0]);
COPY_4FV(ctx->Current.RasterSecondaryColor,
ctx->Current.SecondaryColor);
ctx->Current.Attrib[VERT_ATTRIB_COLOR1]);
}
else {
ctx->Current.RasterIndex = ctx->Current.Index;
@ -362,13 +363,13 @@ raster_pos4f(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
ctx->Current.RasterPos[3] = clip[3];
ctx->Current.RasterPosValid = GL_TRUE;
ctx->Current.RasterFogCoord = ctx->Current.FogCoord;
ctx->Current.RasterFogCoord = ctx->Current.Attrib[VERT_ATTRIB_FOG][0];
{
GLuint texSet;
for (texSet = 0; texSet < ctx->Const.MaxTextureUnits; texSet++) {
COPY_4FV( ctx->Current.RasterMultiTexCoord[texSet],
ctx->Current.Texcoord[texSet] );
ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texSet] );
}
}
@ -559,10 +560,8 @@ _mesa_WindowPos4fMESA( GLfloat x, GLfloat y, GLfloat z, GLfloat w )
/* raster color = current color or index */
if (ctx->Visual.rgbMode) {
ctx->Current.RasterColor[0] = (ctx->Current.Color[0]);
ctx->Current.RasterColor[1] = (ctx->Current.Color[1]);
ctx->Current.RasterColor[2] = (ctx->Current.Color[2]);
ctx->Current.RasterColor[3] = (ctx->Current.Color[3]);
COPY_4FV(ctx->Current.RasterColor,
ctx->Current.Attrib[VERT_ATTRIB_COLOR0]);
}
else {
ctx->Current.RasterIndex = ctx->Current.Index;
@ -573,7 +572,7 @@ _mesa_WindowPos4fMESA( GLfloat x, GLfloat y, GLfloat z, GLfloat w )
GLuint texSet;
for (texSet = 0; texSet < ctx->Const.MaxTextureUnits; texSet++) {
COPY_4FV( ctx->Current.RasterMultiTexCoord[texSet],
ctx->Current.Texcoord[texSet] );
ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texSet] );
}
}
@ -834,23 +833,27 @@ void _mesa_WindowPos3fARB(GLfloat x, GLfloat y, GLfloat z)
ctx->Current.RasterPosValid = GL_TRUE;
/* XXX might have to change this */
ctx->Current.RasterDistance = ctx->Current.FogCoord;
ctx->Current.RasterFogCoord = ctx->Current.FogCoord;
ctx->Current.RasterDistance = ctx->Current.Attrib[VERT_ATTRIB_FOG][0];
ctx->Current.RasterFogCoord = ctx->Current.Attrib[VERT_ATTRIB_FOG][0];
/* raster color = current color or index */
if (ctx->Visual.rgbMode) {
ctx->Current.RasterColor[0] = CLAMP(ctx->Current.Color[0], 0.0F, 1.0F);
ctx->Current.RasterColor[1] = CLAMP(ctx->Current.Color[1], 0.0F, 1.0F);
ctx->Current.RasterColor[2] = CLAMP(ctx->Current.Color[2], 0.0F, 1.0F);
ctx->Current.RasterColor[3] = CLAMP(ctx->Current.Color[3], 0.0F, 1.0F);
ctx->Current.RasterColor[0]
= CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0], 0.0F, 1.0F);
ctx->Current.RasterColor[1]
= CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1], 0.0F, 1.0F);
ctx->Current.RasterColor[2]
= CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2], 0.0F, 1.0F);
ctx->Current.RasterColor[3]
= CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3], 0.0F, 1.0F);
ctx->Current.RasterSecondaryColor[0]
= CLAMP(ctx->Current.SecondaryColor[0], 0.0F, 1.0F);
= CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][0], 0.0F, 1.0F);
ctx->Current.RasterSecondaryColor[1]
= CLAMP(ctx->Current.SecondaryColor[1], 0.0F, 1.0F);
= CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][1], 0.0F, 1.0F);
ctx->Current.RasterSecondaryColor[2]
= CLAMP(ctx->Current.SecondaryColor[2], 0.0F, 1.0F);
= CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][2], 0.0F, 1.0F);
ctx->Current.RasterSecondaryColor[3]
= CLAMP(ctx->Current.SecondaryColor[3], 0.0F, 1.0F);
= CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][3], 0.0F, 1.0F);
}
else {
ctx->Current.RasterIndex = ctx->Current.Index;
@ -861,7 +864,7 @@ void _mesa_WindowPos3fARB(GLfloat x, GLfloat y, GLfloat z)
GLuint texSet;
for (texSet = 0; texSet < ctx->Const.MaxTextureUnits; texSet++) {
COPY_4FV( ctx->Current.RasterMultiTexCoord[texSet],
ctx->Current.Texcoord[texSet] );
ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texSet] );
}
}

View file

@ -1,4 +1,4 @@
/* $Id: state.c,v 1.72 2001/12/04 23:43:31 brianp Exp $ */
/* $Id: state.c,v 1.73 2001/12/14 02:50:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
@ -69,6 +69,7 @@
#include "texstate.h"
#include "mtypes.h"
#include "varray.h"
#include "vpstate.h"
#include "math/m_matrix.h"
#include "math/m_xform.h"
@ -456,6 +457,33 @@ _mesa_init_exec_table(struct _glapi_table *exec, GLuint tableSize)
exec->WindowPos4sMESA = _mesa_WindowPos4sMESA;
exec->WindowPos4svMESA = _mesa_WindowPos4svMESA;
/* ###. GL_NV_vertex_program */
exec->BindProgramNV = _mesa_BindProgramNV;
exec->DeleteProgramsNV = _mesa_DeleteProgramsNV;
exec->ExecuteProgramNV = _mesa_ExecuteProgramNV;
exec->GenProgramsNV = _mesa_GenProgramsNV;
exec->AreProgramsResidentNV = _mesa_AreProgramsResidentNV;
exec->RequestResidentProgramsNV = _mesa_RequestResidentProgramsNV;
exec->GetProgramParameterfvNV = _mesa_GetProgramParameterfvNV;
exec->GetProgramParameterdvNV = _mesa_GetProgramParameterdvNV;
exec->GetProgramivNV = _mesa_GetProgramivNV;
exec->GetProgramStringNV = _mesa_GetProgramStringNV;
exec->GetTrackMatrixivNV = _mesa_GetTrackMatrixivNV;
exec->GetVertexAttribdvNV = _mesa_GetVertexAttribdvNV;
exec->GetVertexAttribfvNV = _mesa_GetVertexAttribfvNV;
exec->GetVertexAttribivNV = _mesa_GetVertexAttribivNV;
exec->GetVertexAttribPointervNV = _mesa_GetVertexAttribPointervNV;
exec->IsProgramNV = _mesa_IsProgramNV;
exec->LoadProgramNV = _mesa_LoadProgramNV;
exec->ProgramParameter4dNV = _mesa_ProgramParameter4dNV;
exec->ProgramParameter4dvNV = _mesa_ProgramParameter4dvNV;
exec->ProgramParameter4fNV = _mesa_ProgramParameter4fNV;
exec->ProgramParameter4fvNV = _mesa_ProgramParameter4fvNV;
exec->ProgramParameters4dvNV = _mesa_ProgramParameters4dvNV;
exec->ProgramParameters4fvNV = _mesa_ProgramParameters4fvNV;
exec->TrackMatrixNV = _mesa_TrackMatrixNV;
exec->VertexAttribPointerNV = _mesa_VertexAttribPointerNV;
/* ARB 1. GL_ARB_multitexture */
exec->ActiveTextureARB = _mesa_ActiveTextureARB;
exec->ClientActiveTextureARB = _mesa_ClientActiveTextureARB;

View file

@ -1,4 +1,4 @@
/* $Id: vtxfmt.c,v 1.8 2001/12/04 23:43:31 brianp Exp $ */
/* $Id: vtxfmt.c,v 1.9 2001/12/14 02:50:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
@ -82,6 +82,7 @@
static void install_vtxfmt( struct _glapi_table *tab, GLvertexformat *vfmt )
{
printf("%s()\n", __FUNCTION__);
tab->ArrayElement = vfmt->ArrayElement;
tab->Color3f = vfmt->Color3f;
tab->Color3fv = vfmt->Color3fv;
@ -132,18 +133,17 @@ static void install_vtxfmt( struct _glapi_table *tab, GLvertexformat *vfmt )
tab->Vertex3fv = vfmt->Vertex3fv;
tab->Vertex4f = vfmt->Vertex4f;
tab->Vertex4fv = vfmt->Vertex4fv;
tab->CallList = vfmt->CallList;
tab->Begin = vfmt->Begin;
tab->End = vfmt->End;
/* tab->NewList = vfmt->NewList; */
tab->CallList = vfmt->CallList;
tab->VertexAttrib4fNV = vfmt->VertexAttrib4fNV;
tab->Rectf = vfmt->Rectf;
tab->DrawArrays = vfmt->DrawArrays;
tab->DrawElements = vfmt->DrawElements;
tab->DrawRangeElements = vfmt->DrawRangeElements;
tab->EvalMesh1 = vfmt->EvalMesh1;
tab->EvalMesh2 = vfmt->EvalMesh2;
assert(tab->EvalMesh2);
}

View file

@ -1,4 +1,4 @@
/* $Id: vtxfmt_tmp.h,v 1.7 2001/12/04 23:43:31 brianp Exp $ */
/* $Id: vtxfmt_tmp.h,v 1.8 2001/12/14 02:55:08 brianp Exp $ */
/*
* Mesa 3-D graphics library
@ -391,6 +391,18 @@ static void TAG(EvalMesh2)( GLenum mode, GLint i1, GLint i2,
_glapi_Dispatch->EvalMesh2( mode, i1, i2, j1, j2 );
}
static void TAG(VertexAttrib4fNV)( GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w )
{
PRE_LOOPBACK( VertexAttrib4fNV );
glVertexAttrib4fNV( index, x, y, z, w );
}
static void TAG(VertexAttrib4fvNV)( GLuint index, const GLfloat *v )
{
PRE_LOOPBACK( VertexAttrib4fNV );
glVertexAttrib4fvNV( index, v );
}
static GLvertexformat TAG(vtxfmt) = {
TAG(ArrayElement),
@ -446,12 +458,14 @@ static GLvertexformat TAG(vtxfmt) = {
TAG(CallList),
TAG(Begin),
TAG(End),
TAG(VertexAttrib4fNV),
TAG(VertexAttrib4fvNV),
TAG(Rectf),
TAG(DrawArrays),
TAG(DrawElements),
TAG(DrawRangeElements),
TAG(EvalMesh1),
TAG(EvalMesh2),
TAG(EvalMesh2)
};
#undef TAG

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,4 @@
/* $Id: s_bitmap.c,v 1.12 2001/06/26 21:15:36 brianp Exp $ */
/* $Id: s_bitmap.c,v 1.13 2001/12/14 02:50:57 brianp Exp $ */
/*
* Mesa 3-D graphics library
@ -76,7 +76,7 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py,
if (ctx->Fog.Enabled) {
if (ctx->Fog.FogCoordinateSource == GL_FOG_COORDINATE_EXT)
fog = _mesa_z_to_fogfactor(ctx, ctx->Current.FogCoord);
fog = _mesa_z_to_fogfactor(ctx, ctx->Current.Attrib[VERT_ATTRIB_FOG][0]);
else
fog = _mesa_z_to_fogfactor(ctx, ctx->Current.RasterDistance);
}

View file

@ -1,4 +1,4 @@
/* $Id: s_copypix.c,v 1.24 2001/07/23 16:07:39 brianp Exp $ */
/* $Id: s_copypix.c,v 1.25 2001/12/14 02:50:57 brianp Exp $ */
/*
* Mesa 3-D graphics library
@ -748,10 +748,16 @@ static void copy_depth_pixels( GLcontext *ctx, GLint srcx, GLint srcy,
/* setup colors or indexes */
if (ctx->Visual.rgbMode) {
GLuint *rgba32 = (GLuint *) rgba;
GLuint color = *(GLuint*)( ctx->Current.Color );
GLchan r, g, b, a;
UNCLAMPED_FLOAT_TO_CHAN(r, ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0]);
UNCLAMPED_FLOAT_TO_CHAN(g, ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1]);
UNCLAMPED_FLOAT_TO_CHAN(b, ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2]);
UNCLAMPED_FLOAT_TO_CHAN(a, ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3]);
for (i = 0; i < width; i++) {
rgba32[i] = color;
rgba[i][RCOMP] = r;
rgba[i][GCOMP] = g;
rgba[i][BCOMP] = b;
rgba[i][ACOMP] = a;
}
}
else {

View file

@ -1,4 +1,4 @@
/* $Id: t_array_import.c,v 1.18 2001/08/13 22:15:54 keithw Exp $ */
/* $Id: t_array_import.c,v 1.19 2001/12/14 02:51:42 brianp Exp $ */
/*
* Mesa 3-D graphics library
@ -247,45 +247,45 @@ static void _tnl_upgrade_client_data( GLcontext *ctx,
if (writeable || stride) ca_flags |= CA_CLIENT_DATA;
if ((required & VERT_CLIP) && VB->ClipPtr == VB->ObjPtr)
required |= VERT_OBJ;
required |= VERT_OBJ_BIT;
/* _tnl_print_vert_flags("_tnl_upgrade_client_data", required); */
if ((required & VERT_OBJ) && (VB->ObjPtr->flags & flags)) {
if ((required & VERT_OBJ_BIT) && (VB->ObjPtr->flags & flags)) {
ASSERT(VB->ObjPtr == &inputs->Obj);
_tnl_import_vertex( ctx, writeable, stride );
VB->importable_data &= ~(VERT_OBJ|VERT_CLIP);
VB->importable_data &= ~(VERT_OBJ_BIT|VERT_CLIP);
}
if ((required & VERT_NORM) && (VB->NormalPtr->flags & flags)) {
if ((required & VERT_NORMAL_BIT) && (VB->NormalPtr->flags & flags)) {
ASSERT(VB->NormalPtr == &inputs->Normal);
_tnl_import_normal( ctx, writeable, stride );
VB->importable_data &= ~VERT_NORM;
VB->importable_data &= ~VERT_NORMAL_BIT;
}
if ((required & VERT_RGBA) && (VB->ColorPtr[0]->Flags & ca_flags)) {
if ((required & VERT_COLOR0_BIT) && (VB->ColorPtr[0]->Flags & ca_flags)) {
ASSERT(VB->ColorPtr[0] == &inputs->Color);
_tnl_import_color( ctx, GL_FLOAT, writeable, stride );
VB->importable_data &= ~VERT_RGBA;
VB->importable_data &= ~VERT_COLOR0_BIT;
}
if ((required & VERT_SPEC_RGB) &&
if ((required & VERT_COLOR1_BIT) &&
(VB->SecondaryColorPtr[0]->Flags & ca_flags)) {
ASSERT(VB->SecondaryColorPtr[0] == &inputs->SecondaryColor);
_tnl_import_secondarycolor( ctx, GL_FLOAT, writeable, stride );
VB->importable_data &= ~VERT_SPEC_RGB;
VB->importable_data &= ~VERT_COLOR1_BIT;
}
if ((required & VERT_FOG_COORD) && (VB->FogCoordPtr->flags & flags)) {
if ((required & VERT_FOG_BIT) && (VB->FogCoordPtr->flags & flags)) {
ASSERT(VB->FogCoordPtr == &inputs->FogCoord);
_tnl_import_fogcoord( ctx, writeable, stride );
VB->importable_data &= ~VERT_FOG_COORD;
VB->importable_data &= ~VERT_FOG_BIT;
}
if ((required & VERT_INDEX) && (VB->IndexPtr[0]->flags & flags)) {
if ((required & VERT_INDEX_BIT) && (VB->IndexPtr[0]->flags & flags)) {
ASSERT(VB->IndexPtr[0] == &inputs->Index);
_tnl_import_index( ctx, writeable, stride );
VB->importable_data &= ~VERT_INDEX;
VB->importable_data &= ~VERT_INDEX_BIT;
}
if (required & VERT_TEX_ANY)
@ -332,19 +332,19 @@ void _tnl_vb_bind_arrays( GLcontext *ctx, GLint start, GLsizei count )
_ac_import_range( ctx, start, count );
if (inputs & VERT_OBJ) {
if (inputs & VERT_OBJ_BIT) {
_tnl_import_vertex( ctx, 0, 0 );
tmp->Obj.count = VB->Count;
VB->ObjPtr = &tmp->Obj;
}
if (inputs & VERT_NORM) {
if (inputs & VERT_NORMAL_BIT) {
_tnl_import_normal( ctx, 0, 0 );
tmp->Normal.count = VB->Count;
VB->NormalPtr = &tmp->Normal;
}
if (inputs & VERT_RGBA) {
if (inputs & VERT_COLOR0_BIT) {
_tnl_import_color( ctx, 0, 0, 0 );
VB->ColorPtr[0] = &tmp->Color;
VB->ColorPtr[1] = 0;
@ -360,26 +360,26 @@ void _tnl_vb_bind_arrays( GLcontext *ctx, GLint start, GLsizei count )
}
}
if (inputs & (VERT_INDEX|VERT_FOG_COORD|VERT_EDGE|VERT_SPEC_RGB)) {
if (inputs & VERT_INDEX) {
if (inputs & (VERT_INDEX_BIT|VERT_FOG_BIT|VERT_EDGEFLAG_BIT|VERT_COLOR1_BIT)) {
if (inputs & VERT_INDEX_BIT) {
_tnl_import_index( ctx, 0, 0 );
tmp->Index.count = VB->Count;
VB->IndexPtr[0] = &tmp->Index;
VB->IndexPtr[1] = 0;
}
if (inputs & VERT_FOG_COORD) {
if (inputs & VERT_FOG_BIT) {
_tnl_import_fogcoord( ctx, 0, 0 );
tmp->FogCoord.count = VB->Count;
VB->FogCoordPtr = &tmp->FogCoord;
}
if (inputs & VERT_EDGE) {
if (inputs & VERT_EDGEFLAG_BIT) {
_tnl_import_edgeflag( ctx, GL_TRUE, sizeof(GLboolean) );
VB->EdgeFlag = (GLboolean *) tmp->EdgeFlag.data;
}
if (inputs & VERT_SPEC_RGB) {
if (inputs & VERT_COLOR1_BIT) {
_tnl_import_secondarycolor( ctx, 0, 0, 0 );
VB->SecondaryColorPtr[0] = &tmp->SecondaryColor;
VB->SecondaryColorPtr[1] = 0;

View file

@ -1,4 +1,4 @@
/* $Id: t_context.h,v 1.32 2001/09/14 21:30:31 brianp Exp $ */
/* $Id: t_context.h,v 1.33 2001/12/14 02:51:44 brianp Exp $ */
/*
* Mesa 3-D graphics library
@ -71,43 +71,45 @@
* 5 spare flags, rearrangement of eval flags can secure at least 3
* more.
*/
#define VERT_OBJ _NEW_ARRAY_VERTEX
#define VERT_RGBA _NEW_ARRAY_COLOR
#define VERT_NORM _NEW_ARRAY_NORMAL
#define VERT_INDEX _NEW_ARRAY_INDEX
#define VERT_EDGE _NEW_ARRAY_EDGEFLAG
#define VERT_SPEC_RGB _NEW_ARRAY_SECONDARYCOLOR
#define VERT_FOG_COORD _NEW_ARRAY_FOGCOORD
#define VERT_TEX0 _NEW_ARRAY_TEXCOORD_0
#define VERT_TEX1 _NEW_ARRAY_TEXCOORD_1
#define VERT_TEX2 _NEW_ARRAY_TEXCOORD_2
#define VERT_TEX3 _NEW_ARRAY_TEXCOORD_3
#define VERT_TEX4 _NEW_ARRAY_TEXCOORD_4
#define VERT_TEX5 _NEW_ARRAY_TEXCOORD_5
#define VERT_TEX6 _NEW_ARRAY_TEXCOORD_6
#define VERT_TEX7 _NEW_ARRAY_TEXCOORD_7
#define VERT_EVAL_C1 0x8000 /* imm only */
#define VERT_EVAL_C2 0x10000 /* imm only */
#define VERT_EVAL_P1 0x20000 /* imm only */
#define VERT_EVAL_P2 0x40000 /* imm only */
#define VERT_OBJ_3 0x80000 /* imm only */
#define VERT_OBJ_4 0x100000 /* imm only */
#define VERT_MATERIAL 0x200000 /* imm only, but tested in vb code */
#define VERT_ELT 0x400000 /* imm only */
#define VERT_BEGIN 0x800000 /* imm only, but tested in vb code */
#define VERT_END 0x1000000 /* imm only, but tested in vb code */
#define VERT_END_VB 0x2000000 /* imm only, but tested in vb code */
#define VERT_POINT_SIZE 0x4000000 /* vb only, could reuse a bit */
#define VERT_OBJ_BIT _NEW_ARRAY_VERTEX
#define VERT_WEIGHT_BIT _NEW_ARRAY_WEIGHT /* unused */
#define VERT_NORMAL_BIT _NEW_ARRAY_NORMAL
#define VERT_COLOR0_BIT _NEW_ARRAY_COLOR0
#define VERT_COLOR1_BIT _NEW_ARRAY_COLOR1
#define VERT_FOG_BIT _NEW_ARRAY_FOGCOORD
#define VERT_INDEX_BIT _NEW_ARRAY_INDEX
#define VERT_EDGEFLAG_BIT _NEW_ARRAY_EDGEFLAG
#define VERT_TEX0_BIT _NEW_ARRAY_TEXCOORD_0
#define VERT_TEX1_BIT _NEW_ARRAY_TEXCOORD_1
#define VERT_TEX2_BIT _NEW_ARRAY_TEXCOORD_2
#define VERT_TEX3_BIT _NEW_ARRAY_TEXCOORD_3
#define VERT_TEX4_BIT _NEW_ARRAY_TEXCOORD_4
#define VERT_TEX5_BIT _NEW_ARRAY_TEXCOORD_5
#define VERT_TEX6_BIT _NEW_ARRAY_TEXCOORD_6
#define VERT_TEX7_BIT _NEW_ARRAY_TEXCOORD_7
#define VERT_EVAL_C1 0x10000 /* imm only */
#define VERT_EVAL_C2 0x20000 /* imm only */
#define VERT_EVAL_P1 0x40000 /* imm only */
#define VERT_EVAL_P2 0x80000 /* imm only */
#define VERT_OBJ_3 0x100000 /* imm only */
#define VERT_OBJ_4 0x200000 /* imm only */
#define VERT_MATERIAL 0x400000 /* imm only, but tested in vb code */
#define VERT_ELT 0x800000 /* imm only */
#define VERT_BEGIN 0x1000000 /* imm only, but tested in vb code */
#define VERT_END 0x2000000 /* imm only, but tested in vb code */
#define VERT_END_VB 0x4000000 /* imm only, but tested in vb code */
#define VERT_POINT_SIZE 0x8000000 /* vb only, could reuse a bit */
#define VERT_EYE VERT_BEGIN /* vb only, reuse imm bit */
#define VERT_CLIP VERT_END /* vb only, reuse imm bit*/
/* Flags for IM->TexCoordSize. Enough flags for 16 units.
*/
#define TEX_0_SIZE_3 (GLuint) 0x1
#define TEX_0_SIZE_4 (GLuint) 0x1001
#define TEX_SIZE_3(unit) (TEX_0_SIZE_3<<unit)
#define TEX_SIZE_4(unit) (TEX_0_SIZE_4<<unit)
#define TEX_0_SIZE_3 0x1
#define TEX_0_SIZE_4 0x10001
#define TEX_SIZE_3(unit) (TEX_0_SIZE_3 << (unit))
#define TEX_SIZE_4(unit) (TEX_0_SIZE_4 << (unit))
/* Shorthands.
@ -115,41 +117,41 @@
#define VERT_EVAL_ANY (VERT_EVAL_C1|VERT_EVAL_P1| \
VERT_EVAL_C2|VERT_EVAL_P2)
#define VERT_OBJ_23 (VERT_OBJ_3|VERT_OBJ)
#define VERT_OBJ_23 (VERT_OBJ_3|VERT_OBJ_BIT)
#define VERT_OBJ_234 (VERT_OBJ_4|VERT_OBJ_23)
#define VERT_TEX0_SHIFT 11
#define VERT_TEX0_BIT_SHIFT 11
#define VERT_TEX(i) (VERT_TEX0 << i)
#define VERT_TEX(i) (VERT_TEX0_BIT << (i))
#define VERT_TEX_ANY (VERT_TEX0 | \
VERT_TEX1 | \
VERT_TEX2 | \
VERT_TEX3 | \
VERT_TEX4 | \
VERT_TEX5 | \
VERT_TEX6 | \
VERT_TEX7)
#define VERT_TEX_ANY (VERT_TEX0_BIT | \
VERT_TEX1_BIT | \
VERT_TEX2_BIT | \
VERT_TEX3_BIT | \
VERT_TEX4_BIT | \
VERT_TEX5_BIT | \
VERT_TEX6_BIT | \
VERT_TEX7_BIT)
#define VERT_FIXUP (VERT_TEX_ANY | \
VERT_RGBA | \
VERT_SPEC_RGB | \
VERT_FOG_COORD | \
VERT_INDEX | \
VERT_EDGE | \
VERT_NORM)
VERT_COLOR0_BIT | \
VERT_COLOR1_BIT | \
VERT_FOG_BIT | \
VERT_INDEX_BIT | \
VERT_EDGEFLAG_BIT | \
VERT_NORMAL_BIT)
#define VERT_CURRENT_DATA (VERT_FIXUP | \
VERT_MATERIAL)
#define VERT_DATA (VERT_TEX_ANY | \
VERT_RGBA | \
VERT_SPEC_RGB | \
VERT_FOG_COORD | \
VERT_INDEX | \
VERT_EDGE | \
VERT_NORM | \
VERT_OBJ | \
VERT_COLOR0_BIT | \
VERT_COLOR1_BIT | \
VERT_FOG_BIT | \
VERT_INDEX_BIT | \
VERT_EDGEFLAG_BIT | \
VERT_NORMAL_BIT | \
VERT_OBJ_BIT | \
VERT_MATERIAL | \
VERT_ELT | \
VERT_EVAL_ANY)
@ -200,21 +202,24 @@ struct immediate
GLuint MaterialOrMask;
GLuint MaterialAndMask;
GLfloat (*TexCoord[MAX_TEXTURE_UNITS])[4];
GLuint Primitive[IMM_SIZE]; /* BEGIN/END */
GLuint PrimitiveLength[IMM_SIZE]; /* BEGIN/END */
GLuint Flag[IMM_SIZE]; /* VERT_* flags */
GLfloat Color[IMM_SIZE][4];
GLfloat Obj[IMM_SIZE][4];
GLfloat Normal[IMM_SIZE][3];
GLfloat Obj[IMM_SIZE][4]; /* attrib 0 */
GLfloat Normal[IMM_SIZE][3]; /* attrib 2 */
GLfloat *NormalLengthPtr;
GLfloat TexCoord0[IMM_SIZE][4]; /* just VERT_TEX0 */
GLfloat Color[IMM_SIZE][4]; /* attrib 3 */
GLfloat SecondaryColor[IMM_SIZE][4]; /* attrib 4 */
GLfloat FogCoord[IMM_SIZE]; /* attrib 5 */
GLfloat TexCoord0[IMM_SIZE][4]; /* just VERT_TEX0_BIT */
GLfloat (*TexCoord[MAX_TEXTURE_UNITS])[4]; /* attribs 8..15 */
GLuint Elt[IMM_SIZE];
GLubyte EdgeFlag[IMM_SIZE];
GLuint Index[IMM_SIZE];
GLfloat SecondaryColor[IMM_SIZE][4];
GLfloat FogCoord[IMM_SIZE];
GLfloat Attrib[16][IMM_SIZE][4]; /* GL_NV_vertex_program */
};
@ -229,6 +234,7 @@ struct vertex_arrays
GLvector4f TexCoord[MAX_TEXTURE_UNITS];
GLvector1ui Elt;
GLvector1f FogCoord;
GLvector4f Attribs[16];
};
@ -244,27 +250,27 @@ typedef struct vertex_buffer
/* Constant over the pipeline.
*/
GLuint Count; /* for everything except Elts */
GLuint FirstClipped; /* temp verts for clipping */
GLuint FirstPrimitive; /* usually zero */
GLuint Count; /* for everything except Elts */
GLuint FirstClipped; /* temp verts for clipping */
GLuint FirstPrimitive; /* usually zero */
/* Pointers to current data.
*/
GLuint *Elts; /* VERT_ELT */
GLvector4f *ObjPtr; /* VERT_OBJ */
GLvector4f *ObjPtr; /* VERT_OBJ_BIT */
GLvector4f *EyePtr; /* VERT_EYE */
GLvector4f *ClipPtr; /* VERT_CLIP */
GLvector4f *ProjectedClipPtr; /* VERT_CLIP (2) */
GLubyte ClipOrMask; /* VERT_CLIP (3) */
GLubyte *ClipMask; /* VERT_CLIP (4) */
GLvector3f *NormalPtr; /* VERT_NORM */
GLfloat *NormalLengthPtr; /* VERT_NORM */
GLboolean *EdgeFlag; /* VERT_EDGE */
GLvector3f *NormalPtr; /* VERT_NORMAL_BIT */
GLfloat *NormalLengthPtr; /* VERT_NORMAL_BIT */
GLboolean *EdgeFlag; /* VERT_EDGEFLAG_BIT */
GLvector4f *TexCoordPtr[MAX_TEXTURE_UNITS]; /* VERT_TEX_0..n */
GLvector1ui *IndexPtr[2]; /* VERT_INDEX */
struct gl_client_array *ColorPtr[2]; /* VERT_RGBA */
struct gl_client_array *SecondaryColorPtr[2]; /* VERT_SPEC_RGB */
GLvector1f *FogCoordPtr; /* VERT_FOG_COORD */
GLvector1ui *IndexPtr[2]; /* VERT_INDEX_BIT */
struct gl_client_array *ColorPtr[2]; /* VERT_COLOR0_BIT */
struct gl_client_array *SecondaryColorPtr[2];/* VERT_COLOR1_BIT */
GLvector1f *FogCoordPtr; /* VERT_FOG_BIT */
GLvector1f *PointSizePtr; /* VERT_POINT_SIZE */
GLmaterial (*Material)[2]; /* VERT_MATERIAL, optional */
GLuint *MaterialMask; /* VERT_MATERIAL, optional */
@ -272,6 +278,7 @@ typedef struct vertex_buffer
GLuint *Primitive; /* GL_(mode)|PRIM_* flags */
GLuint *PrimitiveLength; /* integers */
GLvector4f *AttribPtr[16]; /* GL_NV_vertex_program */
GLuint importable_data;
void *import_source;

View file

@ -1,4 +1,4 @@
/* $Id: t_imm_alloc.c,v 1.10 2001/09/07 06:55:59 joukj Exp $ */
/* $Id: t_imm_alloc.c,v 1.11 2001/12/14 02:51:44 brianp Exp $ */
/*
* Mesa 3-D graphics library
@ -62,7 +62,6 @@ static struct immediate *real_alloc_immediate( GLcontext *ctx )
IM->CopyTexSize = 0;
IM->CopyStart = IM->Start;
/* TexCoord0 is special.
*/
IM->TexCoord[0] = IM->TexCoord0;

View file

@ -1,4 +1,4 @@
/* $Id: t_imm_api.c,v 1.19 2001/12/04 23:43:31 brianp Exp $ */
/* $Id: t_imm_api.c,v 1.20 2001/12/14 02:51:44 brianp Exp $ */
/*
* Mesa 3-D graphics library
@ -46,6 +46,9 @@
#include "t_imm_dlist.h"
extern void _tnl_vprog_vtxfmt_init( GLcontext *ctx );
/* A cassette is full or flushed on a statechange.
*/
void _tnl_flush_immediate( struct immediate *IM )
@ -96,6 +99,13 @@ _tnl_begin( GLcontext *ctx, GLenum p )
if (ctx->NewState)
_mesa_update_state(ctx);
/* Either install the normal vertex functions or the vertex program funcs */
if (ctx->VertexProgram.Enabled)
_tnl_vprog_vtxfmt_init(ctx);
else
_tnl_imm_vtxfmt_init(ctx);
_mesa_init_exec_vtxfmt(ctx);
/* if only a very few slots left, might as well flush now
*/
if (IM->Count > IMM_MAXDATA-8) {
@ -161,7 +171,8 @@ _tnl_save_Begin( GLenum mode )
ctx->Driver.CurrentSavePrimitive = mode;
}
static void
void
_tnl_Begin( GLenum mode )
{
GET_CURRENT_CONTEXT(ctx);
@ -313,11 +324,11 @@ _tnl_end( GLcontext *ctx )
/* You can set this flag to get the old 'flush_vb on glEnd()'
* behaviour.
*/
if (1/*(MESA_DEBUG_FLAGS&DEBUG_ALWAYS_FLUSH)*/)
if (1 /*(MESA_DEBUG_FLAGS&DEBUG_ALWAYS_FLUSH)*/ )
_tnl_flush_immediate( IM );
}
static void
void
_tnl_End(void)
{
GET_CURRENT_CONTEXT(ctx);
@ -335,7 +346,7 @@ _tnl_End(void)
#define COLOR( IM, r, g, b, a ) \
{ \
GLuint count = IM->Count; \
IM->Flag[count] |= VERT_RGBA; \
IM->Flag[count] |= VERT_COLOR0_BIT; \
IM->Color[count][0] = r; \
IM->Color[count][1] = g; \
IM->Color[count][2] = b; \
@ -420,7 +431,7 @@ _tnl_Color4ubv( const GLubyte *v)
#define SECONDARY_COLOR( IM, r, g, b ) \
{ \
GLuint count = IM->Count; \
IM->Flag[count] |= VERT_SPEC_RGB; \
IM->Flag[count] |= VERT_COLOR1_BIT; \
IM->SecondaryColor[count][0] = r; \
IM->SecondaryColor[count][1] = g; \
IM->SecondaryColor[count][2] = b; \
@ -470,7 +481,7 @@ _tnl_EdgeFlag( GLboolean flag )
GET_IMMEDIATE;
count = IM->Count;
IM->EdgeFlag[count] = flag;
IM->Flag[count] |= VERT_EDGE;
IM->Flag[count] |= VERT_EDGEFLAG_BIT;
}
@ -481,7 +492,7 @@ _tnl_EdgeFlagv( const GLboolean *flag )
GET_IMMEDIATE;
count = IM->Count;
IM->EdgeFlag[count] = *flag;
IM->Flag[count] |= VERT_EDGE;
IM->Flag[count] |= VERT_EDGEFLAG_BIT;
}
@ -492,7 +503,7 @@ _tnl_FogCoordfEXT( GLfloat f )
GET_IMMEDIATE;
count = IM->Count;
IM->FogCoord[count] = f;
IM->Flag[count] |= VERT_FOG_COORD;
IM->Flag[count] |= VERT_FOG_BIT;
}
static void
@ -502,7 +513,7 @@ _tnl_FogCoordfvEXT( const GLfloat *v )
GET_IMMEDIATE;
count = IM->Count;
IM->FogCoord[count] = v[0];
IM->Flag[count] |= VERT_FOG_COORD;
IM->Flag[count] |= VERT_FOG_BIT;
}
@ -513,7 +524,7 @@ _tnl_Indexi( GLint c )
GET_IMMEDIATE;
count = IM->Count;
IM->Index[count] = c;
IM->Flag[count] |= VERT_INDEX;
IM->Flag[count] |= VERT_INDEX_BIT;
}
@ -524,7 +535,7 @@ _tnl_Indexiv( const GLint *c )
GET_IMMEDIATE;
count = IM->Count;
IM->Index[count] = *c;
IM->Flag[count] |= VERT_INDEX;
IM->Flag[count] |= VERT_INDEX_BIT;
}
@ -534,7 +545,7 @@ _tnl_Indexiv( const GLint *c )
GLfloat *normal; \
GET_IMMEDIATE; \
count = IM->Count; \
IM->Flag[count] |= VERT_NORM; \
IM->Flag[count] |= VERT_NORMAL_BIT; \
normal = IM->Normal[count]; \
ASSIGN_3V(normal, x,y,z); \
}
@ -546,7 +557,7 @@ _tnl_Indexiv( const GLint *c )
fi_type *normal; \
GET_IMMEDIATE; \
count = IM->Count; \
IM->Flag[count] |= VERT_NORM; \
IM->Flag[count] |= VERT_NORMAL_BIT; \
normal = (fi_type *)IM->Normal[count]; \
normal[0].i = ((fi_type *)&(x))->i; \
normal[1].i = ((fi_type *)&(y))->i; \
@ -577,7 +588,7 @@ _tnl_Normal3fv( const GLfloat *v )
GLfloat *tc; \
GET_IMMEDIATE; \
count = IM->Count; \
IM->Flag[count] |= VERT_TEX0; \
IM->Flag[count] |= VERT_TEX0_BIT; \
tc = IM->TexCoord0[count]; \
ASSIGN_4V(tc,s,0,0,1); \
}
@ -588,7 +599,7 @@ _tnl_Normal3fv( const GLfloat *v )
GLfloat *tc; \
GET_IMMEDIATE; \
count = IM->Count; \
IM->Flag[count] |= VERT_TEX0; \
IM->Flag[count] |= VERT_TEX0_BIT; \
tc = IM->TexCoord0[count]; \
ASSIGN_4V(tc, s,t,0,1); \
}
@ -599,7 +610,7 @@ _tnl_Normal3fv( const GLfloat *v )
GLfloat *tc; \
GET_IMMEDIATE; \
count = IM->Count; \
IM->Flag[count] |= VERT_TEX0; \
IM->Flag[count] |= VERT_TEX0_BIT; \
IM->TexSize |= TEX_0_SIZE_3; \
tc = IM->TexCoord0[count]; \
ASSIGN_4V(tc, s,t,u,1); \
@ -611,7 +622,7 @@ _tnl_Normal3fv( const GLfloat *v )
GLfloat *tc; \
GET_IMMEDIATE; \
count = IM->Count; \
IM->Flag[count] |= VERT_TEX0; \
IM->Flag[count] |= VERT_TEX0_BIT; \
IM->TexSize |= TEX_0_SIZE_4; \
tc = IM->TexCoord0[count]; \
ASSIGN_4V(tc, s,t,u,v); \
@ -624,7 +635,7 @@ _tnl_Normal3fv( const GLfloat *v )
fi_type *tc; \
GET_IMMEDIATE; \
count = IM->Count; \
IM->Flag[count] |= VERT_TEX0; \
IM->Flag[count] |= VERT_TEX0_BIT; \
tc = (fi_type *)IM->TexCoord0[count]; \
tc[0].i = ((fi_type *)&(s))->i; \
tc[1].i = ((fi_type *)&(t))->i; \
@ -694,7 +705,7 @@ _tnl_TexCoord4fv( const GLfloat *v )
{ \
GLuint count = IM->Count++; \
GLfloat *dest = IM->Obj[count]; \
IM->Flag[count] |= VERT_OBJ; \
IM->Flag[count] |= VERT_OBJ_BIT; \
ASSIGN_4V(dest, x, y, 0, 1); \
/* ASSERT(IM->Flag[IM->Count]==0); */\
if (count == IMM_MAXDATA - 1) \
@ -727,7 +738,7 @@ _tnl_TexCoord4fv( const GLfloat *v )
{ \
GLuint count = IM->Count++; \
fi_type *dest = (fi_type *)IM->Obj[count]; \
IM->Flag[count] |= VERT_OBJ; \
IM->Flag[count] |= VERT_OBJ_BIT; \
dest[0].i = ((fi_type *)&(x))->i; \
dest[1].i = ((fi_type *)&(y))->i; \
dest[2].i = 0; \
@ -1100,6 +1111,30 @@ _tnl_vertex2f( GLcontext *ctx, GLfloat x, GLfloat y )
/*
* NV_vertex_program
*/
static void
_tnl_VertexAttrib4fNV(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
{
/* no-op? */
printf("%s(%d, %f, %f, %f, %f)\n", __FUNCTION__, index, x, y, z, w);
(void) index;
(void) x;
(void) y;
(void) z;
(void) w;
}
static void
_tnl_VertexAttrib4fvNV(GLuint index, const GLfloat *v)
{
/* no-op? */
(void) index;
(void) v;
}
/* Execute a glRectf() function. _tnl_hard_begin() ensures the check
@ -1206,6 +1241,8 @@ void _tnl_imm_vtxfmt_init( GLcontext *ctx )
{
GLvertexformat *vfmt = &(TNL_CONTEXT(ctx)->vtxfmt);
printf("%s()\n", __FUNCTION__);
/* All begin/end operations are handled by this vertex format:
*/
vfmt->ArrayElement = _tnl_ArrayElement;
@ -1260,6 +1297,8 @@ void _tnl_imm_vtxfmt_init( GLcontext *ctx )
vfmt->Vertex3fv = _tnl_Vertex3fv;
vfmt->Vertex4f = _tnl_Vertex4f;
vfmt->Vertex4fv = _tnl_Vertex4fv;
vfmt->VertexAttrib4fNV = _tnl_VertexAttrib4fNV;
vfmt->VertexAttrib4fvNV = _tnl_VertexAttrib4fvNV;
/* Outside begin/end functions (from t_varray.c, t_eval.c, ...):
*/

View file

@ -1,8 +1,8 @@
/* $Id: t_imm_api.h,v 1.3 2001/03/12 00:48:43 gareth Exp $ */
/* $Id: t_imm_api.h,v 1.4 2001/12/14 02:51:44 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
* Version: 4.1
*
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
@ -34,6 +34,11 @@
extern void _tnl_save_Begin( GLenum mode );
extern void _tnl_Begin( GLenum mode );
extern void _tnl_End(void);
/* TNL-private internal functions for building higher-level operations:
*/
extern GLboolean _tnl_hard_begin( GLcontext *ctx, GLenum p );

View file

@ -1,4 +1,4 @@
/* $Id: t_imm_debug.c,v 1.4 2001/08/01 05:10:42 keithw Exp $ */
/* $Id: t_imm_debug.c,v 1.5 2001/12/14 02:51:45 brianp Exp $ */
/*
* Mesa 3-D graphics library
@ -35,29 +35,29 @@ void _tnl_print_vert_flags( const char *name, GLuint flags )
name,
flags,
(flags & VERT_CLIP) ? "clip/proj-clip/glend, " : "",
(flags & VERT_EDGE) ? "edgeflag, " : "",
(flags & VERT_EDGEFLAG_BIT) ? "edgeflag, " : "",
(flags & VERT_ELT) ? "array-elt, " : "",
(flags & VERT_END_VB) ? "end-vb, " : "",
(flags & VERT_EVAL_ANY) ? "eval-coord, " : "",
(flags & VERT_EYE) ? "eye/glbegin, " : "",
(flags & VERT_FOG_COORD) ? "fog-coord, " : "",
(flags & VERT_INDEX) ? "index, " : "",
(flags & VERT_FOG_BIT) ? "fog-coord, " : "",
(flags & VERT_INDEX_BIT) ? "index, " : "",
(flags & VERT_MATERIAL) ? "material, " : "",
(flags & VERT_NORM) ? "normals, " : "",
(flags & VERT_OBJ) ? "obj, " : "",
(flags & VERT_NORMAL_BIT) ? "normals, " : "",
(flags & VERT_OBJ_BIT) ? "obj, " : "",
(flags & VERT_OBJ_3) ? "obj-3, " : "",
(flags & VERT_OBJ_4) ? "obj-4, " : "",
(flags & VERT_POINT_SIZE) ? "point-size, " : "",
(flags & VERT_RGBA) ? "colors, " : "",
(flags & VERT_SPEC_RGB) ? "specular, " : "",
(flags & VERT_TEX0) ? "texcoord0, " : "",
(flags & VERT_TEX1) ? "texcoord1, " : "",
(flags & VERT_TEX2) ? "texcoord2, " : "",
(flags & VERT_TEX3) ? "texcoord3, " : "",
(flags & VERT_TEX4) ? "texcoord4, " : "",
(flags & VERT_TEX5) ? "texcoord5, " : "",
(flags & VERT_TEX6) ? "texcoord6, " : "",
(flags & VERT_TEX7) ? "texcoord7, " : ""
(flags & VERT_COLOR0_BIT) ? "colors, " : "",
(flags & VERT_COLOR1_BIT) ? "specular, " : "",
(flags & VERT_TEX0_BIT) ? "texcoord0, " : "",
(flags & VERT_TEX1_BIT) ? "texcoord1, " : "",
(flags & VERT_TEX2_BIT) ? "texcoord2, " : "",
(flags & VERT_TEX3_BIT) ? "texcoord3, " : "",
(flags & VERT_TEX4_BIT) ? "texcoord4, " : "",
(flags & VERT_TEX5_BIT) ? "texcoord5, " : "",
(flags & VERT_TEX6_BIT) ? "texcoord6, " : "",
(flags & VERT_TEX7_BIT) ? "texcoord7, " : ""
);
}
@ -107,7 +107,7 @@ void _tnl_print_cassette( struct immediate *IM )
if (req & flags[i] & VERT_ELT)
fprintf(stderr, " Elt %u\t", IM->Elt[i]);
if (req & flags[i] & VERT_NORM)
if (req & flags[i] & VERT_NORMAL_BIT)
fprintf(stderr, " Norm %f %f %f ",
IM->Normal[i][0], IM->Normal[i][1], IM->Normal[i][2]);
@ -124,23 +124,23 @@ void _tnl_print_cassette( struct immediate *IM )
}
}
if (req & flags[i] & VERT_RGBA)
if (req & flags[i] & VERT_COLOR0_BIT)
fprintf(stderr, " Rgba %f %f %f %f ",
IM->Color[i][0], IM->Color[i][1],
IM->Color[i][2], IM->Color[i][3]);
if (req & flags[i] & VERT_SPEC_RGB)
if (req & flags[i] & VERT_COLOR1_BIT)
fprintf(stderr, " Spec %f %f %f ",
IM->SecondaryColor[i][0], IM->SecondaryColor[i][1],
IM->SecondaryColor[i][2]);
if (req & flags[i] & VERT_FOG_COORD)
if (req & flags[i] & VERT_FOG_BIT)
fprintf(stderr, " Fog %f ", IM->FogCoord[i]);
if (req & flags[i] & VERT_INDEX)
if (req & flags[i] & VERT_INDEX_BIT)
fprintf(stderr, " Index %u ", IM->Index[i]);
if (req & flags[i] & VERT_EDGE)
if (req & flags[i] & VERT_EDGEFLAG_BIT)
fprintf(stderr, " Edgeflag %d ", IM->EdgeFlag[i]);
if (req & flags[i] & VERT_MATERIAL)

View file

@ -1,4 +1,4 @@
/* $Id: t_imm_dlist.c,v 1.32 2001/12/13 10:49:04 keithw Exp $ */
/* $Id: t_imm_dlist.c,v 1.33 2001/12/14 02:51:45 brianp Exp $ */
/*
* Mesa 3-D graphics library
@ -86,7 +86,7 @@ static void build_normal_lengths( struct immediate *IM )
for (i = 0 ; i < count ; ) {
dest[i] = len;
if (flags[++i] & VERT_NORM) {
if (flags[++i] & VERT_NORMAL_BIT) {
len = (GLfloat) LEN_3FV( data[i] );
if (len > 0.0F) len = 1.0F / len;
}
@ -108,7 +108,7 @@ static void fixup_normal_lengths( struct immediate *IM )
}
if (i < IM->Count) {
while (!(flags[i] & (VERT_NORM|VERT_END_VB))) {
while (!(flags[i] & (VERT_NORMAL_BIT|VERT_END_VB))) {
dest[i] = len;
i++;
}
@ -611,28 +611,28 @@ static void loopback_compiled_cassette( GLcontext *ctx, struct immediate *IM )
}
}
if (flags[i] & VERT_NORM) {
if (flags[i] & VERT_NORMAL_BIT) {
/* fprintf(stderr, "normal %d: %f %f %f\n", i, */
/* IM->Normal[i][0], IM->Normal[i][1], IM->Normal[i][2]); */
glNormal3fv(IM->Normal[i]);
}
if (flags[i] & VERT_RGBA) {
if (flags[i] & VERT_COLOR0_BIT) {
/* fprintf(stderr, "color %d: %f %f %f\n", i, */
/* IM->Color[i][0], IM->Color[i][1], IM->Color[i][2]); */
glColor4fv( IM->Color[i] );
}
if (flags[i] & VERT_SPEC_RGB)
if (flags[i] & VERT_COLOR1_BIT)
glSecondaryColor3fvEXT( IM->SecondaryColor[i] );
if (flags[i] & VERT_FOG_COORD)
if (flags[i] & VERT_FOG_BIT)
glFogCoordfEXT( IM->FogCoord[i] );
if (flags[i] & VERT_INDEX)
if (flags[i] & VERT_INDEX_BIT)
glIndexi( IM->Index[i] );
if (flags[i] & VERT_EDGE)
if (flags[i] & VERT_EDGEFLAG_BIT)
glEdgeFlag( IM->EdgeFlag[i] );
if (flags[i] & VERT_MATERIAL)

View file

@ -1,4 +1,4 @@
/* $Id: t_imm_elt.c,v 1.12 2001/09/14 21:30:31 brianp Exp $ */
/* $Id: t_imm_elt.c,v 1.13 2001/12/14 02:51:45 brianp Exp $ */
/*
* Mesa 3-D graphics library
@ -757,10 +757,10 @@ void _tnl_translate_array_elts( GLcontext *ctx, struct immediate *IM,
if (MESA_VERBOSE&VERBOSE_IMMEDIATE)
fprintf(stderr, "exec_array_elements %d .. %d\n", start, count);
if (translate & VERT_OBJ) {
if (translate & VERT_OBJ_BIT) {
_tnl_trans_elt_4f( IM->Obj,
&ctx->Array.Vertex,
flags, elts, (VERT_ELT|VERT_OBJ),
flags, elts, (VERT_ELT|VERT_OBJ_BIT),
start, count);
if (ctx->Array.Vertex.Size == 4)
@ -770,42 +770,42 @@ void _tnl_translate_array_elts( GLcontext *ctx, struct immediate *IM,
}
if (translate & VERT_NORM)
if (translate & VERT_NORMAL_BIT)
_tnl_trans_elt_3f( IM->Normal,
&ctx->Array.Normal,
flags, elts, (VERT_ELT|VERT_NORM),
flags, elts, (VERT_ELT|VERT_NORMAL_BIT),
start, count);
if (translate & VERT_EDGE)
if (translate & VERT_EDGEFLAG_BIT)
_tnl_trans_elt_1ub( IM->EdgeFlag,
&ctx->Array.EdgeFlag,
flags, elts, (VERT_ELT|VERT_EDGE),
flags, elts, (VERT_ELT|VERT_EDGEFLAG_BIT),
start, count);
if (translate & VERT_RGBA) {
if (translate & VERT_COLOR0_BIT) {
_tnl_trans_elt_4f( IM->Color,
&ctx->Array.Color,
flags, elts, (VERT_ELT|VERT_RGBA),
flags, elts, (VERT_ELT|VERT_COLOR0_BIT),
start, count);
}
if (translate & VERT_SPEC_RGB) {
if (translate & VERT_COLOR1_BIT) {
_tnl_trans_elt_4f( IM->SecondaryColor,
&ctx->Array.SecondaryColor,
flags, elts, (VERT_ELT|VERT_SPEC_RGB),
flags, elts, (VERT_ELT|VERT_COLOR1_BIT),
start, count);
}
if (translate & VERT_FOG_COORD)
if (translate & VERT_FOG_BIT)
_tnl_trans_elt_1f( IM->FogCoord,
&ctx->Array.FogCoord,
flags, elts, (VERT_ELT|VERT_FOG_COORD),
flags, elts, (VERT_ELT|VERT_FOG_BIT),
start, count);
if (translate & VERT_INDEX)
if (translate & VERT_INDEX_BIT)
_tnl_trans_elt_1ui( IM->Index,
&ctx->Array.Index,
flags, elts, (VERT_ELT|VERT_INDEX),
flags, elts, (VERT_ELT|VERT_INDEX_BIT),
start, count);
if (translate & VERT_TEX_ANY) {

View file

@ -1,4 +1,4 @@
/* $Id: t_imm_eval.c,v 1.18 2001/09/14 21:30:31 brianp Exp $ */
/* $Id: t_imm_eval.c,v 1.19 2001/12/14 02:51:45 brianp Exp $ */
/*
* Mesa 3-D graphics library
@ -379,34 +379,34 @@ static void update_eval( GLcontext *ctx )
GLuint eval1 = 0, eval2 = 0;
if (ctx->Eval.Map1Index)
eval1 |= VERT_INDEX;
eval1 |= VERT_INDEX_BIT;
if (ctx->Eval.Map2Index)
eval2 |= VERT_INDEX;
eval2 |= VERT_INDEX_BIT;
if (ctx->Eval.Map1Color4)
eval1 |= VERT_RGBA;
eval1 |= VERT_COLOR0_BIT;
if (ctx->Eval.Map2Color4)
eval2 |= VERT_RGBA;
eval2 |= VERT_COLOR0_BIT;
if (ctx->Eval.Map1Normal)
eval1 |= VERT_NORM;
eval1 |= VERT_NORMAL_BIT;
if (ctx->Eval.Map2Normal)
eval2 |= VERT_NORM;
eval2 |= VERT_NORMAL_BIT;
if (ctx->Eval.Map1TextureCoord4 ||
ctx->Eval.Map1TextureCoord3 ||
ctx->Eval.Map1TextureCoord2 ||
ctx->Eval.Map1TextureCoord1)
eval1 |= VERT_TEX0;
eval1 |= VERT_TEX0_BIT;
if (ctx->Eval.Map2TextureCoord4 ||
ctx->Eval.Map2TextureCoord3 ||
ctx->Eval.Map2TextureCoord2 ||
ctx->Eval.Map2TextureCoord1)
eval2 |= VERT_TEX0;
eval2 |= VERT_TEX0_BIT;
if (ctx->Eval.Map1Vertex4)
eval1 |= VERT_OBJ_234;
@ -416,13 +416,13 @@ static void update_eval( GLcontext *ctx )
if (ctx->Eval.Map2Vertex4) {
if (ctx->Eval.AutoNormal)
eval2 |= VERT_OBJ_234 | VERT_NORM;
eval2 |= VERT_OBJ_234 | VERT_NORMAL_BIT;
else
eval2 |= VERT_OBJ_234;
}
else if (ctx->Eval.Map2Vertex3) {
if (ctx->Eval.AutoNormal)
eval2 |= VERT_OBJ_23 | VERT_NORM;
eval2 |= VERT_OBJ_23 | VERT_NORMAL_BIT;
else
eval2 |= VERT_OBJ_23;
}
@ -507,7 +507,7 @@ void _tnl_eval_immediate( GLcontext *ctx, struct immediate *IM )
/* Perform the evaluations on active data elements.
*/
if (req & VERT_INDEX)
if (req & VERT_INDEX_BIT)
{
GLuint generated = 0;
@ -528,7 +528,7 @@ void _tnl_eval_immediate( GLcontext *ctx, struct immediate *IM )
}
}
if (req & VERT_RGBA)
if (req & VERT_COLOR0_BIT)
{
GLuint generated = 0;
@ -541,7 +541,7 @@ void _tnl_eval_immediate( GLcontext *ctx, struct immediate *IM )
tmp->Color.Ptr = store->Color + IM->CopyStart;
tmp->Color.StrideB = 4 * sizeof(GLfloat);
tmp->Color.Flags = 0;
tnl->vb.importable_data &= ~VERT_RGBA;
tnl->vb.importable_data &= ~VERT_COLOR0_BIT;
if (ctx->Eval.Map1Color4 && any_eval1) {
eval1_4f_ca( &tmp->Color, coord, flags, 4, &ctx->EvalMap.Map1Color4 );
@ -616,7 +616,7 @@ void _tnl_eval_immediate( GLcontext *ctx, struct immediate *IM )
}
if (req & VERT_NORM)
if (req & VERT_NORMAL_BIT)
{
GLuint generated = 0;
@ -647,7 +647,7 @@ void _tnl_eval_immediate( GLcontext *ctx, struct immediate *IM )
/* In the AutoNormal case, the copy and assignment of tmp->NormalPtr
* are done above.
*/
if (req & VERT_OBJ)
if (req & VERT_OBJ_BIT)
{
if (copycount) {
/* This copy may already have occurred when eliminating
@ -678,7 +678,7 @@ void _tnl_eval_immediate( GLcontext *ctx, struct immediate *IM )
if (any_eval2) {
if (ctx->Eval.Map2Vertex4)
{
if (ctx->Eval.AutoNormal && (req & VERT_NORM))
if (ctx->Eval.AutoNormal && (req & VERT_NORMAL_BIT))
eval2_obj_norm( &tmp->Obj, &tmp->Normal, coord, flags, 4,
&ctx->EvalMap.Map2Vertex4 );
else
@ -687,7 +687,7 @@ void _tnl_eval_immediate( GLcontext *ctx, struct immediate *IM )
}
else if (ctx->Eval.Map2Vertex3)
{
if (ctx->Eval.AutoNormal && (req & VERT_NORM))
if (ctx->Eval.AutoNormal && (req & VERT_NORMAL_BIT))
eval2_obj_norm( &tmp->Obj, &tmp->Normal, coord, flags, 3,
&ctx->EvalMap.Map2Vertex3 );
else
@ -704,7 +704,7 @@ void _tnl_eval_immediate( GLcontext *ctx, struct immediate *IM )
* must be ignored.
*/
if (purge_flags) {
GLuint vertex = VERT_OBJ|(VERT_EVAL_ANY & ~purge_flags);
GLuint vertex = VERT_OBJ_BIT|(VERT_EVAL_ANY & ~purge_flags);
GLuint last_new_prim = 0;
GLuint new_prim_length = 0;
GLuint next_old_prim = 0;

View file

@ -1,4 +1,4 @@
/* $Id: t_imm_exec.c,v 1.30 2001/11/30 15:43:53 alanh Exp $ */
/* $Id: t_imm_exec.c,v 1.31 2001/12/14 02:51:45 brianp Exp $ */
/*
* Mesa 3-D graphics library
@ -96,6 +96,7 @@ void _tnl_reset_exec_input( GLcontext *ctx,
reset_input( ctx, start, beginstate, savedbeginstate );
IM->CopyStart = start - tnl->ExecCopyCount;
IM->Primitive[IM->CopyStart] = ctx->Driver.CurrentExecPrimitive;
if (tnl->ExecParity)
IM->Primitive[IM->CopyStart] |= PRIM_PARITY;
@ -117,40 +118,44 @@ void _tnl_reset_compile_input( GLcontext *ctx,
}
/*
* Copy the last specified normal, color, texcoord, edge flag, etc
* from the immediate struct into the ctx->Current attribute group.
*/
void _tnl_copy_to_current( GLcontext *ctx, struct immediate *IM,
GLuint flag, GLuint count )
{
if (MESA_VERBOSE&VERBOSE_IMMEDIATE)
_tnl_print_vert_flags("copy to current", flag);
if (flag & VERT_NORM)
COPY_3FV( ctx->Current.Normal, IM->Normal[count]);
if (flag & VERT_NORMAL_BIT)
COPY_3FV( ctx->Current.Attrib[VERT_ATTRIB_NORMAL], IM->Normal[count]);
if (flag & VERT_INDEX)
if (flag & VERT_INDEX_BIT)
ctx->Current.Index = IM->Index[count];
if (flag & VERT_EDGE)
if (flag & VERT_EDGEFLAG_BIT)
ctx->Current.EdgeFlag = IM->EdgeFlag[count];
if (flag & VERT_RGBA) {
COPY_4FV(ctx->Current.Color, IM->Color[count]);
if (flag & VERT_COLOR0_BIT) {
COPY_4FV(ctx->Current.Attrib[VERT_ATTRIB_COLOR0], IM->Color[count]);
if (ctx->Light.ColorMaterialEnabled) {
_mesa_update_color_material( ctx, ctx->Current.Color );
_mesa_update_color_material( ctx, ctx->Current.Attrib[VERT_ATTRIB_COLOR0] );
_mesa_validate_all_lighting_tables( ctx );
}
}
if (flag & VERT_SPEC_RGB)
COPY_4FV(ctx->Current.SecondaryColor, IM->SecondaryColor[count]);
if (flag & VERT_COLOR1_BIT)
COPY_4FV(ctx->Current.Attrib[VERT_ATTRIB_COLOR1], IM->SecondaryColor[count]);
if (flag & VERT_FOG_COORD)
ctx->Current.FogCoord = IM->FogCoord[count];
if (flag & VERT_FOG_BIT)
ctx->Current.Attrib[VERT_ATTRIB_FOG][0] = IM->FogCoord[count];
if (flag & VERT_TEX_ANY) {
GLuint i;
for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++) {
if (flag & VERT_TEX(i)) {
COPY_4FV( ctx->Current.Texcoord[0], IM->TexCoord[0][count]);
COPY_4FV( ctx->Current.Attrib[VERT_ATTRIB_TEX0 + i], IM->TexCoord[i][count]);
}
}
}
@ -202,13 +207,11 @@ void _tnl_compute_orflag( struct immediate *IM, GLuint start )
}
/* Note: The 'start' member of the GLvector structs is now redundant
/*
* This is where the vertex data is transfered from the 'struct immediate
* into the 'struct vertex_buffer'.
*
* Note: The 'start' member of the GLvector structs is now redundant
* because we always re-transform copied vertices, and the vectors
* below are set up so that the first copied vertex (if any) appears
* at position zero.
@ -263,7 +266,7 @@ static void _tnl_vb_bind_immediate( GLcontext *ctx, struct immediate *IM )
/* Setup the initial values of array pointers in the vb.
*/
if (inputs & VERT_OBJ) {
if (inputs & VERT_OBJ_BIT) {
tmp->Obj.data = IM->Obj + start;
tmp->Obj.start = (GLfloat *)(IM->Obj + start);
tmp->Obj.count = count;
@ -276,7 +279,7 @@ static void _tnl_vb_bind_immediate( GLcontext *ctx, struct immediate *IM )
tmp->Obj.size = 2;
}
if (inputs & VERT_NORM) {
if (inputs & VERT_NORMAL_BIT) {
tmp->Normal.data = IM->Normal + start;
tmp->Normal.start = (GLfloat *)(IM->Normal + start);
tmp->Normal.count = count;
@ -285,40 +288,41 @@ static void _tnl_vb_bind_immediate( GLcontext *ctx, struct immediate *IM )
VB->NormalLengthPtr = IM->NormalLengthPtr + start;
}
if (inputs & VERT_INDEX) {
if (inputs & VERT_INDEX_BIT) {
tmp->Index.count = count;
tmp->Index.data = IM->Index + start;
tmp->Index.start = IM->Index + start;
VB->IndexPtr[0] = &tmp->Index;
}
if (inputs & VERT_FOG_COORD) {
if (inputs & VERT_FOG_BIT) {
tmp->FogCoord.data = IM->FogCoord + start;
tmp->FogCoord.start = IM->FogCoord + start;
tmp->FogCoord.count = count;
VB->FogCoordPtr = &tmp->FogCoord;
}
if (inputs & VERT_SPEC_RGB) {
if (inputs & VERT_COLOR1_BIT) {
tmp->SecondaryColor.Ptr = IM->SecondaryColor + start;
VB->SecondaryColorPtr[0] = &tmp->SecondaryColor;
}
if (inputs & VERT_EDGE) {
if (inputs & VERT_EDGEFLAG_BIT) {
VB->EdgeFlag = IM->EdgeFlag + start;
}
if (inputs & VERT_RGBA) {
if (IM->CopyOrFlag & VERT_RGBA) {
if (inputs & VERT_COLOR0_BIT) {
if (IM->CopyOrFlag & VERT_COLOR0_BIT) {
tmp->Color.Ptr = IM->Color + start;
tmp->Color.StrideB = 4 * sizeof(GLfloat);
tmp->Color.Flags = 0;
} else {
tmp->Color.Ptr = ctx->Current.Color;
}
else {
tmp->Color.Ptr = ctx->Current.Attrib[VERT_ATTRIB_COLOR0];
tmp->Color.StrideB = 0;
tmp->Color.Flags = CA_CLIENT_DATA; /* hack */
VB->import_source = IM;
VB->importable_data |= VERT_RGBA;
VB->importable_data |= VERT_COLOR0_BIT;
VB->import_data = _tnl_upgrade_current_data;
}
VB->ColorPtr[0] = &tmp->Color;
@ -347,6 +351,18 @@ static void _tnl_vb_bind_immediate( GLcontext *ctx, struct immediate *IM )
VB->MaterialMask = IM->MaterialMask + start;
VB->Material = IM->Material + start;
}
/* GL_NV_vertex_program */
if (ctx->VertexProgram.Enabled) {
GLuint attr;
for (attr = 0; attr < 16; attr++) {
tmp->Attribs[attr].count = count;
tmp->Attribs[attr].data = IM->Attrib[attr] + start;
tmp->Attribs[attr].start = (GLfloat *) (IM->Attrib[attr] + start);
tmp->Attribs[attr].size = 4;
VB->AttribPtr[attr] = &(tmp->Attribs[attr]);
}
}
}
@ -359,8 +375,6 @@ void _tnl_run_cassette( GLcontext *ctx, struct immediate *IM )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
/* fprintf(stderr, "%s\n", __FUNCTION__); */
_tnl_vb_bind_immediate( ctx, IM );
if (IM->OrFlag & VERT_EVAL_ANY)
@ -449,6 +463,7 @@ void _tnl_execute_cassette( GLcontext *ctx, struct immediate *IM )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
printf("enter %s()\n", __FUNCTION__);
_tnl_compute_orflag( IM, IM->Start );
_tnl_copy_immediate_vertices( ctx, IM );
_tnl_get_exec_copy_verts( ctx, IM );
@ -456,6 +471,7 @@ void _tnl_execute_cassette( GLcontext *ctx, struct immediate *IM )
if (tnl->pipeline.build_state_changes)
_tnl_validate_pipeline( ctx );
printf(" CopyStart %d == Count %d ?\n", IM->CopyStart, IM->Count);
if (IM->CopyStart == IM->Count) {
exec_empty_cassette( ctx, IM );
}
@ -488,6 +504,7 @@ void _tnl_execute_cassette( GLcontext *ctx, struct immediate *IM )
if (ctx->Driver.CurrentExecPrimitive == GL_POLYGON+1)
ctx->Driver.NeedFlush &= ~FLUSH_STORED_VERTICES;
printf("leave %s()\n", __FUNCTION__);
}

View file

@ -1,4 +1,4 @@
/* $Id: t_imm_fixup.c,v 1.28 2001/12/03 17:47:04 keithw Exp $ */
/* $Id: t_imm_fixup.c,v 1.29 2001/12/14 02:51:45 brianp Exp $ */
/*
* Mesa 3-D graphics library
@ -194,37 +194,41 @@ fixup_first_1ub( GLubyte data[], GLuint flag[], GLuint match,
data[i] = dflt;
}
/*
* Copy vertex attributes from the ctx->Current group into the immediate
* struct at the given position according to copyMask.
*/
static void copy_from_current( GLcontext *ctx, struct immediate *IM,
GLuint start, GLuint copy )
GLuint pos, GLuint copyMask )
{
if (MESA_VERBOSE&VERBOSE_IMMEDIATE)
_tnl_print_vert_flags("copy from current", copy);
_tnl_print_vert_flags("copy from current", copyMask);
if (copy & VERT_NORM) {
COPY_3V( IM->Normal[start], ctx->Current.Normal );
if (copyMask & VERT_NORMAL_BIT) {
COPY_3V(IM->Normal[pos], ctx->Current.Attrib[VERT_ATTRIB_NORMAL]);
}
if (copy & VERT_RGBA) {
COPY_4FV( IM->Color[start], ctx->Current.Color);
if (copyMask & VERT_COLOR0_BIT) {
COPY_4FV( IM->Color[pos], ctx->Current.Attrib[VERT_ATTRIB_COLOR0]);
}
if (copy & VERT_SPEC_RGB)
COPY_4FV( IM->SecondaryColor[start], ctx->Current.SecondaryColor);
if (copyMask & VERT_COLOR1_BIT)
COPY_4FV( IM->SecondaryColor[pos], ctx->Current.Attrib[VERT_ATTRIB_COLOR1]);
if (copy & VERT_FOG_COORD)
IM->FogCoord[start] = ctx->Current.FogCoord;
if (copyMask & VERT_FOG_BIT)
IM->FogCoord[pos] = ctx->Current.Attrib[VERT_ATTRIB_FOG][0];
if (copy & VERT_INDEX)
IM->Index[start] = ctx->Current.Index;
if (copyMask & VERT_INDEX_BIT)
IM->Index[pos] = ctx->Current.Index;
if (copy & VERT_EDGE)
IM->EdgeFlag[start] = ctx->Current.EdgeFlag;
if (copyMask & VERT_EDGEFLAG_BIT)
IM->EdgeFlag[pos] = ctx->Current.EdgeFlag;
if (copy & VERT_TEX_ANY) {
if (copyMask & VERT_TEX_ANY) {
GLuint i;
for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++) {
if (copy & VERT_TEX(i))
COPY_4FV( IM->TexCoord[i][start], ctx->Current.Texcoord[i] );
if (copyMask & VERT_TEX(i))
COPY_4FV(IM->TexCoord[i][pos], ctx->Current.Attrib[VERT_ATTRIB_TEX0 + i]);
}
}
}
@ -254,7 +258,7 @@ void _tnl_fixup_input( GLcontext *ctx, struct immediate *IM )
if (!ctx->ExecuteFlag)
fixup &= orflag;
if ((orflag & (VERT_OBJ|VERT_EVAL_ANY)) == 0)
if ((orflag & (VERT_OBJ_BIT|VERT_EVAL_ANY)) == 0)
fixup = 0;
if (fixup) {
@ -285,50 +289,50 @@ void _tnl_fixup_input( GLcontext *ctx, struct immediate *IM )
}
if (fixup & VERT_EDGE) {
if (orflag & VERT_EDGE)
_tnl_fixup_1ub( IM->EdgeFlag, IM->Flag, start, VERT_EDGE );
if (fixup & VERT_EDGEFLAG_BIT) {
if (orflag & VERT_EDGEFLAG_BIT)
_tnl_fixup_1ub( IM->EdgeFlag, IM->Flag, start, VERT_EDGEFLAG_BIT );
else
fixup_first_1ub( IM->EdgeFlag, IM->Flag, VERT_END_VB, start,
IM->EdgeFlag[start] );
}
if (fixup & VERT_INDEX) {
if (orflag & VERT_INDEX)
_tnl_fixup_1ui( IM->Index, IM->Flag, start, VERT_INDEX );
if (fixup & VERT_INDEX_BIT) {
if (orflag & VERT_INDEX_BIT)
_tnl_fixup_1ui( IM->Index, IM->Flag, start, VERT_INDEX_BIT );
else
fixup_first_1ui( IM->Index, IM->Flag, VERT_END_VB, start,
IM->Index[start] );
}
if (fixup & VERT_RGBA) {
if (orflag & VERT_RGBA)
_tnl_fixup_4f( IM->Color, IM->Flag, start, VERT_RGBA );
if (fixup & VERT_COLOR0_BIT) {
if (orflag & VERT_COLOR0_BIT)
_tnl_fixup_4f( IM->Color, IM->Flag, start, VERT_COLOR0_BIT );
/* No need for else case as the drivers understand stride
* zero here. (TODO - propogate this)
*/
}
if (fixup & VERT_SPEC_RGB) {
if (orflag & VERT_SPEC_RGB)
if (fixup & VERT_COLOR1_BIT) {
if (orflag & VERT_COLOR1_BIT)
_tnl_fixup_4f( IM->SecondaryColor, IM->Flag, start,
VERT_SPEC_RGB );
VERT_COLOR1_BIT );
else
fixup_first_4f( IM->SecondaryColor, IM->Flag, VERT_END_VB, start,
IM->SecondaryColor[start] );
}
if (fixup & VERT_FOG_COORD) {
if (orflag & VERT_FOG_COORD)
_tnl_fixup_1f( IM->FogCoord, IM->Flag, start, VERT_FOG_COORD );
if (fixup & VERT_FOG_BIT) {
if (orflag & VERT_FOG_BIT)
_tnl_fixup_1f( IM->FogCoord, IM->Flag, start, VERT_FOG_BIT );
else
fixup_first_1f( IM->FogCoord, IM->Flag, VERT_END_VB, start,
IM->FogCoord[start] );
}
if (fixup & VERT_NORM) {
if (orflag & VERT_NORM)
_tnl_fixup_3f( IM->Normal, IM->Flag, start, VERT_NORM );
if (fixup & VERT_NORMAL_BIT) {
if (orflag & VERT_NORMAL_BIT)
_tnl_fixup_3f( IM->Normal, IM->Flag, start, VERT_NORMAL_BIT );
else
fixup_first_3f( IM->Normal, IM->Flag, VERT_END_VB, start,
IM->Normal[start] );
@ -417,6 +421,7 @@ void _tnl_copy_immediate_vertices( GLcontext *ctx, struct immediate *next )
}
next->CopyStart = next->Start - count;
printf("%s() CopyStart = %d\n", __FUNCTION__, next->CopyStart);
if ((prev->CopyOrFlag & VERT_DATA) == VERT_ELT &&
ctx->Array.LockCount &&
@ -472,7 +477,7 @@ void _tnl_copy_immediate_vertices( GLcontext *ctx, struct immediate *next )
*/
COPY_4FV( next->Obj[dst], inputs->Obj.data[isrc] );
if (copy & VERT_NORM) {
if (copy & VERT_NORMAL_BIT) {
/* fprintf(stderr, "copy vert norm %d to %d (%p): %f %f %f\n", */
/* isrc, dst, */
/* next->Normal[dst], */
@ -482,11 +487,11 @@ void _tnl_copy_immediate_vertices( GLcontext *ctx, struct immediate *next )
COPY_3FV( next->Normal[dst], inputs->Normal.data[isrc] );
}
if (copy & VERT_RGBA)
if (copy & VERT_COLOR0_BIT)
COPY_4FV( next->Color[dst],
((GLfloat (*)[4])inputs->Color.Ptr)[isrc] );
if (copy & VERT_INDEX)
if (copy & VERT_INDEX_BIT)
next->Index[dst] = inputs->Index.data[isrc];
if (copy & VERT_TEX_ANY) {
@ -501,7 +506,7 @@ void _tnl_copy_immediate_vertices( GLcontext *ctx, struct immediate *next )
/* Remaining values should be the same in the 'input' struct and the
* original immediate.
*/
if (copy & (VERT_ELT|VERT_EDGE|VERT_SPEC_RGB|VERT_FOG_COORD|
if (copy & (VERT_ELT|VERT_EDGEFLAG_BIT|VERT_COLOR1_BIT|VERT_FOG_BIT|
VERT_MATERIAL)) {
if (prev->Flag[src] & VERT_MATERIAL)
@ -516,7 +521,7 @@ void _tnl_copy_immediate_vertices( GLcontext *ctx, struct immediate *next )
next->Flag[dst] = flag;
next->CopyOrFlag |= prev->Flag[src] & (VERT_FIXUP|
VERT_MATERIAL|
VERT_OBJ);
VERT_OBJ_BIT);
}
}
@ -580,37 +585,37 @@ void _tnl_fixup_compiled_cassette( GLcontext *ctx, struct immediate *IM )
for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++) {
if (fixup & VERT_TEX(i))
fixup_first_4f( IM->TexCoord[i], IM->Flag, VERT_TEX(i), start,
ctx->Current.Texcoord[i] );
ctx->Current.Attrib[VERT_ATTRIB_TEX0 + i] );
}
}
if (fixup & VERT_EDGE)
fixup_first_1ub(IM->EdgeFlag, IM->Flag, VERT_EDGE, start,
if (fixup & VERT_EDGEFLAG_BIT)
fixup_first_1ub(IM->EdgeFlag, IM->Flag, VERT_EDGEFLAG_BIT, start,
ctx->Current.EdgeFlag );
if (fixup & VERT_INDEX)
fixup_first_1ui(IM->Index, IM->Flag, VERT_INDEX, start,
if (fixup & VERT_INDEX_BIT)
fixup_first_1ui(IM->Index, IM->Flag, VERT_INDEX_BIT, start,
ctx->Current.Index );
if (fixup & VERT_RGBA) {
if (IM->CopyOrFlag & VERT_RGBA)
fixup_first_4f(IM->Color, IM->Flag, VERT_RGBA, start,
ctx->Current.Color );
if (fixup & VERT_COLOR0_BIT) {
if (IM->CopyOrFlag & VERT_COLOR0_BIT)
fixup_first_4f(IM->Color, IM->Flag, VERT_COLOR0_BIT, start,
ctx->Current.Attrib[VERT_ATTRIB_COLOR0] );
else
fixup &= ~VERT_RGBA;
fixup &= ~VERT_COLOR0_BIT;
}
if (fixup & VERT_SPEC_RGB)
fixup_first_4f(IM->SecondaryColor, IM->Flag, VERT_SPEC_RGB, start,
ctx->Current.SecondaryColor );
if (fixup & VERT_COLOR1_BIT)
fixup_first_4f(IM->SecondaryColor, IM->Flag, VERT_COLOR1_BIT, start,
ctx->Current.Attrib[VERT_ATTRIB_COLOR1] );
if (fixup & VERT_FOG_COORD)
fixup_first_1f(IM->FogCoord, IM->Flag, VERT_FOG_COORD, start,
ctx->Current.FogCoord );
if (fixup & VERT_FOG_BIT)
fixup_first_1f(IM->FogCoord, IM->Flag, VERT_FOG_BIT, start,
ctx->Current.Attrib[VERT_ATTRIB_FOG][0] );
if (fixup & VERT_NORM) {
fixup_first_3f(IM->Normal, IM->Flag, VERT_NORM, start,
ctx->Current.Normal );
if (fixup & VERT_NORMAL_BIT) {
fixup_first_3f(IM->Normal, IM->Flag, VERT_NORMAL_BIT, start,
ctx->Current.Attrib[VERT_ATTRIB_NORMAL] );
}
IM->CopyOrFlag |= fixup;
@ -795,7 +800,7 @@ void _tnl_upgrade_current_data( GLcontext *ctx,
/* _tnl_print_vert_flags("_tnl_upgrade_client_data", required); */
if ((required & VERT_RGBA) && (VB->ColorPtr[0]->Flags & CA_CLIENT_DATA)) {
if ((required & VERT_COLOR0_BIT) && (VB->ColorPtr[0]->Flags & CA_CLIENT_DATA)) {
struct gl_client_array *tmp = &tnl->imm_inputs.Color;
GLuint start = IM->CopyStart;
@ -803,7 +808,7 @@ void _tnl_upgrade_current_data( GLcontext *ctx,
tmp->StrideB = 4 * sizeof(GLfloat);
tmp->Flags = 0;
COPY_4FV( IM->Color[start], ctx->Current.Color);
COPY_4FV( IM->Color[start], ctx->Current.Attrib[VERT_ATTRIB_COLOR0]);
/*
ASSERT(IM->Flag[IM->LastData+1] & VERT_END_VB);
@ -812,7 +817,7 @@ void _tnl_upgrade_current_data( GLcontext *ctx,
fixup_first_4f( IM->Color, IM->Flag, VERT_END_VB, start,
IM->Color[start] );
VB->importable_data &= ~VERT_RGBA;
VB->importable_data &= ~VERT_COLOR0_BIT;
}
}

View file

@ -1,4 +1,4 @@
/* $Id: t_pipeline.c,v 1.19 2001/05/21 16:33:41 gareth Exp $ */
/* $Id: t_pipeline.c,v 1.20 2001/12/14 02:51:45 brianp Exp $ */
/*
* Mesa 3-D graphics library
@ -131,6 +131,8 @@ void _tnl_run_pipeline( GLcontext *ctx )
pipe->run_state_changes = 0;
pipe->run_input_changes = 0;
printf("%s()\n", __FUNCTION__);
/* Done elsewhere.
*/
ASSERT(pipe->build_state_changes == 0);
@ -203,6 +205,7 @@ const struct gl_pipeline_stage *_tnl_default_pipeline[] = {
&_tnl_texgen_stage,
&_tnl_texture_transform_stage,
&_tnl_point_attenuation_stage,
&_tnl_vertex_program_stage,
&_tnl_render_stage,
0
};

View file

@ -1,4 +1,4 @@
/* $Id: t_pipeline.h,v 1.8 2001/07/12 22:09:22 keithw Exp $ */
/* $Id: t_pipeline.h,v 1.9 2001/12/14 02:51:45 brianp Exp $ */
/*
* Mesa 3-D graphics library
@ -54,6 +54,7 @@ extern const struct gl_pipeline_stage _tnl_fog_coordinate_stage;
extern const struct gl_pipeline_stage _tnl_texgen_stage;
extern const struct gl_pipeline_stage _tnl_texture_transform_stage;
extern const struct gl_pipeline_stage _tnl_point_attenuation_stage;
extern const struct gl_pipeline_stage _tnl_vertex_program_stage;
extern const struct gl_pipeline_stage _tnl_render_stage;
/* Shorthand to plug in the default pipeline:

View file

@ -1,4 +1,4 @@
/* $Id: t_vb_fog.c,v 1.12 2001/09/14 21:30:31 brianp Exp $ */
/* $Id: t_vb_fog.c,v 1.13 2001/12/14 02:51:45 brianp Exp $ */
/*
* Mesa 3-D graphics library
@ -166,8 +166,7 @@ static GLboolean run_fog_stage( GLcontext *ctx,
input->count = VB->ObjPtr->count;
}
else
{
else {
input = &store->input;
if (VB->EyePtr->size < 2)
@ -178,7 +177,8 @@ static GLboolean run_fog_stage( GLcontext *ctx,
input->stride = VB->EyePtr->stride;
input->count = VB->EyePtr->count;
}
} else {
}
else {
/* use glFogCoord() coordinates */
/* source = VB->FogCoordPtr */
input = VB->FogCoordPtr;
@ -190,14 +190,15 @@ static GLboolean run_fog_stage( GLcontext *ctx,
return GL_TRUE;
}
static void check_fog_stage( GLcontext *ctx, struct gl_pipeline_stage *stage )
{
stage->active = ctx->Fog.Enabled;
stage->active = ctx->Fog.Enabled && !ctx->VertexProgram.Enabled;
if (ctx->Fog.FogCoordinateSource == GL_FRAGMENT_DEPTH_EXT)
stage->inputs = VERT_EYE;
else
stage->inputs = VERT_FOG_COORD;
stage->inputs = VERT_FOG_BIT;
}
@ -239,11 +240,14 @@ static void free_fog_data( struct gl_pipeline_stage *stage )
const struct gl_pipeline_stage _tnl_fog_coordinate_stage =
{
"build fog coordinates",
_NEW_FOG,
_NEW_FOG,
0, 0, VERT_FOG_COORD, /* active, inputs, outputs */
0, 0, /* changed_inputs, private_data */
"build fog coordinates", /* name */
_NEW_FOG, /* check_state */
_NEW_FOG, /* run_state */
GL_FALSE, /* active? */
0, /* inputs */
VERT_FOG_BIT, /* outputs */
0, /* changed_inputs */
NULL, /* private_data */
free_fog_data, /* dtr */
check_fog_stage, /* check */
alloc_fog_data /* run -- initially set to init. */

View file

@ -1,4 +1,4 @@
/* $Id: t_vb_light.c,v 1.15 2001/07/17 19:39:32 keithw Exp $ */
/* $Id: t_vb_light.c,v 1.16 2001/12/14 02:51:45 brianp Exp $ */
/*
* Mesa 3-D graphics library
@ -168,12 +168,12 @@ static GLboolean run_lighting( GLcontext *ctx, struct gl_pipeline_stage *stage )
/* Make sure we can talk about elements 0..2 in the vector we are
* lighting.
*/
if (stage->changed_inputs & (VERT_EYE|VERT_OBJ)) {
if (stage->changed_inputs & (VERT_EYE|VERT_OBJ_BIT)) {
if (input->size <= 2) {
if (input->flags & VEC_NOT_WRITEABLE) {
ASSERT(VB->importable_data & VERT_OBJ);
ASSERT(VB->importable_data & VERT_OBJ_BIT);
VB->import_data( ctx, VERT_OBJ, VEC_NOT_WRITEABLE );
VB->import_data( ctx, VERT_OBJ_BIT, VEC_NOT_WRITEABLE );
input = ctx->_NeedEyeCoords ? VB->EyePtr : VB->ObjPtr;
ASSERT((input->flags & VEC_NOT_WRITEABLE) == 0);
@ -295,19 +295,19 @@ static GLboolean run_init_lighting( GLcontext *ctx,
*/
static void check_lighting( GLcontext *ctx, struct gl_pipeline_stage *stage )
{
stage->active = ctx->Light.Enabled;
stage->active = ctx->Light.Enabled && !ctx->VertexProgram.Enabled;
if (stage->active) {
if (stage->privatePtr)
stage->run = run_validate_lighting;
stage->inputs = VERT_NORM|VERT_MATERIAL;
stage->inputs = VERT_NORMAL_BIT|VERT_MATERIAL;
if (ctx->Light._NeedVertices)
stage->inputs |= VERT_EYE; /* effectively, even when lighting in obj */
if (ctx->Light.ColorMaterialEnabled)
stage->inputs |= VERT_RGBA;
stage->inputs |= VERT_COLOR0_BIT;
stage->outputs = VERT_RGBA;
stage->outputs = VERT_COLOR0_BIT;
if (ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)
stage->outputs |= VERT_SPEC_RGB;
stage->outputs |= VERT_COLOR1_BIT;
}
}
@ -334,13 +334,16 @@ static void dtr( struct gl_pipeline_stage *stage )
const struct gl_pipeline_stage _tnl_lighting_stage =
{
"lighting",
"lighting", /* name */
_NEW_LIGHT, /* recheck */
_NEW_LIGHT|_NEW_MODELVIEW, /* recalc -- modelview dependency
* otherwise not captured by inputs
* (which may be VERT_OBJ) */
0,0,0, /* active, inputs, outputs */
0,0, /* changed_inputs, private_data */
* (which may be VERT_OBJ_BIT) */
GL_FALSE, /* active? */
0, /* inputs */
0, /* outputs */
0, /* changed_inputs */
NULL, /* private_data */
dtr, /* destroy */
check_lighting, /* check */
run_init_lighting /* run -- initially set to ctr */

View file

@ -1,4 +1,4 @@
/* $Id: t_vb_lighttmp.h,v 1.19 2001/10/20 00:13:45 keithw Exp $ */
/* $Id: t_vb_lighttmp.h,v 1.20 2001/12/14 02:51:45 brianp Exp $ */
/*
* Mesa 3-D graphics library
@ -37,20 +37,20 @@
# define CHECK_END_VB(x) (flags[x] & VERT_END_VB)
# if (IDX & LIGHT_COLORMATERIAL)
# define CMSTRIDE STRIDE_F(CMcolor, CMstride)
# define CHECK_COLOR_MATERIAL(x) (flags[x] & VERT_RGBA)
# define CHECK_VALIDATE(x) (flags[x] & (VERT_RGBA|VERT_MATERIAL))
# define CHECK_COLOR_MATERIAL(x) (flags[x] & VERT_COLOR0_BIT)
# define CHECK_VALIDATE(x) (flags[x] & (VERT_COLOR0_BIT|VERT_MATERIAL))
# define DO_ANOTHER_NORMAL(x) \
((flags[x] & (VERT_RGBA|VERT_NORM|VERT_END_VB|VERT_MATERIAL)) == VERT_NORM)
((flags[x] & (VERT_COLOR0_BIT|VERT_NORMAL_BIT|VERT_END_VB|VERT_MATERIAL)) == VERT_NORMAL_BIT)
# define REUSE_LIGHT_RESULTS(x) \
((flags[x] & (VERT_RGBA|VERT_NORM|VERT_END_VB|VERT_MATERIAL)) == 0)
((flags[x] & (VERT_COLOR0_BIT|VERT_NORMAL_BIT|VERT_END_VB|VERT_MATERIAL)) == 0)
# else
# define CMSTRIDE (void)0
# define CHECK_COLOR_MATERIAL(x) 0
# define CHECK_VALIDATE(x) (flags[x] & (VERT_MATERIAL))
# define DO_ANOTHER_NORMAL(x) \
((flags[x] & (VERT_NORM|VERT_END_VB|VERT_MATERIAL)) == VERT_NORM)
((flags[x] & (VERT_NORMAL_BIT|VERT_END_VB|VERT_MATERIAL)) == VERT_NORMAL_BIT)
# define REUSE_LIGHT_RESULTS(x) \
((flags[x] & (VERT_NORM|VERT_END_VB|VERT_MATERIAL)) == 0)
((flags[x] & (VERT_NORMAL_BIT|VERT_END_VB|VERT_MATERIAL)) == 0)
# endif
#else
# define VSTRIDE vstride

View file

@ -1,4 +1,4 @@
/* $Id: t_vb_normals.c,v 1.9 2001/06/28 17:34:14 keithw Exp $ */
/* $Id: t_vb_normals.c,v 1.10 2001/12/14 02:51:45 brianp Exp $ */
/*
* Mesa 3-D graphics library
@ -128,7 +128,7 @@ static GLboolean run_validate_normal_stage( GLcontext *ctx,
static void check_normal_transform( GLcontext *ctx,
struct gl_pipeline_stage *stage )
{
stage->active = ctx->_NeedNormals;
stage->active = ctx->_NeedNormals && !ctx->VertexProgram.Enabled;
/* Don't clobber the initialize function:
*/
if (stage->privatePtr)
@ -175,11 +175,14 @@ static void free_normal_data( struct gl_pipeline_stage *stage )
const struct gl_pipeline_stage _tnl_normal_transform_stage =
{
"normal transform",
"normal transform", /* name */
_TNL_NEW_NORMAL_TRANSFORM, /* re-check */
_TNL_NEW_NORMAL_TRANSFORM, /* re-run */
0,VERT_NORM,VERT_NORM, /* active, inputs, outputs */
0, 0, /* changed_inputs, private */
GL_FALSE, /* active? */
VERT_NORMAL_BIT, /* inputs */
VERT_NORMAL_BIT, /* outputs */
0, /* changed_inputs */
NULL, /* private data */
free_normal_data, /* destructor */
check_normal_transform, /* check */
alloc_normal_data /* run -- initially set to alloc */

View file

@ -1,4 +1,4 @@
/* $Id: t_vb_points.c,v 1.4 2001/03/12 00:48:44 gareth Exp $ */
/* $Id: t_vb_points.c,v 1.5 2001/12/14 02:51:45 brianp Exp $ */
/*
* Mesa 3-D graphics library
@ -113,11 +113,11 @@ const struct gl_pipeline_stage _tnl_point_attenuation_stage =
"point size attenuation", /* name */
_NEW_POINT, /* build_state_change */
_NEW_POINT, /* run_state_change */
0, /* active */
GL_FALSE, /* active */
VERT_EYE, /* inputs */
VERT_POINT_SIZE, /* outputs */
0, /* changed_inputs (temporary value) */
0, /* stage private data */
NULL, /* stage private data */
free_point_data, /* destructor */
check_point_size, /* check */
alloc_point_data /* run -- initially set to alloc data */

1028
src/mesa/tnl/t_vb_program.c Normal file

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,4 @@
/* $Id: t_vb_render.c,v 1.24 2001/12/03 17:48:58 keithw Exp $ */
/* $Id: t_vb_render.c,v 1.25 2001/12/14 02:51:45 brianp Exp $ */
/*
* Mesa 3-D graphics library
@ -282,7 +282,6 @@ static GLboolean run_render( GLcontext *ctx,
render_func *tab;
GLint pass = 0;
/* Allow the drivers to lock before projected verts are built so
* that window coordinates are guarenteed not to change before
* rendering.
@ -354,10 +353,10 @@ static void check_render( GLcontext *ctx, struct gl_pipeline_stage *stage )
GLuint i;
if (ctx->Visual.rgbMode) {
inputs |= VERT_RGBA;
inputs |= VERT_COLOR0_BIT;
if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR)
inputs |= VERT_SPEC_RGB;
inputs |= VERT_COLOR1_BIT;
if (ctx->Texture._ReallyEnabled) {
for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++) {
@ -367,7 +366,7 @@ static void check_render( GLcontext *ctx, struct gl_pipeline_stage *stage )
}
}
else {
inputs |= VERT_INDEX;
inputs |= VERT_INDEX_BIT;
}
if (ctx->Point._Attenuated)
@ -376,10 +375,10 @@ static void check_render( GLcontext *ctx, struct gl_pipeline_stage *stage )
/* How do drivers turn this off?
*/
if (ctx->Fog.Enabled)
inputs |= VERT_FOG_COORD;
inputs |= VERT_FOG_BIT;
if (ctx->_TriangleCaps & DD_TRI_UNFILLED)
inputs |= VERT_EDGE;
inputs |= VERT_EDGEFLAG_BIT;
if (ctx->RenderMode==GL_FEEDBACK)
inputs |= VERT_TEX_ANY;
@ -397,7 +396,7 @@ static void dtr( struct gl_pipeline_stage *stage )
const struct gl_pipeline_stage _tnl_render_stage =
{
"render",
"render", /* name */
(_NEW_BUFFERS |
_DD_NEW_SEPARATE_SPECULAR |
_DD_NEW_FLATSHADE |
@ -408,9 +407,11 @@ const struct gl_pipeline_stage _tnl_render_stage =
_DD_NEW_TRI_UNFILLED |
_NEW_RENDERMODE), /* re-check (new inputs, interp function) */
0, /* re-run (always runs) */
GL_TRUE, /* active */
0, 0, /* inputs (set in check_render), outputs */
0, 0, /* changed_inputs, private */
GL_TRUE, /* active? */
0, /* inputs (set in check_render) */
0, /* outputs */
0, /* changed_inputs */
NULL, /* private data */
dtr, /* destructor */
check_render, /* check */
run_render /* run */

View file

@ -1,4 +1,4 @@
/* $Id: t_vb_texgen.c,v 1.9 2001/04/26 14:53:48 keithw Exp $ */
/* $Id: t_vb_texgen.c,v 1.10 2001/12/14 02:51:45 brianp Exp $ */
/*
* Mesa 3-D graphics library
@ -529,7 +529,7 @@ static GLboolean run_texgen_stage( GLcontext *ctx,
for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++)
if (ctx->Texture._TexGenEnabled & ENABLE_TEXGEN(i)) {
if (stage->changed_inputs & (VERT_EYE | VERT_NORM | VERT_TEX(i)))
if (stage->changed_inputs & (VERT_EYE | VERT_NORMAL_BIT | VERT_TEX(i)))
store->TexgenFunc[i]( ctx, store, i );
VB->TexCoordPtr[i] = &store->texcoord[i];
@ -591,18 +591,18 @@ static void check_texgen( GLcontext *ctx, struct gl_pipeline_stage *stage )
GLuint i;
stage->active = 0;
if (ctx->Texture._TexGenEnabled) {
if (ctx->Texture._TexGenEnabled && !ctx->VertexProgram.Enabled) {
GLuint inputs = 0;
GLuint outputs = 0;
if (ctx->Texture._GenFlags & TEXGEN_OBJ_LINEAR)
inputs |= VERT_OBJ;
inputs |= VERT_OBJ_BIT;
if (ctx->Texture._GenFlags & TEXGEN_NEED_EYE_COORD)
inputs |= VERT_EYE;
if (ctx->Texture._GenFlags & TEXGEN_NEED_NORMALS)
inputs |= VERT_NORM;
inputs |= VERT_NORMAL_BIT;
for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++)
if (ctx->Texture._TexGenEnabled & ENABLE_TEXGEN(i))
@ -678,11 +678,14 @@ static void free_texgen_data( struct gl_pipeline_stage *stage )
const struct gl_pipeline_stage _tnl_texgen_stage =
{
"texgen",
"texgen", /* name */
_NEW_TEXTURE, /* when to call check() */
_NEW_TEXTURE, /* when to invalidate stored data */
0,0,0, /* active, inputs, outputs */
0,0, /* changed_inputs, private */
GL_FALSE, /* active? */
0, /* inputs */
0, /* outputs */
0, /* changed_inputs */
NULL, /* private data */
free_texgen_data, /* destructor */
check_texgen, /* check */
alloc_texgen_data /* run -- initially set to alloc data */

View file

@ -1,4 +1,4 @@
/* $Id: t_vb_texmat.c,v 1.5 2001/03/29 21:16:26 keithw Exp $ */
/* $Id: t_vb_texmat.c,v 1.6 2001/12/14 02:51:45 brianp Exp $ */
/*
* Mesa 3-D graphics library
@ -60,7 +60,7 @@ static void check_texmat( GLcontext *ctx, struct gl_pipeline_stage *stage )
GLuint i;
stage->active = 0;
if (ctx->Texture._TexMatEnabled) {
if (ctx->Texture._TexMatEnabled && !ctx->VertexProgram.Enabled) {
GLuint flags = 0;
for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++)
@ -137,12 +137,15 @@ static void free_texmat_data( struct gl_pipeline_stage *stage )
const struct gl_pipeline_stage _tnl_texture_transform_stage =
{
"texture transform",
_NEW_TEXTURE|_NEW_TEXTURE_MATRIX,
_NEW_TEXTURE|_NEW_TEXTURE_MATRIX,
0,0,0, /* active, inputs, outputs */
0,0, /* changed_inputs, private */
free_texmat_data, /* destructor */
check_texmat, /* check */
alloc_texmat_data, /* run -- initially set to init */
"texture transform", /* name */
_NEW_TEXTURE|_NEW_TEXTURE_MATRIX, /* check_state */
_NEW_TEXTURE|_NEW_TEXTURE_MATRIX, /* run_state */
GL_FALSE, /* active? */
0, /* inputs */
0, /* outputs */
0, /* changed_inputs */
NULL, /* private data */
free_texmat_data, /* destructor */
check_texmat, /* check */
alloc_texmat_data, /* run -- initially set to init */
};

View file

@ -1,4 +1,4 @@
/* $Id: t_vb_vertex.c,v 1.9 2001/05/30 10:01:41 keithw Exp $ */
/* $Id: t_vb_vertex.c,v 1.10 2001/12/14 02:51:45 brianp Exp $ */
/*
* Mesa 3-D graphics library
@ -170,7 +170,7 @@ static GLboolean run_vertex_stage( GLcontext *ctx,
if (VB->ClipPtr->size < 4) {
if (VB->ClipPtr->flags & VEC_NOT_WRITEABLE) {
ASSERT(VB->ClipPtr == VB->ObjPtr);
VB->import_data( ctx, VERT_OBJ, VEC_NOT_WRITEABLE );
VB->import_data( ctx, VERT_OBJ_BIT, VEC_NOT_WRITEABLE );
VB->ClipPtr = VB->ObjPtr;
}
if (VB->ClipPtr->size == 2)
@ -222,7 +222,7 @@ static GLboolean run_vertex_stage( GLcontext *ctx,
VB->ClipOrMask = store->ormask;
VB->ClipMask = store->clipmask;
if (VB->ClipPtr == VB->ObjPtr && (VB->importable_data & VERT_OBJ))
if (VB->ClipPtr == VB->ObjPtr && (VB->importable_data & VERT_OBJ_BIT))
VB->importable_data |= VERT_CLIP;
store->save_eyeptr = VB->EyePtr;
@ -237,7 +237,7 @@ static GLboolean run_vertex_stage( GLcontext *ctx,
VB->ProjectedClipPtr = store->save_projptr;
VB->ClipMask = store->clipmask;
VB->ClipOrMask = store->ormask;
if (VB->ClipPtr == VB->ObjPtr && (VB->importable_data & VERT_OBJ))
if (VB->ClipPtr == VB->ObjPtr && (VB->importable_data & VERT_OBJ_BIT))
VB->importable_data |= VERT_CLIP;
if (store->andmask)
return GL_FALSE;
@ -249,8 +249,7 @@ static GLboolean run_vertex_stage( GLcontext *ctx,
static void check_vertex( GLcontext *ctx, struct gl_pipeline_stage *stage )
{
(void) ctx;
(void) stage;
stage->active = !ctx->VertexProgram.Enabled;
}
static GLboolean init_vertex_stage( GLcontext *ctx,
@ -308,9 +307,10 @@ const struct gl_pipeline_stage _tnl_vertex_transform_stage =
_NEW_PROJECTION|
_NEW_TRANSFORM, /* re-run */
GL_TRUE, /* active */
VERT_OBJ, /* inputs */
VERT_OBJ_BIT, /* inputs */
VERT_EYE|VERT_CLIP, /* outputs */
0, 0, /* changed_inputs, private */
0, /* changed_inputs */
NULL, /* private data */
dtr, /* destructor */
check_vertex, /* check */
init_vertex_stage /* run -- initially set to init */

View file

@ -4123,5 +4123,389 @@ GL_PREFIX(WindowPos3svARB):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_WindowPos3svARB))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(BindProgramNV))
GL_PREFIX(BindProgramNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_BindProgramNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(DeleteProgramsNV))
GL_PREFIX(DeleteProgramsNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_DeleteProgramsNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(ExecuteProgramNV))
GL_PREFIX(ExecuteProgramNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_ExecuteProgramNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GenProgramsNV))
GL_PREFIX(GenProgramsNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_GenProgramsNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(AreProgramsResidentNV))
GL_PREFIX(AreProgramsResidentNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_AreProgramsResidentNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(RequestResidentProgramsNV))
GL_PREFIX(RequestResidentProgramsNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_RequestResidentProgramsNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetProgramParameterfvNV))
GL_PREFIX(GetProgramParameterfvNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_GetProgramParameterfvNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetProgramParameterdvNV))
GL_PREFIX(GetProgramParameterdvNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_GetProgramParameterdvNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetProgramivNV))
GL_PREFIX(GetProgramivNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_GetProgramivNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetProgramStringNV))
GL_PREFIX(GetProgramStringNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_GetProgramStringNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetTrackMatrixivNV))
GL_PREFIX(GetTrackMatrixivNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_GetTrackMatrixivNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetVertexAttribdvNV))
GL_PREFIX(GetVertexAttribdvNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_GetVertexAttribdvNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetVertexAttribfvNV))
GL_PREFIX(GetVertexAttribfvNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_GetVertexAttribfvNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetVertexAttribivNV))
GL_PREFIX(GetVertexAttribivNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_GetVertexAttribivNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(GetVertexAttribPointervNV))
GL_PREFIX(GetVertexAttribPointervNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_GetVertexAttribPointervNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(IsProgramNV))
GL_PREFIX(IsProgramNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_IsProgramNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(LoadProgramNV))
GL_PREFIX(LoadProgramNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_LoadProgramNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(ProgramParameter4fNV))
GL_PREFIX(ProgramParameter4fNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_ProgramParameter4fNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(ProgramParameter4dNV))
GL_PREFIX(ProgramParameter4dNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_ProgramParameter4dNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(ProgramParameter4dvNV))
GL_PREFIX(ProgramParameter4dvNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_ProgramParameter4dvNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(ProgramParameter4fvNV))
GL_PREFIX(ProgramParameter4fvNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_ProgramParameter4fvNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(ProgramParameters4dvNV))
GL_PREFIX(ProgramParameters4dvNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_ProgramParameters4dvNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(ProgramParameters4fvNV))
GL_PREFIX(ProgramParameters4fvNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_ProgramParameters4fvNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(TrackMatrixNV))
GL_PREFIX(TrackMatrixNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_TrackMatrixNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(VertexAttribPointerNV))
GL_PREFIX(VertexAttribPointerNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_VertexAttribPointerNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(VertexAttrib1sNV))
GL_PREFIX(VertexAttrib1sNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_VertexAttrib1sNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(VertexAttrib1fNV))
GL_PREFIX(VertexAttrib1fNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_VertexAttrib1fNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(VertexAttrib1dNV))
GL_PREFIX(VertexAttrib1dNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_VertexAttrib1dNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(VertexAttrib2sNV))
GL_PREFIX(VertexAttrib2sNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_VertexAttrib2sNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(VertexAttrib2fNV))
GL_PREFIX(VertexAttrib2fNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_VertexAttrib2fNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(VertexAttrib2dNV))
GL_PREFIX(VertexAttrib2dNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_VertexAttrib2dNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(VertexAttrib3sNV))
GL_PREFIX(VertexAttrib3sNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_VertexAttrib3sNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(VertexAttrib3fNV))
GL_PREFIX(VertexAttrib3fNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_VertexAttrib3fNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(VertexAttrib3dNV))
GL_PREFIX(VertexAttrib3dNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_VertexAttrib3dNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(VertexAttrib4sNV))
GL_PREFIX(VertexAttrib4sNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_VertexAttrib4sNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(VertexAttrib4fNV))
GL_PREFIX(VertexAttrib4fNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_VertexAttrib4fNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(VertexAttrib4dNV))
GL_PREFIX(VertexAttrib4dNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_VertexAttrib4dNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(VertexAttrib4ubNV))
GL_PREFIX(VertexAttrib4ubNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_VertexAttrib4ubNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(VertexAttrib1svNV))
GL_PREFIX(VertexAttrib1svNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_VertexAttrib1svNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(VertexAttrib1fvNV))
GL_PREFIX(VertexAttrib1fvNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_VertexAttrib1fvNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(VertexAttrib1dvNV))
GL_PREFIX(VertexAttrib1dvNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_VertexAttrib1dvNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(VertexAttrib2svNV))
GL_PREFIX(VertexAttrib2svNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_VertexAttrib2svNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(VertexAttrib2fvNV))
GL_PREFIX(VertexAttrib2fvNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_VertexAttrib2fvNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(VertexAttrib2dvNV))
GL_PREFIX(VertexAttrib2dvNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_VertexAttrib2dvNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(VertexAttrib3svNV))
GL_PREFIX(VertexAttrib3svNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_VertexAttrib3svNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(VertexAttrib3fvNV))
GL_PREFIX(VertexAttrib3fvNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_VertexAttrib3fvNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(VertexAttrib3dvNV))
GL_PREFIX(VertexAttrib3dvNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_VertexAttrib3dvNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(VertexAttrib4svNV))
GL_PREFIX(VertexAttrib4svNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_VertexAttrib4svNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(VertexAttrib4fvNV))
GL_PREFIX(VertexAttrib4fvNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_VertexAttrib4fvNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(VertexAttrib4dvNV))
GL_PREFIX(VertexAttrib4dvNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_VertexAttrib4dvNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(VertexAttrib4ubvNV))
GL_PREFIX(VertexAttrib4ubvNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_VertexAttrib4ubvNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(VertexAttribs1svNV))
GL_PREFIX(VertexAttribs1svNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_VertexAttribs1svNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(VertexAttribs1fvNV))
GL_PREFIX(VertexAttribs1fvNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_VertexAttribs1fvNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(VertexAttribs1dvNV))
GL_PREFIX(VertexAttribs1dvNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_VertexAttribs1dvNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(VertexAttribs2svNV))
GL_PREFIX(VertexAttribs2svNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_VertexAttribs2svNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(VertexAttribs2fvNV))
GL_PREFIX(VertexAttribs2fvNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_VertexAttribs2fvNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(VertexAttribs2dvNV))
GL_PREFIX(VertexAttribs2dvNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_VertexAttribs2dvNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(VertexAttribs3svNV))
GL_PREFIX(VertexAttribs3svNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_VertexAttribs3svNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(VertexAttribs3fvNV))
GL_PREFIX(VertexAttribs3fvNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_VertexAttribs3fvNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(VertexAttribs3dvNV))
GL_PREFIX(VertexAttribs3dvNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_VertexAttribs3dvNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(VertexAttribs4svNV))
GL_PREFIX(VertexAttribs4svNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_VertexAttribs4svNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(VertexAttribs4fvNV))
GL_PREFIX(VertexAttribs4fvNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_VertexAttribs4fvNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(VertexAttribs4dvNV))
GL_PREFIX(VertexAttribs4dvNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_VertexAttribs4dvNV))
ALIGNTEXT16
GLOBL_FN(GL_PREFIX(VertexAttribs4ubvNV))
GL_PREFIX(VertexAttribs4ubvNV):
MOV_L(GLNAME(_glapi_Dispatch), EAX)
JMP(GL_OFFSET(_gloffset_VertexAttribs4ubvNV))
#endif /* __WIN32__ */