[Mesa-dev] [PATCH v2 081/103] i965/vec4: fix move_push_constants_to_pull_constants() for 64-bit data

Iago Toral Quiroga itoral at igalia.com
Tue Oct 11 09:02:25 UTC 2016


---
 src/mesa/drivers/dri/i965/brw_vec4.cpp | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_vec4.cpp b/src/mesa/drivers/dri/i965/brw_vec4.cpp
index 0788ba2..b0bc2d5 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4.cpp
@@ -884,10 +884,24 @@ vec4_visitor::move_push_constants_to_pull_constants()
 
          int uniform = inst->src[i].nr;
 
-         dst_reg temp = dst_reg(this, glsl_type::vec4_type);
+         dst_reg temp;
+         if (type_sz(inst->src[i].type) != 8) {
+            temp = dst_reg(this, glsl_type::vec4_type);
+            emit_pull_constant_load(block, inst, temp, inst->src[i],
+                                    pull_constant_loc[uniform], src_reg());
+         } else {
+            dst_reg shuffled = dst_reg(this, glsl_type::dvec4_type);
+            dst_reg shuffled_float = retype(shuffled, BRW_REGISTER_TYPE_F);
+
+            emit_pull_constant_load(block, inst, shuffled_float, inst->src[i],
+                                    pull_constant_loc[uniform], src_reg());
+            emit_pull_constant_load(block, inst, offset(shuffled_float, 1),
+                                    offset(inst->src[i], 1),
+                                    pull_constant_loc[uniform], src_reg());
 
-         emit_pull_constant_load(block, inst, temp, inst->src[i],
-                                 pull_constant_loc[uniform], src_reg());
+            temp = dst_reg(this, glsl_type::dvec4_type);
+            shuffle_64bit_data(temp, src_reg(shuffled), false, block, inst);
+         }
 
          inst->src[i].file = temp.file;
          inst->src[i].nr = temp.nr;
-- 
2.7.4



More information about the mesa-dev mailing list