Discussion:
[osg-users] Core Profile: glEnable/glDisable GL_POINT_SPRITE
Damian Dixon
2018-07-29 13:23:40 UTC
Permalink
Hi,

I have a build of OSG 3.6.2 for GLCORE for Mesa 18.0.5, Intel HD Graphics
620.

I am seeing a lot of warnings/errors around the use of PointSprite.

The warnings/errors are (once per PointSprite):

Warning: detected OpenGL error 'invalid enumerant' at after
RenderBin::draw(..)
Mesa: User error: GL_INVALID_ENUM in glEnable(GL_POINT_SPRITE)

The Intel Mesa i965 driver is fairly strict with regards to Core Profile
and does
not provide a compatibility profile.

I'm using osgEarth so I have to build for Core Profile for osgEarth to work.

I've looked at trying to add additional logic to stop OSG from calling
glEnable/glDIsable for GL_POINT_SPRITE but I can't see a sensible place to
disable calling to glEnable/glDisable.

Core Profile says that GL_POINT_SPRITE is always on so I believe that all
that needs to be done is to not call glEnable/glDisable for GL_POINT_SPRITE.

Regards
Damian
Robert Osfield
2018-07-29 14:28:02 UTC
Permalink
Hi Damian,

The glEnable/glDisable will be done directed by your scene graph via
the StateSet::setMode(GLenum,..), so simply remove the
setMode(GL_POINT_SPRITE).

Robert.
Hi,
I have a build of OSG 3.6.2 for GLCORE for Mesa 18.0.5, Intel HD Graphics 620.
I am seeing a lot of warnings/errors around the use of PointSprite.
Warning: detected OpenGL error 'invalid enumerant' at after RenderBin::draw(..)
Mesa: User error: GL_INVALID_ENUM in glEnable(GL_POINT_SPRITE)
The Intel Mesa i965 driver is fairly strict with regards to Core Profile and does
not provide a compatibility profile.
I'm using osgEarth so I have to build for Core Profile for osgEarth to work.
I've looked at trying to add additional logic to stop OSG from calling
glEnable/glDIsable for GL_POINT_SPRITE but I can't see a sensible place to
disable calling to glEnable/glDisable.
Core Profile says that GL_POINT_SPRITE is always on so I believe that all
that needs to be done is to not call glEnable/glDisable for GL_POINT_SPRITE.
Regards
Damian
_______________________________________________
osg-users mailing list
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Daniel Emminizer, Code 5773
2018-08-01 11:25:23 UTC
Permalink
This post might be inappropriate. Click to display it.
Daniel Emminizer, Code 5773
2018-08-20 13:25:25 UTC
Permalink
Hi Robert,

Still a low priority because I am able to work around in my own code. But wanted to make sure this doesn't get lost in the traffic about texture modes in other threads. The original message had an example .cpp that demonstrated the issue.

Is it worthwhile to create an issue on the github issue tracker?

Thanks.

