]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/texturecube.cpp
Tweak some texture allocation checks
[libs/gl.git] / source / core / texturecube.cpp
index 277cba6df35b821d4119060dc83ed64be1dc886c..2db1b63b92162c358618c7c3d7a6a0831ce3cb5e 100644 (file)
@@ -77,8 +77,6 @@ void TextureCube::allocate(unsigned level)
                throw invalid_operation("TextureCube::allocate");
        if(level>=levels)
                throw invalid_argument("TextureCube::allocate");
-       if(allocated&(64<<level))
-               return;
 
        bool direct = ARB_texture_storage && ARB_direct_state_access;
        if(!direct)
@@ -95,6 +93,9 @@ void TextureCube::allocate(unsigned level)
 
 void TextureCube::allocate_(unsigned level)
 {
+       if(allocated&(64<<level))
+               return;
+
        if(ARB_texture_storage)
        {
                GLenum fmt = get_gl_pixelformat(storage_fmt);