nir/types: Add a utility wrapper to glsl_type::sampler_index()

I think it is more accurate to call it a sampler target (?).

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
This commit is contained in:
Eduardo Lima Mitev
2017-10-26 11:05:30 +02:00
committed by Alejandro Piñeiro
parent f1ab16cf17
commit 3d6664763d
2 changed files with 8 additions and 0 deletions
+7
View File
@@ -150,6 +150,13 @@ glsl_get_sampler_result_type(const struct glsl_type *type)
return (glsl_base_type)type->sampled_type;
}
unsigned
glsl_get_sampler_target(const struct glsl_type *type)
{
assert(glsl_type_is_sampler(type));
return type->sampler_index();
}
unsigned
glsl_get_record_location_offset(const struct glsl_type *type,
unsigned length)
+1
View File
@@ -80,6 +80,7 @@ const char *glsl_get_struct_elem_name(const struct glsl_type *type,
enum glsl_sampler_dim glsl_get_sampler_dim(const struct glsl_type *type);
enum glsl_base_type glsl_get_sampler_result_type(const struct glsl_type *type);
unsigned glsl_get_sampler_target(const struct glsl_type *type);
unsigned glsl_get_record_location_offset(const struct glsl_type *type,
unsigned length);