- Dan
-----Original Message-----
From: Daniel Emminizer, Code 5773
Sent: Wednesday, August 01, 2018 7:25 AM
To: OpenSceneGraph Users
Subject: RE: [osg-users] Core Profile: glEnable/glDisable GL_POINT_SPRITE
Hi Robert,
I just started seeing something similar at the end of the day yesterday. I am
using osg::PointSprite, not using GL_POINT_SPRITE directly. I have some
more background too and I think I see the cause, but not the solution.
PointSprite::checkValidityOfAssociatedModes() is great, and it works great
and is right when called. But I found an edge case where it's not being called
although PointSprite is in the scene.
I have a scene that is generated dynamically on user input. When the Viewer
starts, there are no points, and there is no PointSprite. This is when the
GLObjectsVisitor is called, who is responsible for (among other things) calling
checkValidityOfAssociatedModes(), due to the
Renderer::_compileOnNextDraw flag being set.
Later on in some GUIEventHandler, a GL_POINTS drawable is added with
PointSprite in its stateset. checkValidityOfAssociatedModes() is never called
because the Renderer already did its compile pass. Because it's never called,
we never get to state.setModeValidity(GL_POINT_SPRITE_ARB, modeValid
[false]).
Because of this, the associated mode of PointSprite ends up applying,
causing a GL error. Basically, checkValidityOfAssociatedModes() never gets
called if that mode is not present under the scene, when the scene is first
compiled.
* Adding PointSprite to the osg::View::getCamera() on start-up. Did not
work because GLObjectVisitor only visits scene data.
checkValidityOfAssociatedModes() never called.
* Adding PointSprite to osgViewer::View's root node near setSceneData()
call. This did work.
I can work around this because I do control my View/Viewer and I can add
this PointSprite. But this bug might have other side effects. Though I'm
seeing this in GL3/GLCORE, it is not a bug exclusive to GL core nor to Point
Sprite. (I think)
Attached is a small example that demonstrates the bad behavior. I know
you're not currently working on OSG, for me at least this issue can sit for a
while. But I wanted to provide you with all the info I had while it was fresh in
my mind.
- Dan
-----Original Message-----
Behalf Of Robert Osfield
Sent: Sunday, July 29, 2018 10:28 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Core Profile: glEnable/glDisable
GL_POINT_SPRITE
Hi Damian,
The glEnable/glDisable will be done directed by your scene graph via
the StateSet::setMode(GLenum,..), so simply remove the
setMode(GL_POINT_SPRITE).
Robert.
Robert Osfield
2018-08-22 07:27:04 UTC
Permalink
Hi Dan,

On Tue, 21 Aug 2018 at 23:15, Daniel Emminizer, Code 5773
Post by Daniel Emminizer, Code 5773
Still a low priority because I am able to work around in my own code. But wanted to make sure this doesn't get lost in the traffic about texture modes in other threads. The original message had an example .cpp that demonstrated the issue.
Is it worthwhile to create an issue on the github issue tracker?
If I am not able to address the problem right away then it would make
sense to put it into the Issue tracker to make it easier to find, a
reference back to any associated thread on osg-users ML/forum would
help too.

I will spend some time on it this morning, so no need to add it to
Issue right away, hopefully I'll have a fix before you get online!

Robert.
Robert Osfield
2018-08-22 10:23:22 UTC
Permalink
Hi Dan et. al,

To resolve this issue I have added a mode validity setting to
State::nitializeExtensionProcs(), this resolves the GL warning
generated by the checkvalidity_bug test program. The fix is checked
into master, 3.6 branch and 3.6-TexStorage.

Cheers,
Robert.
Daniel Emminizer, Code 5773
2018-08-22 10:37:12 UTC
Permalink
Hi Robert,

It's on my list to swap over to 3.6-TexStorage to make sure it doesn't break anything. I'll do that in the next couple of days and test this out.

The change looked good from a quick review on 3.6 branch. But on master branch you have "if (false)" around the code block. I'll point out on github to make it easier to find. Looks unintentional and does not match 3.6 branch.

- Dan
-----Original Message-----
Behalf Of Robert Osfield
Sent: Wednesday, August 22, 2018 6:23 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Core Profile: glEnable/glDisable GL_POINT_SPRITE
Hi Dan et. al,
To resolve this issue I have added a mode validity setting to
State::nitializeExtensionProcs(), this resolves the GL warning
generated by the checkvalidity_bug test program. The fix is checked
into master, 3.6 branch and 3.6-TexStorage.
Cheers,
Robert.
_______________________________________________
osg-users mailing list
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Robert Osfield
2018-08-22 13:28:31 UTC
Permalink
On Wed, 22 Aug 2018 at 12:54, Daniel Emminizer, Code 5773
Post by Daniel Emminizer, Code 5773
It's on my list to swap over to 3.6-TexStorage to make sure it doesn't break anything. I'll do that in the next couple of days and test this out.
Thanks.
Post by Daniel Emminizer, Code 5773
The change looked good from a quick review on 3.6 branch. But on master branch you have "if (false)" around the code block. I'll point out on github to make it easier to find. Looks unintentional and does not match 3.6 branch.
I'm a bit confused by this assertion as I don't see the if (false) in
the master branch.

