idea how to improve FPS (without threading)
Posted: Tue Jun 13, 2023 6:14 pm
Hey,
There's a hack to improve FPS with a fully synchronous game loop. On all my Radeon and GTX cards, all time was spent¹ inside both SwapBuffers() and update(). But you can execute them sort-of in parallel.
I think what you're doing is this:
But what you can do is this:
Then a decent portion of all time normally spent in swapbuffers() should be spent in glFlush(). You don't need to actually rework a lot of code or mod APIs because the order of update() and render() doesn't actually change.
I don't know if you already know this trick but perhaps it can help with megabases.
¹ The representative workload is fully unzoomed 4K screen with an 8-blue-output red circuit blueprint.
There's a hack to improve FPS with a fully synchronous game loop. On all my Radeon and GTX cards, all time was spent¹ inside both SwapBuffers() and update(). But you can execute them sort-of in parallel.
I think what you're doing is this:
Code: Select all
while !should_quit
call_message_pump()
update()
render()
swapbuffers()
Code: Select all
call_message_pump()
update()
while !should_quit
render()
glFlush()
update()
swapbuffers()
call_message_pump()
I don't know if you already know this trick but perhaps it can help with megabases.
¹ The representative workload is fully unzoomed 4K screen with an 8-blue-output red circuit blueprint.