diff options
author | Dave Airlie <airlied@gmail.com> | 2015-02-05 11:38:44 +0200 |
---|---|---|
committer | Ilia Mirkin <imirkin@alum.mit.edu> | 2015-02-19 00:28:33 -0500 |
commit | 3af8db94cd315314ae8db096ba67f6655a005c23 (patch) | |
tree | a3e68c5278ed095fbc99edbbc44d0ea19468d19c /src/glsl/glsl_types.h | |
parent | 277f4d75a74b7b3e3af295e102be8bb5343d85dc (diff) | |
download | external_mesa3d-3af8db94cd315314ae8db096ba67f6655a005c23.zip external_mesa3d-3af8db94cd315314ae8db096ba67f6655a005c23.tar.gz external_mesa3d-3af8db94cd315314ae8db096ba67f6655a005c23.tar.bz2 |
glsl: Add double builtin type generation
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Diffstat (limited to 'src/glsl/glsl_types.h')
-rw-r--r-- | src/glsl/glsl_types.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/glsl/glsl_types.h b/src/glsl/glsl_types.h index f472db0..5dc7e45 100644 --- a/src/glsl/glsl_types.h +++ b/src/glsl/glsl_types.h @@ -200,6 +200,7 @@ struct glsl_type { * @{ */ static const glsl_type *vec(unsigned components); + static const glsl_type *dvec(unsigned components); static const glsl_type *ivec(unsigned components); static const glsl_type *uvec(unsigned components); static const glsl_type *bvec(unsigned components); @@ -388,7 +389,7 @@ struct glsl_type { bool is_matrix() const { /* GLSL only has float matrices. */ - return (matrix_columns > 1) && (base_type == GLSL_TYPE_FLOAT); + return (matrix_columns > 1) && (base_type == GLSL_TYPE_FLOAT || base_type == GLSL_TYPE_DOUBLE); } /** @@ -396,7 +397,7 @@ struct glsl_type { */ bool is_numeric() const { - return (base_type >= GLSL_TYPE_UINT) && (base_type <= GLSL_TYPE_FLOAT); + return (base_type >= GLSL_TYPE_UINT) && (base_type <= GLSL_TYPE_DOUBLE); } /** @@ -414,6 +415,12 @@ struct glsl_type { bool contains_integer() const; /** + * Query whether or not type is a double type, or for struct and array + * types, contains a double type. + */ + bool contains_double() const; + + /** * Query whether or not a type is a float type */ bool is_float() const |