aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYevhenii Kolesnikov <[email protected]>2020-05-20 19:16:28 +0300
committerMarge Bot <[email protected]>2020-05-24 23:55:44 +0000
commitc7943343a0fc2463987f667658a257b74cec1782 (patch)
tree502d0d51aec5d3c6623cdbd97a9181173d18914d /src
parent5bc18b79a4625ae39f1d44e8139017834a53736c (diff)
glsl: subroutine signatures must match exactly
From GLSL 4.60.7 spec, section 6.1.2 "Subroutines": It is a compile-time error if arguments and return type don’t match between the function and each associated subroutine type. Before, if subroutine type and implementation function were declared with types, that could be implicitly converted, it led to a runtime crash. Signed-off-by: Yevhenii Kolesnikov <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5125>
Diffstat (limited to 'src')
-rw-r--r--src/compiler/glsl/ir_function.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/compiler/glsl/ir_function.cpp b/src/compiler/glsl/ir_function.cpp
index 97262f0f4b9..a38e5285292 100644
--- a/src/compiler/glsl/ir_function.cpp
+++ b/src/compiler/glsl/ir_function.cpp
@@ -329,6 +329,9 @@ ir_function::matching_signature(_mesa_glsl_parse_state *state,
free(inexact_matches);
return sig;
case PARAMETER_LIST_INEXACT_MATCH:
+ /* Subroutine signatures must match exactly */
+ if (this->is_subroutine)
+ continue;
inexact_matches_temp = (ir_function_signature **)
realloc(inexact_matches,
sizeof(*inexact_matches) *