Hi Robert,

If the buffer_value is being resize multi-threaded then this in an
indication that the the buffer isn't a large enough value before
threading started.

Yes, indeed, and this is the case for most uses of OSG. Generally, you'll load the scene data first (so the buffered_value will be set to size 0 as you don't have any contexts yet) and only then will you create your viewer and contexts.

Even if you create your viewer first, you generally won't call realize() (which creates the contexts) until after all your scene data is loaded, because otherwise it would show an empty window for the time you're loading the scene data, which users don't like.

In the mean time have using
DisplaySettings::setMaxNumberOfGraphicsContexts(uint) to make sure
enough contexts are set up are the begging.

I don't think this is feasible, since the number of windows I need is driven by config files, and I load these with the scene data. So even if I would call this once I know the value to pass to it, it would already be too late as the scene data would have been created and the buffered_values would have been constructed with the old value of maxNumberOfGraphicsContexts.

But I'll look into it, as it's still a workaround, but a less hacky one.

On try calling
viewer.getSceneData()->resizeGLObjectsBuffers(uint) prior to
restarting the viewer threads.

osg::Texture::resizeGLObjectBuffers() does this:

void Texture::resizeGLObjectBuffers(unsigned int maxSize)
{
    _textureObjectBuffer.resize(maxSize);
}

but the value that's being resized by the GLObjectsVisitor is _texParametersDirtyList, so calling resizeGLObjectBuffers() won't help.

Whenever you have time, please have a look at the code I sent and (especially) run it. First of all, it will be interesting to see if the issue is reproduced on Linux, and second if it is, you'll see what I mean more clearly than trying to explain it by e-mail.

For now I have a workaround, but it's an issue that might affect others. Though as I understand it not many people do what we do, i.e. run many scenarios in one run of the same program, so it might not affect many others, but still...

Thanks in advance,

J-S
--
______________________________________________________
Jean-Sebastien Guay    jean-sebastien.g...@cm-labs.com
                               http://www.cm-labs.com/
                        http://whitestar02.webhop.org/
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to