-# $Id: Makefile.X11,v 1.34 2000/11/24 10:25:05 keithw Exp $
+# $Id: Makefile.X11,v 1.35 2000/11/24 15:21:59 keithw Exp $
# Mesa 3-D graphics library
# Version: 3.5
ADDITIONAL_OBJ =
OBJECTS = $(ASM_SOURCES:.S=.o) \
- $(DRIVER_SOURCES:.c=.o) \
$(CORE_SOURCES:.c=.o) \
+ $(DRIVER_SOURCES:.c=.o) \
$(ADDITIONAL_OBJ)
-# $Id: Makefile.X11,v 1.34 2000/11/24 10:25:05 keithw Exp $
+# $Id: Makefile.X11,v 1.35 2000/11/24 15:21:59 keithw Exp $
# Mesa 3-D graphics library
# Version: 3.5
ADDITIONAL_OBJ =
OBJECTS = $(ASM_SOURCES:.S=.o) \
- $(DRIVER_SOURCES:.c=.o) \
$(CORE_SOURCES:.c=.o) \
+ $(DRIVER_SOURCES:.c=.o) \
$(ADDITIONAL_OBJ)
* hence 'loopback'.
*
* The driver must supply all of the remaining entry points, which are
- * listed in vtxfmt.h. The easiest way for a driver to do this is to
+ * listed in dd.h. The easiest way for a driver to do this is to
* install the supplied software t&l module.
*/
#define DRIVER(x) gl##x
-/* $Id: dlist.c,v 1.53 2000/11/24 10:25:05 keithw Exp $ */
+/* $Id: dlist.c,v 1.54 2000/11/24 15:21:59 keithw Exp $ */
/*
* Mesa 3-D graphics library
-static void save_EvalMesh1( GLenum mode, GLint i1, GLint i2 )
+void _mesa_save_EvalMesh1( GLenum mode, GLint i1, GLint i2 )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
}
-static void save_EvalMesh2(
- GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 )
+void _mesa_save_EvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 )
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
table->DrawPixels = save_DrawPixels;
table->Enable = save_Enable;
table->EndList = _mesa_EndList;
- table->EvalMesh1 = save_EvalMesh1;
- table->EvalMesh2 = save_EvalMesh2;
+ table->EvalMesh1 = _mesa_save_EvalMesh1;
+ table->EvalMesh2 = _mesa_save_EvalMesh2;
table->Finish = _mesa_Finish;
table->Flush = _mesa_Flush;
table->Fogf = save_Fogf;
-/* $Id: dlist.h,v 1.8 2000/11/22 07:32:16 joukj Exp $ */
+/* $Id: dlist.h,v 1.9 2000/11/24 15:21:59 keithw Exp $ */
/*
* Mesa 3-D graphics library
void (*destroy)( GLcontext *, void * ),
void (*print)( GLcontext *, void * ) );
+extern void _mesa_save_EvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 );
+extern void _mesa_save_EvalMesh1( GLenum mode, GLint i1, GLint i2 );
+
+
#endif
-/* $Id: light.c,v 1.28 2000/11/24 10:25:05 keithw Exp $ */
+/* $Id: light.c,v 1.29 2000/11/24 15:21:59 keithw Exp $ */
/*
* Mesa 3-D graphics library
struct gl_material *mat = &ctx->Light.Material[0];
COPY_4FV( mat->Specular, src[0].Specular );
foreach (light, list) {
- ACC_SCALE_3V( light->_MatSpecular[0], light->Specular, mat->Specular);
+ SCALE_3V( light->_MatSpecular[0], light->Specular, mat->Specular);
}
}
if (bitmask & BACK_SPECULAR_BIT) {
struct gl_material *mat = &ctx->Light.Material[1];
COPY_4FV( mat->Specular, src[1].Specular );
foreach (light, list) {
- ACC_SCALE_3V( light->_MatSpecular[1], light->Specular, mat->Specular);
+ SCALE_3V( light->_MatSpecular[1], light->Specular, mat->Specular);
}
}
#include "mtypes.h"
#include "mem.h"
+#include "dlist.h"
#include "vtxfmt.h"
#include "t_context.h"
_tnl_reset_input( ctx, 0, 0 ); /* initially outside begin/end */
- tnl->_CurrentFlag = (VERT_NORM |
- VERT_INDEX |
- VERT_RGBA |
- VERT_SPEC_RGB |
- VERT_FOG_COORD |
- VERT_EDGE |
- VERT_TEX0_12 |
- VERT_TEX1_12 |
- VERT_TEX2_12 |
- VERT_TEX3_12 |
- VERT_MATERIAL);
-
+ tnl->_CurrentTex3Flag = 0;
+ tnl->_CurrentTex4Flag = 0;
tnl->_CurrentPrimitive = GL_POLYGON+1;
/* Hook our functions into exec and compile dispatch tables.
*/
- _mesa_install_save_vtxfmt( ctx, &tnl->vtxfmt );
_mesa_install_exec_vtxfmt( ctx, &tnl->vtxfmt );
+ _mesa_install_save_vtxfmt( ctx, &tnl->vtxfmt );
+ ctx->Save->EvalMesh1 = _mesa_save_EvalMesh1; /* fixme */
+ ctx->Save->EvalMesh2 = _mesa_save_EvalMesh2;
/* Set a few default values in the driver struct.
*/
/* Special state not restored by other methods:
*/
- _tnl_recalc_current_flag( ctx );
+ _tnl_validate_current_tex_flags( ctx, ~0 );
+
}
void
_tnl_wakeup_exec( ctx );
_mesa_install_save_vtxfmt( ctx, &tnl->vtxfmt );
+ ctx->Save->EvalMesh1 = _mesa_save_EvalMesh1; /* fixme */
+ ctx->Save->EvalMesh2 = _mesa_save_EvalMesh2;
}
-/* $Id: t_context.h,v 1.4 2000/11/24 10:25:12 keithw Exp $ */
+/* $Id: t_context.h,v 1.5 2000/11/24 15:22:00 keithw Exp $ */
/*
* Mesa 3-D graphics library
#define VERT_EDGE 0x200 /* glEdgeFlag */
#define VERT_MATERIAL 0x400 /* glMaterial */
#define VERT_END_VB 0x800 /* end vb marker */
-#define VERT_TEX0_12 0x1000
-#define VERT_TEX0_3 0x2000
-#define VERT_TEX0_4 0x4000
-#define VERT_TEX1_12 0x8000
-#define VERT_TEX1_3 0x10000
-#define VERT_TEX1_4 0x20000
-#define VERT_TEX2_12 0x40000
-#define VERT_TEX2_3 0x80000
-#define VERT_TEX2_4 0x100000
-#define VERT_TEX3_12 0x200000
-#define VERT_TEX3_3 0x400000
-#define VERT_TEX3_4 0x800000
+#define VERT_TEX0 0x1000
+#define VERT_TEX1 0x2000
+#define VERT_TEX2 0x3000
+#define VERT_TEX3 0x4000
+#define VERT_TEX4 0x10000
+#define VERT_TEX5 0x20000
+#define VERT_TEX6 0x30000
+#define VERT_TEX7 0x40000
+#define VERT_TEX8 0x100000
+#define VERT_TEX9 0x200000
+#define VERT_TEX10 0x300000
+#define VERT_TEX11 0x400000
#define VERT_EVAL_C1 0x1000000 /* could reuse OBJ bits for this? */
#define VERT_EVAL_C2 0x2000000 /* - or just use 3 bits */
#define VERT_EVAL_P1 0x4000000 /* */
#define VERT_EVAL_P2 0x8000000 /* */
#define VERT_SPEC_RGB 0x10000000
-#define VERT_FOG_COORD 0x20000000 /* internal use only, currently */
+#define VERT_FOG_COORD 0x20000000
#define VERT_EYE VERT_BEGIN /* reuse */
#define VERT_WIN VERT_END /* reuse */
/* Shorthands.
*/
-#define VERT_TEX0_SHIFT 11
#define VERT_EVAL_ANY (VERT_EVAL_C1|VERT_EVAL_P1| \
VERT_EVAL_C2|VERT_EVAL_P2)
#define VERT_OBJ_234 (VERT_OBJ_4|VERT_OBJ_23)
#define VERT_OBJ_ANY VERT_OBJ_2
-#define VERT_TEX0_123 (VERT_TEX0_3|VERT_TEX0_12)
-#define VERT_TEX0_1234 (VERT_TEX0_4|VERT_TEX0_123)
-#define VERT_TEX0_ANY VERT_TEX0_12
-
-#define VERT_TEX1_123 (VERT_TEX1_3|VERT_TEX1_12)
-#define VERT_TEX1_1234 (VERT_TEX1_4|VERT_TEX1_123)
-#define VERT_TEX1_ANY VERT_TEX1_12
-
-#define VERT_TEX2_123 (VERT_TEX2_3|VERT_TEX2_12)
-#define VERT_TEX2_1234 (VERT_TEX2_4|VERT_TEX2_123)
-#define VERT_TEX2_ANY VERT_TEX2_12
-
-#define VERT_TEX3_123 (VERT_TEX3_3|VERT_TEX3_12)
-#define VERT_TEX3_1234 (VERT_TEX3_4|VERT_TEX3_123)
-#define VERT_TEX3_ANY VERT_TEX3_12
-
-#define VERT_TEX_ANY_ANY (VERT_TEX0_ANY|VERT_TEX1_ANY| \
- VERT_TEX2_ANY|VERT_TEX3_ANY)
-
-#define NR_TEXSIZE_BITS 3
-#define VERT_TEX_ANY(i) (VERT_TEX0_ANY << ((i) * NR_TEXSIZE_BITS))
-
-#define VERT_FIXUP (VERT_TEX0_ANY | \
- VERT_TEX1_ANY | \
- VERT_TEX2_ANY | \
- VERT_TEX3_ANY | \
- VERT_RGBA | \
- VERT_SPEC_RGB | \
- VERT_FOG_COORD | \
- VERT_INDEX | \
- VERT_EDGE | \
+#define VERT_TEX0_SHIFT 11
+#define VERT_TEX(i) (VERT_TEX0 << i)
+#define VERT_TEX_ANY (VERT_TEX0 | \
+ VERT_TEX1 | \
+ VERT_TEX2 | \
+ VERT_TEX3 | \
+ VERT_TEX4 | \
+ VERT_TEX5 | \
+ VERT_TEX6 | \
+ VERT_TEX7 | \
+ VERT_TEX8 | \
+ VERT_TEX9 | \
+ VERT_TEX10 | \
+ VERT_TEX11)
+
+#define VERT_FIXUP (VERT_TEX_ANY | \
+ VERT_RGBA | \
+ VERT_SPEC_RGB | \
+ VERT_FOG_COORD | \
+ VERT_INDEX | \
+ VERT_EDGE | \
VERT_NORM)
-#define VERT_DATA (VERT_TEX0_ANY | \
- VERT_TEX1_ANY | \
- VERT_TEX2_ANY | \
- VERT_TEX3_ANY | \
+#define VERT_DATA (VERT_TEX_ANY | \
VERT_RGBA | \
VERT_SPEC_RGB | \
VERT_FOG_COORD | \
GLuint Start, Count;
GLuint LastData; /* count or count+1 */
GLuint AndFlag, OrFlag;
+ GLuint Tex3Flag, Tex4Flag; /* keep track of texcoord sizes */
GLuint BeginState, SavedBeginState;
GLuint LastPrimitive;
GLuint ArrayEltFlush;
GLuint FlushElt;
- GLuint TF1[MAX_TEXTURE_UNITS]; /* precalc'ed for glTexCoord */
- GLuint TF2[MAX_TEXTURE_UNITS];
- GLuint TF3[MAX_TEXTURE_UNITS];
- GLuint TF4[MAX_TEXTURE_UNITS];
-
GLuint Primitive[VB_SIZE]; /* GLubyte would do... */
GLuint NextPrimitive[VB_SIZE];
GLuint PurgeFlags;
GLuint IndirectCount; /* defaults to count */
GLuint OrFlag, SavedOrFlag;
+ GLuint Tex3Flag, Tex4Flag;
+ GLuint SavedTex3Flag, SavedTex4Flag;
GLuint EarlyCull;
GLuint Culled, CullDone;
#define PIPE_OP_NORM_XFORM 0x2
#define PIPE_OP_LIGHT 0x4
#define PIPE_OP_FOG 0x8
-#define PIPE_OP_TEX0 0x10
-#define PIPE_OP_TEX1 0x20
-#define PIPE_OP_TEX2 0x40
-#define PIPE_OP_TEX3 0x80
+#define PIPE_OP_TEX 0x10
#define PIPE_OP_RAST_SETUP_0 0x100
#define PIPE_OP_RAST_SETUP_1 0x200
#define PIPE_OP_RENDER 0x400
GLuint _ArrayFlags;
GLuint _ArraySummary; /* Like flags, but no size information */
GLuint _ArrayNewState; /* Tracks which arrays have been changed. */
+ GLuint _ArrayTex3Flag;
+ GLuint _ArrayTex4Flag;
/* Pipeline stages - shared between the two pipelines,
shade_func *_shade_func_tab; /* Current shading function table */
GLenum _CurrentPrimitive; /* Prim or GL_POLYGON+1 */
- GLuint _CurrentFlag;
+ GLuint _CurrentTex3Flag;
+ GLuint _CurrentTex4Flag;
GLboolean _ReplayHardBeginEnd; /* Display list execution of rect, etc */
-/* $Id: t_pipeline.c,v 1.4 2000/11/24 10:25:12 keithw Exp $ */
+/* $Id: t_pipeline.c,v 1.5 2000/11/24 15:22:00 keithw Exp $ */
/*
* Mesa 3-D graphics library
(flags & PIPE_OP_NORM_XFORM) ? "norm-xform, " : "",
(flags & PIPE_OP_LIGHT) ? "light, " : "",
(flags & PIPE_OP_FOG) ? "fog, " : "",
- (flags & PIPE_OP_TEX0) ? "tex-0, " : "",
- (flags & PIPE_OP_TEX1) ? "tex-1, " : "",
- (flags & PIPE_OP_TEX2) ? "tex-2, " : "",
- (flags & PIPE_OP_TEX3) ? "tex-3, " : "",
+ (flags & PIPE_OP_TEX) ? "tex-gen/tex-mat, " : "",
(flags & PIPE_OP_RAST_SETUP_0) ? "rast-0, " : "",
(flags & PIPE_OP_RAST_SETUP_1) ? "rast-1, " : "",
(flags & PIPE_OP_RENDER) ? "render, " : "");
-#define MINIMAL_VERT_DATA (VERT_DATA & ~(VERT_TEX0_4 | \
- VERT_TEX1_4 | \
- VERT_TEX2_4 | \
- VERT_TEX3_4 | \
- VERT_EVAL_ANY))
+#define MINIMAL_VERT_DATA (VERT_DATA & ~VERT_EVAL_ANY)
-#define VERT_CURRENT_DATA (VERT_TEX0_1234 | \
- VERT_TEX1_1234 | \
- VERT_TEX2_1234 | \
- VERT_TEX3_1234 | \
+#define VERT_CURRENT_DATA (VERT_TEX_ANY | \
VERT_RGBA | \
VERT_SPEC_RGB | \
VERT_FOG_COORD | \
GLuint changed_ops = 0;
GLuint oldoutputs = pre->outputs;
GLuint oldinputs = pre->inputs;
- GLuint fallback = (VERT_CURRENT_DATA & tnl->_CurrentFlag &
+ GLuint fallback = (VERT_CURRENT_DATA &
~tnl->_ArraySummary);
GLuint changed_outputs = (tnl->_ArrayNewState |
(fallback & cva->orflag));
cva->orflag != cva->last_orflag ||
tnl->_ArrayFlags != cva->last_array_flags)
{
+ GLuint j;
GLuint flags = VERT_WIN;
if (ctx->Visual.RGBAflag) {
} else
flags |= VERT_INDEX;
- if (ctx->Texture._ReallyEnabled & TEXTURE0_ANY)
- flags |= VERT_TEX0_ANY;
-
- if (ctx->Texture._ReallyEnabled & TEXTURE1_ANY)
- flags |= VERT_TEX1_ANY;
-
-#if MAX_TEXTURE_UNITS > 2
- if (ctx->Texture._ReallyEnabled & TEXTURE2_ANY)
- flags |= VERT_TEX2_ANY;
-#endif
-#if MAX_TEXTURE_UNITS > 3
- if (ctx->Texture._ReallyEnabled & TEXTURE3_ANY)
- flags |= VERT_TEX3_ANY;
-#endif
+ for (j = 0 ; j < ctx->Const.MaxTextureUnits ; j++) {
+ if (ctx->Texture.Unit[j]._ReallyEnabled)
+ flags |= VERT_TEX(j);
+ }
if (ctx->Polygon._Unfilled)
flags |= VERT_EDGE;
flags |= VERT_FOG_COORD;
if (ctx->RenderMode==GL_FEEDBACK) {
- flags = (VERT_WIN | VERT_RGBA | VERT_INDEX | VERT_NORM | VERT_EDGE
- | VERT_TEX0_ANY
- | VERT_TEX1_ANY
-#if MAX_TEXTURE_UNITS > 2
- | VERT_TEX2_ANY
-#endif
-#if MAX_TEXTURE_UNITS > 3
- | VERT_TEX3_ANY
-#endif
- );
+ flags = (VERT_WIN | VERT_RGBA | VERT_INDEX | VERT_NORM |
+ VERT_EDGE | VERT_TEX_ANY);
}
tnl->_RenderFlags = flags;