[Mesa-dev] [Mesa-stable] [PATCH V3 03/10] mesa: Add error condition for integer formats in glGetTexImage()

Anuj Phogat anuj.phogat at gmail.com
Mon Apr 21 13:36:02 PDT 2014


On Mon, Apr 21, 2014 at 11:42 AM, Carl Worth <cworth at cworth.org> wrote:
> Anuj Phogat <anuj.phogat at gmail.com> writes:
>> OpenGL 4.0 spec, page 306 suggests an INVALID_OPERATION in glGetTexImage
>> if :
>>    "format is one of the integer formats in table 3.3 and the internal
>>     format of the texture image is not integer, or format is not one of
>>     the integer formats in table 3.3 and the internal format is integer."
> ...
>> +   else if (_mesa_is_enum_format_integer(format) !=
>> +            _mesa_is_format_integer(texImage->TexFormat)) {
>> +      _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexImage(format mismatch)");
>> +      return GL_TRUE;
>> +   }
>
> I need some clarification of this patch for purposes of the stable
> branch.
>
> Without this error case present, how would a program with an incorrect
> format behave?
>
> If it would previously function, then I think this patch should be
> skipped for the stable branch, (to avoid regressing such programs).
>
> If it would previously fail in some way, (such as a crash), but will now
> fail more cleanly with the error, then I can accept this patch for the
> stable branch.
Previously it would fail with an error like:
"implementation error: bad format in _mesa_pack_rgba_span"
Now it'll throw out a genuine GL error.
>
> -Carl
>
> _______________________________________________
> mesa-stable mailing list
> mesa-stable at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-stable
>


More information about the mesa-dev mailing list