summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/queryobj.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2012-10-16 17:36:42 -0700
committerEric Anholt <eric@anholt.net>2012-10-22 17:36:53 -0700
commitab7188e1992e655031550d611178c55abe33d5c5 (patch)
tree864ea8dd582596d22e33bf8105d67e39cfdee665 /src/mesa/main/queryobj.c
parent8f1131fcc00333efd824642576addacbea57f4ba (diff)
downloadexternal_mesa3d-ab7188e1992e655031550d611178c55abe33d5c5.zip
external_mesa3d-ab7188e1992e655031550d611178c55abe33d5c5.tar.gz
external_mesa3d-ab7188e1992e655031550d611178c55abe33d5c5.tar.bz2
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 <brianp@vmware.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Diffstat (limited to 'src/mesa/main/queryobj.c')
-rw-r--r--src/mesa/main/queryobj.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c
index 735e4d1..65e8571 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)");