]> git.tdb.fi Git - libs/gl.git/blobdiff - source/texture3d.cpp
Use UNSIGNED_SHORT for allocating DEPTH_COMPONENT textures
[libs/gl.git] / source / texture3d.cpp
index 7b9c3590ef6bc7eb8e936e20816c36549bbdec2c..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)