Hello Allen,
Allen Bierbaum wrote:
> I am running into a very strange intermittent bug where it looks like
> OpenSG may be getting a system exception (possibly failed new or
> something similar) deep in the middle of a render traversal and then
> ends up with stack overflows in OpenGL because the state doesn't get
> reset correctly after the exception.
hm, the render traversal itself almost does *not* touch the OpenGL
state, that mostly happens when the draw tree is processed, i.e. in
RenderPartition::doExecution and below. Off the top of my head I can't
think of any allocation happening when processing the draw tree.
> I am just theorizing here, I still need to track it down more, but I
> wanted to ask the question.
>
> If this happens, if OpenSG gets an exception doing in some render
> code, does it do anything to clean up the OpenGL state machine?
no, the exception will happily bubble up the stack and leave OpenGL alone.
> For
> example will it pop the matrix stack back to the same size it was
> before starting the render, same thing with the other stacks and the
> rendering state.
>
> If not, does anyone know how to do this or have any sample code for doing
> this?
well, I guess every change to OpenGL state would have to be turned into
creation of a "guard" object, which sets the state in its c'tor and
resets it in the d'tor, i.e. do resource acquisition is instantiation.
Or you'd have to place explicit handling code in every code path, ugly
and hard to get right IMHO.
When using RAI on the other hand you have to figure out how to handle
the state efficiently as you don't want to go back to the defaults when
switching between two chunks of the same type. Also the idea of all
these objects created in the render path is not overly appealing, even
if they are small and on the stack.
Cheers,
Carsten
------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users