View Full Version : what about multi_threading ?
05-21-2006, 11:08 PM
threads independent contexts ?
05-22-2006, 03:15 AM
I don't think it's a good idea to make OpenGL threadsafe per default, because it will certainly cost performance for everyone who doesn't want to use it. And the operations would have to be serialized anyway, because the GPU itself is not capable of doing multithreading.
After all, it's not that hard to synchronize access to the GPU yourself. Streaming for example is rather easy: Map the buffer in your rendering thread, write into the mapped buffer in another thread, unmap it in your rendering thread.
05-22-2006, 11:03 PM
Updating textures also with same way -
download data (async. mode) to the pixel buffer object, and than copy (TexSubImage)
it to the target texture. Memory overhead ?
05-23-2006, 05:03 AM
Of course there is an additional memory overhead if you do it with PBO. The alternative would be to use a synchronous glTex(Sub)Image call in the render thread after you have loaded the texture from file in another thread.
This would trade performance for memory, but you still get the same performance as a hypothetical multithreaded implementation of OpenGL, where the driver has to serialize the operations.
05-23-2006, 06:05 AM
>> additional memory overhead if you do it with PBO
Why ? Can you elaborate, I am not fluent with the inner workings of PBO, but I though there was less memory overhead ? With glTexImage the driver often keep its own copy in local RAM.
05-24-2006, 02:50 AM
That's system memory. We have plenty of that.
With PBO, you have to reserve video memory for the PBO plus you need memory for the texture itself. Of course, you can free the PBO when you are finished with uploading the texture, but if it's a dynamic texture you are never finished with uploading ;)
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.