Mesa (master): compiler/types: Add a struct_type_is_packed wrapper

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Aug 4 04:06:00 UTC 2020


Module: Mesa
Branch: master
Commit: 140a5492e0493d516b76ea7740c92516c91bf874
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=140a5492e0493d516b76ea7740c92516c91bf874

Author: Jason Ekstrand <jason at jlekstrand.net>
Date:   Fri Jul 24 10:45:36 2020 -0500

compiler/types: Add a struct_type_is_packed wrapper

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6065>

---

 src/compiler/nir_types.cpp | 7 +++++++
 src/compiler/nir_types.h   | 1 +
 2 files changed, 8 insertions(+)

diff --git a/src/compiler/nir_types.cpp b/src/compiler/nir_types.cpp
index 70ae1173c36..a53b14db814 100644
--- a/src/compiler/nir_types.cpp
+++ b/src/compiler/nir_types.cpp
@@ -360,6 +360,13 @@ glsl_sampler_type_is_array(const struct glsl_type *type)
    return type->sampler_array;
 }
 
+bool
+glsl_struct_type_is_packed(const struct glsl_type *type)
+{
+   assert(glsl_type_is_struct(type));
+   return type->packed;
+}
+
 bool
 glsl_type_is_dual_slot(const struct glsl_type *type)
 {
diff --git a/src/compiler/nir_types.h b/src/compiler/nir_types.h
index eeddcf2dabe..6118e52bfc5 100644
--- a/src/compiler/nir_types.h
+++ b/src/compiler/nir_types.h
@@ -152,6 +152,7 @@ bool glsl_type_is_integer(const struct glsl_type *type);
 bool glsl_type_contains_64bit(const struct glsl_type *type);
 bool glsl_sampler_type_is_shadow(const struct glsl_type *type);
 bool glsl_sampler_type_is_array(const struct glsl_type *type);
+bool glsl_struct_type_is_packed(const struct glsl_type *type);
 bool glsl_contains_atomic(const struct glsl_type *type);
 bool glsl_contains_opaque(const struct glsl_type *type);
 



More information about the mesa-commit mailing list