Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-33406

OSX: QGLFramebufferObject doesn't successfully construct when the number of samples is 2

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • 5.3.1
    • 5.1.1
    • GUI: OpenGL
    • OS X 10.8.4, Intel HD 4000 Graphics card (13" Macbook Pro Retina)
    • macOS
    • d1c00155464fe9a8ce08216141ca978fe6415dcc

      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
      

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            lagocs Laszlo Agocs
            kileppal Kimmo Leppälä
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes