[Mesa-dev] [PATCH 5/8] gallium: add get_disk_shader_cache() callback

Nicolai Hähnle nhaehnle at gmail.com
Wed Feb 22 10:58:03 UTC 2017


On 22.02.2017 07:23, Michel Dänzer wrote:
> On 22/02/17 12:45 PM, Timothy Arceri wrote:
>>
>> +get_disk_shader_cache
>> +^^^^^^^^^^^^^^^^^^^^^
>> +
>> +Returns a pointer to driver-specific on-disk shader cache. If the driver
>> +failed to create the cache or does not support an on-disk shader cache NULL is
>> +returned.
>
> [...]
>
>> +   /**
>> +    * Returns a pointer to driver-specific on-disk shader cache. If the driver
>> +    * failed to create the cache or does not support an on-disk shader cache
>> +    * NULL is returned.
>> +    */
>> +   struct disk_cache *(*get_disk_shader_cache)(struct pipe_screen *screen);
>>  };
>
> Drivers which don't support an on-disk shader cache don't set this
> callback in the first place, right? :) (Just a suggestion for
> improvement before landing this patch, not a blocker, no need to resend)

Yeah, but creating the shader cache might have failed, or it might be 
disabled. Perhaps a driver that doesn't do its own caching might want to 
initialize the cache lazily. I think the interface is more flexible this 
way.

Nicolai


More information about the mesa-dev mailing list