OpenGL multithreading/shared context and glGenBuffers

c++, multithreading, opengl

Solution

Vaos aren't shared so you'll need to generate a new vao for each object per context or else the behavior will become unpredictable and incorrect upon deletion / creation of a new one. This can be a major source of error. Vbos can be shared, so you just need one vbo per object.

Problem

If I plan to use multithreading in OpenGL, should I have separate buffers (from glGenBuffers) for each context? I do not know much about OpenGL multithreading yet (for now I work in "single" thread). I need to know if I can share buffers already pushed to Video Memory (with glBufferData/glBufferSubData), or I have to keep copy of buffer for another thread.

Original source

Related problems