opengl: glFlush() vs. glFinish()

前端 未结 8 1323
感情败类
感情败类 2020-12-02 06:40

I\'m having trouble distinguishing the practical difference between calling glFlush() and glFinish().

The docs say that glFlush()

8条回答
  •  情书的邮戳
    2020-12-02 06:48

    Have a look here. In short, it says:

    glFinish() has the same effect as glFlush(), with the addition that glFinish() will block until all commands submitted have been executed.

    Another article describes other differences:

    • Swap functions (used in double-buffered applications) automatically flush the commands, so no need to call glFlush
    • glFinish forces OpenGL to perform outstanding commands, which is a bad idea (e.g. with VSync)

    To sum up, this means that you don't even need these functions when using double buffering, except if your swap-buffers implementation doesn't automatically flush the commands.

提交回复
热议问题