RESOLVED FIXED 137897
Use glFinish instead of glFlush when drawing final GL output to screen
https://bugs.webkit.org/show_bug.cgi?id=137897
Summary Use glFinish instead of glFlush when drawing final GL output to screen
Roger Fong
Reported 2014-10-20 15:51:31 PDT
When we want to draw the final WebGL output to the screen we call drawInCGLContext which in turn calls GraphicsContext3D::prepareTexture. We used to call glFinish here, which pushes all buffered gl operations and blocks until every operation has been completed and every last pixel has been drawn. glFlush also pushes all buffered gl operations but returns immediately. Using glFinish is a huge performance hit and based on my testing does not seem to offer any particular benefit over glFlush. Thus we will switch to using glFlush. This gives us a 20% performance boost on Unity 3d tests and a 33% boost on the frame rate on http://threejs.org/examples/#webgl_performance.
Attachments
patch (1.49 KB, patch)
2014-10-20 15:54 PDT, Roger Fong
bfulgham: review+
Roger Fong
Comment 1 2014-10-20 15:54:52 PDT
Roger Fong
Comment 2 2014-10-20 15:57:02 PDT
We should commit this, live on it, and keep an eye out for any unforeseen consequences.
Roger Fong
Comment 3 2014-10-20 15:58:09 PDT
Brent Fulgham
Comment 4 2014-10-20 16:16:31 PDT
Comment on attachment 240154 [details] patch Looks good! r=me.
Roger Fong
Comment 5 2014-10-20 18:07:56 PDT
Note You need to log in before you can comment on or make changes to this bug.