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

Kristian Høgsberg krh at bitplanet.net
Tue Jun 22 08:24:26 PDT 2010


On Tue, Jun 22, 2010 at 10:42 AM, Brian Paul <brianp at vmware.com> wrote:
> 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.

Yes, that looks good, thanks for catching it.  I believe I had it in
mind when I wrote the patch, but it slipped my mind.  I did check that
we only allow valid pname values though.  All the invalid ones are
texture attachments, which never happens for fb 0, so we reject those
automatically.

Kristian


More information about the mesa-dev mailing list