Module: Mesa
Branch: master
Commit: 65e80ce5b565953ffb07586790eeea51199ca9cf
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=65e80ce5b565953ffb07586790eeea51199ca9cf

Author: Jason Ekstrand <[email protected]>
Date:   Tue Sep 22 21:11:23 2015 -0700

nir/lower_vec_to_movs: Properly handle source modifiers on vecN ops

I don't know of any piglit tests that are currently broken.  However, there
is nothing stopping a vecN instruction from getting source modifiers and
lower_vec_to_movs is run after we lower to source modifiers.

Reviewed-by: Eduardo Lima Mitev <[email protected]>
Reviewed-by: Matt Turner <[email protected]>

---

 src/glsl/nir/nir_lower_vec_to_movs.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/glsl/nir/nir_lower_vec_to_movs.c 
b/src/glsl/nir/nir_lower_vec_to_movs.c
index 622e59c..287f2bf 100644
--- a/src/glsl/nir/nir_lower_vec_to_movs.c
+++ b/src/glsl/nir/nir_lower_vec_to_movs.c
@@ -68,12 +68,16 @@ insert_mov(nir_alu_instr *vec, unsigned start_idx, 
nir_shader *shader)
 
    mov->dest.write_mask = (1u << start_idx);
    mov->src[0].swizzle[start_idx] = vec->src[start_idx].swizzle[0];
+   mov->src[0].negate = vec->src[start_idx].negate;
+   mov->src[0].abs = vec->src[start_idx].abs;
 
    for (unsigned i = start_idx + 1; i < 4; i++) {
       if (!(vec->dest.write_mask & (1 << i)))
          continue;
 
-      if (nir_srcs_equal(vec->src[i].src, vec->src[start_idx].src)) {
+      if (nir_srcs_equal(vec->src[i].src, vec->src[start_idx].src) &&
+          vec->src[i].negate == vec->src[start_idx].negate &&
+          vec->src[i].abs == vec->src[start_idx].abs) {
          mov->dest.write_mask |= (1 << i);
          mov->src[0].swizzle[i] = vec->src[i].swizzle[0];
       }

_______________________________________________
mesa-commit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to