summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2018-08-16 10:22:32 -0500
committerJason Ekstrand <[email protected]>2018-08-29 14:04:02 -0500
commitb217705dec60ef8335e4ff304605f26e9038b632 (patch)
treef0fde665d8b05a91a773296b38deb22521b774a0
parentf2d0a2b1100537348d25e445871a66fa90d16131 (diff)
nir/types: Add a wrapper for coordinate_components
Reviewed-by: Kenneth Graunke <[email protected]>
-rw-r--r--src/compiler/nir_types.cpp7
-rw-r--r--src/compiler/nir_types.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/src/compiler/nir_types.cpp b/src/compiler/nir_types.cpp
index 1fae6aa8180..d24f0941519 100644
--- a/src/compiler/nir_types.cpp
+++ b/src/compiler/nir_types.cpp
@@ -172,6 +172,13 @@ glsl_get_sampler_target(const struct glsl_type *type)
return type->sampler_index();
}
+int
+glsl_get_sampler_coordinate_components(const struct glsl_type *type)
+{
+ assert(glsl_type_is_sampler(type) || glsl_type_is_image(type));
+ return type->coordinate_components();
+}
+
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 ea0438541af..77454fa9fab 100644
--- a/src/compiler/nir_types.h
+++ b/src/compiler/nir_types.h
@@ -84,6 +84,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);
+int glsl_get_sampler_coordinate_components(const struct glsl_type *type);
unsigned glsl_get_record_location_offset(const struct glsl_type *type,
unsigned length);