Mesa (master): mesa: Add support for querying GL_FRAGMENT_SHADER_DISCARDS_SAMPLES_EXT.

Francisco Jerez currojerez at kemper.freedesktop.org
Wed Aug 24 20:31:43 UTC 2016


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

Author: Francisco Jerez <currojerez at riseup.net>
Date:   Tue Jul  5 21:28:11 2016 -0700

mesa: Add support for querying GL_FRAGMENT_SHADER_DISCARDS_SAMPLES_EXT.

This can currently only give true as result since the only way you can
expose EXT_shader_framebuffer_fetch right now is by flipping the
MESA_shader_framebuffer_fetch bit, but that could potentially change
in the future, see [1] for an explanation.

[1] https://lists.freedesktop.org/archives/mesa-dev/2016-July/124028.html

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/mesa/main/get.c              | 7 +++++++
 src/mesa/main/get_hash_params.py | 4 ++++
 src/mesa/main/glheader.h         | 3 +++
 3 files changed, 14 insertions(+)

diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 8cb0cc7..b017827 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -530,6 +530,13 @@ static const int extra_core_ARB_color_buffer_float_and_new_buffers[] = {
    EXTRA_END
 };
 
+static const int extra_EXT_shader_framebuffer_fetch[] = {
+   EXTRA_API_ES2,
+   EXTRA_API_ES3,
+   EXT(MESA_shader_framebuffer_fetch),
+   EXTRA_END
+};
+
 /* This is the big table describing all the enums we accept in
  * glGet*v().  The table is partitioned into six parts: enums
  * understood by all GL APIs (OpenGL, GLES and GLES2), enums shared
diff --git a/src/mesa/main/get_hash_params.py b/src/mesa/main/get_hash_params.py
index cd8e47f..89d164d 100644
--- a/src/mesa/main/get_hash_params.py
+++ b/src/mesa/main/get_hash_params.py
@@ -424,6 +424,10 @@ descriptor=[
 ]},
 
 { "apis": ["GLES", "GLES2"], "params": [
+# GL_EXT_shader_framebuffer_fetch.  Should be true if the MESA framebuffer
+# fetch extension is supported since the latter imposes no restrictions on
+# non-uniform per-sample discard.
+  [ "FRAGMENT_SHADER_DISCARDS_SAMPLES_EXT", "CONTEXT_BOOL(Extensions.MESA_shader_framebuffer_fetch), extra_EXT_shader_framebuffer_fetch" ],
 # GL_OES_EGL_image_external
   [ "TEXTURE_BINDING_EXTERNAL_OES", "LOC_CUSTOM, TYPE_INT, TEXTURE_EXTERNAL_INDEX, extra_OES_EGL_image_external" ],
   [ "TEXTURE_EXTERNAL_OES", "LOC_CUSTOM, TYPE_BOOLEAN, 0, extra_OES_EGL_image_external" ],
diff --git a/src/mesa/main/glheader.h b/src/mesa/main/glheader.h
index 40fada1..3f2a923 100644
--- a/src/mesa/main/glheader.h
+++ b/src/mesa/main/glheader.h
@@ -140,6 +140,9 @@ typedef void *GLeglImageOES;
 #define GL_ETC1_RGB8_OES                                        0x8D64
 #endif
 
+#ifndef GL_EXT_shader_framebuffer_fetch
+#define GL_FRAGMENT_SHADER_DISCARDS_SAMPLES_EXT                 0x8A52
+#endif
 
 /* Inexplicably, GL_HALF_FLOAT_OES has a different value than GL_HALF_FLOAT.
  */




More information about the mesa-commit mailing list