Hi folks,
I think this topic has been discussed from time to time, but I’m not sure there have been any clear conclusions
Anyway, I’m making a multithreaded OpenGL application. The main thread does all the rendering, and a separate thread is used for loading textures and other data from disk.
For the textures, the data reader loads the image data from disk, and the main thread does the actual texture binding and upload, to avoid having to lock the gl context.
Now, what I’m wondering is if there is anything to gain from having a separate GL context in the reader thread and sharing the textures with the main thread GL context. Then I could do the texture uploads from the reader thread too and there would be less work in the main thread. What kind of synchronization would I need to do for this to work? Can I expect this to be well supported across a wide range of platforms and graphics cards? (The application runs on Windows, Linux and OSX).
Any thoughts on this?
Cheers!