<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - glGetFramebufferAttachmentParameteriv() returns GL_INVALID_ENUM when getting attachment size from back buffer"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=100609">100609</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>glGetFramebufferAttachmentParameteriv() returns GL_INVALID_ENUM when getting attachment size from back buffer
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>Mesa
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>17.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Mesa core
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>mesa-dev@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>nfxjfg@gmail.com
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>mesa-dev@lists.freedesktop.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I'm doing this to determine the default framebuffer depth in "generic" GL code
that can't access GLX or EGL:

    glBindFramebuffer(GL_FRAMEBUFFER, 0);
    glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_BACK_LEFT,
GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE, &depth_g);

This would be in OpenGL 3 (not sure which versions exactly, probably 3.0 and
3.3 at least).

Mesa causes a GL_INVALID_ENUM error, while nVidia binary drivers accept this
and return the expected value.

The GL 3 spec is not entirely clear on this, but there seems to be nothing that
disallows using glGetFramebufferAttachmentParameteriv() like this. Some other
GL implementations also seem to support it. So I would tend towards considering
this a Mesa bug, but of course I'm not sure.

I think this has been happening at least with Mesa 11, up to at least 17.0.2.

The above snippet is simplified from:
<a href="https://github.com/mpv-player/mpv/blob/master/video/out/opengl/utils.c#L1282">https://github.com/mpv-player/mpv/blob/master/video/out/opengl/utils.c#L1282</a>
mpv itself might serve as use-case, although current releases use an older
version of this code.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
          <li>You are the QA Contact for the bug.</li>
      </ul>
    </body>
</html>