diff --git a/src/osg/Texture.cpp b/src/osg/Texture.cpp index 25782619f..752cb22d9 100644 --- a/src/osg/Texture.cpp +++ b/src/osg/Texture.cpp @@ -2286,7 +2286,17 @@ void Texture::applyTexImage2D_load(State& state, GLenum target, const Image* ima if(useTexStorrage) { - extensions->glTexStorage2D(target, numMipmapLevels, sizedInternalFormat, width, height); + if (getTextureTarget()==GL_TEXTURE_CUBE_MAP) + { + if (target==GL_TEXTURE_CUBE_MAP_POSITIVE_X) + { + extensions->glTexStorage2D(GL_TEXTURE_CUBE_MAP, numMipmapLevels, sizedInternalFormat, width, height); + } + } + else + { + extensions->glTexStorage2D(target, numMipmapLevels, sizedInternalFormat, width, height); + } if( !compressed_image ) {