From e452923f1effdfd015ca32b8830b9ddfda696570 Mon Sep 17 00:00:00 2001 From: Kim Motoyoshi Kalland Date: Wed, 15 Feb 2012 12:45:08 +0100 Subject: Corrected the size of mipmaps in framebuffer objects. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ia3c0daefc6537b12be7f9072e7defc0631794690 Reviewed-by: Samuel Rødal --- src/opengl/qglframebufferobject.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/opengl/qglframebufferobject.cpp') diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp index 96479e189e..21b3abfdd8 100644 --- a/src/opengl/qglframebufferobject.cpp +++ b/src/opengl/qglframebufferobject.cpp @@ -459,8 +459,8 @@ void QGLFramebufferObjectPrivate::init(QGLFramebufferObject *q, const QSize &sz, int height = size.height(); int level = 0; while (width > 1 || height > 1) { - width = (width + 1) >> 1; - height = (height + 1) >> 1; + width = qMax(1, width >> 1); + height = qMax(1, height >> 1); ++level; glTexImage2D(target, level, internal_format, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); -- cgit v1.2.3