[Mesa-dev] Mesa (master): mesa: Allow querying the system FBO in GetFramebufferAttachmentParameteriv

Brian Paul brianp at vmware.com
Tue Jun 22 07:42:31 PDT 2010


Kristian Høgsberg wrote:
> Module: Mesa
> Branch: master
> Commit: 80dfec3e53fd5b5c8c31fb16376c9910258c91b0
> URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=80dfec3e53fd5b5c8c31fb16376c9910258c91b0
> 
> Author: Kristian Høgsberg <krh at bitplanet.net>
> Date:   Tue Jun 15 13:07:01 2010 -0400
> 
> mesa: Allow querying the system FBO in GetFramebufferAttachmentParameteriv
> 
>         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


This isn't quite correct.

If glGetFramebufferAttachmentParameteriv() is called on the 
window-system FBO we need to disallow querying attachments such as 
GL_COLOR_ATTACHMENT0_EXT and GL_DEPTH_STENCIL_ATTACHMENT.

Similarly, if glGetFramebufferAttachmentParameteriv() is called on a 
user-created FBO we need to disallow querying attachments such as 
GL_FRONT_LEFT and GL_AUX0.

The attached patch fixes this by adding a new 
_mesa_get_fb0_attachment() function.  Pretty simple.  I'll commit 
later if there's no other concerns.

-Brian


More information about the mesa-dev mailing list