[Mesa-dev] [PATCH 22/37] i965/gen6/gs: Assign geometry shader VUE map properly.

Iago Toral Quiroga itoral at igalia.com
Thu Aug 14 04:11:54 PDT 2014


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.
---
 src/mesa/drivers/dri/i965/brw_vec4_gs.c | 12 ++++++------
 src/mesa/drivers/dri/i965/brw_vs.c      |  2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_vec4_gs.c b/src/mesa/drivers/dri/i965/brw_vec4_gs.c
index a445174..f735cf3 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_gs.c
+++ b/src/mesa/drivers/dri/i965/brw_vec4_gs.c
@@ -296,18 +296,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 19b1d3b..3ea7681 100644
--- a/src/mesa/drivers/dri/i965/brw_vs.c
+++ b/src/mesa/drivers/dri/i965/brw_vs.c
@@ -495,7 +495,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.
           */
-- 
1.9.1



More information about the mesa-dev mailing list