From: Iago Toral Quiroga Date: Mon, 28 Jul 2014 08:05:57 +0000 (+0200) Subject: i965/gen6/gs: Assign geometry shader VUE map properly. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6669fd0818a07f3bd8232ee72cf5e01d992b39f2;p=mesa.git i965/gen6/gs: Assign geometry shader VUE map properly. So far in gen6 we only used geometry shaders to implement transform feedback in vertex shaders, so we assumed that the VUE map for the geometry shader stage was always the same as for the vertex shader stage. This is no longer true now that we support user provided geometry shaders in gen6 too. Acked-by: Kenneth Graunke Reviewed-by: Jordan Justen --- diff --git a/src/mesa/drivers/dri/i965/brw_vec4_gs.c b/src/mesa/drivers/dri/i965/brw_vec4_gs.c index 41c6d8b6593..3c618828c2e 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4_gs.c +++ b/src/mesa/drivers/dri/i965/brw_vec4_gs.c @@ -298,18 +298,18 @@ brw_upload_gs_prog(struct brw_context *brw) (struct brw_geometry_program *) brw->geometry_program; if (gp == NULL) { - if (brw->gen == 6) { - if (brw->state.dirty.brw & BRW_NEW_TRANSFORM_FEEDBACK) - gen6_brw_upload_ff_gs_prog(brw); - return; - } - /* No geometry shader. Vertex data just passes straight through. */ if (brw->state.dirty.brw & BRW_NEW_VUE_MAP_VS) { brw->vue_map_geom_out = brw->vue_map_vs; brw->state.dirty.brw |= BRW_NEW_VUE_MAP_GEOM_OUT; } + if (brw->gen == 6 && + (brw->state.dirty.brw & BRW_NEW_TRANSFORM_FEEDBACK)) { + gen6_brw_upload_ff_gs_prog(brw); + return; + } + /* Other state atoms had better not try to access prog_data, since * there's no GS program. */ diff --git a/src/mesa/drivers/dri/i965/brw_vs.c b/src/mesa/drivers/dri/i965/brw_vs.c index e1063c734f6..edaa82cb4c3 100644 --- a/src/mesa/drivers/dri/i965/brw_vs.c +++ b/src/mesa/drivers/dri/i965/brw_vs.c @@ -498,7 +498,7 @@ static void brw_upload_vs_prog(struct brw_context *brw) sizeof(brw->vue_map_geom_out)) != 0) { brw->vue_map_vs = brw->vs.prog_data->base.vue_map; brw->state.dirty.brw |= BRW_NEW_VUE_MAP_VS; - if (brw->gen < 7) { + if (brw->gen < 6) { /* No geometry shader support, so the VS VUE map is the VUE map for * the output of the "geometry" portion of the pipeline. */