Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crash in new VAO code #165

Closed
gedalia opened this issue Nov 10, 2016 · 6 comments
Closed

crash in new VAO code #165

gedalia opened this issue Nov 10, 2016 · 6 comments

Comments

@gedalia
Copy link

gedalia commented Nov 10, 2016

while loading a flt file I'm seeing a crash in the new vao code, I hooked up gldebugoutput and got the following warning
OpenGL Driver Info:
Vendor: NVIDIA Corporation
Renderer: GeForce GTX 980M/PCIe/SSE2
Version: 4.5.0 NVIDIA 372.54
gl debug message: source = 33350
type = ERROR
id = 1282
severity = HIGH
message = GL_INVALID_OPERATION error generated. Invalid VAO/VBO/pointer usage.
Attaching some sample code to demonstrate the debug callback:
gldebugoutput.txt

GlDebugCallback(unsigned int source=33350, unsigned int type=33356, unsigned int id=1282, unsigned int severity=37190, int length=68, const char * message=0x0000000066011b80, const void * userParam=0x0000000000000000) Line 53	C++
0000000064af218b()	Unknown
00000000648c2860()	Unknown
00000000648c294c()	Unknown
00000000648c28f5()	Unknown
NormalArrayDispatch::enable_and_dispatch(osg::State & __formal={...}, const osg::Array * new_array=0x0000029d80ea96c0) Line 233	C++
osg::VertexArrayState::setArray(osg::VertexArrayState::ArrayDispatch * vad=0x0000029d812b8b70, osg::State & state={...}, const osg::Array * new_array=0x0000029d80ea96c0) Line 673	C++
osg::VertexArrayState::setNormalArray(osg::State & state={...}, const osg::Array * array=0x0000029d80ea96c0) Line 133	C++
osg::Geometry::drawVertexArraysImplementation(osg::RenderInfo & renderInfo={...}) Line 861	C++

osg::Geometry::drawImplementation(osg::RenderInfo & renderInfo={...}) Line 802 C++
osg::Drawable::drawInner(osg::RenderInfo & renderInfo={...}) Line 273 C++
osg::Drawable::draw(osg::RenderInfo & renderInfo={...}) Line 525 C++
osgUtil::RenderLeaf::render(osg::RenderInfo & renderInfo={...}, osgUtil::RenderLeaf * previous=0x0000000000000000) Line 84 C++
osgUtil::RenderBin::drawImplementation(osg::RenderInfo & renderInfo={...}, osgUtil::RenderLeaf * & previous=0x0000000000000000) Line 488 C++
osgUtil::RenderStage::drawImplementation(osg::RenderInfo & renderInfo={...}, osgUtil::RenderLeaf * & previous=0x0000000000000000) Line 1403 C++
osgUtil::RenderBin::draw(osg::RenderInfo & renderInfo={...}, osgUtil::RenderLeaf * & previous=0x0000000000000000) Line 432 C++
osgUtil::RenderStage::drawInner(osg::RenderInfo & renderInfo={...}, osgUtil::RenderLeaf * & previous=0x0000000000000000, bool & doCopyTexture=false) Line 934 C++
osgUtil::RenderStage::draw(osg::RenderInfo & renderInfo={...}, osgUtil::RenderLeaf * & previous=0x0000000000000000) Line 1244 C++

it's possible that it's due to using old style client pointers
but even disabling OSG_GL_VERTEX_ARRAY_FUNCS_AVAILABLE, and modifying drawable.cpp

a number of things try to turn on display lists as well:
src\osgPlugins\OpenFlight\GeometryRecords.cpp
which uses the default Geometry constructor which turns on display lists
and
GLObjectsVisitor(Mode mode=COMPILE_DISPLAY_LISTS|COMPILE_STATE_ATTRIBUTES|CHECK_BLACK_LISTED_MODES);
even disabling all this stuff the crash still happens.

@openscenegraph
Copy link
Owner

Unfortunately there isn't for me to go on when looking at trying to reproduce the issue. Would it be possible to get access to the flight file that causes the problem? Sending the data to be directly via email would be sufficient.

