]> git.tdb.fi Git - libs/gl.git/blobdiff - source/texture3d.cpp
Add aliases for uniform statements without the type suffix
[libs/gl.git] / source / texture3d.cpp
index 61c745bb95bf4d8ae3df56c1c94c7aec43a686f7..d5badc725435fb3efb37d4c15c52bedafd40ece6 100644 (file)
@@ -41,7 +41,8 @@ void Texture3D::allocate(unsigned level)
        if(allocated&(1<<level))
                return;
 
-       image(level, get_base_pixelformat(ifmt), UNSIGNED_BYTE, 0);
+       PixelFormat base_fmt = get_base_pixelformat(ifmt);
+       image(level, base_fmt, get_alloc_type(base_fmt), 0);
 }
 
 void Texture3D::image(unsigned level, PixelFormat fmt, DataType type, const void *data)
@@ -60,6 +61,7 @@ void Texture3D::image(unsigned level, PixelFormat fmt, DataType type, const void
        allocated |= 1<<level;
        if(gen_mipmap && level==0)
        {
+               auto_generate_mipmap();
                for(; (w || h || d); w>>=1, h>>=1, d>>=1, ++level) ;
                allocated |= (1<<level)-1;
        }