From 2448fc7deeaa870d879de17158f243f239c05b15 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Fri, 16 Feb 2001 00:35:34 +0000 Subject: 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. --- src/mesa/tnl/t_imm_dlist.c | 4 +++- src/mesa/tnl/t_imm_exec.c | 4 +++- src/mesa/tnl/t_pipeline.c | 3 +-- src/mesa/tnl/t_pipeline.h | 3 +-- src/mesa/tnl/t_vb_light.c | 34 ++++++++++++++++++-------------- src/mesa/tnl/t_vb_lighttmp.h | 35 +++++++-------------------------- src/mesa/tnl/t_vb_render.c | 47 ++++++++++++++++++++++++++------------------ 7 files changed, 62 insertions(+), 68 deletions(-) (limited to 'src/mesa/tnl') diff --git a/src/mesa/tnl/t_imm_dlist.c b/src/mesa/tnl/t_imm_dlist.c index c0393cec9a..c722c9629e 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 80e5ce5440..ce64c16b31 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 467074abaa..f1c5a255a5 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 3f64eb8ed9..8c996da89e 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 13ab9a395b..00beb53123 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 8cbb073567..50bbedd8a0 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 d364b4f460..9412a0fcb9 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; } -- cgit v1.2.3