]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/texture3d.cpp
Tweak some texture allocation checks
[libs/gl.git] / source / core / texture3d.cpp
index 9db8b06150b110a525e8569a9ee0074badef7f51..bdb87882e878333c23e88373bc85b57d277c7e74 100644 (file)
@@ -57,8 +57,6 @@ void Texture3D::allocate(unsigned level)
                throw invalid_operation("Texture3D::allocate");
        if(level>=levels)
                throw invalid_argument("Texture3D::allocate");
-       if(allocated&(1<<level))
-               return;
 
        bool direct = ARB_texture_storage && ARB_direct_state_access;
        if(!direct)
@@ -75,6 +73,9 @@ void Texture3D::allocate(unsigned level)
 
 void Texture3D::allocate_(unsigned level)
 {
+       if(allocated&(1<<level))
+               return;
+
        if(ARB_texture_storage)
        {
                GLenum fmt = get_gl_pixelformat(storage_fmt);