[Mesa-dev] [PATCH] mesa: queries of non-existent FBO attachments should return INVALID_OPERATION

Chad Versace chad at chad-versace.us
Tue May 31 15:06:46 PDT 2011


On 05/31/2011 11:41 AM, Marek Olšák wrote:

Immediately after the last hunk,

> @@ -2237,6 +2257,10 @@ _mesa_GetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment,
>           _mesa_error(ctx, GL_INVALID_ENUM,
>                       "glGetFramebufferAttachmentParameterivEXT(pname)");
>        }
> +      else if (att->Type == GL_NONE) {
> +         _mesa_error(ctx, GL_INVALID_OPERATION,
> +                     "glGetFramebufferAttachmentParameterivEXT(pname)");
> +      }
>        else if (att->Texture) {
>           const struct gl_texture_image *texImage =
>              _mesa_select_tex_image(ctx, att->Texture, att->Texture->Target,

you may wish to change the else branch to this

> else {
> -    *params = 0;
> +    assert(0);
> }

since the all valid cases for 'att' are handled above in the 'else if'
branches.

With or without that change, this is
Reviewed-by: Chad Versace <chad at chad-versace.us>

-- 
Chad Versace
chad at chad-versace.us


More information about the mesa-dev mailing list