summaryrefslogtreecommitdiffstats
path: root/src/intel/compiler
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2018-12-11 13:49:28 -0800
committerEric Anholt <[email protected]>2018-12-13 12:24:26 -0800
commit4407e688cdf65b1a25f09bcfdb577d5c175aeb9a (patch)
tree7979fc31f121d8eccfec099e5a4122ad52b3dfee /src/intel/compiler
parent3a417a044e9ce3ab2ee6f1647e9be24cf9d310f5 (diff)
nir: Move intel's half-float image store lowering to to nir_format.h.
I needed the same function for v3d. This was originally in d3e046e76c06 ("nir: Pull some of intel's image load/store format conversion to nir_format.h") before we made am istake about simplifying the function. Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/intel/compiler')
-rw-r--r--src/intel/compiler/brw_nir_lower_image_load_store.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/intel/compiler/brw_nir_lower_image_load_store.c b/src/intel/compiler/brw_nir_lower_image_load_store.c
index 269dbf8e283..2abebceb2d1 100644
--- a/src/intel/compiler/brw_nir_lower_image_load_store.c
+++ b/src/intel/compiler/brw_nir_lower_image_load_store.c
@@ -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: