Creating objects in another thread
I'm trying to use another thread for creating (and loading) OpenGL objects
The problem is that I have a successful D3D implementation, as it supports threaded object creation.
As for OpenGL , I have followed the guideline described here, and also using GLFW3 for managing contexts:
- At Init, I Create the main context and set it after other contexts and threads are created
- At Init I create a context (new 1x1 hidden window in GLFW) for loader thread, in the main thread, Also I pass the main thread's context to loader thread as shared
- At the start of loader thread execution, set it to current
- Create my objects in the loader thread
- After loading done, pass the object IDs and render them in main thread
But I'm currently having couple of problems, that I need to ask ...
- Besides Buffers and texture objects, I'm creating VAOs, I've read somewhere that VAO's can't be shared, as a result I don't get valid geometry, is this true?
- Performance is terrible, when I create another context shared with the main one, I get terrible frame-rates, for example from 3-4ms per-frame to 20ms per-frame (using latest AMD gpu drivers), any tips? or is there anything wrong with this method of loading ?
Last edited by septag; 01-20-2014 at 10:15 AM.
Tags for this Thread