[Mesa-dev] [PATCH 2/4] mesa: Throw an error for a new query on an already-active query target.

Brian Paul brianp at vmware.com
Fri Oct 19 14:56:42 PDT 2012


On 10/19/2012 12:53 PM, Eric Anholt wrote:
> There's a similar test below, but it's not the same: that one checks whether
> this query object is already active (potentially on another target).
> ---
>   src/mesa/main/queryobj.c |   13 +++++++++++++
>   1 file changed, 13 insertions(+)
>
> diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c
> index 18792cf..ac03649 100644
> --- a/src/mesa/main/queryobj.c
> +++ b/src/mesa/main/queryobj.c
> @@ -301,6 +301,19 @@ _mesa_BeginQueryIndexed(GLenum target, GLuint index, GLuint id)
>         return;
>      }
>
> +   /* From the GL_ARB_occlusion_query spec:
> +    *
> +    *     "If BeginQueryARB is called while another query is already in
> +    *      progress with the same target, an INVALID_OPERATION error is
> +    *      generated."
> +    */
> +   if (*bindpt) {
> +      _mesa_error(ctx, GL_INVALID_OPERATION,
> +                  "glBeginQuery{Indexed}(target=%s is active)",
> +                  _mesa_lookup_enum_by_nr(target));
> +      return;
> +   }
> +
>      if (id == 0) {
>         _mesa_error(ctx, GL_INVALID_OPERATION, "glBeginQuery{Indexed}(id==0)");
>         return;

Reviewed-by: Brian Paul <brianp at vmware.com>


More information about the mesa-dev mailing list