[Mesa-dev] [PATCH 2/3] mesa: Fix core GL genned-name handling for glBeginQuery().

Brian Paul brianp at vmware.com
Thu Nov 1 07:20:36 PDT 2012


On 10/31/2012 07:10 PM, Eric Anholt wrote:
> Fixes piglit gl-3.1/genned-names.
> ---
>   src/mesa/main/queryobj.c |   15 ++++++++++-----
>   1 file changed, 10 insertions(+), 5 deletions(-)
>
> diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c
> index d216913..2a39176 100644
> --- a/src/mesa/main/queryobj.c
> +++ b/src/mesa/main/queryobj.c
> @@ -321,13 +321,18 @@ _mesa_BeginQueryIndexed(GLenum target, GLuint index, GLuint id)
>
>      q = _mesa_lookup_query_object(ctx, id);
>      if (!q) {
> -      /* create new object */
> -      q = ctx->Driver.NewQueryObject(ctx, id);
> -      if (!q) {
> -         _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBeginQuery{Indexed}");
> +      if (ctx->API == API_OPENGL_CORE) {
> +         _mesa_error(ctx, GL_INVALID_OPERATION, "glBeginQuery(non-gen name)");

Put "{Indexed}" in the error string as below?


>            return;
> +      } else {
> +         /* create new object */
> +         q = ctx->Driver.NewQueryObject(ctx, id);
> +         if (!q) {
> +            _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBeginQuery{Indexed}");
> +            return;
> +         }
> +         _mesa_HashInsert(ctx->Query.QueryObjects, id, q);
>         }
> -      _mesa_HashInsert(ctx->Query.QueryObjects, id, q);
>      }
>      else {
>         /* pre-existing object */

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


More information about the mesa-dev mailing list