Enable gl state cache by default?

Discussion area about developing or extending OGRE, adding plugins for it or building applications on it. No newbie questions please, use the Help forum for that.
Post Reply
scrawl
OGRE Expert User
OGRE Expert User
Posts: 1119
Joined: Sat Jan 01, 2011 7:57 pm
x 216

Enable gl state cache by default?

Post 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 :)
User avatar
Wolfmanfx
OGRE Team Member
OGRE Team Member
Posts: 1525
Joined: Fri Feb 03, 2006 10:37 pm
Location: Austria - Leoben
x 99
Contact:

Re: Enable gl state cache by default?

Post 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.
User avatar
masterfalcon
OGRE Team Member
OGRE Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126
Contact:

Re: Enable gl state cache by default?

Post 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.
scrawl
OGRE Expert User
OGRE Expert User
Posts: 1119
Joined: Sat Jan 01, 2011 7:57 pm
x 216

Re: Enable gl state cache by default?

Post 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.
User avatar
masterfalcon
OGRE Team Member
OGRE Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126
Contact:

Re: Enable gl state cache by default?

Post 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.
Post Reply