Mesa (master): nir: add C wrapper around glsl_type::record_location_offset

Emil Velikov evelikov at kemper.freedesktop.org
Mon Sep 21 16:00:46 UTC 2015


Module: Mesa
Branch: master
Commit: d130cda4531602185dcf7cafe217c9b7abdba954
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=d130cda4531602185dcf7cafe217c9b7abdba954

Author: Emil Velikov <emil.l.velikov at gmail.com>
Date:   Thu Sep 17 15:57:26 2015 +0100

nir: add C wrapper around glsl_type::record_location_offset

This will allow us to convert nir_lower_sampler.cpp to C.

Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
Tested-by: Gottfried Haider <gottfried.haider at gmail.com>
Reviewed-by: Timothy Arceri <t_arceri at yahoo.com.au>

---

 src/glsl/nir/nir_types.cpp |    7 +++++++
 src/glsl/nir/nir_types.h   |    2 ++
 2 files changed, 9 insertions(+)

diff --git a/src/glsl/nir/nir_types.cpp b/src/glsl/nir/nir_types.cpp
index 940c676..da9807f 100644
--- a/src/glsl/nir/nir_types.cpp
+++ b/src/glsl/nir/nir_types.cpp
@@ -112,6 +112,13 @@ glsl_get_struct_elem_name(const struct glsl_type *type, unsigned index)
    return type->fields.structure[index].name;
 }
 
+unsigned
+glsl_get_record_location_offset(const struct glsl_type *type,
+                                unsigned length)
+{
+   return type->record_location_offset(length);
+}
+
 bool
 glsl_type_is_void(const glsl_type *type)
 {
diff --git a/src/glsl/nir/nir_types.h b/src/glsl/nir/nir_types.h
index bf2faf4..49d6a65 100644
--- a/src/glsl/nir/nir_types.h
+++ b/src/glsl/nir/nir_types.h
@@ -62,6 +62,8 @@ unsigned glsl_get_length(const struct glsl_type *type);
 const char *glsl_get_struct_elem_name(const struct glsl_type *type,
                                       unsigned index);
 
+unsigned glsl_get_record_location_offset(const struct glsl_type *type,
+                                         unsigned length);
 
 bool glsl_type_is_void(const struct glsl_type *type);
 bool glsl_type_is_vector(const struct glsl_type *type);




More information about the mesa-commit mailing list