Mesa (master): mesa/main: fix validation of GL_TIMESTAMP
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Fri Nov 23 09:48:59 UTC 2018
Module: Mesa
Branch: master
Commit: d52be6dd29ad465ec6cad9afabf9525834878f80
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=d52be6dd29ad465ec6cad9afabf9525834878f80
Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date: Wed Nov 7 13:45:01 2018 +0100
mesa/main: fix validation of GL_TIMESTAMP
ctx->Extensions.ARB_timer_query is set based on the driver-
capabilities, not based on the context type. We need to check
against _mesa_has_ARB_timer_query(ctx) instead to figure out
if the extension is really supported. We also need to check for
EXT_disjoint_timer_query for GLES-support.
This shouln't have any functional effect, as this entry-point is only
valid on desktop GL, or on GLES with EXT_disjoint_timer_query in the
first place. But if this gets added to the core of a future version
of ES, this should be a step in the right direction.
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 c86b9ec065..27086a4b68 100644
--- a/src/mesa/main/queryobj.c
+++ b/src/mesa/main/queryobj.c
@@ -679,7 +679,8 @@ _mesa_GetQueryIndexediv(GLenum target, GLuint index, GLenum pname,
}
if (target == GL_TIMESTAMP) {
- if (!ctx->Extensions.ARB_timer_query) {
+ if (!_mesa_has_ARB_timer_query(ctx) &&
+ !_mesa_has_EXT_disjoint_timer_query(ctx)) {
_mesa_error(ctx, GL_INVALID_ENUM, "glGetQueryARB(target)");
return;
}
More information about the mesa-commit
mailing list