Changed glFlush to not wait until issued event is processed.

I think these reduced synchronization guarantees are still compliant with the spec. I found that this significantly improved the frame rate for some of our demos (40 fps to 50fps for one on my box). I will change the demo so that it does not call glFlush at all but I still think this is a valuable change.

The OpenGL ES2 spec says:

"The command

void Flush( void );

indicates that all commands that have previously been sent to the GL must complete in finite time."

My reading of it is that any GL calls previously issued will be processed at some point in the future but not necessarily prior to glFlush returning. I believe that issuing the D3D event and then calling GetData once with the flush flag should meet these requirements.

I also added some assertions to glFinish because I was paranoid that if issuing an event ever failed, the spin loop might never terminate.


Review URL: http://codereview.appspot.com/1941049

git-svn-id: http://angleproject.googlecode.com/svn/trunk@401 736b8ea6-26fd-11df-bfd4-992fa37f6226
1 file changed