From: Eric Anholt Date: Wed, 17 Oct 2012 00:36:42 +0000 (-0700) Subject: mesa: Return 0 for GL_CURRENT_QUERY with a mismatched query target. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ab7188e1992e655031550d611178c55abe33d5c5;p=mesa.git mesa: Return 0 for GL_CURRENT_QUERY with a mismatched query target. With the previous two commits, this fixes piglit GL_ARB_occlusion_query2/api. Reviewed-by: Brian Paul Reviewed-by: Ian Romanick --- diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c index 735e4d1b1ab..65e8571483a 100644 --- a/src/mesa/main/queryobj.c +++ b/src/mesa/main/queryobj.c @@ -532,7 +532,7 @@ _mesa_GetQueryIndexediv(GLenum target, GLuint index, GLenum pname, } break; case GL_CURRENT_QUERY_ARB: - *params = q ? q->Id : 0; + *params = (q && q->Target == target) ? q->Id : 0; break; default: _mesa_error(ctx, GL_INVALID_ENUM, "glGetQuery{Indexed}iv(pname)");