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

Timothy Arceri tarceri at itsqueeze.com
Wed May 16 07:04:28 UTC 2018


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



More information about the mesa-dev mailing list