summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeil Roberts <[email protected]>2017-11-28 13:38:32 +0100
committerAlejandro PiƱeiro <[email protected]>2018-07-03 12:41:46 +0200
commit1fb9984d7e6d93fb174ff1fb57d2b3b8eda45515 (patch)
tree67a243866aea6da9ec79e3a07d8e2622db03bb01
parent54d7fca077d051af0b91f0684cdfa0055915b917 (diff)
nir/types: Add wrappers for a couple of atomic counter methods
Reviewed-by: Timothy Arceri <[email protected]>
-rw-r--r--src/compiler/nir_types.cpp12
-rw-r--r--src/compiler/nir_types.h3
2 files changed, 15 insertions, 0 deletions
diff --git a/src/compiler/nir_types.cpp b/src/compiler/nir_types.cpp
index 973881fc41c..6f1182b742c 100644
--- a/src/compiler/nir_types.cpp
+++ b/src/compiler/nir_types.cpp
@@ -539,3 +539,15 @@ glsl_atomic_uint_type(void)
{
return glsl_type::atomic_uint_type;
}
+
+unsigned
+glsl_atomic_size(const struct glsl_type *type)
+{
+ return type->atomic_size();
+}
+
+bool
+glsl_contains_atomic(const struct glsl_type *type)
+{
+ return type->contains_atomic();
+}
diff --git a/src/compiler/nir_types.h b/src/compiler/nir_types.h
index d0fd99706b3..c128250c7d3 100644
--- a/src/compiler/nir_types.h
+++ b/src/compiler/nir_types.h
@@ -85,6 +85,8 @@ unsigned glsl_get_sampler_target(const struct glsl_type *type);
unsigned glsl_get_record_location_offset(const struct glsl_type *type,
unsigned length);
+unsigned glsl_atomic_size(const struct glsl_type *type);
+
static inline unsigned
glsl_get_bit_size(const struct glsl_type *type)
{
@@ -136,6 +138,7 @@ bool glsl_type_is_numeric(const struct glsl_type *type);
bool glsl_type_is_boolean(const struct glsl_type *type);
bool glsl_sampler_type_is_shadow(const struct glsl_type *type);
bool glsl_sampler_type_is_array(const struct glsl_type *type);
+bool glsl_contains_atomic(const struct glsl_type *type);
const struct glsl_type *glsl_void_type(void);
const struct glsl_type *glsl_float_type(void);