From f3607134a2a2fa3279976b1edc50e1f2e3b3cd82 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 10 Nov 2017 17:12:20 +0000 Subject: [PATCH] Fixed handling of GL_TEXTURE_CUBE_MAP when using glTextureStorage. --- src/osg/Texture.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/osg/Texture.cpp b/src/osg/Texture.cpp index ea2c9a94d..8802b6cce 100644 --- a/src/osg/Texture.cpp +++ b/src/osg/Texture.cpp @@ -2313,7 +2313,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 ) {