Mesa (master): nir/glsl: Add glsl_get_cl_type_size_align helper

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Aug 19 18:33:21 UTC 2020


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

Author: Jesse Natalie <jenatali at microsoft.com>
Date:   Thu May 28 10:24:34 2020 -0700

nir/glsl: Add glsl_get_cl_type_size_align helper

Signed-off-by: Boris Brezillon <boris.brezillon at collabora.com>
Signed-off-by: Karol Herbst <kherbst at redhat.com>
Reviewed-by: Boris Brezillon <boris.brezillon at collabora.com>
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6367>

---

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

diff --git a/src/compiler/nir_types.cpp b/src/compiler/nir_types.cpp
index 975f5480e11..f86f0a79868 100644
--- a/src/compiler/nir_types.cpp
+++ b/src/compiler/nir_types.cpp
@@ -761,6 +761,14 @@ glsl_get_cl_alignment(const struct glsl_type *type)
    return type->cl_alignment();
 }
 
+void
+glsl_get_cl_type_size_align(const struct glsl_type *type,
+                            unsigned *size, unsigned *align)
+{
+   *size = glsl_get_cl_size(type);
+   *align = glsl_get_cl_alignment(type);
+}
+
 unsigned
 glsl_type_get_sampler_count(const struct glsl_type *type)
 {
diff --git a/src/compiler/nir_types.h b/src/compiler/nir_types.h
index 5e4da1e8ab3..8d82f492e02 100644
--- a/src/compiler/nir_types.h
+++ b/src/compiler/nir_types.h
@@ -118,6 +118,9 @@ int glsl_get_cl_size(const struct glsl_type *type);
 
 int glsl_get_cl_alignment(const struct glsl_type *type);
 
+void glsl_get_cl_type_size_align(const struct glsl_type *type,
+                                 unsigned *size, unsigned *align);
+
 unsigned glsl_get_explicit_size(const struct glsl_type *type, bool align_to_stride);
 
 static inline unsigned



More information about the mesa-commit mailing list