Hello All,
I wonder how can I make sure that glBufferObjects are properly shared ?
My app runs two renderthreads, rendering the same scene , using the
same BufferObjectBinding. I want to share GLContext and need to work
on the same buffer object from both threads.
Under Debug I can see that glBufferObjects are created for each
RenderThread by GlBufferObject::Extensions::glGenBuffers() , even if I
have only one BufferObject in my Scene, so I guess there are 2 copies in
GPU memory for each context. Under execution I see that one renderthread
is working on" the right" BufferMemory while the other one is reading
data from the second glBufferObject. I want to avoid this and want to
make sure that both renderthreads are reading from the same buffer on GPU.
Maybe I need to tell OSG that it should not create a BufferObject for
each RenderThread , instead it should share the only one BufferObject I
want to read from both threads ?
This way I tried to share GL Context between two renderthreads:
firstRenderThreadTraits->sharedContext = secondRenderThreadContext;
(called before realize()) ist this enough for proper sharing ?
This way I access BufferObject data from VertexShader Program :
layout(std140, binding = 0) buffer particles{vec4 p[];};
Did I forgot to set something something in my app code, or do I need to
dig deeper in this case ?
thanks, Markus
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org