nir: add C wrapper around glsl_type::record_location_offset
authorEmil Velikov <emil.l.velikov@gmail.com>
Thu, 17 Sep 2015 14:57:26 +0000 (15:57 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Mon, 21 Sep 2015 16:01:56 +0000 (17:01 +0100)
This will allow us to convert nir_lower_sampler.cpp to C.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Gottfried Haider <gottfried.haider@gmail.com>
Reviewed-by: Timothy Arceri <t_arceri@yahoo.com.au>
src/glsl/nir/nir_types.cpp
src/glsl/nir/nir_types.h

index 940c676005aa06fee6a1b7e1c2802961ebf95fcc..da9807f0e629b167af6ebae07c35b3a291b879fe 100644 (file)
@@ -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)
 {
index bf2faf496c4d6b89fac4764cef85e08370d6b530..49d6a65e7c4c64ddfd3e1793229365652d972291 100644 (file)
@@ -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);