[GLES] Avoid getting viewport so often
authorpopcornmix <popcornmix@gmail.com>
Wed, 27 Nov 2013 22:04:56 +0000 (22:04 +0000)
committerpopcornmix <popcornmix@gmail.com>
Thu, 28 Nov 2013 20:31:49 +0000 (20:31 +0000)
commit518556b45b61de06a0bc810147cd1a6347497461
tree7813c1b159d6ece3dedeccd68bb8eee58d2348d7
parent037800e745c64549dc0c7887efd1a0954a6aa03e
[GLES] Avoid getting viewport so often

GLES is generally offloaded to a GPU and fed a stream of commands.
These can be executed asynchronously by GPU and there is no need for the host to block.
Whenever a gl call requires a result back that may be affected by previous commands
the queue needs to be drained and a result returned from GPU. This acts as a bottleneck.

Looking closely at what xbmc does, there is only one call that requires a result that is
executed every frame. That is glGetIntegerv(GL_VIEWPORT).
However xbcm is perfectly capable of remembering what it set this to.

By using a cached version of this value, on a Pi, the framerate improves from 69fps to 95fps,
with vsync disabled, and RSS feed showing in home screen.
xbmc/rendering/gles/RenderSystemGLES.cpp