X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbackends%2Fopengl%2Ftexture2darray_backend.cpp;h=edca615d91a8440ca7cabfa3fca8b7db235a9a0e;hb=8a8cce8ef4ee28b3572a72958b8b407759f9f826;hp=610229ba4acf96f16cb7d4cf92761ab21c5c128f;hpb=160e9eea29bd10034733d59507fa1bcca36be401;p=libs%2Fgl.git diff --git a/source/backends/opengl/texture2darray_backend.cpp b/source/backends/opengl/texture2darray_backend.cpp index 610229ba..edca615d 100644 --- a/source/backends/opengl/texture2darray_backend.cpp +++ b/source/backends/opengl/texture2darray_backend.cpp @@ -10,5 +10,17 @@ OpenGLTexture2DArray::OpenGLTexture2DArray(): static Require _req(EXT_texture_array); } +size_t OpenGLTexture2DArray::get_data_size() const +{ + if(!id) + return 0; + + size_t level_size = width*height*get_pixel_size(format); + size_t total_size = level_size; + for(unsigned i=0; i>=2) + total_size += level_size*depth; + return total_size; +} + } // namespace GL } // namespace Msp