   Strange behavior with multithreading & wglShareLists
  Hello everyone,I have recently refactored some OpenGL rendering code to be multithreaded. The way I have it set up is that each thread has its own offscreen OpenGL context (a draw-to-window context created for a hidden window with a Frame Buffer Object attached). Each thread renders a separate tile from the final output image, and then copies the result into the output buffer in system memory using glReadPixels. After I have created these contexts, but before creating the FBOs and so on, I call wglShareLists so that they can share resources. I then maintain one thread-safe cache of the OpenGL ID numbers for the textures, display lists, and so on for the resources used in rendering. The problem I am seeing is that when I have 2 threads rendering at once, the output is highly unpredictable. Some frames will be perfect, while in other frames (rendering the exact same scene):- Some, but rarely all, objects will be rendered without textures (pure white)- Some, but rarely all, objects will appear not to be transparent (may have something to do with the fact that I am using depth peeling)I should throw in that I am indeed calling wglMakeCurrent(0,0) before binding the contexts. I have tried this on my MacBook Pro (running Windows via Boot Camp) and on my friend's HP Workstation with the same results. The MacBook has a GeForce 8600M, and the Workstation has an NVidia Quadro FX (not sure which model).  Thank you very much for your insights!   
This thread may help you (it links to a couple of others aswell).Once draw calls are moving from the driver to the card I believe they HAVE to be serialized, so as far as pure drawing performance is concerned you won't gain anything from multi-threading. I don't know how much you stand to gain from parallelising the actual API calls, or how the driver will interact with the multi-threading. I know the nVidia driver has a "multi-threaded" setting, which still does not actually increase performance, and was totally broken for quite a while.   ;  *Sigh* Fixed it. Guess what? Turns out it was just that the textures I was using were aligned in such a way as the image was hidden. Simply using a better texture fixed it. Thanks for the input anyway, guys!   ;*Sigh* Fixed it. Guess what? Turns out it was just that the textures I was using were aligned in such a way as the image was hidden. Simply using a better texture fixed it. Thanks for the input anyway, guys!???? Are you the OP?   