Avoid checking the fb status in every bind

On some drivers (e.g. NVIDIA, tested on Windows) the
status check is apparently expensive. A simple FBO
test app rendering into the FBO on every frame (and
thus calling bind()) shows a 19-21% CPU usage. With
the patch this gets reduced to 0.8-1%.

The check is fairly useless too - whenever creating
attachments, the status is checked, so d->valid is
up-to-date.

Task-number: QTBUG-50496
Change-Id: Ie9f0db34e5c2bc1a1141c734ca0b318419013c0d
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
This commit is contained in:
Laszlo Agocs 2016-01-16 19:59:23 +01:00
parent bc81a28554
commit fd6cf5c875

View File

@ -1077,8 +1077,6 @@ bool QOpenGLFramebufferObject::bind()
}
}
d->valid = d->checkFramebufferStatus(current);
return d->valid;
}