The if (false) was added to help test whether the GL warnings were
visible with/without the fix. I checked in removal of this. Master
shouldn't have this, and I removed this from the 3.6 and
3.6-TexStorage where it was unintentionally checked in.

Robert.
Daniel Emminizer, Code 5773
2018-08-24 12:39:48 UTC
Permalink
Hi Robert,

Don't worry about the assertion you mentioned below: I was looking at the wrong branch, and it looks like your removal occurred within the same hour as my email. It was just a real-life race condition. :)

The code looks fine on my side. Fixes the immediate problem presented.

So good so far on 3.6-TexStorage branch, running on win64 VC-14 (Visual Studio 2015). No issues seen yet.

- Dan
-----Original Message-----
Behalf Of Robert Osfield
Sent: Wednesday, August 22, 2018 9:29 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Core Profile: glEnable/glDisable GL_POINT_SPRITE
On Wed, 22 Aug 2018 at 12:54, Daniel Emminizer, Code 5773
Post by Daniel Emminizer, Code 5773
It's on my list to swap over to 3.6-TexStorage to make sure it doesn't break
anything. I'll do that in the next couple of days and test this out.
Thanks.
Post by Daniel Emminizer, Code 5773
The change looked good from a quick review on 3.6 branch. But on master
branch you have "if (false)" around the code block. I'll point out on github to
make it easier to find. Looks unintentional and does not match 3.6 branch.
I'm a bit confused by this assertion as I don't see the if (false) in
the master branch.
The if (false) was added to help test whether the GL warnings were
visible with/without the fix. I checked in removal of this. Master
shouldn't have this, and I removed this from the 3.6 and
3.6-TexStorage where it was unintentionally checked in.
Robert.
_______________________________________________
osg-users mailing list
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Robert Osfield
2018-08-24 13:45:28 UTC
Permalink
On Fri, 24 Aug 2018 at 13:59, Daniel Emminizer, Code 5773
Post by Daniel Emminizer, Code 5773
So good so far on 3.6-TexStorage branch, running on win64 VC-14 (Visual Studio 2015). No issues seen yet.
Thanks for the testing. Good to hear things are working fine. If
there no reports of issues I'll merge 3.6-TexStorage with the main 3.6
branch and make a 3-6.3-rc1.

Cheers,
Robert.

Daniel Emminizer, Code 5773
2018-08-22 10:38:32 UTC
Permalink
Disregard, looks like you already got it! Thanks.
-----Original Message-----
From: Daniel Emminizer, Code 5773
Sent: Wednesday, August 22, 2018 6:37 AM
To: OpenSceneGraph Users
Subject: RE: [osg-users] Core Profile: glEnable/glDisable GL_POINT_SPRITE
Hi Robert,
It's on my list to swap over to 3.6-TexStorage to make sure it doesn't break
anything. I'll do that in the next couple of days and test this out.
The change looked good from a quick review on 3.6 branch. But on master
branch you have "if (false)" around the code block. I'll point out on github to
make it easier to find. Looks unintentional and does not match 3.6 branch.
- Dan
-----Original Message-----
Behalf Of Robert Osfield
Sent: Wednesday, August 22, 2018 6:23 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Core Profile: glEnable/glDisable GL_POINT_SPRITE
Hi Dan et. al,
To resolve this issue I have added a mode validity setting to
State::nitializeExtensionProcs(), this resolves the GL warning
generated by the checkvalidity_bug test program. The fix is checked
into master, 3.6 branch and 3.6-TexStorage.
Cheers,
Robert.
_______________________________________________
osg-users mailing list
http://lists.openscenegraph.org/listinfo.cgi/osg-users-
openscenegraph.org
Loading...