[Mesa-dev] [PATCH 11/13] mesa/main: fix validation of ARB_query_buffer_object

Erik Faye-Lund erik.faye-lund at collabora.com
Wed Nov 7 15:58:35 UTC 2018


ctx->Extensions.ARB_query_buffer_object is set based on the driver-
capabilities, not based on the context type. We need to check against
_mesa_has_ARB_query_buffer_object(ctx) instead to figure out if the
extension is really supported.

This turns attempts to read queries into buffer objects on ES 3 into
errors, as required by the spec.

Signed-off-by: Erik Faye-Lund <erik.faye-lund at collabora.com>
---
 src/mesa/main/queryobj.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c
index d22432930d0..01a5504575d 100644
--- a/src/mesa/main/queryobj.c
+++ b/src/mesa/main/queryobj.c
@@ -822,7 +822,7 @@ get_query_object(struct gl_context *ctx, const char *func,
    if (buf && buf != ctx->Shared->NullBufferObj) {
       bool is_64bit = ptype == GL_INT64_ARB ||
          ptype == GL_UNSIGNED_INT64_ARB;
-      if (!ctx->Extensions.ARB_query_buffer_object) {
+      if (!_mesa_has_ARB_query_buffer_object(ctx)) {
          _mesa_error(ctx, GL_INVALID_OPERATION, "%s(not supported)", func);
          return;
       }
@@ -855,7 +855,7 @@ get_query_object(struct gl_context *ctx, const char *func,
       value = q->Result;
       break;
    case GL_QUERY_RESULT_NO_WAIT:
-      if (!ctx->Extensions.ARB_query_buffer_object)
+      if (!_mesa_has_ARB_query_buffer_object(ctx))
          goto invalid_enum;
       ctx->Driver.CheckQuery(ctx, q);
       if (!q->Ready)
-- 
2.19.1



More information about the mesa-dev mailing list