[Mesa-dev] [PATCH 2/2] Differentiate between DeleteQueries and DeleteQueriesARB

Matt Turner mattst88 at gmail.com
Wed Apr 6 18:07:49 UTC 2016


On Tue, Apr 5, 2016 at 4:27 AM,  <kevin.rogovin at intel.com> wrote:
> From: Kevin Rogovin <kevin.rogovin at intel.com>

Subject is missing a required prefix.

> The extension, GL_ARB_occlusion_queries mandates that an
> INVALID_OPERATION should be thrown if DeleteQueriesARB is
> called while a query is active. In contrast, the GL spec
> has no such requirement for DeleteQueries. This patch
> unaliases the two functions and has that the ARB variant
> performs that extra check.
>
> Signed-off-by: Kevin Rogovin <kevin.rogovin at intel.com>
> ---
>  src/mapi/glapi/gen/gl_API.xml |  2 +-
>  src/mesa/main/context.c       |  1 +
>  src/mesa/main/queryobj.c      | 31 ++++++++++++++++++++++++++-----
>  src/mesa/main/queryobj.h      |  2 ++
>  4 files changed, 30 insertions(+), 6 deletions(-)
>
> diff --git a/src/mapi/glapi/gen/gl_API.xml b/src/mapi/glapi/gen/gl_API.xml
> index 5918e63..452584c 100644
> --- a/src/mapi/glapi/gen/gl_API.xml
> +++ b/src/mapi/glapi/gen/gl_API.xml
> @@ -7569,7 +7569,7 @@
>          <param name="ids" type="GLuint *"/>
>      </function>
>
> -    <function name="DeleteQueriesARB" alias="DeleteQueries">
> +    <function name="DeleteQueriesARB">
>          <param name="n" type="GLsizei"/>
>          <param name="ids" type="const GLuint *"/>
>      </function>
> diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
> index dbba136..1b250c0 100644
> --- a/src/mesa/main/context.c
> +++ b/src/mesa/main/context.c
> @@ -1090,6 +1090,7 @@ create_beginend_table(const struct gl_context *ctx)
>     COPY_DISPATCH(IsTexture);
>     COPY_DISPATCH(IsTransformFeedback);
>     COPY_DISPATCH(DeleteQueries);
> +   COPY_DISPATCH(DeleteQueriesARB);
>     COPY_DISPATCH(AreTexturesResident);
>     COPY_DISPATCH(FenceSync);
>     COPY_DISPATCH(ClientWaitSync);
> diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c
> index 43f1b0c..d8575c2 100644
> --- a/src/mesa/main/queryobj.c
> +++ b/src/mesa/main/queryobj.c
> @@ -321,19 +321,29 @@ _mesa_CreateQueries(GLenum target, GLsizei n, GLuint *ids)
>     create_queries(ctx, target, n, ids, true);
>  }
>
> -
> -void GLAPIENTRY
> -_mesa_DeleteQueries(GLsizei n, const GLuint *ids)
> +static void
> +delete_queries(GLsizei n, const GLuint *ids, const char *func, bool is_arb)
>  {
>     GLint i;
>     GET_CURRENT_CONTEXT(ctx);
>     FLUSH_VERTICES(ctx, 0);
>
>     if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glDeleteQueries(%d)\n", n);
> +      _mesa_debug(ctx, "%s(%d)\n", func, n);
>
>     if (n < 0) {
> -      _mesa_error(ctx, GL_INVALID_VALUE, "glDeleteQueriesARB(n < 0)");
> +      _mesa_error(ctx, GL_INVALID_VALUE, "%s(n < 0)", func);
> +      return;
> +   }
> +
> +   /* From GL_ARB_occlusion_query:
> +      "The error INVALID_OPERATION is generated if GenQueriesARB or
> +       DeleteQueriesARB is called when a query of any target is active."

Newline after the quote.

> +      That extension only support the target SAMPLES_PASSED_ARB, so we
> +      only check for CurrentOcclusionObject
> +    */
> +   if(is_arb && ctx->Query.CurrentOcclusionObject != NULL) {

Space after if


More information about the mesa-dev mailing list