i965: Use BRW_MATH_DATA_SCALAR when source regioning is scalar.
authorMatt Turner <mattst88@gmail.com>
Sat, 30 Aug 2014 04:10:32 +0000 (21:10 -0700)
committerMatt Turner <mattst88@gmail.com>
Mon, 29 Sep 2014 22:59:19 +0000 (15:59 -0700)
Notice the mistaken (but harmless) argument swapping in brw_math_invert().

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_eu.h
src/mesa/drivers/dri/i965/brw_eu_emit.c
src/mesa/drivers/dri/i965/brw_eu_util.c
src/mesa/drivers/dri/i965/brw_fs_generator.cpp
src/mesa/drivers/dri/i965/brw_sf_emit.c
src/mesa/drivers/dri/i965/brw_vec4_generator.cpp

index e6c26e3922569fc0eb400e74aa2a05b4738beab1..db40497751ad034cf035fa40afc86099d5046c8e 100644 (file)
@@ -291,7 +291,6 @@ void gen4_math(struct brw_compile *p,
               unsigned function,
               unsigned msg_reg_nr,
               struct brw_reg src,
-              unsigned data_type,
               unsigned precision );
 
 void gen6_math(struct brw_compile *p,
index 15e1da7a6868cf99fe1a1f7752afacdb4cd8a7c7..e4488fc8ead0600565b367b45abd1ca052524504 100644 (file)
@@ -1879,11 +1879,18 @@ void gen4_math(struct brw_compile *p,
               unsigned function,
               unsigned msg_reg_nr,
               struct brw_reg src,
-              unsigned data_type,
               unsigned precision )
 {
    struct brw_context *brw = p->brw;
    brw_inst *insn = next_insn(p, BRW_OPCODE_SEND);
+   unsigned data_type;
+   if (src.vstride == BRW_VERTICAL_STRIDE_0 &&
+       src.width == BRW_WIDTH_1 &&
+       src.hstride == BRW_HORIZONTAL_STRIDE_0) {
+      data_type = BRW_MATH_DATA_SCALAR;
+   } else {
+      data_type = BRW_MATH_DATA_VECTOR;
+   }
 
    assert(brw->gen < 6);
 
index 0950fad99fd157c061d0ef22d11527904b065ebc..af4cfafcd6df84ca8f0a650db87f67926ee10e89 100644 (file)
@@ -44,8 +44,7 @@ void brw_math_invert( struct brw_compile *p,
             BRW_MATH_FUNCTION_INV,
             0,
             src,
-            BRW_MATH_PRECISION_FULL,
-            BRW_MATH_DATA_VECTOR );
+            BRW_MATH_PRECISION_FULL);
 }
 
 
index 1bc10f5614b3682f75af7b96dc70a8d226d831cd..e523df557f639174653733ccbfef0721aa2b90b4 100644 (file)
@@ -342,7 +342,6 @@ fs_generator::generate_math_gen4(fs_inst *inst,
    gen4_math(p, dst,
             op,
             inst->base_mrf, src,
-            BRW_MATH_DATA_VECTOR,
             BRW_MATH_PRECISION_FULL);
 
    if (dispatch_width == 16) {
@@ -350,7 +349,6 @@ fs_generator::generate_math_gen4(fs_inst *inst,
       gen4_math(p, sechalf(dst),
                op,
                inst->base_mrf + 1, sechalf(src),
-               BRW_MATH_DATA_VECTOR,
                BRW_MATH_PRECISION_FULL);
 
       brw_set_default_compression_control(p, BRW_COMPRESSION_COMPRESSED);
@@ -376,7 +374,6 @@ fs_generator::generate_math_g45(fs_inst *inst,
    gen4_math(p, dst,
              op,
              inst->base_mrf, src,
-             BRW_MATH_DATA_VECTOR,
              BRW_MATH_PRECISION_FULL);
 }
 
index 04d21a8f4e9e680ed9dfdf24eea642644c9eb415..e8bf7163e262114a4446603688ab41f8cfa3bd25 100644 (file)
@@ -327,7 +327,6 @@ static void invert_det( struct brw_sf_compile *c)
             BRW_MATH_FUNCTION_INV,
             0,
             c->det,
-            BRW_MATH_DATA_SCALAR,
             BRW_MATH_PRECISION_FULL);
 
 }
@@ -616,7 +615,6 @@ void brw_emit_point_sprite_setup(struct brw_sf_compile *c, bool allocate)
                   BRW_MATH_FUNCTION_INV,
                   0,
                   c->dx0,
-                  BRW_MATH_DATA_SCALAR,
                   BRW_MATH_PRECISION_FULL);
 
         brw_set_default_access_mode(p, BRW_ALIGN_16);
index 88695381045a73814218bf88a98a96dba9ab22ff..e52256738121d41531f351e0281c68589592ac1a 100644 (file)
@@ -157,7 +157,6 @@ vec4_generator::generate_math1_gen4(vec4_instruction *inst,
             brw_math_function(inst->opcode),
             inst->base_mrf,
             src,
-            BRW_MATH_DATA_VECTOR,
             BRW_MATH_PRECISION_FULL);
 }
 
@@ -218,7 +217,6 @@ vec4_generator::generate_math2_gen4(vec4_instruction *inst,
             brw_math_function(inst->opcode),
             inst->base_mrf,
             op0,
-            BRW_MATH_DATA_VECTOR,
             BRW_MATH_PRECISION_FULL);
 }