nir: add glsl_get_std140_size() helper
authorTimothy Arceri <tarceri@itsqueeze.com>
Thu, 16 Jan 2020 03:43:30 +0000 (14:43 +1100)
committerMarge Bot <eric+marge@anholt.net>
Fri, 6 Mar 2020 23:22:14 +0000 (23:22 +0000)
This will be used by the nir glsl linker for linking uniforms.

Reviewed-by: Alejandro PiƱeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4050>

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

index 74a5a8d769a695f963a08cf560993d419f4df97d..631e8b4183297baef28f3e59cf4652b36673ce99 100644 (file)
@@ -785,6 +785,12 @@ glsl_get_std140_base_alignment(const struct glsl_type *type, bool row_major)
    return type->std140_base_alignment(row_major);
 }
 
+unsigned
+glsl_get_std140_size(const struct glsl_type *type, bool row_major)
+{
+   return type->std140_size(row_major);
+}
+
 unsigned
 glsl_get_explicit_size(const struct glsl_type *type, bool align_to_stride)
 {
index e3a7ebcdaea46c0ca90deff96220e6b5590d418a..67d719adec69a4d8edac43ff5bb626723fe288f1 100644 (file)
@@ -58,6 +58,7 @@ glsl_get_internal_ifc_packing(const struct glsl_type *type,
 
 unsigned glsl_get_std140_base_alignment(const struct glsl_type *type,
                                         bool row_major);
+unsigned glsl_get_std140_size(const struct glsl_type *type, bool row_major);
 unsigned glsl_get_explicit_stride(const struct glsl_type *type);
 const struct glsl_type *glsl_get_array_element(const struct glsl_type *type);
 const struct glsl_type *glsl_without_array(const struct glsl_type *type);