I would like to know if it's possible to do occlusion queries per fbo. I would like, for example, do a 'set' of queries in the global framebuffer and do other 'sets' of queries in some fbo, and later check the results of all of them.
However, tests I made shew that the first made tests on the first framebuffer (or fbo) impact the next tests.
The solutions I have found are to create as much contexts as 'sets' of queries (1 per framebuffer) since occlusion queries are context-dependent. However I would like to avoid this solution since context switching is said heavy-weight and this will also complicate my code (and I don't really like this way to achive this).
Other solutions would be to use occlusion queries 1 and 2 (so use 2 different targets) since I never saw any performance issue between both versions of occlusion query, but this will be limited to 2 'sets' of queries per frame, limited to 3 'sets' if I use the HP version too.
Note that I do 'frame-late' queries, so this is why I'm facing this problem. I could do simple queries in a single frame, but this would lead to several clears of the depth-buffer, and several waitings of the query results, which I would like to avoid, for performance issues.
Any clue ? Thanks in advance.