glsl: Add fp16 case for ir_triop_lrp optimization
authorKristian H. Kristensen <hoegsberg@google.com>
Thu, 16 Jan 2020 22:58:57 +0000 (14:58 -0800)
committerMarge Bot <eric+marge@anholt.net>
Mon, 9 Mar 2020 16:31:08 +0000 (16:31 +0000)
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3929>

src/compiler/glsl/opt_algebraic.cpp

index 3147d25aea86a2a18bf566a630a2b9213ad86f42..226f6245fca79a48452a9b202fe4d9dbc42997cb 100644 (file)
@@ -983,6 +983,9 @@ ir_algebraic_visitor::handle_expression(ir_expression *ir)
          ir_constant *one;
 
          switch (ir->type->base_type) {
+         case GLSL_TYPE_FLOAT16:
+            one = new(mem_ctx) ir_constant(float16_t::one(), op2_components);
+            break;
          case GLSL_TYPE_FLOAT:
             one = new(mem_ctx) ir_constant(1.0f, op2_components);
             break;