Re: Query OpenGL to know if there are still commands on the queue

Kent Quirk <[email protected]> Tue, 03 Oct 2006 12:53:23 -0800
Newsgroups gmane.games.devel.opengl
Organization Fat City Network Services, San Diego, California
Message-ID <[email protected]>
It's not clear to me what you're really looking for here.

Your application drives the bug, right? Presumably, adding the glFlush 
makes it go away. I'll bet the spec for render-to-texture either says or 
implies that you should call glFlush() before attempting to use the 
texture, so this is sort of the moral equivalent of a memory leak.

 From the glFlush description:

"Because any GL program might be executed [...] on an accelerator that 
buffers commands, all programs should call glFlush whenever they count 
on having all of their previously issued commands completed."

Something that should have been done hasn't been done. There's no debate 
about whether this line is necessary, really.

I don't see how adding an extra test around the glFlush call would 
benefit you.

I could imagine that someone in QA would like a test case that shows the 
problem clearly, but this is a driver-dependent issue. Certainly it 
should be possible to create a test case that would fail on some cards. 
If you're worried about how long it would take to write that test case, 
that's the argument to have with QA and your management:

"Here's the cause of the bug and its solution. It will take N days to 
write the required test case here. I can work on that, or we can test 
this one using the application and I can get on to other bugs. Which do 
you prefer?"

    Kent


Igor Kravtchenko wrote:
>
> Hi!
>
> We have noticed some problems of render-to-texture in our application 
> on some drivers (the texture remains
> totally white).  After having investigated the code, I noticed it 
> lacks a call to glFlush() before swapping double
> buffer or releasing a pbuffer (used for the render-to-texture).
>
> So at first, I just wanted to add a call to glFlush(), commit the code 
> et voila.
> The problem is we have a pretty rigorous QA that just forbids to 
> commit any line of code if it's not
> proved to solve a problem with an appropriate test code.
>
> My idea was to find a way to query OpenGL and ask if there are still 
> GL commands on the queue
> just before swapping double buffer or releasing a pbuffer.  If yes 
> make a call to glFlush().
> I'm pretty confident it's a good thing to always make a glFlush() so 
> this would be really just for the QA's
> stuff.  Maybe, it's just not feasible anyway...
>
> Any hint would be appreciated,
>
> Igor.
>
> ----- FAQ and OpenGL Resources at:
>  http://www.geocities.com/SiliconValley/Hills/9956/OpenGL
>

----- 
FAQ and OpenGL Resources at:
  http://www.geocities.com/SiliconValley/Hills/9956/OpenGL

-- 
Author: Kent Quirk
  INET: [email protected]

Fat City Hosting, San Diego, California -- http://www.fatcity.com
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [email protected] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB OPENGL-GAMEDEV-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).