cgrant said:
I will check out the codebase or the example when posted when I get a chance. Also to clarify my previous question #2, this only matters if the textures are ‘create/modified’ in different context. If the are within the same context then the OpenGL will ensure the commands are dispatched in the order submitted, meaning that the texture will be ‘complete’ by the time any subsequent GL call that uses the said texture was submitted. In addition is you are calling make the context current every frame or even periodically ( wglMakeCurrent, glxMakeCurrent), you are going to seem hiccups in your frame as the current context will flush the previous context per the docs for WGL: https://docs.microsoft.com/en-us/windows/win32/api/wingdi/nf-wingdi-wglmakecurrent. The main idea is that this really should be a one time deal. This in turn forces one to thing more about the intent of their application on how to structure it to abide by that limitation.
Updated post above with link to a stripped down version which shows basic usage example to go along with the engine code.
To clarify, I am only switching between contexts once in order to load new scenes. For example, think of a loading screen that's showing a user a progress bar or some animation which needs to remain responsive while the next scene is loaded in the background. Once the main thread context has been switched with the loading thread's context, no further context switching (or asset loading) of any kind is happening (until the next scene load is initiated). I may not have made that fact clear in the beginning.
If you feel like checking out the engine/example code that would be wonderful, if not though no worries. I know digging through someone elses code isn't the most pleasant thing to do sometimes. Greatly appreciate the assistance up to this point.
If you do decide to take a look, know that this is by no means a final solution, especially this branch as I cut it simply to play around with the multiple context loading and wound up having to implement some things I'm not so proud of just to see it work. I plan on refactoring once I have this issue figured out.