From 32e899ab8b3e0cc717c740e95e05f5e9d11e8224 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Thu, 15 Nov 2012 20:35:20 +0000 Subject: draw: Consider the geometry shader when choosing the vertex size. A single vertex size is chosen for the whole pipeline. So the number of geometry shader outputs must also be taken in consideration. Reviewed-by: Brian Paul --- src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') 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 27420f06798..053ea7db729 100644 --- a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c +++ b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c @@ -59,12 +59,11 @@ static void fetch_pipeline_prepare( struct draw_pt_middle_end *middle, struct fetch_pipeline_middle_end *fpme = (struct fetch_pipeline_middle_end *)middle; struct draw_context *draw = fpme->draw; struct draw_vertex_shader *vs = draw->vs.vertex_shader; + struct draw_geometry_shader *gs = draw->gs.geometry_shader; unsigned i; unsigned instance_id_index = ~0; - unsigned gs_out_prim = (draw->gs.geometry_shader ? - draw->gs.geometry_shader->output_primitive : - prim); + unsigned gs_out_prim = (gs ? gs->output_primitive : prim); /* Add one to num_outputs because the pipeline occasionally tags on * an additional texcoord, eg for AA lines. @@ -72,6 +71,10 @@ static void fetch_pipeline_prepare( struct draw_pt_middle_end *middle, unsigned nr = MAX2( vs->info.num_inputs, vs->info.num_outputs + 1 ); + if (gs) { + nr = MAX2(nr, gs->info.num_outputs + 1); + } + /* Scan for instanceID system value. */ for (i = 0; i < vs->info.num_inputs; i++) { -- cgit v1.2.3