nir: Move intel's half-float image store lowering to to nir_format.h.
[mesa.git] / src / intel / compiler / brw_nir_lower_image_load_store.c
index 269dbf8e2835badd4ac6ab760965afca13b582f1..2abebceb2d1a37bf2a487a7a081c274f1b4be617 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_format_float_to_half(b, color);
       break;
 
    case ISL_UINT: