[Mesa-dev] [PATCH] fix bfo#59876: glGetTexLevelParameteriv broken for indirect rendering

Brian Paul brianp at vmware.com
Mon Feb 18 10:15:43 PST 2013


On 02/18/2013 10:48 AM, Roland Scheidegger wrote:
> Am 05.02.2013 17:29, schrieb "Stefan Brüns":
>> A single element in a GLX reply is contained in the header itself.
>> The number of elements is denoted in the "n" field of the reply, if
>> "n" is 1, the length of additional data is 0.
>> The XXX_data_length() function of xcb does not return the length of
>> the (optional, n>1) data but the number of elements.
>>
>> Signed-off-by: Stefan Brüns<stefan.bruens at rwth-aachen.de>
>> ---
>>   src/mapi/glapi/gen/glX_proto_send.py |    4 +++-
>>   1 files changed, 3 insertions(+), 1 deletions(-)
>>
>> diff --git a/src/mapi/glapi/gen/glX_proto_send.py b/src/mapi/glapi/gen/glX_proto_send.py
>> index fbc0dd3..ae6b8d9 100644
>> --- a/src/mapi/glapi/gen/glX_proto_send.py
>> +++ b/src/mapi/glapi/gen/glX_proto_send.py
>> @@ -700,7 +700,9 @@ generic_%u_byte( GLint rop, const void * ptr )
>>                           if f.reply_always_array:
>>                               print '        (void)memcpy(%s, %s_data(reply), %s_data_length(reply) * sizeof(%s));' % (output.name, xcb_name, xcb_name, output.get_base_type_string())
>>                           else:
>> -                            print '        if (%s_data_length(reply) == 0)' % (xcb_name)
>> +                            print '        // the XXX_data_length() xcb function name is misleading, it returns the number'
>> +                            print '        // of elements, not the lenght of the data part. A single element is embedded.'
> s/lenght/length.
>
>
>> +                            print '        if (%s_data_length(reply) == 1)' % (xcb_name)
>>                               print '            (void)memcpy(%s,&reply->datum, sizeof(reply->datum));' % (output.name)
>>                               print '        else'
>>                               print '            (void)memcpy(%s, %s_data(reply), %s_data_length(reply) * sizeof(%s));' % (output.name, xcb_name, xcb_name, output.get_base_type_string())
>
>
> Looks good to me otherwise though this is not my area of expertise.
> I think this should be stable branch candidate.

Yeah, I noticed the typo and was going to clean-up the commit message 
a bit.  I'll post the updated patch for one more review.  If there's 
no other feedback I'll push it later.

-Brian



More information about the mesa-dev mailing list