Merge pull request #286041 from K900/mesa-shader-cache-key

mesa: remove disk cache key override

authored by K900 and committed by GitHub 259981b0 145a9cb6

-61
-2
pkgs/development/libraries/mesa/default.nix
··· 121 121 ./musl.patch 122 122 123 123 ./opencl.patch 124 - ./disk_cache-include-dri-driver-path-in-cache-key.patch 125 124 126 125 # Backports to fix build 127 126 # FIXME: remove when applied upstream ··· 170 169 # https://gitlab.freedesktop.org/mesa/mesa/blob/master/docs/meson.html#L327 171 170 "-Db_ndebug=true" 172 171 173 - "-Ddisk-cache-key=${placeholder "drivers"}" 174 172 "-Ddri-search-path=${libglvnd.driverLink}/lib/dri" 175 173 176 174 "-Dplatforms=${lib.concatStringsSep "," eglPlatforms}"
-59
pkgs/development/libraries/mesa/disk_cache-include-dri-driver-path-in-cache-key.patch
··· 1 - diff --git a/meson_options.txt b/meson_options.txt 2 - index 591ed957c85..6cb550593e3 100644 3 - --- a/meson_options.txt 4 - +++ b/meson_options.txt 5 - @@ -519,6 +519,13 @@ option( 6 - description : 'Enable direct rendering in GLX and EGL for DRI', 7 - ) 8 - 9 - +option( 10 - + 'disk-cache-key', 11 - + type : 'string', 12 - + value : '', 13 - + description : 'Mesa cache key.' 14 - +) 15 - + 16 - option('egl-lib-suffix', 17 - type : 'string', 18 - value : '', 19 - diff --git a/src/util/disk_cache.c b/src/util/disk_cache.c 20 - index 1d23b92af7e..fbb4b04f3cf 100644 21 - --- a/src/util/disk_cache.c 22 - +++ b/src/util/disk_cache.c 23 - @@ -218,8 +218,10 @@ disk_cache_type_create(const char *gpu_name, 24 - 25 - /* Create driver id keys */ 26 - size_t id_size = strlen(driver_id) + 1; 27 - + size_t key_size = strlen(DISK_CACHE_KEY) + 1; 28 - size_t gpu_name_size = strlen(gpu_name) + 1; 29 - cache->driver_keys_blob_size += id_size; 30 - + cache->driver_keys_blob_size += key_size; 31 - cache->driver_keys_blob_size += gpu_name_size; 32 - 33 - /* We sometimes store entire structs that contains a pointers in the cache, 34 - @@ -240,6 +242,7 @@ disk_cache_type_create(const char *gpu_name, 35 - uint8_t *drv_key_blob = cache->driver_keys_blob; 36 - DRV_KEY_CPY(drv_key_blob, &cache_version, cv_size) 37 - DRV_KEY_CPY(drv_key_blob, driver_id, id_size) 38 - + DRV_KEY_CPY(drv_key_blob, DISK_CACHE_KEY, key_size) 39 - DRV_KEY_CPY(drv_key_blob, gpu_name, gpu_name_size) 40 - DRV_KEY_CPY(drv_key_blob, &ptr_size, ptr_size_size) 41 - DRV_KEY_CPY(drv_key_blob, &driver_flags, driver_flags_size) 42 - diff --git a/src/util/meson.build b/src/util/meson.build 43 - index eb88f235c47..eae5c54cc10 100644 44 - --- a/src/util/meson.build 45 - +++ b/src/util/meson.build 46 - @@ -286,7 +286,12 @@ _libmesa_util = static_library( 47 - include_directories : [inc_util, include_directories('format')], 48 - dependencies : deps_for_libmesa_util, 49 - link_with: [libmesa_util_sse41], 50 - - c_args : [c_msvc_compat_args], 51 - + c_args : [ 52 - + c_msvc_compat_args, 53 - + '-DDISK_CACHE_KEY="@0@"'.format( 54 - + get_option('disk-cache-key') 55 - + ), 56 - + ], 57 - gnu_symbol_visibility : 'hidden', 58 - build_by_default : false 59 - )