glsl: Remove integer matrix support from ir_dereference_array::constant_expression_value
authorIan Romanick <ian.d.romanick@intel.com>
Wed, 20 May 2020 20:39:57 +0000 (13:39 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Fri, 22 May 2020 00:47:08 +0000 (17:47 -0700)
It looks like this code has existed since day 1, but I have no idea why.
There have never been integer matrices in GLSL.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5135>

src/compiler/glsl/ir_constant_expression.cpp

index 759924ed9e1f1b8bb508a29b0a47481d40172a40..33b097aafd47f14164dbe2eb88a47605e1390d0c 100644 (file)
@@ -867,13 +867,6 @@ ir_dereference_array::constant_expression_value(void *mem_ctx,
          ir_constant_data data = { { 0 } };
 
          switch (column_type->base_type) {
-         case GLSL_TYPE_UINT:
-         case GLSL_TYPE_INT:
-            for (unsigned i = 0; i < column_type->vector_elements; i++)
-               data.u[i] = array->value.u[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];
@@ -887,8 +880,7 @@ ir_dereference_array::constant_expression_value(void *mem_ctx,
             break;
 
          default:
-            assert(!"Should not get here.");
-            break;
+            unreachable("Matrix types are either float or double.");
          }
 
          return new(mem_ctx) ir_constant(column_type, &data);