remove redondant variable and test

This commit is contained in:
mp3butcher 2018-08-19 22:46:10 +02:00
parent 29e87780f5
commit 274b6894af

View File

@ -2310,22 +2310,21 @@ void Texture::applyTexImage2D_load(State& state, GLenum target, const Image* ima
int width = inwidth;
int height = inheight;
bool useTexStorage = extensions->isTextureStorageEnabled && extensions->isTexStorage2DSupported() && (_borderWidth==0);
GLenum sizedInternalFormat = useTexStorage ? selectSizedInternalFormat(image) : 0;
OSG_NOTICE<<"New path useTexStorage="<<useTexStorage<<", sizedInternalFormat="<<sizedInternalFormat<<std::endl;
GLenum texStoragesizedInternalFormat = extensions->isTextureStorageEnabled && extensions->isTexStorage2DSupported() && (_borderWidth==0) ? selectSizedInternalFormat(image) : 0;
if (useTexStorage && sizedInternalFormat!=0)
if (texStoragesizedInternalFormat!=0)
{
if (getTextureTarget()==GL_TEXTURE_CUBE_MAP)
{
if (target==GL_TEXTURE_CUBE_MAP_POSITIVE_X)
{
extensions->glTexStorage2D(GL_TEXTURE_CUBE_MAP, numMipmapLevels, sizedInternalFormat, width, height);
// only allocate on first face image
extensions->glTexStorage2D(GL_TEXTURE_CUBE_MAP, numMipmapLevels, texStoragesizedInternalFormat, width, height);
}
}
else
{
extensions->glTexStorage2D(target, numMipmapLevels, sizedInternalFormat, width, height);
extensions->glTexStorage2D(target, numMipmapLevels, texStoragesizedInternalFormat, width, height);
}
if( !compressed_image )