diff options
Diffstat (limited to 'src/glsl/glsl_types.h')
-rw-r--r-- | src/glsl/glsl_types.h | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/src/glsl/glsl_types.h b/src/glsl/glsl_types.h index dccab0a60d..57e7b09d98 100644 --- a/src/glsl/glsl_types.h +++ b/src/glsl/glsl_types.h @@ -43,16 +43,17 @@ _mesa_glsl_initialize_types(struct _mesa_glsl_parse_state *state); extern "C" void _mesa_glsl_release_types(void); -#define GLSL_TYPE_UINT 0 -#define GLSL_TYPE_INT 1 -#define GLSL_TYPE_FLOAT 2 -#define GLSL_TYPE_BOOL 3 -#define GLSL_TYPE_SAMPLER 4 -#define GLSL_TYPE_STRUCT 5 -#define GLSL_TYPE_ARRAY 6 -#define GLSL_TYPE_FUNCTION 7 -#define GLSL_TYPE_VOID 8 -#define GLSL_TYPE_ERROR 9 +enum glsl_base_type { + GLSL_TYPE_UINT = 0, + GLSL_TYPE_INT, + GLSL_TYPE_FLOAT, + GLSL_TYPE_BOOL, + GLSL_TYPE_SAMPLER, + GLSL_TYPE_STRUCT, + GLSL_TYPE_ARRAY, + GLSL_TYPE_VOID, + GLSL_TYPE_ERROR +}; enum glsl_sampler_dim { GLSL_SAMPLER_DIM_1D = 0, @@ -66,7 +67,7 @@ enum glsl_sampler_dim { struct glsl_type { GLenum gl_type; - unsigned base_type:4; + glsl_base_type base_type; unsigned sampler_dimensionality:3; unsigned sampler_shadow:1; @@ -123,11 +124,6 @@ struct glsl_type { * For \c GLSL_TYPE_ARRAY, this is the length of the array. For * \c GLSL_TYPE_STRUCT, it is the number of elements in the structure and * the number of values pointed to by \c fields.structure (below). - * - * For \c GLSL_TYPE_FUNCTION, it is the number of parameters to the - * function. The return value from a function is implicitly the first - * parameter. The types of the parameters are stored in - * \c fields.parameters (below). */ unsigned length; @@ -146,6 +142,7 @@ struct glsl_type { */ /*@{*/ static const glsl_type *const error_type; + static const glsl_type *const void_type; static const glsl_type *const int_type; static const glsl_type *const ivec4_type; static const glsl_type *const uint_type; @@ -399,7 +396,7 @@ private: /** Constructor for vector and matrix types */ glsl_type(GLenum gl_type, - unsigned base_type, unsigned vector_elements, + glsl_base_type base_type, unsigned vector_elements, unsigned matrix_columns, const char *name); /** Constructor for sampler types */ @@ -428,7 +425,7 @@ private: */ /*@{*/ static const glsl_type _error_type; - static const glsl_type void_type; + static const glsl_type _void_type; static const glsl_type builtin_core_types[]; static const glsl_type builtin_structure_types[]; static const glsl_type builtin_110_deprecated_structure_types[]; |