Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 6 of 6

Thread: what about multi_threading ?

  1. #1
    Intern Newbie
    Join Date
    Jul 2005
    Location
    Russian federation
    Posts
    37

    what about multi_threading ?

    Streaming -
    threads independent contexts ?

  2. #2
    Senior Member OpenGL Pro
    Join Date
    May 2000
    Location
    Naarn, Austria
    Posts
    1,142

    Re: what about multi_threading ?

    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.

  3. #3
    Intern Newbie
    Join Date
    Jul 2005
    Location
    Russian federation
    Posts
    37

    Re: what about multi_threading ?

    Ok.
    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 ?

  4. #4
    Senior Member OpenGL Pro
    Join Date
    May 2000
    Location
    Naarn, Austria
    Posts
    1,142

    Re: what about multi_threading ?

    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.

  5. #5
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,655

    Re: what about multi_threading ?

    >> 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.

  6. #6
    Senior Member OpenGL Pro
    Join Date
    May 2000
    Location
    Naarn, Austria
    Posts
    1,142

    Re: what about multi_threading ?

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •