diff options
author | Francisco Jerez <currojerez@riseup.net> | 2013-10-20 12:35:47 -0700 |
---|---|---|
committer | Francisco Jerez <currojerez@riseup.net> | 2013-10-29 12:40:55 -0700 |
commit | 26db3b933f7fbc81d6c2bead2a8b0479a3691424 (patch) | |
tree | 217193e3025d3946565e809793508ad797497279 /src/glsl/glsl_types.h | |
parent | 0bed1ab73bc8a673b4d7d590d9d39b76fd8bf797 (diff) | |
download | external_mesa3d-26db3b933f7fbc81d6c2bead2a8b0479a3691424.zip external_mesa3d-26db3b933f7fbc81d6c2bead2a8b0479a3691424.tar.gz external_mesa3d-26db3b933f7fbc81d6c2bead2a8b0479a3691424.tar.bz2 |
glsl: Add new atomic_uint built-in GLSL type.
v2: Fix GLSL version in which the type became available. Add
contains_atomic() convenience method. Split off atomic counter
comparison error checking to a separate patch that will handle all
opaque types. Include new ir_variable fields for atomic types.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Diffstat (limited to 'src/glsl/glsl_types.h')
-rw-r--r-- | src/glsl/glsl_types.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/glsl/glsl_types.h b/src/glsl/glsl_types.h index b105007..69ad4b8 100644 --- a/src/glsl/glsl_types.h +++ b/src/glsl/glsl_types.h @@ -53,6 +53,7 @@ enum glsl_base_type { GLSL_TYPE_FLOAT, GLSL_TYPE_BOOL, GLSL_TYPE_SAMPLER, + GLSL_TYPE_ATOMIC_UINT, GLSL_TYPE_STRUCT, GLSL_TYPE_INTERFACE, GLSL_TYPE_ARRAY, @@ -441,6 +442,27 @@ struct glsl_type { } /** + * Return the amount of atomic counter storage required for a type. + */ + unsigned atomic_size() const + { + if (base_type == GLSL_TYPE_ATOMIC_UINT) + return ATOMIC_COUNTER_SIZE; + else if (is_array()) + return length * element_type()->atomic_size(); + else + return 0; + } + + /** + * Return whether a type contains any atomic counters. + */ + bool contains_atomic() const + { + return atomic_size(); + } + + /** * Query the full type of a matrix row * * \return |