mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 22:49:13 +02:00
glsl: Restrict func redeclarations (not just redefinitions) on GLSL 1.00.
Fixes DEQP's scoping.invalid.redeclare_function_fragment/vertex. v2: Fix accidental rejection of prototype+decl. Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> (v1) Tested-by: Matt Turner <mattst88@gmail.com>
This commit is contained in:
parent
e5ade7db73
commit
79da0ed2fc
1 changed files with 10 additions and 0 deletions
|
|
@ -5933,6 +5933,16 @@ ast_function::hir(exec_list *instructions,
|
|||
*/
|
||||
return NULL;
|
||||
}
|
||||
} else if (state->language_version == 100 && !is_definition) {
|
||||
/* From the GLSL 1.00 spec, section 4.2.7:
|
||||
*
|
||||
* "A particular variable, structure or function declaration
|
||||
* may occur at most once within a scope with the exception
|
||||
* that a single function prototype plus the corresponding
|
||||
* function definition are allowed."
|
||||
*/
|
||||
YYLTYPE loc = this->get_location();
|
||||
_mesa_glsl_error(&loc, state, "function `%s' redeclared", name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue