diff options
author | Eduardo Lima Mitev <[email protected]> | 2017-10-26 11:05:30 +0200 |
---|---|---|
committer | Alejandro PiƱeiro <[email protected]> | 2018-06-21 14:25:05 +0200 |
commit | 3d6664763dbbaea12ed0c485863adfffd912df68 (patch) | |
tree | 9658f5a6a5a46a06b7ebbef5bed47625a9f3e026 /src/compiler | |
parent | f1ab16cf179b605882c927a5be2f01daca703a47 (diff) |
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 <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/nir_types.cpp | 7 | ||||
-rw-r--r-- | src/compiler/nir_types.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/compiler/nir_types.cpp b/src/compiler/nir_types.cpp index 51ca797497e..d2b2a93b207 100644 --- a/src/compiler/nir_types.cpp +++ b/src/compiler/nir_types.cpp @@ -151,6 +151,13 @@ glsl_get_sampler_result_type(const struct glsl_type *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) { diff --git a/src/compiler/nir_types.h b/src/compiler/nir_types.h index 9c81980042f..1107cfd73f2 100644 --- a/src/compiler/nir_types.h +++ b/src/compiler/nir_types.h @@ -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); |