summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbdiel Janulgue <abdiel.janulgue@linux.intel.com>2015-04-21 15:01:16 +0300
committerAbdiel Janulgue <abdiel.janulgue@linux.intel.com>2015-04-28 22:22:45 +0300
commit3c0b0e1776ed1744a4c35513e457b14ee056ac6b (patch)
tree7c6c39e24b268f1ded1b891edf2724240155a277
parent431036861ff07aa561f1699052e6f795cab83d11 (diff)
nir: Add glsl_get_array_size() wrapper.
Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
-rw-r--r--src/glsl/nir/nir_types.cpp6
-rw-r--r--src/glsl/nir/nir_types.h2
2 files changed, 8 insertions, 0 deletions
diff --git a/src/glsl/nir/nir_types.cpp b/src/glsl/nir/nir_types.cpp
index 249678f3f9..7218eeb4b8 100644
--- a/src/glsl/nir/nir_types.cpp
+++ b/src/glsl/nir/nir_types.cpp
@@ -164,3 +164,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 125f075f3d..32e18f307b 100644
--- a/src/glsl/nir/nir_types.h
+++ b/src/glsl/nir/nir_types.h
@@ -53,6 +53,8 @@ const struct glsl_type *glsl_get_element_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);