[Mesa-dev] [PATCH 08/20] nir: Add glsl_get_array_size() wrapper.

Abdiel Janulgue abdiel.janulgue at linux.intel.com
Fri Sep 11 01:33:22 PDT 2015


Signed-off-by: Abdiel Janulgue <abdiel.janulgue at linux.intel.com>
---
 src/glsl/nir/nir_types.cpp | 6 ++++++
 src/glsl/nir/nir_types.h   | 2 ++
 2 files changed, 8 insertions(+)

diff --git a/src/glsl/nir/nir_types.cpp b/src/glsl/nir/nir_types.cpp
index 940c676..a0caf0e 100644
--- a/src/glsl/nir/nir_types.cpp
+++ b/src/glsl/nir/nir_types.cpp
@@ -165,3 +165,9 @@ glsl_array_type(const glsl_type *base, unsigned elements)
 {
    return glsl_type::get_array_instance(base, elements);
 }
+
+unsigned
+glsl_get_array_size(const struct glsl_type *type)
+{
+   return type->array_size();
+}
diff --git a/src/glsl/nir/nir_types.h b/src/glsl/nir/nir_types.h
index a8ff8f2..72b980a 100644
--- a/src/glsl/nir/nir_types.h
+++ b/src/glsl/nir/nir_types.h
@@ -51,6 +51,8 @@ const struct glsl_type *glsl_get_column_type(const struct glsl_type *type);
 
 enum glsl_base_type glsl_get_base_type(const struct glsl_type *type);
 
+unsigned glsl_get_array_size(const struct glsl_type *type);
+
 unsigned glsl_get_vector_elements(const struct glsl_type *type);
 
 unsigned glsl_get_components(const struct glsl_type *type);
-- 
1.9.1



More information about the mesa-dev mailing list