Discussion:
[osg-users] OpenGL viewport error (with Oculus)
Riccardo Corsi
2018-10-17 10:43:30 UTC
Permalink
Hi all,

when using my application with the Oculus I get the following GL error at
every frame:
*Warning: detected OpenGL error 'invalid operation' after applying
attribute Viewport *

This error is coming from the call RenderStage::drawImplementation()
<https://github.com/openscenegraph/OpenSceneGraph/blob/master/src/osgUtil/RenderStage.cpp#L1333>
but
the _viewport is valid. I'm not so familiar with the backend to understand
where this error might come from.
Any hint to debug this?

Note: I'm using the Oculus through osgOculusViewer
<https://github.com/bjornblissing/osgoculusviewer>.
The sample Oculus viewer works fine without GL errors.
My app is setup the same way, I cannot spot any sensible difference.

I'm using win10, osg 3.6.3

Thanks,
Riccardo
Robert Osfield
2018-10-17 10:56:20 UTC
Permalink
Hi Riccardo,

The OSG doesn't do fine grained GL error checking by default so when it
does check for a GL error this error may have occurred many GL operations
before, so while the error may have been reported just after a viewport is
set it could well be prior operations that are the cause.

You can enable finer grained GL error checking by setting the
OSG_GL_ERROR_CHECKING env var to ON i.e.

set OSG_GL_ERROR_CHECKING=ON

This will hopefully give you a more precise location of the error.

Robert.
Post by Riccardo Corsi
Hi all,
when using my application with the Oculus I get the following GL error at
*Warning: detected OpenGL error 'invalid operation' after applying
attribute Viewport *
This error is coming from the call RenderStage::drawImplementation()
<https://github.com/openscenegraph/OpenSceneGraph/blob/master/src/osgUtil/RenderStage.cpp#L1333> but
the _viewport is valid. I'm not so familiar with the backend to understand
where this error might come from.
Any hint to debug this?
Note: I'm using the Oculus through osgOculusViewer
<https://github.com/bjornblissing/osgoculusviewer>.
The sample Oculus viewer works fine without GL errors.
My app is setup the same way, I cannot spot any sensible difference.
I'm using win10, osg 3.6.3
Thanks,
Riccardo
_______________________________________________
osg-users mailing list
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Riccardo Corsi
2018-10-17 11:17:16 UTC
Permalink
Hi Robert,

the error I've reported is what I get with the env var already ON.
Unfortunately it doesn't add any more details.
Riccardo
Post by Robert Osfield
Hi Riccardo,
The OSG doesn't do fine grained GL error checking by default so when it
does check for a GL error this error may have occurred many GL operations
before, so while the error may have been reported just after a viewport is
set it could well be prior operations that are the cause.
You can enable finer grained GL error checking by setting the
OSG_GL_ERROR_CHECKING env var to ON i.e.
set OSG_GL_ERROR_CHECKING=ON
This will hopefully give you a more precise location of the error.
Robert.
Post by Riccardo Corsi
Hi all,
when using my application with the Oculus I get the following GL error at
*Warning: detected OpenGL error 'invalid operation' after applying
attribute Viewport *
This error is coming from the call RenderStage::drawImplementation()
<https://github.com/openscenegraph/OpenSceneGraph/blob/master/src/osgUtil/RenderStage.cpp#L1333> but
the _viewport is valid. I'm not so familiar with the backend to understand
where this error might come from.
Any hint to debug this?
Note: I'm using the Oculus through osgOculusViewer
<https://github.com/bjornblissing/osgoculusviewer>.
The sample Oculus viewer works fine without GL errors.
My app is setup the same way, I cannot spot any sensible difference.
I'm using win10, osg 3.6.3
Thanks,
Riccardo
_______________________________________________
osg-users mailing list
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Robert Osfield
2018-10-17 12:32:36 UTC
Permalink
Post by Riccardo Corsi
the error I've reported is what I get with the env var already ON.
Unfortunately it doesn't add any more details.
Try adding GL checks around any of the Oculus related code.

Robert.
Riccardo Corsi
2018-10-19 14:37:40 UTC
Permalink
I've tracked the issue down to the fact that it is necessary to call
viewer.setReleaseContextAtEndOfFrameHint(false);
for the Oculus to work properly.

Thanks,
Riccardo
Post by Robert Osfield
Post by Riccardo Corsi
the error I've reported is what I get with the env var already ON.
Unfortunately it doesn't add any more details.
Try adding GL checks around any of the Oculus related code.
Robert.
_______________________________________________
osg-users mailing list
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Robert Osfield
2018-10-19 14:55:20 UTC
Permalink
Hi Riccardo,
Post by Riccardo Corsi
I've tracked the issue down to the fact that it is necessary to call
viewer.setReleaseContextAtEndOfFrameHint(false);
for the Oculus to work properly.
Is it running single context, single threading and then using GL calls in
the main thread?

Robert.
Riccardo Corsi
2018-10-22 08:45:30 UTC
Permalink
Hi Robert,

yes, it's single context, single thread, all GL calls are done by osg and
osgOculusViewer in the various camera draw callbacks.
Post by Robert Osfield
Hi Riccardo,
Post by Riccardo Corsi
I've tracked the issue down to the fact that it is necessary to call
viewer.setReleaseContextAtEndOfFrameHint(false);
for the Oculus to work properly.
Is it running single context, single threading and then using GL calls in
the main thread?
Robert.
_______________________________________________
osg-users mailing list
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Loading...