glsl: Enable dFdx, dFdy, and fwidth by default in GLSL ES 3.00.
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 7 Nov 2013 22:39:23 +0000 (14:39 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 7 Nov 2013 23:52:02 +0000 (15:52 -0800)
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.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/glsl/builtin_functions.cpp

index 3fa0cb5ad4c17fe49e1c37c5df05979478d0488a..8cb75e5ad6eaa3391c35d948a33996e17d95ec8f 100644 (file)
@@ -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