Mesa (master): mesa/main: fix validation of GL_TIME_ELAPSED

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Nov 23 09:48:59 UTC 2018


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

Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date:   Wed Nov  7 13:37:11 2018 +0100

mesa/main: fix validation of GL_TIME_ELAPSED

ctx->Extensions.EXT_timer_query is set based on the driver-
capabilities, not based on the context type. We need to check against
_mesa_has_EXT_timer_query(ctx) instead to figure out if the extension
is really supported. We also need to check for
EXT_disjoint_timer_query, which enables the same functionality for ES.

This turns usage of GL_TIME_ELAPSED into an error on ES 3, as is
required by the spec.

Signed-off-by: Erik Faye-Lund <erik.faye-lund at collabora.com>
Reviewed-by: Tapani Pälli <tapani.palli at intel.com>

---

 src/mesa/main/queryobj.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c
index e9bc1a7de4..9b3671f90a 100644
--- a/src/mesa/main/queryobj.c
+++ b/src/mesa/main/queryobj.c
@@ -197,7 +197,8 @@ get_query_binding_point(struct gl_context *ctx, GLenum target, GLuint index)
       else
          return NULL;
    case GL_TIME_ELAPSED:
-      if (ctx->Extensions.EXT_timer_query)
+      if (_mesa_has_EXT_timer_query(ctx) ||
+          _mesa_has_EXT_disjoint_timer_query(ctx))
          return &ctx->Query.CurrentTimerObject;
       else
          return NULL;




More information about the mesa-commit mailing list