Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.1.1
-
OS X 10.8.4, Intel HD 4000 Graphics card (13" Macbook Pro Retina)
-
-
d1c00155464fe9a8ce08216141ca978fe6415dcc
Description
The issue can be seen at least on OS X with Intel HD 4000 Graphics card.
The QGLFramebufferObject doesn't successfully construct with the combinedDepthStencil attachment when the number of samples is set to 2. If the number of samples is 0, 4, or 8 there doesn't appear to be an issue.
QGLFramebufferObjectFormat format; format.setSamples(2); format.setInternalTextureFormat(GL_SRGB8_ALPHA8_EXT); format.setAttachment(QGLFramebufferObject::CombinedDepthStencil); QGLFramebufferObject qGLFBO = QGLFramebufferObject(deviceSize, format);
The example will output error "QGLFramebufferObject: Framebuffer incomplete, attachments must have same number of samples per pixel."
Issue appears to be qtbase/src/opengl/qglframebufferobject.cpp in void QGLFramebufferObjectPrivate::init(QGLFramebufferObject *q, const QSize &sz, GL_RENDERBUFFER, color_buffer);
Call funcs.glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_SAMPLES, &samples);
will return 4 instead of 2.
QGLFramebufferObject.patch
diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp index 8210b21..b8949ed 100644 --- a/src/opengl/qglframebufferobject.cpp +++ b/src/opengl/qglframebufferobject.cpp @@ -540,10 +540,12 @@ void QGLFramebufferObjectPrivate::init(QGLFramebufferObject *q, const QSize &sz, GL_RENDERBUFFER, color_buffer); QT_CHECK_GLERROR(); - valid = checkFramebufferStatus(); - - if (valid) - funcs.glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_SAMPLES, &samples); + //valid = checkFramebufferStatus(); + //if (valid) + // funcs.glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_SAMPLES, &samples); } // In practice, a combined depth-stencil buffer is supported by all desktop platforms, while a