wglShareList with Query Objects

Started by
1 comment, last by BornToCode 10 years, 7 months ago
Using wglShareList with any gl object context works fine. But i am kind of confuse as to why Query Objects do not work. Does anyone know why. When i create an Query object on one context and then switch to a different context which is shared glIsQuery is returning 0. But for every other resource it works fine.
Advertisement

The documentation to wglShareList is not very specific (and wrong/incomplete, because it only talks about sharing lists, not textures or other things), but the specification of WGL_ARB_create_context which is the more modern context sharing implementation is more precise. It states that GL objects for which it makes sense to be shared are shared, if the respective context versions allow for it. That means for example, shaders from a GL3/GL4 context are not shared with a GL2 context (but textures would be).

Now it is debatable whether sharing query objects makes sense or not, but it seems like the implementors seem to think it doesn't make a lot of sense (and I somewhat agree -- what exactly would you want e.g. the number of fragments rendered in another context, it's of no use).

It does make sense to share fences (and those do indeed work!), textures, and shaders.

The documentation to wglShareList is not very specific (and wrong/incomplete, because it only talks about sharing lists, not textures or other things), but the specification of WGL_ARB_create_context which is the more modern context sharing implementation is more precise. It states that GL objects for which it makes sense to be shared are shared, if the respective context versions allow for it. That means for example, shaders from a GL3/GL4 context are not shared with a GL2 context (but textures would be).

Now it is debatable whether sharing query objects makes sense or not, but it seems like the implementors seem to think it doesn't make a lot of sense (and I somewhat agree -- what exactly would you want e.g. the number of fragments rendered in another context, it's of no use).

It does make sense to share fences (and those do indeed work!), textures, and shaders.

What i was wanted to do is that when i call glEndQuery instead of waiting for the Query result. I would have it wait for the result on a queue in a background thread on another context which is shared. That way my program can continue executing, while it keep checking in the background thread if the result is ready. Once it is it would let the main thread know.

It seems like in GL 4.4 you will be able to do what i am trying to accomplish using the ability to have query object outputs to a buffer.

This topic is closed to new replies.

Advertisement