[osg-users] Minor change proposal : Blacklist usage of all unsized texture internat format

Julien Valentin julienvalentin51 at gmail.com
Wed Aug 15 13:57:32 PDT 2018


the killer feature requiring immutable texture is BindImageTexture...


mp3butcher wrote:
> Immutable Storage  mandatory for lot of GL4 features:
> TextureImage synchronization,TextureView, persistance mapping, virtual texture and surely other stuff I didn't used yet
> 
> Further it's better for the driver checks
> 
> 
> robertosfield wrote:
> > Hi Julien,
> > 
> > On Wed, 15 Aug 2018 at 16:35, Julien Valentin
> > <> wrote:
> > 
> > > I'll do the pr you want from me
> > > (with this ugly patch code:
> > > 
> > > Code:
> > > 
> > > ex for Texture2D:
> > > if( useTexStorrage)
> > > extensions->glTexStorage2D( GL_TEXTURE_2D, (_numMipmapLevels >0)?_numMipmapLevels:1,
> > > _sourceFormat ? assumeSizedInternalFormat(_internalFormat,_sourceFormat) :
> > > assumeSizedInternalFormat(_internalFormat,GL_UNSIGNED_BYTE),
> > > _textureWidth, _textureHeight);
> > > )
> > > 
> > > 
> > 
> > It is indeed ugly change, the best way to avoid this code complexity
> > would be to push the test into a dedicated helper method such
> > selectInternalFormat().  I don't saying this is the actual solution to
> > go for but that's the general way to avoid extra tests from
> > obfuscating local code.
> > 
> > --
> > 
> > However, having don't a first pass look into the wider glTexStorage
> > issue I'm truck by just by adding glTexStorage* usage is what is
> > complicating all the texture setup code, as glTexStorage isn't
> > available everywhere we can't remove the old glTexImage calls, so we
> > are stuck with two code paths, in some case these two code paths have
> > lots of nested if () blocks within them so it's a substantial amount
> > of code that is being added.
> > 
> > Every line of extra code is an extra potential sight for bugs, every
> > extra optional code path adds another platform combination that needs
> > testing - and as us developers are limited resource each of these code
> > paths has less usage exposure, the less exposure the more likely bugs
> > are likely to creep into the code without being spotted.
> > 
> > So for code quality we need to avoid optional code path where
> > possible.  If we have to introduce an optional code path it has to be
> > justified by real functionality.
> > 
> > So for the topic of glTexStorage I'm asking do we *really* need it,
> > what things can't be done without it's usage.
> > 
> > What is the killer feature that requires use of glTexSorage?  This is
> > an honest question, I want to know.
> > 
> > Robert.
> > _______________________________________________
> > osg-users mailing list
> > 
> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> > 
> >  ------------------
> > Post generated by Mail2Forum
> 


------------------------
Twirling twirling twirling toward freedom

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=74536#74536







More information about the osg-users mailing list