Corrected the size of mipmaps in framebuffer objects.

Change-Id: Ia3c0daefc6537b12be7f9072e7defc0631794690
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
This commit is contained in:
Kim Motoyoshi Kalland 2012-02-15 12:45:08 +01:00 committed by Qt by Nokia
parent b8342ad6fd
commit e452923f1e
2 changed files with 4 additions and 4 deletions

View File

@ -414,8 +414,8 @@ void QOpenGLFramebufferObjectPrivate::init(QOpenGLFramebufferObject *, const QSi
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);

View File

@ -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);