diff options
author | Christian Kamm <christian.d.kamm@nokia.com> | 2010-08-09 11:39:51 (GMT) |
---|---|---|
committer | Christian Kamm <christian.d.kamm@nokia.com> | 2010-08-09 11:39:51 (GMT) |
commit | 24742e54332a71db0bc5ae7b1632924ae592aea7 (patch) | |
tree | ec6ec8eb81f0981c6ff60f12cb107305941bf049 /src/opengl/qglframebufferobject.cpp | |
parent | 2e31dfd1e3ec30b63c776d46b7f9010ea04631c3 (diff) | |
download | Qt-24742e54332a71db0bc5ae7b1632924ae592aea7.zip Qt-24742e54332a71db0bc5ae7b1632924ae592aea7.tar.gz Qt-24742e54332a71db0bc5ae7b1632924ae592aea7.tar.bz2 |
OpenGL: Fix multisample renderbuffer creation when MAX_SAMPLES is 0.
Previously, we would try to create one with samples = 1 anyway,
potentially resulting in an INVALID_VALUE error.
Task-number: QTBUG-12757
Reviewed-by: Samuel Rødal
Diffstat (limited to 'src/opengl/qglframebufferobject.cpp')
-rw-r--r-- | src/opengl/qglframebufferobject.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp index deffc20..9b8a3d1 100644 --- a/src/opengl/qglframebufferobject.cpp +++ b/src/opengl/qglframebufferobject.cpp @@ -445,11 +445,11 @@ void QGLFramebufferObjectPrivate::init(QGLFramebufferObject *q, const QSize &sz, GLint maxSamples; glGetIntegerv(GL_MAX_SAMPLES_EXT, &maxSamples); - samples = qBound(1, int(samples), int(maxSamples)); + samples = qBound(0, int(samples), int(maxSamples)); glGenRenderbuffers(1, &color_buffer); glBindRenderbuffer(GL_RENDERBUFFER_EXT, color_buffer); - if (glRenderbufferStorageMultisampleEXT) { + if (glRenderbufferStorageMultisampleEXT && samples > 0) { glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT, samples, internal_format, size.width(), size.height()); } else { |