diff options
author | Laszlo Agocs <laszlo.agocs@digia.com> | 2014-06-17 15:08:24 +0200 |
---|---|---|
committer | Jani Heikkinen <jani.heikkinen@digia.com> | 2014-06-18 13:39:32 +0200 |
commit | 10ff9d5b6f9643d3bcae519d8bf5107711d4e55d (patch) | |
tree | 68a71f6ea8ffc084b937fa6e6d96c35825d90a3c /src/gui/opengl/qopenglframebufferobject.cpp | |
parent | cf7805d3644f762ac9b70de72eaa9f847bc95f89 (diff) |
Handle invalid sample counts gracefully in FBOs
Passing in a sample count of -1 should be treated as 0. This is common
when setting up framebuffer formats from a QSurfaceFormat where the
default, unset value is indicated by a value of -1.
This broke QQuickWidget which was unaware of this limitation of
QOpenGLFramebufferObject and was passing format.samples() as the sample
count without making sure it is 0 or higher.
Task-number: QTBUG-39699
Change-Id: I324b8b006eaa992c15ae932f9df305500fefeb65
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'src/gui/opengl/qopenglframebufferobject.cpp')
-rw-r--r-- | src/gui/opengl/qopenglframebufferobject.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gui/opengl/qopenglframebufferobject.cpp b/src/gui/opengl/qopenglframebufferobject.cpp index cd6468cccd..3102e1ecd2 100644 --- a/src/gui/opengl/qopenglframebufferobject.cpp +++ b/src/gui/opengl/qopenglframebufferobject.cpp @@ -436,6 +436,7 @@ void QOpenGLFramebufferObjectPrivate::init(QOpenGLFramebufferObject *, const QSi samples = qBound(0, int(samples), int(maxSamples)); #endif + samples = qMax(0, samples); requestedSamples = samples; size = sz; target = texture_target; |