[Mesa-dev] [PATCH 4/4] mesa: Return 0 for GL_CURRENT_QUERY with a mismatched query target.

Eric Anholt eric at anholt.net
Fri Oct 19 11:53:49 PDT 2012


With the previous two commits, this fixes piglit
GL_ARB_occlusion_query2/api.
---
 src/mesa/main/queryobj.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c
index d2f064e..32aa519 100644
--- a/src/mesa/main/queryobj.c
+++ b/src/mesa/main/queryobj.c
@@ -531,7 +531,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)");
-- 
1.7.10.4



More information about the mesa-dev mailing list