From a8582efaca35d09c8ca18918a243a9284583356d Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Wed, 16 Apr 2008 10:03:18 +0100 Subject: draw: make pt run pipeline when need_pipeline is true, not just when clipped --- .../auxiliary/draw/draw_pt_fetch_shade_pipeline.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c') diff --git a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c index 2d83e11940..52be4a64aa 100644 --- a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c +++ b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c @@ -42,11 +42,13 @@ struct fetch_pipeline_middle_end { unsigned pipeline_vertex_size; unsigned prim; + unsigned opt; }; static void fetch_pipeline_prepare( struct draw_pt_middle_end *middle, - unsigned prim ) + unsigned prim, + unsigned opt ) { struct fetch_pipeline_middle_end *fpme = (struct fetch_pipeline_middle_end *)middle; struct draw_context *draw = fpme->draw; @@ -57,6 +59,7 @@ static void fetch_pipeline_prepare( struct draw_pt_middle_end *middle, struct translate_key hw_key; fpme->prim = prim; + fpme->opt = opt; ok = draw->render->set_primitive(draw->render, prim); if (!ok) { @@ -157,6 +160,7 @@ static void fetch_pipeline_run( struct draw_pt_middle_end *middle, struct draw_context *draw = fpme->draw; struct draw_vertex_shader *shader = draw->vertex_shader; char *pipeline_verts; + unsigned pipeline = PT_PIPELINE; pipeline_verts = MALLOC(fpme->pipeline_vertex_size * fetch_count); @@ -170,9 +174,17 @@ static void fetch_pipeline_run( struct draw_pt_middle_end *middle, /* Shade */ shader->prepare(shader, draw); + if (shader->run(shader, draw, fetch_elts, fetch_count, pipeline_verts, - fpme->pipeline_vertex_size)) { - /* Run the pipeline */ + fpme->pipeline_vertex_size)) + { + pipeline |= PT_CLIPTEST; + } + + + /* Do we need to run the pipeline? + */ + if (fpme->opt & pipeline) { draw_pt_run_pipeline( fpme->draw, fpme->prim, pipeline_verts, -- cgit v1.2.3