queryobj: Add EverBound flag, making ISQuery() return false before BeginQuery()
authorCarl Worth <cworth@cworth.org>
Thu, 13 Dec 2012 20:47:56 +0000 (12:47 -0800)
committerCarl Worth <cworth@cworth.org>
Tue, 15 Jan 2013 21:34:01 +0000 (13:34 -0800)
commit3dd76f7168bba6123c9ac5e2442b8c811f40399f
tree1a404f69a4ca4c5b9b9085bad4a5b9af4872e41d
parentc7df9c0e12e000f3d2fd57ebb3072f4afbda8579
queryobj: Add EverBound flag, making ISQuery() return false before BeginQuery()

This flag allows for the specified behavior that GenQueries reserves a name,
but does not associate an object with it until BeginQuery. We allocate the
object immediately with the new EverBound flag set to false, and then set the
flag to true at the time of BeginQuery.

This allows us to implement a conformant IsQuery function by checking the
state of the new EverBound flag.

This fixes the following es3conform tests:

occlusion_query_genqueries
occlusion_query_is_query_nonzero

and the following piglit test:

occlusion_query_lifetime

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/main/mtypes.h
src/mesa/main/queryobj.c