i965/gen6/gs: Assign geometry shader VUE map properly.
authorIago Toral Quiroga <itoral@igalia.com>
Mon, 28 Jul 2014 08:05:57 +0000 (10:05 +0200)
committerIago Toral Quiroga <itoral@igalia.com>
Fri, 19 Sep 2014 13:01:15 +0000 (15:01 +0200)
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 <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
src/mesa/drivers/dri/i965/brw_vec4_gs.c
src/mesa/drivers/dri/i965/brw_vs.c

index 41c6d8b659354490be2bf8e8d8351c70c71883e7..3c618828c2e65fa6d4a1394c4360332e0a380495 100644 (file)
@@ -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.
        */
index e1063c734f6a2ac211288d8ee8e9bb0c2fb2a96c..edaa82cb4c3fb03ed0fa556315e6c982d9458eb7 100644 (file)
@@ -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.
           */