[Mesa-dev] [PATCH 21/27] i965/vec4: Append uniform entries to the gather table

Abdiel Janulgue abdiel.janulgue at linux.intel.com
Tue Apr 28 13:08:18 PDT 2015


Signed-off-by: Abdiel Janulgue <abdiel.janulgue at 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 c4c77b2..799d79e 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4.cpp
@@ -571,6 +571,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).
  *
@@ -1757,6 +1768,7 @@ vec4_visitor::run()
       return false;
 
    setup_payload();
+   generate_gather_table();
 
    if (false) {
       /* 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 a0ee2cc..e58ea25 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4.h
+++ b/src/mesa/drivers/dri/i965/brw_vec4.h
@@ -212,6 +212,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



More information about the mesa-dev mailing list