glsl: Implement constant propagation for fp16
authorKristian H. Kristensen <hoegsberg@google.com>
Tue, 4 Feb 2020 23:50:25 +0000 (15:50 -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_constant_propagation.cpp

index cc57c48c83aaab34857d86c20061b898e917f1de..674208348b87aa59bda660a9e6178bc237cc9bde 100644 (file)
@@ -208,6 +208,9 @@ ir_constant_propagation_visitor::constant_propagation(ir_rvalue **rvalue) {
       case GLSL_TYPE_FLOAT:
         data.f[i] = found->constant->value.f[rhs_channel];
         break;
+      case GLSL_TYPE_FLOAT16:
+        data.f16[i] = found->constant->value.f16[rhs_channel];
+        break;
       case GLSL_TYPE_DOUBLE:
         data.d[i] = found->constant->value.d[rhs_channel];
         break;