summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c9
1 files changed, 6 insertions, 3 deletions
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++) {