[Mesa-dev] [PATCH] mesa: Use _mesa_lookup_enum_by_nr in tex*_error_check

Kenneth Graunke kenneth at whitecape.org
Sat Dec 1 12:45:23 PST 2012


On 11/30/2012 11:55 AM, Brian Paul wrote:
> On 11/30/2012 12:26 PM, Matt Turner wrote:
>> ---
>>   src/mesa/main/teximage.c |    9 ++++++---
>>   1 files changed, 6 insertions(+), 3 deletions(-)
>>
>> diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
>> index 347b3e2..6401824 100644
>> --- a/src/mesa/main/teximage.c
>> +++ b/src/mesa/main/teximage.c
>> @@ -1949,7 +1949,8 @@ texture_error_check( struct gl_context *ctx,
>>      if (err != GL_NO_ERROR) {
>>         _mesa_error(ctx, err,
>>                     "glTexImage%dD(incompatible format 0x%x, type 0x%x)",
>> -                  dimensions, format, type);
>> +                  dimensions, _mesa_lookup_enum_by_nr(format),
>> +          _mesa_lookup_enum_by_nr(type));
>>         return GL_TRUE;
>>      }
>>
>> @@ -1962,7 +1963,8 @@ texture_error_check( struct gl_context *ctx,
>>          (_mesa_is_dudv_format(internalFormat) !=
>> _mesa_is_dudv_format(format))) {
>>         _mesa_error(ctx, GL_INVALID_OPERATION,
>>                     "glTexImage%dD(incompatible internalFormat 0x%x,
>> format 0x%x)",
>> -                  dimensions, internalFormat, format);
>> +                  dimensions, _mesa_lookup_enum_by_nr(internalFormat),
>> +          _mesa_lookup_enum_by_nr(format));
>>         return GL_TRUE;
>>      }
>>
>> @@ -2265,7 +2267,8 @@ texsubimage_error_check(struct gl_context *ctx,
>> GLuint dimensions,
>>      if (err != GL_NO_ERROR) {
>>         _mesa_error(ctx, err,
>>                     "glTexSubImage%dD(incompatible format 0x%x, type
>> 0x%x)",
>> -                  dimensions, format, type);
>> +                  dimensions, _mesa_lookup_enum_by_nr(format),
>> +          _mesa_lookup_enum_by_nr(type));
>>         return GL_TRUE;
>>      }
>>
>
> Reviewed-by: Brian Paul <brianp at vmware.com>
>
> BTW, I think we were interested in renaming _mesa_lookup_enum_by_nr() to
> something nicer a while back.

Yeah, I think we settled on _mesa_enum_string() or some such.  I'd still 
love to see that happen (maybe after these patches land?)


More information about the mesa-dev mailing list