intel: Simplify the half-float packing in image load/store lowering.
authorEric Anholt <eric@anholt.net>
Wed, 12 Dec 2018 19:29:29 +0000 (11:29 -0800)
committerEric Anholt <eric@anholt.net>
Thu, 13 Dec 2018 00:09:48 +0000 (16:09 -0800)
This was noted by Jason in review when I tried to make a helper for the
old path.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/intel/compiler/brw_nir_lower_image_load_store.c

index 269dbf8e2835badd4ac6ab760965afca13b582f1..d1547c98c54ba0f61056adb6bc6169cade7dd650 100644 (file)
@@ -544,14 +544,8 @@ convert_color_for_store(nir_builder *b, const struct gen_device_info *devinfo,
       break;
 
    case ISL_SFLOAT:
-      if (image.bits[0] == 16) {
-         nir_ssa_def *f16comps[4];
-         for (unsigned i = 0; i < image.chans; i++) {
-            f16comps[i] = nir_pack_half_2x16_split(b, nir_channel(b, color, i),
-                                                      nir_imm_float(b, 0));
-         }
-         color = nir_vec(b, f16comps, image.chans);
-      }
+      if (image.bits[0] == 16)
+         color = nir_pack_half_2x16_split(b, color, nir_imm_float(b, 0));
       break;
 
    case ISL_UINT: