mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-15 08:50:28 +01:00
iris: use device info sha in device renderer string
For iris, use the intel device info hash function instead of PCI ID in the renderer name. The renderer is incorporated into the gallium disk cache for programs, as part of the key for looking up cache entries. PCI ID can vary between on devices which are comparable from the perspective of the shader compiler. A more precise key eliminates redundant entries in a multiplatform shader cache. Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26844>
This commit is contained in:
parent
c4ce1ca847
commit
48bf7ad3b8
1 changed files with 6 additions and 5 deletions
|
|
@ -274,11 +274,12 @@ iris_disk_cache_init(struct iris_screen *screen)
|
|||
if (INTEL_DEBUG(DEBUG_DISK_CACHE_DISABLE_MASK))
|
||||
return;
|
||||
|
||||
/* array length = print length + nul char + 1 extra to verify it's unused */
|
||||
char renderer[11];
|
||||
UNUSED int len =
|
||||
snprintf(renderer, sizeof(renderer), "iris_%04x", screen->devinfo->pci_device_id);
|
||||
assert(len == sizeof(renderer) - 2);
|
||||
/* array length = strlen("iris_") + sha + nul char */
|
||||
char renderer[5 + 40 + 1] = {0};
|
||||
char device_info_sha[41];
|
||||
brw_device_sha1(device_info_sha, screen->compiler->devinfo);
|
||||
memcpy(renderer, "iris_", 5);
|
||||
memcpy(renderer + 5, device_info_sha, 40);
|
||||
|
||||
const struct build_id_note *note =
|
||||
build_id_find_nhdr_for_addr(iris_disk_cache_init);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue