Jump to content

  • Log In with Google      Sign In   
  • Create Account

#Actualsamoth

Posted 23 September 2013 - 02:13 AM

What is CGLEnable(gOpenGLContext,kCGLCEMPEngine); doing, or supposed to do? You enable a feature with the GL enumeration constant equal to the current context handle? Or something? What's that supposed to do?

 

Also, you seem to use only a single context which you make current in your loader thread. This does not make much sense, and it is probably the reason for the crash, too. To parallelize loading textures, you either only do OpenGL calls from one thread and do the disk work and shuffling data into buffer objects in another thread (passing mapped buffer object pointers between threads, never any actual OpenGL object!), or you use two shared contexts, one bound to each thread.

You will never want to do anything else, because not only will it not be running concurrently (even though adding complexity due to multithreading) but also because it will likely end up with one thread calling an OpenGL function without a valid context at some point.


#1samoth

Posted 23 September 2013 - 02:11 AM

What is CGLEnable(gOpenGLContext,kCGLCEMPEngine); doing, or supposed to do? You enable a feature with the GL enumeration constant equal to the current context handle? Or something? What's that supposed to do?

 

Also, you seem to use only a single context which you make current in your loader thread. This does not make much sense, and it is probably the reason for the crash, too. To parallelize loading textures, you either only do OpenGL calls from one thread and do the disk work and shuffling data into buffer objects in another thread, or you use two shared contexts, one bound to each thread.

You will never want to do anything else, because not only will it not be running concurrently (even though adding complexity due to multithreading) but also because it will likely end up with one thread calling an OpenGL function without a valid context at some point.


PARTNERS