summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/ast_to_hir.cpp
diff options
context:
space:
mode:
authorIlia Mirkin <[email protected]>2017-07-03 17:08:12 -0400
committerIlia Mirkin <[email protected]>2017-07-05 20:05:53 -0400
commit880f21f55d579fe2183255d031c23343da30f69e (patch)
tree90bed3cbfae5903ce36f47973f9d1383094ae6e2 /src/compiler/glsl/ast_to_hir.cpp
parentab1939aea8ff10d2e8b7d579575068ec11f60030 (diff)
glsl: check if any of the named builtins are available first
_mesa_glsl_has_builtin_function is used to determine whether any variant of a builtin are available, for the purpose of enforcing the GLSL ES 3.00+ rule that overloads or overrides of builtins are disallowed. However the builtin_builder contains information on all builtins, irrespective of parse state, or versions, or extension enablement. As a result we would say that a builtin existed even if it was not actually available. To resolve this, first check if at least one signature is available for a builtin before returning true. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101666 Signed-off-by: Ilia Mirkin <[email protected]> Cc: [email protected] Reviewed-by: Timothy Arceri <[email protected]> Acked-by: Lionel Landwerlin <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/compiler/glsl/ast_to_hir.cpp')
-rw-r--r--src/compiler/glsl/ast_to_hir.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp
index b1e490eefd9..c338ad79ca3 100644
--- a/src/compiler/glsl/ast_to_hir.cpp
+++ b/src/compiler/glsl/ast_to_hir.cpp
@@ -5916,7 +5916,7 @@ ast_function::hir(exec_list *instructions,
/* Local shader has no exact candidates; check the built-ins. */
_mesa_glsl_initialize_builtin_functions();
if (state->language_version >= 300 &&
- _mesa_glsl_has_builtin_function(name)) {
+ _mesa_glsl_has_builtin_function(state, name)) {
YYLTYPE loc = this->get_location();
_mesa_glsl_error(& loc, state,
"A shader cannot redefine or overload built-in "