[Mesa-dev] [PATCH] glsl: Enable dFdx, dFdy, and fwidth by default in GLSL ES 3.00.

Matt Turner mattst88 at gmail.com
Thu Nov 7 15:18:38 PST 2013


On Thu, Nov 7, 2013 at 2:39 PM, Kenneth Graunke <kenneth at whitecape.org> wrote:
> Previously, we only exposed them in desktop GL or with:
>
>    #extension GL_OES_standard_derivatives : enable
>
> GLSL ES 3.00 includes these without an extension, so we need to expose
> them by default.
>
> Note that the above #extension line results in an error or desktop GL,
> so we don't need to worry about this.
>
> Cc: Aras Pranckevičius <aras at unity3d.com>
> Cc: mesa-stable at lists.freedesktop.org
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> ---
>  src/glsl/builtin_functions.cpp | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/glsl/builtin_functions.cpp b/src/glsl/builtin_functions.cpp
> index 3fa0cb5..8cb75e5 100644
> --- a/src/glsl/builtin_functions.cpp
> +++ b/src/glsl/builtin_functions.cpp
> @@ -293,7 +293,8 @@ static bool
>  fs_oes_derivatives(const _mesa_glsl_parse_state *state)
>  {
>     return state->target == fragment_shader &&
> -          (!state->es_shader || state->OES_standard_derivatives_enable);
> +          (state->is_version(110, 300) ||
> +           state->OES_standard_derivatives_enable);
>  }
>
>  static bool
> --
> 1.8.3.2
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reviewed-by: Matt Turner <mattst88 at gmail.com>


More information about the mesa-dev mailing list