[Mesa-dev] [PATCH 1/4] gallivm: (trivial) fix lp_build_concat_n

Roland Scheidegger sroland at vmware.com
Tue Jun 4 06:46:13 PDT 2013


Am 04.06.2013 14:38, schrieb Jose Fonseca:
> 
> 
> ----- Original Message -----
>> From: Roland Scheidegger <sroland at vmware.com>
>>
>> The code was designed to handle no-op concat but failed (unless the
>> caller was using same pointer for src and dst).
>> ---
>>  src/gallium/auxiliary/gallivm/lp_bld_pack.c |    6 +++++-
>>  1 file changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/src/gallium/auxiliary/gallivm/lp_bld_pack.c
>> b/src/gallium/auxiliary/gallivm/lp_bld_pack.c
>> index 0a57e39..14fcd38 100644
>> --- a/src/gallium/auxiliary/gallivm/lp_bld_pack.c
>> +++ b/src/gallium/auxiliary/gallivm/lp_bld_pack.c
>> @@ -241,8 +241,12 @@ lp_build_concat_n(struct gallivm_state *gallivm,
>>     assert(num_srcs >= num_dsts);
>>     assert((num_srcs % size) == 0);
>>  
>> -   if (num_srcs == num_dsts)
>> +   if (num_srcs == num_dsts) {
>> +      for (i = 0; i < num_dsts; ++i) {
>> +         dst[i] = src[i];
>> +      }
>>        return 1;
>> +   }
>>  
>>     for (i = 0; i < num_dsts; ++i) {
>>        dst[i] = lp_build_concat(gallivm, &src[i * size], src_type, size);
> 
> Looks good.
> 
> Was this path ever being hit? If so this is a candidate for stable branches.
> 
> Jose
> 

No I didn't see it getting hit, just saw it by accident. All callers
seem to both not call it when there's nothing to concat, and always use
same src and dst anyway.

Roland


More information about the mesa-dev mailing list