[Mesa-dev] [PATCH] gallivm: use llvm jit code for decoding s3tc

Roland Scheidegger sroland at vmware.com
Wed Dec 19 16:32:22 UTC 2018


Am 19.12.18 um 08:35 schrieb Jose Fonseca:
> On 19/12/2018 03:51, sroland at vmware.com wrote:
>> From: Roland Scheidegger <sroland at vmware.com>
>>
>> This is (much) faster than using the util fallback.
>> (Note that there's two methods here, one would use a cache, similar to
>> the existing code (although the cache was disabled), except the block
>> decode is done with jit code, the other directly decodes the required
>> pixels. For now don't use the cache (being direct-mapped is suboptimal,
>> but it's difficult to come up with something better which doesn't have
>> too much overhead.)
>> ---

>> diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c
>> b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c
>> index 018cca8f9df..a6662c5e01b 100644
>> --- a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c
>> +++ b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c
>> @@ -3549,10 +3549,6 @@ lp_build_sample_soa_func(struct gallivm_state
>> *gallivm,
>>         const struct util_format_description *format_desc;
>>         format_desc =
>> util_format_description(static_texture_state->format);
>>         if (format_desc && format_desc->layout ==
>> UTIL_FORMAT_LAYOUT_S3TC) {
>> -         /*
>> -          * This is not 100% correct, if we have cache but the
>> -          * util_format_s3tc_prefer is true the cache won't get used
>> -          * regardless (could hook up the block decode there...) */
>>            need_cache = TRUE;
> 
> I'm a bit confused.  Based on your comment description, shouldnt this be
> FALSE?  Or is this dead code?
No that should be correct (note util_format_s3tc_prefer doesn't even
exist anymore). This is in if (cache_ptr) section - it just means that
we will pass the cache pointer (if it exists, that is if cache is
enabled) to the (separate) texture function.

Roland


> 
>>         }
>>      }
>> diff --git a/src/gallium/auxiliary/meson.build
>> b/src/gallium/auxiliary/meson.build
>> index a4dbcf7b4ca..57f7e69050f 100644
>> --- a/src/gallium/auxiliary/meson.build
>> +++ b/src/gallium/auxiliary/meson.build
>> @@ -389,8 +389,8 @@ if with_llvm
>>       'gallivm/lp_bld_flow.h',
>>       'gallivm/lp_bld_format_aos_array.c',
>>       'gallivm/lp_bld_format_aos.c',
>> -    'gallivm/lp_bld_format_cached.c',
>>       'gallivm/lp_bld_format_float.c',
>> +    'gallivm/lp_bld_format_s3tc.c',
>>       'gallivm/lp_bld_format.c',
>>       'gallivm/lp_bld_format.h',
>>       'gallivm/lp_bld_format_soa.c',
>>
> 
> 
> Otherwise looks great.  Thanks!
> 
> Reviewed-by: Jose Fonseca <jfonseca at vmware.com>



More information about the mesa-dev mailing list