Best way to debug detected OpenGL error 'invalid value' at top of State::apply(StateSet*)

28 views
Skip to first unread message

Erik Hensens

unread,
May 29, 2020, 5:41:49 PM5/29/20
to OpenSceneGraph Users
Hello everyone!

I've been chasing a bad bug (you can tell by my recent posts) and I think it's related to a warning I get that there is an 'invalid value' detected by glGetError which was originally first detected at the start of State::apply(StateSet*) since I turned on ONCE_PER_ATTRIBUTE checking for GL errors.

Since then, I've manually added checking for GL errors at the beginning an end of almost all State methods, and I've since narrowed it down, and now the first time I get the warning is at the top of State::applyProjectionMatrix(const osg::RefMatrix*)

My question is: how can I find out what the underlying problem is? What is the 'invalid value'? Where is it coming from? If I know how that invalid value is begin set (and where, why, etc.) I can debug the underlying issue. As of now, I still don't know what the value is or where it comes from, just that it is first detected at the top of State::applyProjectionMatrix

Please let me know what ideas you have, I am getting desperate for a solution as I've been working on this for a very long time.

Thank you very much!
Erik

Daniel Trstenjak

unread,
Jun 3, 2020, 4:45:28 AM6/3/20
to osg-...@googlegroups.com
> take a look at the GL_KHR_debug and GL_ARB_debug_output extensions. They
> add some checking to OpenGL state changes and report errors.

You can set a breakpoint in the callback function for the errors and
the backtrace will then show you the OpenGL function and its call from OSG.

Daniel Trstenjak

unread,
Jun 3, 2020, 4:45:28 AM6/3/20
to osg-...@googlegroups.com
Hi Erik,

> My question is: how can I find out what the underlying problem is? What is the 'invalid value'?
> Where is it coming from?

take a look at the GL_KHR_debug and GL_ARB_debug_output extensions. They
add some checking to OpenGL state changes and report errors.

Greetings,
Daniel

Glenn Waldron

unread,
Jun 3, 2020, 6:52:34 AM6/3/20
to OpenSceneGraph Users
Download CodeXL and set it to break on OpenGL errors. That will tell you the exact GL call generating the error

Glenn
Reply all
Reply to author
Forward
0 new messages