Does the problem occur when loading all flight files? Does it occur when running the standard osgviewer?

@gedalia
Copy link
Author

gedalia commented Nov 11, 2016

so I can't get it to work on any flight file that I check, But here's a link to one of my test cases
https://www.dropbox.com/s/k6tcyo8xhfaq1id/default_stage7.zip?dl=0
I'm loading it via the osgTerrain example
I had to made the following changes to get it to run in the vao pipeline
-GLObjectsVisitor(Mode mode=COMPILE_DISPLAY_LISTS|COMPILE_STATE_ATTRIBUTES|CHECK_BLACK_LISTED_MODES);
+GLObjectsVisitor(Mode mode=COMPILE_STATE_ATTRIBUTES|CHECK_BLACK_LISTED_MODES);

Drawable::Drawable()
_useVertexBufferObjects = true;
_useDisplayList = false;

Geometry::Geometry():
_useVertexBufferObjects = true;

osgterrain.cpp
int main(int argc, char** argv)
{

  • osg::DisplaySettings::instance()->setVertexBufferHint(osg::DisplaySettings::VERTEX_ARRAY_OBJECT);

I had to muck with the defaults in include/GL too,
hope this helps

@openscenegraph
Copy link
Owner

Thanks for the file, I've downloaded it and reproduced the crash with git master by doing:

export OSG_VERTEX_BUFFER_HINT=VAO
osgviewer flt/default_stage7.flt

I also see a GL warning just before the crash:

Warning: detected OpenGL error 'invalid operation' at After Renderer::compile

When I use VBO it works fine and don't get any GL warnings. I don't yet know the cause of the problem. Now I can reproduce the issue I'm optimistic of getting a fix in, should be fixed early next week.

@gedalia
Copy link
Author

gedalia commented Nov 14, 2016

you might want to set up the gldebugoutput callback since it lets you get a stack trace directly from the function that had the problem, Details at https://www.opengl.org/wiki/Debug_Output (that's where I got the stack trace) it's not totally clear to me where the best place would be to set it up in the osg code base would be, but I made a changeset for the debug label infrastructure.
Thanks for looking into it.

@openscenegraph
Copy link
Owner

It took me quite a while to track down the cause of the crash, it turned out to be inconsistent set up of the osg::BufferObject assigned to the osg::Geometry arrays, this inconsistent set up was due to the OpenFlight setting the osg::Geometry it creates it a bit of adhoc way that it defeats the normal ways that the osg::Geometry attempts to prevent these inconsistent states being set up.

To fix the problem I introduced a osg::Geometry::configureBufferObjects() and psg::ConfigureBufferObjectsVisitor to help detect these problems and fix them, and add usage of this to the OpenFlight plugin. This fixes can be found it git master, via the two commits:

5b37512
36b2dda

@gedalia
Copy link
Author

gedalia commented Nov 14, 2016

thanks I'll give it a shot

On Mon, Nov 14, 2016 at 1:08 PM, OpenSceneGraph git repository <
notifications@github.com> wrote:

It took me quite a while to track down the cause of the crash, it turned
out to be inconsistent set up of the osg::BufferObject assigned to the
osg::Geometry arrays, this inconsistent set up was due to the OpenFlight
setting the osg::Geometry it creates it a bit of adhoc way that it defeats
the normal ways that the osg::Geometry attempts to prevent these
inconsistent states being set up.

To fix the problem I introduced a osg::Geometry::configureBufferObjects()
and psg::ConfigureBufferObjectsVisitor to help detect these problems and
fix them, and add usage of this to the OpenFlight plugin. This fixes can be
found it git master, via the two commits:

5b37512
5b37512
36b2dda
36b2dda


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#165 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAQKPNnaSuBFyGorot9J1FELzXeU5Gxoks5q-KOlgaJpZM4KvI-k
.


cel: 917.776.8346

http://www.gedalia.net

Fight Entropy!!! Fight Entropy!!! Figth Etnropy! !
iFgth Etnrop!y ! giFth tErno!py ! giFt htrEno!p y! --- Well maybe
not...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants