X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Fframebuffer.cpp;h=45eaff656b65322a5d137133061e9e2ce35924ac;hb=3efe3bab1c8290bd49a957ebec0ad97e58a35fcf;hp=8a1a52316f9fa6835e685570f6357d14955389d0;hpb=f4f81f1d86d50b29b9a44b237f67c6f5ad8f0523;p=libs%2Fgl.git diff --git a/source/core/framebuffer.cpp b/source/core/framebuffer.cpp index 8a1a5231..45eaff65 100644 --- a/source/core/framebuffer.cpp +++ b/source/core/framebuffer.cpp @@ -60,6 +60,7 @@ void Framebuffer::check_size() { unsigned w = 0; unsigned h = 0; + unsigned l = 1; if(const Texture2D *tex2d = dynamic_cast(a.tex)) { w = max(tex2d->get_width()>>a.level, 1U); @@ -74,23 +75,27 @@ void Framebuffer::check_size() { w = max(tex3d->get_width()>>a.level, 1U); h = max(tex3d->get_height()>>a.level, 1U); + l = (a.layer<0 ? tex3d->get_depth() : 1); } else if(const TextureCube *tex_cube = dynamic_cast(a.tex)) { w = max(tex_cube->get_size()>>a.level, 1U); h = w; + l = (a.layer<0 ? 6 : 1); } if(first) { width = w; height = h; + layers = l; first = false; } else { width = min(width, w); height = min(height, h); + layers = min(layers, l); } } }