Jump to content
  • Advertisement
Sign in to follow this  
obhi

OpenGL Locking and updating VBOs from a separate thread.

This topic is 2705 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi,

I am fairly new to opengl so my question is, if I have to lock/update a vertex buffer object from a spearete thread what would be the way to go? More specifically do I have to create a new context and bind it to that thread? or can I manage with the original context bound to the updating thread? Given that I have made sure this buffer will not be used in the current draw call.

Thanks for any help.
-obhi

Share this post


Link to post
Share on other sites
Advertisement
The magic word is glMapBuffer.
You call that in your main thread and the pointer it returns, you can keep it or send it to your other thread.
You have to call glUnmapBuffer later from your main thread.

You should also read this part "Dynamic VBO"
and it is doable from 1 thread

http://www.opengl.org/wiki/VBO_-_more

Share this post


Link to post
Share on other sites
Thanks for that link.
Passing the buffer pointer between the threads however is not the way i want to go.
Solely because the need to update the (backing) VBO is determined by the main thread while the renderer is already drawing the current updated data. So, the sync that will be necessary here (possibly by message passing) would make the whole process stall on each other. Not the way I would like it.

Thanks,
obhi

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!