glsl: fix evaluating float16 constant expression matrices
authorMarek Olšák <marek.olsak@amd.com>
Sat, 4 Jul 2020 21:43:50 +0000 (17:43 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 8 Jul 2020 02:02:06 +0000 (22:02 -0400)
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5746>

src/compiler/glsl/ir_constant_expression.cpp

index 595cc821797578387aa24726f3e628cae6c070ee..855b7884fb76754bbe21eefbefd010297c644afc 100644 (file)
@@ -935,6 +935,12 @@ ir_dereference_array::constant_expression_value(void *mem_ctx,
          ir_constant_data data = { { 0 } };
 
          switch (column_type->base_type) {
+         case GLSL_TYPE_FLOAT16:
+            for (unsigned i = 0; i < column_type->vector_elements; i++)
+               data.f16[i] = array->value.f16[mat_idx + i];
+
+            break;
+
          case GLSL_TYPE_FLOAT:
             for (unsigned i = 0; i < column_type->vector_elements; i++)
                data.f[i] = array->value.f[mat_idx + i];