summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2001-02-16 00:35:34 +0000
committerKeith Whitwell <[email protected]>2001-02-16 00:35:34 +0000
commit2448fc7deeaa870d879de17158f243f239c05b15 (patch)
treec5d192531cdc1043b54856b9d60f6c3e8e217b33 /src
parent86ca15ece74ccb5a8f4d566a4b2c8024b178d73b (diff)
Fixed conform problems with recent material tracking change.
Remove redundant 'update_materials' stage. Fix conform segfault with seperate specular colors in mustpass.c. These tests still fail, however.
Diffstat (limited to 'src')
-rw-r--r--src/mesa/Makefile.X113
-rw-r--r--src/mesa/main/Makefile.X113
-rw-r--r--src/mesa/main/state.c116
-rw-r--r--src/mesa/swrast_setup/ss_context.c12
-rw-r--r--src/mesa/swrast_setup/ss_vbtmp.h8
-rw-r--r--src/mesa/tnl/t_imm_dlist.c4
-rw-r--r--src/mesa/tnl/t_imm_exec.c4
-rw-r--r--src/mesa/tnl/t_pipeline.c3
-rw-r--r--src/mesa/tnl/t_pipeline.h3
-rw-r--r--src/mesa/tnl/t_vb_light.c34
-rw-r--r--src/mesa/tnl/t_vb_lighttmp.h35
-rw-r--r--src/mesa/tnl/t_vb_render.c47
12 files changed, 129 insertions, 143 deletions
diff --git a/src/mesa/Makefile.X11 b/src/mesa/Makefile.X11
index f764cac558c..eed597bb36e 100644
--- a/src/mesa/Makefile.X11
+++ b/src/mesa/Makefile.X11
@@ -1,4 +1,4 @@
-# $Id: Makefile.X11,v 1.43 2001/02/06 21:42:48 brianp Exp $
+# $Id: Makefile.X11,v 1.44 2001/02/16 00:35:34 keithw Exp $
# Mesa 3-D graphics library
# Version: 3.5
@@ -36,7 +36,6 @@ CORE_SOURCES = \
tnl/t_pipeline.c \
tnl/t_vb_fog.c \
tnl/t_vb_light.c \
- tnl/t_vb_material.c \
tnl/t_vb_normals.c \
tnl/t_vb_points.c \
tnl/t_vb_render.c \
diff --git a/src/mesa/main/Makefile.X11 b/src/mesa/main/Makefile.X11
index f764cac558c..eed597bb36e 100644
--- a/src/mesa/main/Makefile.X11
+++ b/src/mesa/main/Makefile.X11
@@ -1,4 +1,4 @@
-# $Id: Makefile.X11,v 1.43 2001/02/06 21:42:48 brianp Exp $
+# $Id: Makefile.X11,v 1.44 2001/02/16 00:35:34 keithw Exp $
# Mesa 3-D graphics library
# Version: 3.5
@@ -36,7 +36,6 @@ CORE_SOURCES = \
tnl/t_pipeline.c \
tnl/t_vb_fog.c \
tnl/t_vb_light.c \
- tnl/t_vb_material.c \
tnl/t_vb_normals.c \
tnl/t_vb_points.c \
tnl/t_vb_render.c \
diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c
index f61195283b4..533fa687242 100644
--- a/src/mesa/main/state.c
+++ b/src/mesa/main/state.c
@@ -1,4 +1,4 @@
-/* $Id: state.c,v 1.57 2001/02/12 19:04:30 brianp Exp $ */
+/* $Id: state.c,v 1.58 2001/02/16 00:35:35 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -26,7 +26,8 @@
/*
- * This file manages internal Mesa state update.
+ * This file manages recalculation of derived values in the
+ * __GLcontext.
*/
@@ -944,74 +945,65 @@ void gl_update_state( GLcontext *ctx )
*/
ctx->NewState = 0;
ctx->Driver.UpdateState(ctx, new_state);
+ ctx->Array.NewState = 0;
-#ifdef DEBUG
- /* At this point we can do some assertions to be sure the required device
- * driver function pointers are all initialized.
+ /* At this point we can do some assertions to be sure the required
+ * device driver function pointers are all initialized.
+ *
+ * KW: Moved the some of these asserts to t_vb_render.c, as they
+ * are strictly only required for that stage. The Driver struct
+ * should probably be split; the read/write span/pixels functions
+ * should be referenced only from swrast, for instance.
*/
- assert(ctx->Driver.GetString);
- assert(ctx->Driver.UpdateState);
- assert(ctx->Driver.Clear);
- assert(ctx->Driver.SetDrawBuffer);
- assert(ctx->Driver.SetReadBuffer);
- assert(ctx->Driver.GetBufferSize);
+ ASSERT(ctx->Driver.GetString);
+ ASSERT(ctx->Driver.UpdateState);
+ ASSERT(ctx->Driver.Clear);
+ ASSERT(ctx->Driver.SetDrawBuffer);
+ ASSERT(ctx->Driver.SetReadBuffer);
+ ASSERT(ctx->Driver.GetBufferSize);
if (ctx->Visual.rgbMode) {
- assert(ctx->Driver.WriteRGBASpan);
- assert(ctx->Driver.WriteRGBSpan);
- assert(ctx->Driver.WriteMonoRGBASpan);
- assert(ctx->Driver.WriteRGBAPixels);
- assert(ctx->Driver.WriteMonoRGBAPixels);
- assert(ctx->Driver.ReadRGBASpan);
- assert(ctx->Driver.ReadRGBAPixels);
+ ASSERT(ctx->Driver.WriteRGBASpan);
+ ASSERT(ctx->Driver.WriteRGBSpan);
+ ASSERT(ctx->Driver.WriteMonoRGBASpan);
+ ASSERT(ctx->Driver.WriteRGBAPixels);
+ ASSERT(ctx->Driver.WriteMonoRGBAPixels);
+ ASSERT(ctx->Driver.ReadRGBASpan);
+ ASSERT(ctx->Driver.ReadRGBAPixels);
}
else {
- assert(ctx->Driver.WriteCI32Span);
- assert(ctx->Driver.WriteCI8Span);
- assert(ctx->Driver.WriteMonoCISpan);
- assert(ctx->Driver.WriteCI32Pixels);
- assert(ctx->Driver.WriteMonoCIPixels);
- assert(ctx->Driver.ReadCI32Span);
- assert(ctx->Driver.ReadCI32Pixels);
+ ASSERT(ctx->Driver.WriteCI32Span);
+ ASSERT(ctx->Driver.WriteCI8Span);
+ ASSERT(ctx->Driver.WriteMonoCISpan);
+ ASSERT(ctx->Driver.WriteCI32Pixels);
+ ASSERT(ctx->Driver.WriteMonoCIPixels);
+ ASSERT(ctx->Driver.ReadCI32Span);
+ ASSERT(ctx->Driver.ReadCI32Pixels);
}
if (ctx->Visual.accumRedBits > 0) {
- assert(ctx->Driver.Accum);
+ ASSERT(ctx->Driver.Accum);
}
- assert(ctx->Driver.DrawPixels);
- assert(ctx->Driver.ReadPixels);
- assert(ctx->Driver.CopyPixels);
- assert(ctx->Driver.Bitmap);
- assert(ctx->Driver.ResizeBuffersMESA);
- assert(ctx->Driver.TexImage1D);
- assert(ctx->Driver.TexImage2D);
- assert(ctx->Driver.TexImage3D);
- assert(ctx->Driver.TexSubImage1D);
- assert(ctx->Driver.TexSubImage2D);
- assert(ctx->Driver.TexSubImage3D);
+ ASSERT(ctx->Driver.DrawPixels);
+ ASSERT(ctx->Driver.ReadPixels);
+ ASSERT(ctx->Driver.CopyPixels);
+ ASSERT(ctx->Driver.Bitmap);
+ ASSERT(ctx->Driver.ResizeBuffersMESA);
+ ASSERT(ctx->Driver.TexImage1D);
+ ASSERT(ctx->Driver.TexImage2D);
+ ASSERT(ctx->Driver.TexImage3D);
+ ASSERT(ctx->Driver.TexSubImage1D);
+ ASSERT(ctx->Driver.TexSubImage2D);
+ ASSERT(ctx->Driver.TexSubImage3D);
if (ctx->Extensions.ARB_texture_compression) {
- assert(ctx->Driver.CompressedTexImage1D);
- assert(ctx->Driver.CompressedTexImage2D);
- assert(ctx->Driver.CompressedTexImage3D);
- assert(ctx->Driver.CompressedTexSubImage1D);
- assert(ctx->Driver.CompressedTexSubImage2D);
- assert(ctx->Driver.CompressedTexSubImage3D);
- assert(ctx->Driver.IsCompressedFormat);
- assert(ctx->Driver.GetCompressedTexImage);
- assert(ctx->Driver.BaseCompressedTexFormat);
+ ASSERT(ctx->Driver.CompressedTexImage1D);
+ ASSERT(ctx->Driver.CompressedTexImage2D);
+ ASSERT(ctx->Driver.CompressedTexImage3D);
+ ASSERT(ctx->Driver.CompressedTexSubImage1D);
+ ASSERT(ctx->Driver.CompressedTexSubImage2D);
+ ASSERT(ctx->Driver.CompressedTexSubImage3D);
+ ASSERT(ctx->Driver.IsCompressedFormat);
+ ASSERT(ctx->Driver.GetCompressedTexImage);
+ ASSERT(ctx->Driver.BaseCompressedTexFormat);
}
- assert(ctx->Driver.RenderStart);
- assert(ctx->Driver.RenderFinish);
- assert(ctx->Driver.BuildProjectedVertices);
- assert(ctx->Driver.RenderPrimitive);
- assert(ctx->Driver.PointsFunc);
- assert(ctx->Driver.LineFunc);
- assert(ctx->Driver.TriangleFunc);
- assert(ctx->Driver.QuadFunc);
- assert(ctx->Driver.ResetLineStipple);
- assert(ctx->Driver.RenderInterp);
- assert(ctx->Driver.RenderCopyPV);
- assert(ctx->Driver.RenderClippedLine);
- assert(ctx->Driver.RenderClippedPolygon);
-#endif
-
- ctx->Array.NewState = 0;
+ ASSERT(ctx->Driver.RenderStart);
+ ASSERT(ctx->Driver.RenderFinish);
}
diff --git a/src/mesa/swrast_setup/ss_context.c b/src/mesa/swrast_setup/ss_context.c
index 83c7f45ffa6..181be13f945 100644
--- a/src/mesa/swrast_setup/ss_context.c
+++ b/src/mesa/swrast_setup/ss_context.c
@@ -1,4 +1,4 @@
-/* $Id: ss_context.c,v 1.9 2001/01/29 20:47:39 keithw Exp $ */
+/* $Id: ss_context.c,v 1.10 2001/02/16 00:35:35 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -153,6 +153,16 @@ _swsetup_RenderStart( GLcontext *ctx )
VB->import_data( ctx,
VB->importable_data,
VEC_NOT_WRITEABLE|VEC_BAD_STRIDE);
+
+ /* Ugly hack: Tie up some dangling pointers for flat/twoside code
+ * in ss_tritmp.h and ss_interptmp.h
+ */
+ if ((ctx->_TriangleCaps & DD_SEPERATE_SPECULAR) == 0 ||
+ ctx->Texture._ReallyEnabled == 0) {
+ VB->SecondaryColorPtr[0] = VB->ColorPtr[0];
+ VB->SecondaryColorPtr[1] = VB->ColorPtr[1];
+ }
+
}
void
diff --git a/src/mesa/swrast_setup/ss_vbtmp.h b/src/mesa/swrast_setup/ss_vbtmp.h
index 6197f5bdb56..ab5417ffe5b 100644
--- a/src/mesa/swrast_setup/ss_vbtmp.h
+++ b/src/mesa/swrast_setup/ss_vbtmp.h
@@ -78,14 +78,6 @@ static void TAG(rs)(GLcontext *ctx, GLuint start, GLuint end, GLuint newinputs )
}
}
- /* Tie up some dangling pointers for flat/twoside code in ss_tritmp.h
- */
- if ((ctx->_TriangleCaps & DD_SEPERATE_SPECULAR) == 0) {
- VB->SecondaryColorPtr[0] = VB->ColorPtr[0];
- VB->SecondaryColorPtr[1] = VB->ColorPtr[1];
- }
-
-
proj = VB->ProjectedClipPtr->data;
if (IND & FOG)
fog = VB->FogCoordPtr->data;
diff --git a/src/mesa/tnl/t_imm_dlist.c b/src/mesa/tnl/t_imm_dlist.c
index c0393cec9ad..c722c9629e1 100644
--- a/src/mesa/tnl/t_imm_dlist.c
+++ b/src/mesa/tnl/t_imm_dlist.c
@@ -1,4 +1,4 @@
-/* $Id: t_imm_dlist.c,v 1.8 2001/02/15 01:33:52 keithw Exp $ */
+/* $Id: t_imm_dlist.c,v 1.9 2001/02/16 00:35:35 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -180,6 +180,8 @@ execute_compiled_cassette( GLcontext *ctx, void *data )
IM->AndFlag = node->AndFlag;
IM->LastData = node->LastData;
IM->LastPrimitive = node->LastPrimitive;
+ IM->LastMaterial = node->LastMaterial;
+ IM->MaterialOrMask = node->MaterialOrMask;
if ((MESA_VERBOSE & VERBOSE_DISPLAY_LIST) &&
(MESA_VERBOSE & VERBOSE_IMMEDIATE))
diff --git a/src/mesa/tnl/t_imm_exec.c b/src/mesa/tnl/t_imm_exec.c
index 80e5ce54400..ce64c16b31a 100644
--- a/src/mesa/tnl/t_imm_exec.c
+++ b/src/mesa/tnl/t_imm_exec.c
@@ -1,4 +1,4 @@
-/* $Id: t_imm_exec.c,v 1.11 2001/02/15 01:33:52 keithw Exp $ */
+/* $Id: t_imm_exec.c,v 1.12 2001/02/16 00:35:35 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -76,6 +76,8 @@ void _tnl_reset_input( GLcontext *ctx,
IM->BeginState = beginstate;
IM->SavedBeginState = savedbeginstate;
IM->TexSize = 0;
+ IM->LastMaterial = 0;
+ IM->MaterialOrMask = 0;
IM->ArrayEltFlags = ~ctx->Array._Enabled;
IM->ArrayEltIncr = ctx->Array.Vertex.Enabled ? 1 : 0;
diff --git a/src/mesa/tnl/t_pipeline.c b/src/mesa/tnl/t_pipeline.c
index 467074abaa3..f1c5a255a5d 100644
--- a/src/mesa/tnl/t_pipeline.c
+++ b/src/mesa/tnl/t_pipeline.c
@@ -1,4 +1,4 @@
-/* $Id: t_pipeline.c,v 1.12 2001/02/15 01:33:52 keithw Exp $ */
+/* $Id: t_pipeline.c,v 1.13 2001/02/16 00:35:35 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -202,7 +202,6 @@ void _tnl_run_pipeline( GLcontext *ctx )
* case, if it becomes necessary to do so.
*/
const struct gl_pipeline_stage *_tnl_default_pipeline[] = {
- &_tnl_update_material_stage,
&_tnl_vertex_transform_stage,
&_tnl_normal_transform_stage,
&_tnl_lighting_stage,
diff --git a/src/mesa/tnl/t_pipeline.h b/src/mesa/tnl/t_pipeline.h
index 3f64eb8ed9f..8c996da89ef 100644
--- a/src/mesa/tnl/t_pipeline.h
+++ b/src/mesa/tnl/t_pipeline.h
@@ -1,4 +1,4 @@
-/* $Id: t_pipeline.h,v 1.5 2001/01/05 02:26:49 keithw Exp $ */
+/* $Id: t_pipeline.h,v 1.6 2001/02/16 00:35:35 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -48,7 +48,6 @@ extern void _tnl_install_pipeline( GLcontext *ctx,
/* These are implemented in the t_vb_*.c files:
*/
-extern const struct gl_pipeline_stage _tnl_update_material_stage;
extern const struct gl_pipeline_stage _tnl_vertex_transform_stage;
extern const struct gl_pipeline_stage _tnl_normal_transform_stage;
extern const struct gl_pipeline_stage _tnl_lighting_stage;
diff --git a/src/mesa/tnl/t_vb_light.c b/src/mesa/tnl/t_vb_light.c
index 13ab9a395ba..00beb531232 100644
--- a/src/mesa/tnl/t_vb_light.c
+++ b/src/mesa/tnl/t_vb_light.c
@@ -1,4 +1,4 @@
-/* $Id: t_vb_light.c,v 1.6 2001/01/29 22:10:24 brianp Exp $ */
+/* $Id: t_vb_light.c,v 1.7 2001/02/16 00:35:35 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -133,17 +133,21 @@ static GLboolean run_lighting( GLcontext *ctx, struct gl_pipeline_stage *stage )
GLuint ind;
/* Make sure we can talk about elements 0..2 in the vector we are
- * lighting. TODO: Don't repeat this in CVA!
+ * lighting.
*/
- if (input->size <= 2) {
- if (input->flags & VEC_NOT_WRITEABLE) {
- ASSERT(VB->importable_data & VERT_OBJ);
- VB->import_data( ctx, VERT_OBJ, VEC_NOT_WRITEABLE );
- input = ctx->_NeedEyeCoords ? VB->EyePtr : VB->ObjPtr;
- ASSERT((input->flags & VEC_NOT_WRITEABLE) == 0);
- }
+ if (stage->changed_inputs & (VERT_EYE|VERT_OBJ)) {
+ if (input->size <= 2) {
+ if (input->flags & VEC_NOT_WRITEABLE) {
+ ASSERT(VB->importable_data & VERT_OBJ);
+
+ VB->import_data( ctx, VERT_OBJ, VEC_NOT_WRITEABLE );
+ input = ctx->_NeedEyeCoords ? VB->EyePtr : VB->ObjPtr;
- gl_vector4f_clean_elem(input, VB->Count, 2);
+ ASSERT((input->flags & VEC_NOT_WRITEABLE) == 0);
+ }
+
+ gl_vector4f_clean_elem(input, VB->Count, 2);
+ }
}
if (VB->Flag)
@@ -170,8 +174,8 @@ static GLboolean run_validate_lighting( GLcontext *ctx,
if (ctx->Visual.rgbMode) {
if (ctx->Light._NeedVertices) {
- if (ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR &&
- ctx->Texture._ReallyEnabled)
+ if (ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR &&
+ ctx->Texture._ReallyEnabled)
tab = _tnl_light_spec_tab;
else
tab = _tnl_light_tab;
@@ -182,7 +186,6 @@ static GLboolean run_validate_lighting( GLcontext *ctx,
else
tab = _tnl_light_fast_tab;
}
-/* tab = _tnl_light_tab; */
}
else
tab = _tnl_light_ci_tab;
@@ -306,8 +309,9 @@ static void dtr( struct gl_pipeline_stage *stage )
const struct gl_pipeline_stage _tnl_lighting_stage =
{
"lighting",
- _NEW_LIGHT, /* recheck */
- _NEW_LIGHT|_NEW_MODELVIEW, /* recalc -- modelview dependency
+ _NEW_LIGHT|_NEW_TEXTURE, /* recheck; texture for seperate_specular */
+ _NEW_LIGHT|_NEW_MODELVIEW|
+ _NEW_TEXTURE, /* recalc -- modelview dependency
* otherwise not captured by inputs
* (which may be VERT_OBJ) */
0,0,0, /* active, inputs, outputs */
diff --git a/src/mesa/tnl/t_vb_lighttmp.h b/src/mesa/tnl/t_vb_lighttmp.h
index 8cbb0735671..50bbedd8a0c 100644
--- a/src/mesa/tnl/t_vb_lighttmp.h
+++ b/src/mesa/tnl/t_vb_lighttmp.h
@@ -1,4 +1,4 @@
-/* $Id: t_vb_lighttmp.h,v 1.6 2001/02/14 23:00:42 brianp Exp $ */
+/* $Id: t_vb_lighttmp.h,v 1.7 2001/02/16 00:35:35 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -114,6 +114,8 @@ static void TAG(light_rgba_spec)( GLcontext *ctx,
(void) nstride;
(void) vstride;
+/* fprintf(stderr, "%s\n", __FUNCTION__ ); */
+
if (IDX & LIGHT_COLORMATERIAL) {
CMcolor = (GLchan (*)[4]) VB->ColorPtr[0]->data;
CMstride = VB->ColorPtr[0]->stride;
@@ -279,15 +281,6 @@ static void TAG(light_rgba_spec)( GLcontext *ctx,
Bcolor[j][3] = sumA[1];
}
}
-
- if ( CHECK_COLOR_MATERIAL(j) )
- gl_update_color_material( ctx, CMcolor[j] );
-
- if ( CHECK_MATERIAL(j) )
- gl_update_material( ctx, new_material[j], new_material_mask[j] );
-
- if ( CHECK_VALIDATE(j) )
- gl_validate_all_lighting_tables( ctx );
}
@@ -318,6 +311,7 @@ static void TAG(light_rgba)( GLcontext *ctx,
GLuint *new_material_mask = VB->MaterialMask;
GLuint nr = VB->Count;
+/* fprintf(stderr, "%s\n", __FUNCTION__ ); */
(void) flags;
(void) nstride;
(void) vstride;
@@ -483,15 +477,6 @@ static void TAG(light_rgba)( GLcontext *ctx,
Bcolor[j][3] = sumA[1];
}
}
-
- if ( CHECK_COLOR_MATERIAL(j) )
- gl_update_color_material( ctx, (GLchan *)CMcolor[j] );
-
- if ( CHECK_MATERIAL(j) )
- gl_update_material( ctx, new_material[j], new_material_mask[j] );
-
- if ( CHECK_VALIDATE(j) )
- gl_validate_all_lighting_tables( ctx );
}
@@ -521,6 +506,7 @@ static void TAG(light_fast_rgba_single)( GLcontext *ctx,
GLfloat base[2][3];
GLuint nr = VB->Count;
+/* fprintf(stderr, "%s\n", __FUNCTION__ ); */
(void) input; /* doesn't refer to Eye or Obj */
(void) flags;
(void) nr;
@@ -647,6 +633,7 @@ static void TAG(light_fast_rgba)( GLcontext *ctx,
GLuint nr = VB->Count;
struct gl_light *light;
+/* fprintf(stderr, "%s\n", __FUNCTION__ ); */
(void) flags;
(void) input;
(void) nr;
@@ -778,6 +765,7 @@ static void TAG(light_ci)( GLcontext *ctx,
GLuint *new_material_mask = VB->MaterialMask;
GLuint nr = VB->Count;
+/* fprintf(stderr, "%s\n", __FUNCTION__ ); */
(void) flags;
(void) nstride;
(void) vstride;
@@ -936,15 +924,6 @@ static void TAG(light_ci)( GLcontext *ctx,
indexResult[side][j] = (GLuint) (GLint) index;
}
} /*for vertex*/
-
- if ( CHECK_COLOR_MATERIAL(j) )
- gl_update_color_material( ctx, CMcolor[j] );
-
- if ( CHECK_MATERIAL(j) )
- gl_update_material( ctx, new_material[j], new_material_mask[j] );
-
- if ( CHECK_VALIDATE(j) )
- gl_validate_all_lighting_tables( ctx );
}
diff --git a/src/mesa/tnl/t_vb_render.c b/src/mesa/tnl/t_vb_render.c
index d364b4f4609..9412a0fcb99 100644
--- a/src/mesa/tnl/t_vb_render.c
+++ b/src/mesa/tnl/t_vb_render.c
@@ -1,4 +1,4 @@
-/* $Id: t_vb_render.c,v 1.12 2001/01/29 20:47:39 keithw Exp $ */
+/* $Id: t_vb_render.c,v 1.13 2001/02/16 00:35:35 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -63,13 +63,13 @@
-typedef void (*clip_line_func)( GLcontext *ctx,
- GLuint i, GLuint j,
- GLubyte mask);
+/* typedef void (*clip_line_func)( GLcontext *ctx, */
+/* GLuint i, GLuint j, */
+/* GLubyte mask); */
-typedef void (*clip_poly_func)( GLcontext *ctx,
- GLuint n, GLuint vlist[],
- GLubyte mask );
+/* typedef void (*clip_poly_func)( GLcontext *ctx, */
+/* GLuint n, GLuint vlist[], */
+/* GLubyte mask ); */
@@ -250,10 +250,10 @@ static void clip_elt_triangles( GLcontext *ctx,
#define RENDER_LINE( v1, v2 ) \
LineFunc( ctx, v1, v2 )
-#define RENDER_TRI( v1, v2, v3 ) \
+#define RENDER_TRI( v1, v2, v3 ) \
TriangleFunc( ctx, v1, v2, v3 )
-#define RENDER_QUAD( v1, v2, v3, v4 ) \
+#define RENDER_QUAD( v1, v2, v3, v4 ) \
QuadFunc( ctx, v1, v2, v3, v4 )
#define TAG(x) _tnl_##x##_verts
@@ -299,11 +299,25 @@ 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.
*/
ctx->Driver.RenderStart( ctx );
+
+ ASSERT(ctx->Driver.BuildProjectedVertices);
+ ASSERT(ctx->Driver.RenderPrimitive);
+ ASSERT(ctx->Driver.PointsFunc);
+ ASSERT(ctx->Driver.LineFunc);
+ ASSERT(ctx->Driver.TriangleFunc);
+ ASSERT(ctx->Driver.QuadFunc);
+ ASSERT(ctx->Driver.ResetLineStipple);
+ ASSERT(ctx->Driver.RenderInterp);
+ ASSERT(ctx->Driver.RenderCopyPV);
+ ASSERT(ctx->Driver.RenderClippedLine);
+ ASSERT(ctx->Driver.RenderClippedPolygon);
+
ctx->Driver.BuildProjectedVertices( ctx, 0, VB->Count, new_inputs );
if (VB->ClipOrMask) {
@@ -354,9 +368,8 @@ static void check_render( GLcontext *ctx, struct gl_pipeline_stage *stage )
if (ctx->Visual.rgbMode) {
inputs |= VERT_RGBA;
- if (ctx->_TriangleCaps & DD_SEPERATE_SPECULAR) {
+ if (ctx->_TriangleCaps & DD_SEPERATE_SPECULAR)
inputs |= VERT_SPEC_RGB;
- }
if (ctx->Texture._ReallyEnabled) {
for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++) {
@@ -365,8 +378,7 @@ static void check_render( GLcontext *ctx, struct gl_pipeline_stage *stage )
}
}
}
- else
- {
+ else {
inputs |= VERT_INDEX;
}
@@ -375,17 +387,14 @@ static void check_render( GLcontext *ctx, struct gl_pipeline_stage *stage )
/* How do drivers turn this off?
*/
- if (ctx->Fog.Enabled) {
+ if (ctx->Fog.Enabled)
inputs |= VERT_FOG_COORD;
- }
- if (ctx->_TriangleCaps & DD_TRI_UNFILLED) {
+ if (ctx->_TriangleCaps & DD_TRI_UNFILLED)
inputs |= VERT_EDGE;
- }
- if (ctx->RenderMode==GL_FEEDBACK) {
+ if (ctx->RenderMode==GL_FEEDBACK)
inputs |= VERT_TEX_ANY;
- }
stage->inputs = inputs;
}