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

Brian Paul brian.e.paul at gmail.com
Tue May 31 15:44:29 PDT 2011


On Tue, May 31, 2011 at 4:06 PM, Chad Versace <chad at chad-versace.us> wrote:
> 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.

For that kind of thing I'd usually call _mesa_problem() to report the
issue and continue execution rather than assert/die.

-Brian


More information about the mesa-dev mailing list