Neil Roberts wrote:
On Tue, 2008-08-19 at 23:36 +0300, Michael Boccara wrote:
  
I had the same problem when making the ClutterMD2 renderer. You can work
around it by saving some of the GL state before doing your custom GL
rendering and then restoring it afterwards. Please take a look at the
clutter_md2_data_save/restore_state functions here:

http://tinyurl.com/5dn3bv

  
Thanks Neil. This is a good reference code, relevant for whoever wants to make actors based on complex geometry.
I got the idea: you are basically doing what cogl is doing, i.e. managing a LIFO stack of GL states.
The problem with this workaround is that you do glGet* upon every frame, which is flushing/finishing the GL pipeline, causing performance issues.
But I guess I will manage with this approach until I get to the performance tuning phase.

Is there a way to cancel Cogl's internal GL state cache ?
    

Not at present. There was talk of providing functions in Cogl to help
with this but it needs some more discussion before being implemented
because it's not always obvious what state should be preserved.
Sometimes you may want the GL state to be set to a known consistent
state and sometimes you want some Cogl settings to remain (such as
cogl_enable_depth_test or a shader).

  
I still don't agree with the choice of having Cogl manage a cache of the GL state.
Any good OpenGL driver does this job internally in order to achieve good performance against competitors.
Giving this responsibility to the cogl layer causes more problems than it solves.
Or do I miss another motivation behind this ?

Another issue, when surrendering to using cogl for custom actors, is that only a very small set of cogl functionalities is exposed in the exported cogl.h. For example, even cogl_enable() is hidden in the internals of the source tree.

Michael
- Neil

  


-- 
Michael Boccara
Graphtech
Herzliya, Israel

-- To unsubscribe send a mail to [EMAIL PROTECTED]

Reply via email to