From: Keith Whitwell Date: Wed, 17 Jan 2001 02:49:38 +0000 (+0000) Subject: Fixes for performance bug on compiled array element paths. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c0bcd2ca99609fe8b6e992e2277ef8612d46fdfe;p=mesa.git Fixes for performance bug on compiled array element paths. --- diff --git a/src/mesa/main/enums.c b/src/mesa/main/enums.c index 67087536d44..5a4d871226a 100644 --- a/src/mesa/main/enums.c +++ b/src/mesa/main/enums.c @@ -1,4 +1,4 @@ -/* $Id: enums.c,v 1.10 2001/01/06 22:46:13 gareth Exp $ */ +/* $Id: enums.c,v 1.11 2001/01/17 02:49:38 keithw Exp $ */ /* * Mesa 3-D graphics library @@ -22,6 +22,9 @@ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * Author: + * Keith Whitwell */ @@ -910,20 +913,3 @@ const char *gl_lookup_enum_by_nr( int nr ) } -#if 0 -int main() -{ - int i; - static const char *test[] = { - "GL_POLYGON", - "GL_TRUE", - "GL_BANANA", - "GL_REFLECTION_MAP_NV", - }; - - for (i = 0 ; i < Elements(test) ; i++) { - int d = gl_lookup_enum_by_name( test[i] ); - printf("%s --> %d --> %s\n", test[i], d, gl_lookup_enum_by_nr( d )); - } -} -#endif diff --git a/src/mesa/swrast_setup/ss_vb.c b/src/mesa/swrast_setup/ss_vb.c index f6720dc2f7e..d2cfc6a4f98 100644 --- a/src/mesa/swrast_setup/ss_vb.c +++ b/src/mesa/swrast_setup/ss_vb.c @@ -242,6 +242,20 @@ _swsetup_vb_init( GLcontext *ctx ) setup_func[INDEX|TEX0|FOG|POINT] = rs_index_tex0_fog_point; } +static void printSetupFlags(char *msg, GLuint flags ) +{ + fprintf(stderr, "%s(%x): %s%s%s%s%s%s%s\n", + msg, + (int)flags, + (flags & COLOR) ? "color, " : "", + (flags & INDEX) ? "index, " : "", + (flags & TEX0) ? "tex0, " : "", + (flags & MULTITEX) ? "multitex, " : "", + (flags & SPEC) ? "spec, " : "", + (flags & FOG) ? "fog, " : "", + (flags & POINT) ? "point, " : ""); +} + void _swsetup_choose_rastersetup_func(GLcontext *ctx) @@ -281,6 +295,7 @@ _swsetup_choose_rastersetup_func(GLcontext *ctx) else funcindex = 0; +/* printSetupFlags("software setup func", funcindex); */ swsetup->BuildProjVerts = setup_func[funcindex]; ASSERT(setup_func[funcindex] != rs_invalid); } diff --git a/src/mesa/tnl/t_pipeline.c b/src/mesa/tnl/t_pipeline.c index 11a17849b6a..b2d4f155472 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.9 2001/01/14 06:14:21 keithw Exp $ */ +/* $Id: t_pipeline.c,v 1.10 2001/01/17 02:49:39 keithw Exp $ */ /* * Mesa 3-D graphics library @@ -138,12 +138,12 @@ void _tnl_run_pipeline( GLcontext *ctx ) } if (stage[i].active) { - if (stage[i].changed_inputs) + if (stage[i].changed_inputs) changed_inputs |= stage[i].outputs; if (running) { -/* fprintf(stderr, "run %s\n", stage[i].name); */ running = stage[i].run( ctx, &stage[i] ); + stage[i].changed_inputs = 0; } } } diff --git a/src/mesa/tnl/t_vb_cliptmp.h b/src/mesa/tnl/t_vb_cliptmp.h index 56f2031c90e..35fe391b847 100644 --- a/src/mesa/tnl/t_vb_cliptmp.h +++ b/src/mesa/tnl/t_vb_cliptmp.h @@ -1,4 +1,4 @@ -/* $Id: t_vb_cliptmp.h,v 1.6 2001/01/13 05:48:26 keithw Exp $ */ +/* $Id: t_vb_cliptmp.h,v 1.7 2001/01/17 02:49:39 keithw Exp $ */ /* * Mesa 3-D graphics library @@ -185,11 +185,11 @@ static void TAG(clip_line)( GLcontext *ctx, } } - TAG(build_proj_verts)( ctx ); - if ((ctx->_TriangleCaps & DD_FLATSHADE) && j != jj) VB->copypvfunc( ctx, jj, j ); + TAG(build_proj_verts)( ctx ); + /* Render the new line. */ ctx->Driver.LineFunc( ctx, ii, jj ); diff --git a/src/mesa/tnl/t_vb_lighttmp.h b/src/mesa/tnl/t_vb_lighttmp.h index 656fffff1ad..575c568c06f 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.2 2001/01/03 15:59:30 brianp Exp $ */ +/* $Id: t_vb_lighttmp.h,v 1.3 2001/01/17 02:49:39 keithw Exp $ */ /* * Mesa 3-D graphics library @@ -661,6 +661,9 @@ static void TAG(light_fast_rgba)( GLcontext *ctx, if (IDX & LIGHT_TWOSIDE) VB->ColorPtr[1] = &store->LitColor[1]; + if (stage->changed_inputs == 0) + return; + if ( CHECK_COLOR_MATERIAL(j) ) gl_update_color_material( ctx, *CMcolor ); @@ -783,6 +786,9 @@ static void TAG(light_ci)( GLcontext *ctx, if (IDX & LIGHT_TWOSIDE) VB->IndexPtr[1] = &store->LitIndex[1]; + if (stage->changed_inputs == 0) + return; + indexResult[0] = VB->IndexPtr[0]->data; indexResult[1] = VB->IndexPtr[1]->data;