Mesa (master): glsl: Add support for OES_standard_derivatives in GLSL ES.

Kenneth Graunke kwg at kemper.freedesktop.org
Wed Aug 1 17:45:04 UTC 2012


Module: Mesa
Branch: master
Commit: d5c918f6adb2f7f72a759607c8f76e7616656c13
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=d5c918f6adb2f7f72a759607c8f76e7616656c13

Author: Tomeu Vizoso <tomeu at tomeuvizoso.net>
Date:   Mon Jul 16 20:45:17 2012 +0200

glsl: Add support for OES_standard_derivatives in GLSL ES.

Previously, we advertised the extension but the builtin functions
were enabled only for GLSL and not for ES.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=52003

Signed-off-by: Tomeu Vizoso <tomeu.vizoso at collabora.com>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

 .../profiles/OES_standard_derivatives.frag         |   20 ++++++++++++++++++++
 src/glsl/glsl_parser_extras.cpp                    |    1 +
 src/glsl/glsl_parser_extras.h                      |    2 ++
 3 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/src/glsl/builtins/profiles/OES_standard_derivatives.frag b/src/glsl/builtins/profiles/OES_standard_derivatives.frag
new file mode 100644
index 0000000..2c6ea07
--- /dev/null
+++ b/src/glsl/builtins/profiles/OES_standard_derivatives.frag
@@ -0,0 +1,20 @@
+#version 100
+#extension GL_OES_standard_derivatives : enable
+
+/*
+ * 8.8 - Fragment Processing Functions
+ */
+float dFdx(float p);
+vec2  dFdx(vec2  p);
+vec3  dFdx(vec3  p);
+vec4  dFdx(vec4  p);
+
+float dFdy(float p);
+vec2  dFdy(vec2  p);
+vec3  dFdy(vec3  p);
+vec4  dFdy(vec4  p);
+
+float fwidth(float p);
+vec2  fwidth(vec2  p);
+vec3  fwidth(vec3  p);
+vec4  fwidth(vec4  p);
diff --git a/src/glsl/glsl_parser_extras.cpp b/src/glsl/glsl_parser_extras.cpp
index 09e1e59..872fcda 100644
--- a/src/glsl/glsl_parser_extras.cpp
+++ b/src/glsl/glsl_parser_extras.cpp
@@ -288,6 +288,7 @@ static const _mesa_glsl_extension _mesa_glsl_supported_extensions[] = {
    EXT(OES_EGL_image_external,         true,  false, true,  false, true,      OES_EGL_image_external),
    EXT(ARB_shader_bit_encoding,        true,  true,  true,  true,  false,     ARB_shader_bit_encoding),
    EXT(ARB_uniform_buffer_object,      true,  false, true,  true,  false,     ARB_uniform_buffer_object),
+   EXT(OES_standard_derivatives,       false, false, true,  false,  true,     OES_standard_derivatives),
 };
 
 #undef EXT
diff --git a/src/glsl/glsl_parser_extras.h b/src/glsl/glsl_parser_extras.h
index c0a96c7..66463c5 100644
--- a/src/glsl/glsl_parser_extras.h
+++ b/src/glsl/glsl_parser_extras.h
@@ -203,6 +203,8 @@ struct _mesa_glsl_parse_state {
    bool ARB_shader_bit_encoding_warn;
    bool ARB_uniform_buffer_object_enable;
    bool ARB_uniform_buffer_object_warn;
+   bool OES_standard_derivatives_enable;
+   bool OES_standard_derivatives_warn;
    /*@}*/
 
    /** Extensions supported by the OpenGL implementation. */




More information about the mesa-commit mailing list