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_to_hir.cpp | |
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_to_hir.cpp')
-rw-r--r-- | src/glsl/ast_to_hir.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp index 6210eb12de9..f4dfc4ce34c 100644 --- a/src/glsl/ast_to_hir.cpp +++ b/src/glsl/ast_to_hir.cpp @@ -3904,8 +3904,8 @@ ast_type_specifier::hir(exec_list *instructions, "arrays"); return NULL; } - if (this->type_specifier != ast_float - && this->type_specifier != ast_int) { + if (strcmp(this->type_name, "float") != 0 && + strcmp(this->type_name, "int") != 0) { _mesa_glsl_error(&loc, state, "default precision statements apply only to types " "float and int"); |