mesa: Allow querying the system FBO in GetFramebufferAttachmentParameteriv
authorKristian Høgsberg <krh@bitplanet.net>
Tue, 15 Jun 2010 17:07:01 +0000 (13:07 -0400)
committerKristian Høgsberg <krh@bitplanet.net>
Tue, 15 Jun 2010 17:28:38 +0000 (13:28 -0400)
        If the default framebuffer is bound to <target>, then
        <attachment> must be one of FRONT_LEFT, FRONT_RIGHT, BACK_LEFT,
        BACK_RIGHT, AUXi, DEPTH_BUFFER, or STENCIL_BUFFER, identifying a
        color buffer, the depth buffer, or the stencil buffer, and
        <pname> may be FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE or
        FRAMEBUFFER_ATTACHMENT_OBJECT_NAME.

as well as these <pname> values

        FRAMEBUFFER_ATTACHMENT_RED_SIZE,
        FRAMEBUFFER_ATTACHMENT_GREEN_SIZE,
        FRAMEBUFFER_ATTACHMENT_BLUE_SIZE,
        FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE,
        FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE,
        FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE,
        FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE, or
        FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING.

https://bugs.freedesktop.org/show_bug.cgi?id=28551

src/mesa/main/fbobject.c

index 1a2e9b1da6ff3a320fd897f7b608eaf3f5ed7aad..09fafbc8b9df49499a1ad27903974f18a8dd4706 100644 (file)
@@ -188,6 +188,14 @@ _mesa_get_attachment(GLcontext *ctx, struct gl_framebuffer *fb,
       /* fall-through / new in GL 3.0 */
    case GL_STENCIL_ATTACHMENT_EXT:
       return &fb->Attachment[BUFFER_STENCIL];
+   case GL_FRONT_LEFT:
+      return &fb->Attachment[BUFFER_FRONT_LEFT];
+   case GL_FRONT_RIGHT:
+      return &fb->Attachment[BUFFER_FRONT_RIGHT];
+   case GL_BACK_LEFT:
+      return &fb->Attachment[BUFFER_BACK_LEFT];
+   case GL_BACK_RIGHT:
+      return &fb->Attachment[BUFFER_BACK_RIGHT];
    default:
       return NULL;
    }
@@ -1877,12 +1885,6 @@ _mesa_GetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment,
       return;
    }
 
-   if (buffer->Name == 0) {
-      _mesa_error(ctx, GL_INVALID_OPERATION,
-                  "glGetFramebufferAttachmentParameterivEXT");
-      return;
-   }
-
    att = _mesa_get_attachment(ctx, buffer, attachment);
    if (att == NULL) {
       _mesa_error(ctx, GL_INVALID_ENUM,