I had one Cinder window, and 8 worker threads that each had their own GL context shared with the primary context. Each worker thread was loading textures into their contexts, and these textures were available to the primary context just fine.
Now, I want to add a second window with its own workers threads. However, I’m not entirely clear how this kind of many-to-many resource sharing works in OpenGL, much less Cinder.
My initial thought was to create the two windows with cinder, then create the worker contexts for each window context. However, what appears to happen in this case is that (according to CodeXL) all the resources end up in the context for the first window. I believe this is because Cinder automatically shares resources between the first window and the second window. Then, when I create the worker contexts for the second window, they behave as though I had shared them with the context for the first window (even thought CodeXL is able to properly detect that they were created from the second window’s context).
The window contexts don’t really need to share resources, but I’m also not sure that it hurts. Is there a reason to try to fight Cinder’s default behavior and make the window contexts independent, or is it ok for all the contexts to share resources in one big mess? If the latter, what context should the workers share with? If the former, how do I keep Cinder from sharing resources between the window contexts?
More generally, is this the right way to go about streaming lots of big, I/O intensive textures to multiple windows, or is this insane? Is this possible?