Meta shaders are already stored in a different shader cache file.
Storing them in two places wastes disk space and they are never
loaded from the default shader disk cache anyways.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12937>
/* Always add cache items to disk. This will allow collection of
* compiled shaders by third parties such as steam, even if the app
* implements its own pipeline cache.
+ *
+ * Make sure to exclude meta shaders because they are stored in a different cache file.
*/
- if (device->physical_device->disk_cache) {
+ if (device->physical_device->disk_cache && cache != &device->meta_state.cache) {
uint8_t disk_sha1[20];
disk_cache_compute_key(device->physical_device->disk_cache, sha1, 20, disk_sha1);