residualvm/residualvm — pull request #730 by klusark (2013-05-08 01:59:52+00:00)
Title: GRIM: Draw the scene before updating the lua

This change probably doesn't make very much sense at first glance, but for me I get an extra 60fps, or an extra 200fps in debug mode, when I turn frame limiting off. It should potentially help slower devices, provided they have well written opengl drivers. The only downside I see is that what is displayed on the screen could be an entire frame behind what is happening, but for this game that shouldn't matter.

Now why does this help? OpenGL queues each draw command and actually draws it on the graphics card at the same time the cpu is doing other work. As it was there was no other work for the CPU to be doing as it was forced to wait for the GPU to catch up each time the buffers are flipped. With the change, it draws the previous frame while working on the next frame.

I have only done a little bit of testing, but I don't see any problems arising from this.

Thoughts?