diff options
author | Timothy Arceri <[email protected]> | 2020-01-16 14:01:42 +1100 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-03-06 23:22:14 +0000 |
commit | 120a26c6f25905474464661e351e36a4c7c76aea (patch) | |
tree | a92673fd400632309a4857d78e32d735cf0c7c83 /src | |
parent | 262b611a5bb08ebb8d2876bc44a44952d610a248 (diff) |
nir: add glsl_get_std140_base_alignment() helper
This will be used by the nir glsl linker for linking uniforms.
Reviewed-by: Alejandro PiƱeiro <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4050>
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/nir_types.cpp | 6 | ||||
-rw-r--r-- | src/compiler/nir_types.h | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/compiler/nir_types.cpp b/src/compiler/nir_types.cpp index 432c65a7cdd..74a5a8d769a 100644 --- a/src/compiler/nir_types.cpp +++ b/src/compiler/nir_types.cpp @@ -780,6 +780,12 @@ glsl_get_internal_ifc_packing(const struct glsl_type *type, } unsigned +glsl_get_std140_base_alignment(const struct glsl_type *type, bool row_major) +{ + return type->std140_base_alignment(row_major); +} + +unsigned glsl_get_explicit_size(const struct glsl_type *type, bool align_to_stride) { return type->explicit_size(align_to_stride); diff --git a/src/compiler/nir_types.h b/src/compiler/nir_types.h index 877edda6389..e3a7ebcdaea 100644 --- a/src/compiler/nir_types.h +++ b/src/compiler/nir_types.h @@ -56,6 +56,8 @@ const enum glsl_interface_packing glsl_get_internal_ifc_packing(const struct glsl_type *type, bool std430_supported); +unsigned glsl_get_std140_base_alignment(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); |