intel/tools: add shader compiler hash key to json devinfo format
Offline shader compilation will use json as the source configuration to accurately instantiate mesa for target hardware. Similar platforms generate identical shader binaries even though intel_device_info differs inconsequenially. Include the shader compilation hash key to device info json files, so these platforms can be deduplicated. Closes: #6746 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:
@@ -38,6 +38,7 @@
|
||||
#include "dev/intel_device_info.h"
|
||||
#include "dev/intel_device_info_serialize.h"
|
||||
#include "dev/intel_hwconfig.h"
|
||||
#include "compiler/brw_compiler.h"
|
||||
|
||||
static int
|
||||
error(char *fmt, ...)
|
||||
@@ -260,6 +261,15 @@ main(int argc, char *argv[])
|
||||
|
||||
if (print_json) {
|
||||
JSON_Value *json = intel_device_info_dump_json(&devinfo);
|
||||
|
||||
/* add the compiler device sha, to allow deduplication of similar
|
||||
* device info files
|
||||
*/
|
||||
JSON_Object *obj = json_object(json);
|
||||
char device_info_sha[41];
|
||||
brw_device_sha1(device_info_sha, &devinfo);
|
||||
json_object_set_string(obj, "shader_cache_sha1", device_info_sha);
|
||||
|
||||
char *pretty_string = json_serialize_to_string_pretty(json);
|
||||
printf("%s", pretty_string);
|
||||
json_free_serialized_string(pretty_string);
|
||||
|
@@ -185,7 +185,8 @@ if with_intel_tools
|
||||
intel_dev_info = executable(
|
||||
'intel_dev_info',
|
||||
[files('intel_dev_info.c'), [intel_dev_serialize_src]],
|
||||
dependencies : [dep_libdrm, dep_dl, dep_thread, dep_m, idep_intel_dev, idep_parson],
|
||||
dependencies : [dep_libdrm, dep_dl, dep_thread, dep_m, idep_intel_dev, idep_parson, idep_nir],
|
||||
link_with : [libintel_compiler],
|
||||
include_directories : [inc_include, inc_src, inc_intel],
|
||||
c_args : [no_override_init_args],
|
||||
gnu_symbol_visibility : 'hidden',
|
||||
|
Reference in New Issue
Block a user