[Mesa-dev] [PATCH 1/2] glsl: always enable OES_standard_derivatives features if supported

Ilia Mirkin imirkin at alum.mit.edu
Wed May 16 11:12:39 UTC 2018


>From the spec,

"""
    The built-in derivative functions dFdx, dFdy, and fwidth are optional, and
    must be enabled by

    #extension GL_OES_standard_derivatives : enable

    before being used.
"""

Sounds like you need an application override?

On Wed, May 16, 2018 at 3:04 AM, Timothy Arceri <tarceri at itsqueeze.com> wrote:
> The GLSL ES 1.0 spec made these features optional. With
> OES_standard_derivatives they are guaranteed to be available
> but currently the extension must be enabled to use them.
>
> Instead this changes the code to check if the driver supports
> the extension and if so always enables them.
>
> This fixes compiler errors in Google Earth VR.
> ---
>  src/compiler/glsl/builtin_functions.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/compiler/glsl/builtin_functions.cpp b/src/compiler/glsl/builtin_functions.cpp
> index e1ee9943172..1ecbdc98404 100644
> --- a/src/compiler/glsl/builtin_functions.cpp
> +++ b/src/compiler/glsl/builtin_functions.cpp
> @@ -446,7 +446,7 @@ fs_oes_derivatives(const _mesa_glsl_parse_state *state)
>  {
>     return state->stage == MESA_SHADER_FRAGMENT &&
>            (state->is_version(110, 300) ||
> -           state->OES_standard_derivatives_enable);
> +           state->extensions->OES_standard_derivatives);
>  }
>
>  static bool
> --
> 2.17.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list