summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRhys Weatherley <rhys.weatherley@nokia.com>2009-09-15 07:36:51 (GMT)
committerRhys Weatherley <rhys.weatherley@nokia.com>2009-09-15 07:36:51 (GMT)
commit49ea15e0498ba894647a8667148b4ab5dffcb343 (patch)
treebba56bc235221ad4359153cde854045c690d4b24 /src
parentafd7ba59f1fd9f14c4b7cd85aba764ef6066d64e (diff)
downloadQt-49ea15e0498ba894647a8667148b4ab5dffcb343.zip
Qt-49ea15e0498ba894647a8667148b4ab5dffcb343.tar.gz
Qt-49ea15e0498ba894647a8667148b4ab5dffcb343.tar.bz2
Don't round-trip to GL server for glGetError() in release mode.
Reviewed-by: Samuel Reviewed-by: Tom Cooksey
Diffstat (limited to 'src')
-rw-r--r--src/opengl/qglframebufferobject.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp
index 4b8a67e..e4cef5f 100644
--- a/src/opengl/qglframebufferobject.cpp
+++ b/src/opengl/qglframebufferobject.cpp
@@ -66,6 +66,11 @@ extern QImage qt_gl_read_framebuffer(const QSize&, bool, bool);
#define QGL_FUNC_CONTEXT QGLContextGroup *ctx = d_ptr->ctx;
+#ifndef QT_NO_DEBUG
+#define QT_RESET_GLERROR() \
+{ \
+ while (glGetError() != GL_NO_ERROR) {} \
+}
#define QT_CHECK_GLERROR() \
{ \
GLenum err = glGetError(); \
@@ -74,6 +79,10 @@ extern QImage qt_gl_read_framebuffer(const QSize&, bool, bool);
__FILE__, __LINE__, (int)err); \
} \
}
+#else
+#define QT_RESET_GLERROR() {}
+#define QT_CHECK_GLERROR() {}
+#endif
/*!
\class QGLFramebufferObjectFormat
@@ -407,7 +416,7 @@ void QGLFramebufferObjectPrivate::init(QGLFramebufferObject *q, const QSize &sz,
target = texture_target;
// texture dimensions
- while (glGetError() != GL_NO_ERROR) {} // reset error state
+ QT_RESET_GLERROR(); // reset error state
glGenFramebuffers(1, &fbo);
glBindFramebuffer(GL_FRAMEBUFFER_EXT, fbo);