mesa/main: fix validation of ARB_query_buffer_object
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Wed, 7 Nov 2018 12:45:17 +0000 (13:45 +0100)
committerErik Faye-Lund <erik.faye-lund@collabora.com>
Fri, 23 Nov 2018 09:48:36 +0000 (10:48 +0100)
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@collabora.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
src/mesa/main/queryobj.c

index 45db43139a4b7682ebe40611a10fcf852bc48f3e..c86b9ec065b422b19020034a0e4e8ca59ca8af24 100644 (file)
@@ -825,7 +825,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;
       }
@@ -858,7 +858,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)