summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/glsl_parser.yy
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2017-03-01 22:09:28 +0100
committerSamuel Pitoiset <[email protected]>2017-03-03 00:57:57 +0100
commit9fc86d4f53a66a147f38f54b09629372bd085658 (patch)
tree161bdce5cb4f2a0f7da987246db6f4a0638ffdfc /src/compiler/glsl/glsl_parser.yy
parent10f2c86aa3c318172a3e5cc308a1b83e0dd27e93 (diff)
glsl: fix subroutine mismatch between declarations/definitions
Previously, when q.subroutine was set to 1, a new subroutine declaration was added to the AST, while 0 meant a subroutine definition has been detected by the parser. Thus, setting the q.subroutine flag in both situations is obviously wrong because a new type identifier is added instead of trying to match the declaration. To fix it up, introduce ast_type_qualifier::is_subroutine_decl() to differentiate declarations and definitions easily. This fixes a regression with: arb_shader_subroutine/compiler/direct-call.vert Cc: Mark Janes <[email protected]> Fixes: be8aa76afd ("glsl: remove unecessary flags.q.subroutine_def") Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100026 Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/compiler/glsl/glsl_parser.yy')
-rw-r--r--src/compiler/glsl/glsl_parser.yy2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/glsl/glsl_parser.yy b/src/compiler/glsl/glsl_parser.yy
index 59453d72f64..e703073c9ca 100644
--- a/src/compiler/glsl/glsl_parser.yy
+++ b/src/compiler/glsl/glsl_parser.yy
@@ -900,7 +900,7 @@ function_header:
$$->return_type = $1;
$$->identifier = $2;
- if ($1->qualifier.flags.q.subroutine) {
+ if ($1->qualifier.is_subroutine_decl()) {
/* add type for IDENTIFIER search */
state->symbols->add_type($2, glsl_type::get_subroutine_instance($2));
} else