iris: Only store the SHA1 of the NIR in iris_uncompiled_shader

Jason pointed out that we don't need to keep an entire copy of the
serialized NIR around, we just need the SHA1.  This does change our
disk cache key to be taking a SHA1 of a SHA1, which is a bit odd,
but should work out and be faster and use less memory.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
This commit is contained in:
Kenneth Graunke
2019-05-28 15:34:52 -07:00
parent e45bf01940
commit e1409aead5
3 changed files with 7 additions and 13 deletions

View File

@@ -260,9 +260,8 @@ struct iris_uncompiled_shader {
struct pipe_stream_output_info stream_output;
/* The serialized NIR (for the disk cache) and size in bytes. */
void *ir_cache_binary;
uint32_t ir_cache_binary_size;
/* A SHA1 of the serialized NIR for the disk cache. */
unsigned char nir_sha1[20];
unsigned program_id;