From fd6cf5c875d794d23e513c8e7d6ebabc91dae790 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Sat, 16 Jan 2016 19:59:23 +0100 Subject: 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 --- src/gui/opengl/qopenglframebufferobject.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/gui/opengl/qopenglframebufferobject.cpp b/src/gui/opengl/qopenglframebufferobject.cpp index e0ef7c52a5..5184283a31 100644 --- a/src/gui/opengl/qopenglframebufferobject.cpp +++ b/src/gui/opengl/qopenglframebufferobject.cpp @@ -1077,8 +1077,6 @@ bool QOpenGLFramebufferObject::bind() } } - d->valid = d->checkFramebufferStatus(current); - return d->valid; } -- cgit v1.2.3