[osg-users] minor change: move assumeSizedInternallFormat from Texture to Image

Robert Osfield robert.osfield at gmail.com
Fri Aug 17 02:02:41 PDT 2018


Hi Julien,

On Fri, 17 Aug 2018 at 03:19, Julien Valentin
<julienvalentin51 at gmail.com> wrote:
>
> ..But my question was
> If I'd make a pr with this fix for all Textures
>
> Code:
>   if( useTexStorrage)
>         {
>             //ensure _internalFormat is sized
>             GLenum sized_internalFormat = _internalFormat;
>             if(!isSizedInternalFormat( sized_internalFormat))
>                     sized_internalFormat =  assumeSizedInternalFormat( sized_internalFormat, _sourceType==0 ? _sourceType : GL_UNSIGNED_BYTE);
>             if(!sized_internalFormat)
>                 OSG_WARN<<"Texture2D : can't generate TextureStorage for  internalFormat: "<<_internalFormat<<" and  SourceType: "<<_sourceType==0 ? _sourceType : GL_UNSIGNED_BYTE<<std::endl;
>             extensions->glTexStorage2D( GL_TEXTURE_2D, (_numMipmapLevels >0)?_numMipmapLevels:1, sized_internalFormat, _textureWidth, _textureHeight);
>         };
>
> Would you accept it?

This morning I'll do a full code review of the glTexStorage usage and
surround code and have a think how we might be handle the internal
format issue.  I'll use the above as a guide as to one possible route.
I can't provide any guidance until I've done the full code review.

Cheers,
Robert.


More information about the osg-users mailing list