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 2

Enable gl state cache by default?

Post by scrawl » Tue Nov 19, 2013 11:49 pm

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 :)
0 x

User avatar
Wolfmanfx
OGRE Team Member
OGRE Team Member
Posts: 1525
Joined: Fri Feb 03, 2006 10:37 pm
Location: Austria - Leoben
x 1
Contact:

Re: Enable gl state cache by default?

Post by Wolfmanfx » Wed Nov 20, 2013 12:03 am

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.
0 x

User avatar
masterfalcon
OGRE Team Member
OGRE Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
Contact:

Re: Enable gl state cache by default?

Post by masterfalcon » Wed Nov 20, 2013 5:26 am

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.
0 x

scrawl
OGRE Expert User
OGRE Expert User
Posts: 1119
Joined: Sat Jan 01, 2011 7:57 pm
x 2

Re: Enable gl state cache by default?

Post by scrawl » Wed Nov 20, 2013 5:34 am

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.
0 x

User avatar
masterfalcon
OGRE Team Member
OGRE Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
Contact:

Re: Enable gl state cache by default?

Post by masterfalcon » Wed Nov 20, 2013 5:36 am

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.
0 x

Post Reply