diff options
author | Eric Anholt <[email protected]> | 2012-03-29 23:17:32 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2012-04-09 14:30:46 -0700 |
commit | eb7a71dea78152142b456f29e4881c4d3aeb56b6 (patch) | |
tree | bb14cc5f6d794bebf98c7a7cd4eff53cc7a85acf /src/glsl/ast.h | |
parent | b2c0df2b60a77b043d461f265c85d8b5b066a008 (diff) |
glsl: Drop the round-trip through ast_type_specifier for many builtin types.
We have lexer recognition of a bunch of our types based on the
handling. This code was mapping those recognized tokens to an enum
and then to a string of their name. Just drop the enums and provide
the string directly in the parser.
Reviewed-by: Ian Romanick <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/glsl/ast.h')
-rw-r--r-- | src/glsl/ast.h | 66 |
1 files changed, 2 insertions, 64 deletions
diff --git a/src/glsl/ast.h b/src/glsl/ast.h index 9c0cff87527..9b1e0b19209 100644 --- a/src/glsl/ast.h +++ b/src/glsl/ast.h @@ -418,72 +418,12 @@ public: }; -enum ast_types { - ast_void, - ast_float, - ast_int, - ast_uint, - ast_bool, - ast_vec2, - ast_vec3, - ast_vec4, - ast_bvec2, - ast_bvec3, - ast_bvec4, - ast_ivec2, - ast_ivec3, - ast_ivec4, - ast_uvec2, - ast_uvec3, - ast_uvec4, - ast_mat2, - ast_mat2x3, - ast_mat2x4, - ast_mat3x2, - ast_mat3, - ast_mat3x4, - ast_mat4x2, - ast_mat4x3, - ast_mat4, - ast_sampler1d, - ast_sampler2d, - ast_sampler2drect, - ast_sampler3d, - ast_samplercube, - ast_samplerexternaloes, - ast_sampler1dshadow, - ast_sampler2dshadow, - ast_sampler2drectshadow, - ast_samplercubeshadow, - ast_sampler1darray, - ast_sampler2darray, - ast_sampler1darrayshadow, - ast_sampler2darrayshadow, - ast_isampler1d, - ast_isampler2d, - ast_isampler3d, - ast_isamplercube, - ast_isampler1darray, - ast_isampler2darray, - ast_usampler1d, - ast_usampler2d, - ast_usampler3d, - ast_usamplercube, - ast_usampler1darray, - ast_usampler2darray, - - ast_struct, - ast_type_name -}; - class ast_type_specifier : public ast_node { public: - ast_type_specifier(int specifier); - /** Construct a type specifier from a type name */ ast_type_specifier(const char *name) - : type_specifier(ast_type_name), type_name(name), structure(NULL), + : type_name(name), structure(NULL), is_array(false), array_size(NULL), precision(ast_precision_none), is_precision_statement(false) { @@ -492,7 +432,7 @@ public: /** Construct a type specifier from a structure definition */ ast_type_specifier(ast_struct_specifier *s) - : type_specifier(ast_struct), type_name(s->name), structure(s), + : type_name(s->name), structure(s), is_array(false), array_size(NULL), precision(ast_precision_none), is_precision_statement(false) { @@ -507,8 +447,6 @@ public: ir_rvalue *hir(exec_list *, struct _mesa_glsl_parse_state *); - enum ast_types type_specifier; - const char *type_name; ast_struct_specifier *structure; |