I ran into this a while back, and it turns out this is the correct behaviour as stated by the extension (GL_ARB_occlusion_query, section 4.1.6A):

Quote:

Calling either GenQueriesARB or DeleteQueriesARB while any query of any target is active causes an INVALID_OPERATION error to be generated.

However, this language isn't in the OpenGL 3.3 specification, so it looks like it should be valid. It's likely this feature was never updated to core in the AMD driver.

07-18-2012, 06:58 AM

thokra

The official API reference for glGenQueries doesn't reflect that as well.

07-18-2012, 04:22 PM

aqnuep

Quote:

Originally Posted by malexander

I ran into this a while back, and it turns out this is the correct behaviour as stated by the extension (GL_ARB_occlusion_query, section 4.1.6A).
However, this language isn't in the OpenGL 3.3 specification, so it looks like it should be valid. It's likely this feature was never updated to core in the AMD driver.

I would rather say it's a specification bug. I don't think it would be a good idea to allow GenQueries/DeleteQueries between BeginQuery/EndQuery, especially delete.

07-19-2012, 12:03 AM

thokra

Quote:

Originally Posted by aqnuep

I would rather say it's a specification bug. I don't think it would be a good idea to allow GenQueries/DeleteQueries between BeginQuery/EndQuery, especially delete.

IMHO, I don't think that glGenQueries inside a glBeginQuery/glEndQuery would be a problem because getting names for yet unused query and untyped query objects shouldn't have any side-effects other than reducing the set of available IDs. What really looks like a bug though is that glDeleteQueries() also isn't restricted from use while a query is active, at least according to the API reference. So you could simply try to delete an object which is currently active for a specific target.

07-20-2012, 06:50 AM

kyle_

Actually GL spec is pretty explicit that glDeleteQueries does work even if deleted query is active

Quote:

If an active
query object is deleted its name immediately becomes unused, but the underlying
object is not deleted until it is no longer active

As there is nowhere any mention that glGenQuery is forbidden when there is an active query, the only possible outcome is that it has to work, ie ATI has a bug.

07-20-2012, 07:08 AM

thokra

Quote:

Originally Posted by kyle_

Actually GL spec is pretty explicit that glDeleteQueries does work even if deleted query is active