i965/fs: Set compression only if writing two registers.
authorMatt Turner <mattst88@gmail.com>
Sat, 11 Apr 2015 21:51:13 +0000 (14:51 -0700)
committerMatt Turner <mattst88@gmail.com>
Tue, 21 Apr 2015 16:24:48 +0000 (09:24 -0700)
We don't want to set compression control on a SIMD16 instruction
operating on words or smaller.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
src/mesa/drivers/dri/i965/brw_fs_generator.cpp

index af08f9d6d071dd0079ed5ae673a6890ce5d2c281..397d8257a9188c25e47bf4de1ca7c1259862ba94 100644 (file)
@@ -1631,7 +1631,10 @@ fs_generator::generate_code(const cfg_t *cfg, int dispatch_width)
          break;
       case 16:
       case 32:
-         brw_set_default_compression_control(p, BRW_COMPRESSION_COMPRESSED);
+         if (type_sz(inst->dst.type) < sizeof(float))
+            brw_set_default_compression_control(p, BRW_COMPRESSION_NONE);
+         else
+            brw_set_default_compression_control(p, BRW_COMPRESSION_COMPRESSED);
          break;
       default:
          unreachable("Invalid instruction width");