Skip to content
vade edited this page Oct 12, 2016 · 6 revisions

Notes with Tom for new release.

State Handling for Core Profile

  • Currently legacy inherits a passed in CGLContext from the parent app.
  • Currently legacy uses glPushAttrib / Pop Attribt and various glGets to save and restore state.

Possible Strategies for handling State Changes:

Use a shared context

  • Pro - we isolate some state in some cases
  • Con - context changing overhead
  • Con - we still have to let the client draw with their own state in bind/unbind

Use a shared context / blit

  • Con - we remove old code paths
  • Con - context switching overhead
  • Pro - Blit is not render its super fast
  • Pro - Blit doesnt seem to have any state that needs to be tracked during draw.

pasted from e-mail:

and what I have working to start with is to do our GL work in a shared context. This means we leave the calling context untouched, but there may be performance costs making the context switches and it may prove more complicated for those who want to do their rendering directly between bind/unbindAndPublish calls (they will have to set all their GL state every pass). What I still have to do is to complete the two alternatives I have in mind - both using the original caller's context, one restoring to default GL state, and the other getting and restoring state. We really need to profile performance and think about usability for these three options.

Clone this wiki locally