[Mesa-dev] [PATCH v2 08/10] glsl: A shader cannot redefine or overload built-in functions in GLSL ES 3.00

Kenneth Graunke kenneth at whitecape.org
Thu Feb 19 00:59:56 PST 2015


On Thursday, February 19, 2015 09:55:35 AM Samuel Iglesias Gonsalvez wrote:
> Create a new search function to look for matching built-in functions by name
> and use it for built-in function redefinition or overload in GLSL ES 3.00.
> 
> GLSL ES 3.0 spec, chapter 6.1 "Function Definitions", page 71
> 
>   "A shader cannot redefine or overload built-in functions."
> 
> While in GLSL ES 1.0 specification, chapter 8 "Built-in Functions"
> 
>   "User code can overload the built-in functions but cannot redefine them."
> 
> So this check is specific to GLSL ES 3.00.
> 
> This patch fixes the following dEQP tests:
> 
> dEQP-GLES3.functional.shaders.functions.invalid.overload_builtin_function_vertex
> dEQP-GLES3.functional.shaders.functions.invalid.overload_builtin_function_fragment
> dEQP-GLES3.functional.shaders.functions.invalid.redefine_builtin_function_vertex
> dEQP-GLES3.functional.shaders.functions.invalid.redefine_builtin_function_fragment
> 
> No piglit regressions.
> 
> Signed-off-by: Samuel Iglesias Gonsalvez <siglesias at igalia.com>
> ---
>  src/glsl/ast_to_hir.cpp        | 21 +++++++++++++++++++++
>  src/glsl/builtin_functions.cpp | 11 +++++++++++
>  src/glsl/ir.h                  |  4 ++++
>  3 files changed, 36 insertions(+)

This looks great - thanks!

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150219/95172394/attachment.sig>


More information about the mesa-dev mailing list