Neil Roberts wrote:I guess (and I hope) you're right, actually because of the internal state cache that the OpenGL driver has to manage. I now understand that it is indeed necessary for a scene graph engine to push and pop (save and restore in your terms) the GL state in order to paint-traverse the tree correctly, exactly as you do in your example. So regardless of Cogl's caching, we have to restore the original GL state before moving to the sibling actor. I think that was my mistake which caused the corruption. When Cogl was rewritten, there was a point where we weren't using the cache for some part of the Pango rendering and we had a definite measurable performance impact compared to the old Cogl from calling glEnable/Disable excessively. Even if the OpenGL driver internally caches the state as well, I believe there is still some expense for any GL call to lookup the current context from thread-local storage and do an indirect function call. I have seen some actual GL driver and they were indeed looking up from the TLS, which was not costful as they are using very optimized assembly code.I haven't looked at an actual GL driver though so I'm not an expert, but this is just my experience. But this is just one driver, and maybe others are not that performant. For example, in the mobile world, a leader like imgtec's PowerVR is known for its poor state changing performance, which could indeed motivate toolkits like clutter to take over this task. So I now understand a little more the Cogl choices. Thanks Michael -- Michael Boccara Graphtech Herzliya, Israel-- To unsubscribe send a mail to [EMAIL PROTECTED] |
- [clutter] Custom actors using GL directly Michael Boccara
- Re: [clutter] Custom actors using GL directly Neil Roberts
- Re: [clutter] Custom actors using GL directly Michael Boccara
- Re: [clutter] Custom actors using GL directly Neil Roberts
- Re: [clutter] Custom actors using GL dire... Michael Boccara
- Re: [clutter] Custom actors using GL directly Robert Bragg
- Re: [clutter] Custom actors using GL dire... Michael Boccara
- Re: [clutter] Custom actors using GL... Robert Bragg
