Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualtanzanite7

Posted 12 October 2012 - 04:00 PM

1) glFlush pushes everything through the graphics card, but that seems like it would just be a consistently high number.
2) glutSwapBuffers switches where you are drawing to and what the screen is reading from, to prevent things like tearing.


1) Not quite. glFlush ensures commands do not wait for more commands in some buffer (In case GPU is not on the same machine than the CPU generating the draw command for example. Not creating a new fullbown packet for every command to be sent over network is highly desirable). It is completely useless in an usual desctop / game context as there is no such worry (the driver, which is on the same CPU, is in perfect position to do it for you at the most appropriate time). Do not use glFlush if you are not talking with the GPU over network (you almost certainty are not).

2) Yes, it also ensures there are not too many frames worth of commands in command buffer - in case there are too many then it will stall till all commands from the oldest frame have finished.

edit: might want to check this also: http://www.opengl.org/wiki/Common_Mistakes#glFinish_and_glFlush

#1tanzanite7

Posted 12 October 2012 - 03:57 PM

1) glFlush pushes everything through the graphics card, but that seems like it would just be a consistently high number.
2) glutSwapBuffers switches where you are drawing to and what the screen is reading from, to prevent things like tearing.


1) Not quite. glFlush ensures commands do not wait for more commands in some buffer (In case GPU is not on the same machine than the CPU generating the draw command for example. Not creating a new fullbown packet for every command to be sent over network is highly desirable). It is completely useless in an usual desctop / game context as there is no such worry (the driver, which is on the same CPU, is in perfect position to do it for you at the most appropriate time). Do not use glFlush if you are not talking with the GPU over network (you almost certainty are not).

2) Yes, it also ensures there are not too many frames worth of commands in command buffer - in case there are too many then it will stall till all commands from the oldest frame have finished.

PARTNERS