From 3e377c68f879be05059c3c8871ffc4ea752523f2 Mon Sep 17 00:00:00 2001 From: Iago Toral Quiroga Date: Mon, 17 Dec 2018 09:17:06 +0100 Subject: intel/compiler: add a NIR pass to lower conversions Some conversions are not directly supported in hardware and need to be split in two conversion instructions going through an intermediary type. Doing this at the NIR level simplifies a bit the complexity in the backend. v2: - Consider fp16 rounding conversion opcodes - Properly handle swizzles on conversion sources. v3 - Run the pass earlier, right after nir_opt_algebraic_late (Jason) - NIR alu output types already have the bit-size (Jason) - Use 'is_conversion' to identify conversion operations (Jason) v4: - Be careful about the intermediate types we use so we don't lose range and avoid incorrect rounding semantics (Jason) Reviewed-by: Topi Pohjolainen (v1) Reviewed-by: Jason Ekstrand --- src/intel/compiler/brw_nir.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/intel/compiler/brw_nir.h') diff --git a/src/intel/compiler/brw_nir.h b/src/intel/compiler/brw_nir.h index bb916341e59..d5f36c236b3 100644 --- a/src/intel/compiler/brw_nir.h +++ b/src/intel/compiler/brw_nir.h @@ -115,6 +115,8 @@ void brw_nir_lower_tcs_outputs(nir_shader *nir, const struct brw_vue_map *vue, GLenum tes_primitive_mode); void brw_nir_lower_fs_outputs(nir_shader *nir); +bool brw_nir_lower_conversions(nir_shader *nir); + bool brw_nir_lower_image_load_store(nir_shader *nir, const struct gen_device_info *devinfo); void brw_nir_rewrite_image_intrinsic(nir_intrinsic_instr *intrin, -- cgit v1.2.3