Signed-off-by: Abdiel Janulgue <abdiel.janul...@linux.intel.com>
---
 src/mesa/drivers/dri/i965/brw_vec4.cpp | 12 ++++++++++++
 src/mesa/drivers/dri/i965/brw_vec4.h   |  1 +
 2 files changed, 13 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/brw_vec4.cpp 
b/src/mesa/drivers/dri/i965/brw_vec4.cpp
index 85dc372..f2b03f8 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4.cpp
@@ -595,6 +595,17 @@ vec4_visitor::pack_uniform_registers()
    }
 }
 
+void
+vec4_visitor::generate_gather_table()
+{
+   int num_consts = ALIGN(stage_prog_data->nr_params, 4) / 4;
+   for (int i = 0; i < num_consts; i++) {
+      int p = stage_prog_data->nr_gather_table++;
+      stage_prog_data->gather_table[p].reg = -1;
+      stage_prog_data->gather_table[p].channel_mask = 0xf;
+   }
+}
+
 /**
  * Does algebraic optimizations (0 * a = 0, 1 * a = a, a + 0 = a).
  *
@@ -1832,6 +1843,7 @@ vec4_visitor::run()
       return false;
 
    setup_payload();
+   generate_gather_table();
 
    if (unlikely(INTEL_DEBUG & DEBUG_SPILL_VEC4)) {
       /* Debug of register spilling: Go spill everything. */
diff --git a/src/mesa/drivers/dri/i965/brw_vec4.h 
b/src/mesa/drivers/dri/i965/brw_vec4.h
index 01c6e84..534f1b1 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4.h
+++ b/src/mesa/drivers/dri/i965/brw_vec4.h
@@ -206,6 +206,7 @@ public:
    bool is_dep_ctrl_unsafe(const vec4_instruction *inst);
    void opt_set_dependency_control();
    void opt_schedule_instructions();
+   void generate_gather_table();
 
    vec4_instruction *emit(vec4_instruction *inst);
 
-- 
1.9.1

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to