Re: [osg-users] Invalid operation on immutable texture

2020-03-25 Thread julienvalentin51

I made a PR prefering a new bool in TextureObject to the glGetTexParameter 
solution. However, this solution breaks binary compatibility...

Le mercredi 25 mars 2020 22:25:45 UTC+1, julienvalentin51 a écrit :
>
> What i can think of that doesn't break whole design is to call 
> glGetTexParameter 
>  
> (GL_TEXTURE_IMMUTABLE_FORMAT) 
> before calling glTexStorage
>
> Le lundi 23 mars 2020 16:39:50 UTC+1, OpenSceneGraph Users a écrit :
>>
>> Hi, 
>>
>> I'm trying to find the origin of the two warnings we're getting in our 
>> application (OpenSceneGraph 3.6.4): 
>>Warning: detected OpenGL error 'invalid operation' after applying 
>> attribute Viewport 0x576608a0 
>>Warning: detected OpenGL error 'invalid operation' after applying 
>> GLMode 0xc11 
>>
>> If I'm using the OpenGL debug message extension then I can see a 
>> GL_INVALID_OPERATION 
>> with the message 'Texture is immutable' caused by a call of 
>> glTexStorage2D in 'Texture2D.cpp' 
>> in line 309. Both warnings are printed directly after this invalid 
>> operation. 
>>
>> I'm wondering how the texture object can ever be immutable here, because 
>> it's just created in line 306. 
>>
>> Any ideas? Thanks! 
>>
>> Greetings, 
>> Daniel 
>> ___ 
>> osg-users mailing list 
>> osg-...@lists.openscenegraph.org 
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org 
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osg-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osg-users/0f56477c-7114-4956-b359-f694f6da180a%40googlegroups.com.


Re: [osg-users] Invalid operation on immutable texture

2020-03-25 Thread julienvalentin51
What i can think of that doesn't break whole design is to call 
glGetTexParameter 
 
(GL_TEXTURE_IMMUTABLE_FORMAT) 
before calling glTexStorage

Le lundi 23 mars 2020 16:39:50 UTC+1, OpenSceneGraph Users a écrit :
>
> Hi, 
>
> I'm trying to find the origin of the two warnings we're getting in our 
> application (OpenSceneGraph 3.6.4): 
>Warning: detected OpenGL error 'invalid operation' after applying 
> attribute Viewport 0x576608a0 
>Warning: detected OpenGL error 'invalid operation' after applying 
> GLMode 0xc11 
>
> If I'm using the OpenGL debug message extension then I can see a 
> GL_INVALID_OPERATION 
> with the message 'Texture is immutable' caused by a call of glTexStorage2D 
> in 'Texture2D.cpp' 
> in line 309. Both warnings are printed directly after this invalid 
> operation. 
>
> I'm wondering how the texture object can ever be immutable here, because 
> it's just created in line 306. 
>
> Any ideas? Thanks! 
>
> Greetings, 
> Daniel 
> ___ 
> osg-users mailing list 
> osg-...@lists.openscenegraph.org  
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org 
>

-- 
You received this message because you are subscribed to the Google Groups 
"OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osg-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osg-users/8907ae48-d94d-4fd3-bf0f-872da9b82bc2%40googlegroups.com.


Re: [osg-users] Invalid operation on immutable texture

2020-03-25 Thread Chris Djali / AnyOldName3
Hi Daniel,

It should be as simple as setting up a texture, using it to draw something, 
and then setting up a different texture to use instead. As long as the 
first one goes out of scope properly, it should end up in the orphaned 
pool, and then will eventually get reused. You might have to replace the 
texture multiple times before new ones get taken from the pool, though.

The following is probably more relevant for Robert:

This also seems to be the cause of an issue OpenMW's been tracking for a 
while: https://gitlab.com/OpenMW/openmw/issues/4773. We have stack traces 
and APITrace traces there if that helps. We'd got as far as identifying the 
commit responsible, but hadn't made the link between recycling things from 
the orphaned pool and immutable storage (although I know I'd looked at the 
orphaned pool already, so I guess it was before I'd done anything with 
immutable storage or I'd have made the connection). I've brought it up here 
in the past, but Robert didn't want to open an issue upstream until we were 
sure OpenMW wasn't doing anything dumb. I'm glad someone else has appeared 
who's done the hard part of tracking the problem down.

Cheers,

Chris

On Wednesday, 25 March 2020 09:17:16 UTC, OpenSceneGraph Users wrote:
>
> Hi Robert, 
>
> > From your description it does sounds like reusing of the texture 
> > objects should be forbidden. 
>
> I think it might be fine to reuse the texture objects, because 
> 'Texture::generateAndAssignTextureObject' takes all the parameters 
> needed by 'glTexStorage2D', so the returned texture object should 
> already have the right storage. What currently is missing, is a flag on 
> the texture object, if 'glTexStorage2D' has already been called for it. 
>
> > Could you create an example that reproduces the issue? We can then 
> > use these as testbed for any fixes we come up with. 
>
> I don't quite know how I should trigger this case in an example. I've 
> suspected that if a Texture2D gets deleted, then somehow its texture 
> object gets added to 'TextureObjectSet::_orphanedTextureObjects'. But 
> I can't find this in the code. I'm only seeing additions to 
> '_orphanedTextureObjects' in 'TextureObjectSet::deleteAllTextureObjects' 
> and 'TextureObjectSet::handlePendingOrphandedTextureObjects'. 
>
> Greetings, 
> Daniel 
> ___ 
> osg-users mailing list 
> osg-...@lists.openscenegraph.org  
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org 
>

-- 
You received this message because you are subscribed to the Google Groups 
"OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osg-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osg-users/132a649b-b316-43ce-afec-e2cd8da7db45%40googlegroups.com.