Mesa (master): nir: add glsl_get_std140_size() helper
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Fri Mar 6 23:38:16 UTC 2020
Module: Mesa
Branch: master
Commit: 1ccfe821b2244d6880b2aac6641f312c7171dc49
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=1ccfe821b2244d6880b2aac6641f312c7171dc49
Author: Timothy Arceri <tarceri at itsqueeze.com>
Date: Thu Jan 16 14:43:30 2020 +1100
nir: add glsl_get_std140_size() helper
This will be used by the nir glsl linker for linking uniforms.
Reviewed-by: Alejandro Piñeiro <apinheiro at igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4050>
---
src/compiler/nir_types.cpp | 6 ++++++
src/compiler/nir_types.h | 1 +
2 files changed, 7 insertions(+)
diff --git a/src/compiler/nir_types.cpp b/src/compiler/nir_types.cpp
index 74a5a8d769a..631e8b41832 100644
--- a/src/compiler/nir_types.cpp
+++ b/src/compiler/nir_types.cpp
@@ -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)
{
diff --git a/src/compiler/nir_types.h b/src/compiler/nir_types.h
index e3a7ebcdaea..67d719adec6 100644
--- a/src/compiler/nir_types.h
+++ b/src/compiler/nir_types.h
@@ -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);
More information about the mesa-commit
mailing list