compiler/types: Flip wrapping of cmat related functions
authorCaio Oliveira <caio.oliveira@intel.com>
Thu, 28 Sep 2023 19:17:45 +0000 (12:17 -0700)
committerMarge Bot <emma+marge@anholt.net>
Wed, 25 Oct 2023 01:51:11 +0000 (01:51 +0000)
Also add a missing `struct` related to cmat.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25129>

src/compiler/glsl_types.cpp
src/compiler/nir_types.cpp

index fde4a82..2dcfcb1 100644 (file)
@@ -3021,7 +3021,7 @@ union packed_type {
       unsigned length:13;
       unsigned explicit_stride:14;
    } array;
-   glsl_cmat_description cmat_desc;
+   struct glsl_cmat_description cmat_desc;
    struct {
       unsigned base_type:5;
       unsigned interface_packing_or_packed:2;
@@ -3472,6 +3472,20 @@ glsl_type_wrap_in_arrays(const struct glsl_type *t,
                                         glsl_get_explicit_stride(arrays));
 }
 
+const struct glsl_type *
+glsl_get_cmat_element(const struct glsl_type *t)
+{
+   assert(t->base_type == GLSL_TYPE_COOPERATIVE_MATRIX);
+   return glsl_type::get_instance(t->cmat_desc.element_type, 1, 1);
+}
+
+const struct glsl_cmat_description *
+glsl_get_cmat_description(const struct glsl_type *t)
+{
+   assert(t->base_type == GLSL_TYPE_COOPERATIVE_MATRIX);
+   return &t->cmat_desc;
+}
+
 unsigned
 glsl_get_length(const struct glsl_type *t)
 {
index 9fd8191..102588d 100644 (file)
@@ -669,16 +669,3 @@ glsl_type_replace_vec3_with_vec4(const struct glsl_type *type)
    return type->replace_vec3_with_vec4();
 }
 
-const struct glsl_type *
-glsl_get_cmat_element(const struct glsl_type *type)
-{
-   assert(type->base_type == GLSL_TYPE_COOPERATIVE_MATRIX);
-   return glsl_type::get_instance(type->cmat_desc.element_type, 1, 1);
-}
-
-const struct glsl_cmat_description *
-glsl_get_cmat_description(const struct glsl_type *type)
-{
-   assert(type->base_type == GLSL_TYPE_COOPERATIVE_MATRIX);
-   return &type->cmat_desc;
-}