i965/vec4: Set VERT_BIT_EDGEFLAG based on the VUE map
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 9 May 2017 19:34:10 +0000 (12:34 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 9 May 2017 22:07:47 +0000 (15:07 -0700)
We also add a nice little comment to make it more clear exactly what
happens with the edge flag copy.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/intel/compiler/brw_vec4.cpp
src/mesa/drivers/dri/i965/brw_vs.c

index 9366b893068305c5663d3c6ecd92ad87965c37c0..7b17c6427523226b22d7c2855b331de60636964c 100644 (file)
@@ -2778,6 +2778,17 @@ brw_compile_vs(const struct brw_compiler *compiler, void *log_data,
 
    const unsigned *assembly = NULL;
 
+   if (prog_data->base.vue_map.varying_to_slot[VARYING_SLOT_EDGE] != -1) {
+      /* If the output VUE map contains VARYING_SLOT_EDGE then we need to copy
+       * the edge flag from VERT_ATTRIB_EDGEFLAG.  This will be done
+       * automatically by brw_vec4_visitor::emit_urb_slot but we need to
+       * ensure that prog_data->inputs_read is accurate.
+       */
+      assert(!is_scalar);
+      assert(key->copy_edgeflag);
+      prog_data->inputs_read |= VERT_BIT_EDGEFLAG;
+   }
+
    prog_data->base.clip_distance_mask =
       ((1 << shader->info.clip_distance_array_size) - 1);
    prog_data->base.cull_distance_mask =
index b1ea01a9add5a6d60f14df271e10daca64814dec..b823a4dd5c68187c7966f7451cbf6055d469b6f6 100644 (file)
@@ -213,10 +213,6 @@ brw_codegen_vs_prog(struct brw_context *brw,
    prog_data.inputs_read = vp->program.info.inputs_read;
    prog_data.double_inputs_read = vp->program.info.double_inputs_read;
 
-   if (key->copy_edgeflag) {
-      prog_data.inputs_read |= VERT_BIT_EDGEFLAG;
-   }
-
    brw_compute_vue_map(devinfo,
                        &prog_data.base.vue_map, outputs_written,
                        vp->program.nir->info.separate_shader);