diff options
author | Timothy Arceri <t_arceri@yahoo.com.au> | 2015-04-30 20:45:54 +1000 |
---|---|---|
committer | Timothy Arceri <t_arceri@yahoo.com.au> | 2015-05-22 08:35:45 +1000 |
commit | d67515b7be1ebd9482970ac1867ee4e9bbbf96d5 (patch) | |
tree | 6c89e134e067cbf9a56b7ef92b5734fbb4e3385c /src/glsl/glsl_types.h | |
parent | 51ccdb63467b1e848db025670f126eccb051f8f2 (diff) | |
download | external_mesa3d-d67515b7be1ebd9482970ac1867ee4e9bbbf96d5.zip external_mesa3d-d67515b7be1ebd9482970ac1867ee4e9bbbf96d5.tar.gz external_mesa3d-d67515b7be1ebd9482970ac1867ee4e9bbbf96d5.tar.bz2 |
glsl: remove element_type() helper
We now have is_array() and without_array() that make the
code much clearer and remove the need for this.
For all remaining calls to this we already knew that
the type was an array so returning a null wasn't adding any value.
v2: use without_array() in _mesa_ast_array_index_to_hir() and don't use
without_array() in lower_clip_distance_visitor() as we want to make sure the
array is 2D.
Reviewed-by: Matt Turner <mattst88@gmail.com>
Diffstat (limited to 'src/glsl/glsl_types.h')
-rw-r--r-- | src/glsl/glsl_types.h | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/src/glsl/glsl_types.h b/src/glsl/glsl_types.h index 5645dcd..f54a939 100644 --- a/src/glsl/glsl_types.h +++ b/src/glsl/glsl_types.h @@ -228,18 +228,6 @@ struct glsl_type { const glsl_type *get_scalar_type() const; /** - * Query the type of elements in an array - * - * \return - * Pointer to the type of elements in the array for array types, or \c NULL - * for non-array types. - */ - const glsl_type *element_type() const - { - return is_array() ? fields.array : NULL; - } - - /** * Get the instance of a built-in scalar, vector, or matrix type */ static const glsl_type *get_instance(unsigned base_type, unsigned rows, @@ -556,7 +544,7 @@ struct glsl_type { if (base_type == GLSL_TYPE_ATOMIC_UINT) return ATOMIC_COUNTER_SIZE; else if (is_array()) - return length * element_type()->atomic_size(); + return length * fields.array->atomic_size(); else return 0; } |