nir/glsl: Add glsl_get_cl_type_size_align helper
authorJesse Natalie <jenatali@microsoft.com>
Thu, 28 May 2020 17:24:34 +0000 (10:24 -0700)
committerMarge Bot <eric+marge@anholt.net>
Wed, 19 Aug 2020 18:11:42 +0000 (18:11 +0000)
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6367>

src/compiler/nir_types.cpp
src/compiler/nir_types.h

index 975f5480e111a7e8d4467ac156ec43e60d97f424..f86f0a7986806904c6d5d546847cbe1c682ce2ad 100644 (file)
@@ -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)
 {
index 5e4da1e8ab354ab4e17ba5eb450dfc6efd4c8345..8d82f492e02f9f1e91008d6b593cba164664e077 100644 (file)
@@ -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