summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/ast_to_hir.cpp
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2017-09-20 16:19:15 -0500
committerIan Romanick <[email protected]>2017-10-30 09:27:09 -0700
commit34f7e761bc61d3086c1e4e42285c31678b256107 (patch)
tree6b89692f3cb93611ffb5a484ac903d74bb5bba15 /src/compiler/glsl/ast_to_hir.cpp
parent747c057530a1da32860f3881ca73a0d648e8f317 (diff)
glsl/parser: Track built-in types using the glsl_type directly
Without the lexer changes, tests/glslparsertest/glsl2/tex_rect-02.frag fails. Before this change, the parser would determine that sampler2DRect is not a valid type because the call to state->symbols->get_type() in ast_type_specifier::glsl_type() would return NULL. Since ast_type_specifier::glsl_type() is now going to return the glsl_type pointer that it received from the lexer, it doesn't have an opportunity to generate an error. text data bss dec hex filename 8255243 268856 294072 8818171 868dfb 32-bit i965_dri.so before 8255291 268856 294072 8818219 868e2b 32-bit i965_dri.so after 7815195 345592 420592 8581379 82f103 64-bit i965_dri.so before 7815339 345592 420592 8581523 82f193 64-bit i965_dri.so after Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/compiler/glsl/ast_to_hir.cpp')
-rw-r--r--src/compiler/glsl/ast_to_hir.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp
index d7c8b47f9d4..6090ee92573 100644
--- a/src/compiler/glsl/ast_to_hir.cpp
+++ b/src/compiler/glsl/ast_to_hir.cpp
@@ -2361,7 +2361,9 @@ ast_type_specifier::glsl_type(const char **name,
{
const struct glsl_type *type;
- if (structure)
+ if (this->type != NULL)
+ type = this->type;
+ else if (structure)
type = structure->type;
else
type = state->symbols->get_type(this->type_name);