PDA

View Full Version : AMD_query_buffer_object - Catalyst 12.6 beta



fred_em
06-04-2012, 01:08 AM
Hi,

Anybody knows what this extension is for? Is this some kind of progressive occlusion query, a desired functionality that has been discussed last year on this forum?

Thanks,
Fred

aqnuep
06-18-2012, 01:22 PM
The spec is now public: http://www.opengl.org/registry/specs/AMD/query_buffer_object.txt

thokra
06-18-2012, 02:38 PM
That extensiobn is actually pretty cool. aqnuep, do you foresee any trouble for it to be cross-vendor anytime soon? Shouldn't be much of a problem to support this, right?

mhagain
06-18-2012, 03:01 PM
It looks like a more generalized variant on D3D10/11 Predicate Queries, and is definitely a very very nice extension. There's still a case to be made for readbacks being needed - keeping queries on the GPU would still necessitate submitting state changes and draw calls, running your shaders and modifying your shaders behaviour based on the query result - but it sounds as though it could be a useful addition if a query result were not yet available for readback.

aqnuep
06-18-2012, 03:56 PM
That extensiobn is actually pretty cool. aqnuep, do you foresee any trouble for it to be cross-vendor anytime soon? Shouldn't be much of a problem to support this, right?
I don't know whether NVIDIA could support this, but I would assume they should be able.


It looks like a more generalized variant on D3D10/11 Predicate Queries, and is definitely a very very nice extension.
Well, actually the equivalent of predicate queries in OpenGL is conditional rendering, except that OpenGL supports only the "if occlusion query passed" condition, but not the "if occlusion query failed", "if transform feedback buffer overflowed" and "if transform feedback buffer didn't overflow" conditions.
This is something more... ;)


There's still a case to be made for readbacks being needed - keeping queries on the GPU would still necessitate submitting state changes and draw calls, running your shaders and modifying your shaders behaviour based on the query result - but it sounds as though it could be a useful addition if a query result were not yet available for readback.
Well, depends. If you want to use occlusion queries for visibility determination, there's conditional rendering for you. However, query buffers come handy when you would like to do something like:
1. Determine the number of vertices/instances to be drawn based on a primitive query. Just write the primitive query result to a buffer that you'll subsequently use as a draw indirect buffer.
2. Determine the size of a point sprite based on an occlusion query. Just write the occlusion query result to a buffer that you'll read in the vertex shader to decide what to write to gl_PointSize.
These are just some use cases, of course there can be a lot more so it's your turn to show how would you use it.
Obviously, conditional rendering is more or less subsumed by query buffers as you could use a boolean occlusion query and draw indirect to perform the same, but it isn't necessarily implemented in the same way, so conditional rendering still makes sense (and is probably more simple if you want to only do simple visibility queries).