Page 1 of 1

Enable gl state cache by default?

Posted: Tue Nov 19, 2013 11:49 pm
by scrawl
This is slightly off topic, but I also think we should enable state cache (for desktop GL at least) by default. I personally contributed to it and it seems pretty stable to me at this point. If there's any further issues, they're unlikely to get discovered as long as this is hidden behind a build option and <1% of users know about it. This is a vicious circle - you can't find all issues without shipping it to users.
I believe there are some problems on Android with the system UI invalidating our cache, so GLES2 may not be stable yet (though a simple fix would be to erase our cache at the beginning of each frame. Can someone test that?)
Sorry, I should open a new topic :)

Re: Enable gl state cache by default?

Posted: Wed Nov 20, 2013 12:03 am
by Wolfmanfx
I split the topic. For glrs we could enable it by default for 1.10. On mobile i am not sure if it counterproductive to clear the cache every frame.
There are still some bugs on android.

Re: Enable gl state cache by default?

Posted: Wed Nov 20, 2013 5:26 am
by masterfalcon
Yeah, clearing the cache would negate the effect of it being there in the first place.

I haven't thought much about how to deal with GL calls made outside of Ogre and how to compensate for them getting GL and the cache out of sync.

Re: Enable gl state cache by default?

Posted: Wed Nov 20, 2013 5:34 am
by scrawl
clearing the cache would negate the effect of it being there in the first place.
Not really. It would negate the effect for the first batch rendered each frame, but all subsequent batches would benefit from the effects of caching. Let's say 50 batches per frame, that's 98%. Pretty good speed up.

Re: Enable gl state cache by default?

Posted: Wed Nov 20, 2013 5:36 am
by masterfalcon
That's true. I just read the comment about it not being enabled and that's a good point. Public testing is definitely necessary to find some of those more obscure issues.