diff options
author | Timothy Arceri <[email protected]> | 2017-08-23 16:32:59 +1000 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2017-08-25 13:20:29 +1000 |
commit | 07018d49dc95b0a9cf7b22c33af2286c36583e82 (patch) | |
tree | 7b791aa4ed2419c52781d36bf5a8b1a82ba5d1b5 /src/util/disk_cache.h | |
parent | ef42423e7be93578f6896ed02e022b98323e4c8a (diff) |
util/disk_cache: add struct cache_item_metadata
This will be used to store more information about the cache item
in it's header. This information is intended for 3rd party and
cache analysis use but can also be used for detecting the unlikely
scenario of cache collisions.
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/util/disk_cache.h')
-rw-r--r-- | src/util/disk_cache.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/util/disk_cache.h b/src/util/disk_cache.h index 3521ef4a6b5..ef5ec2ac921 100644 --- a/src/util/disk_cache.h +++ b/src/util/disk_cache.h @@ -43,6 +43,26 @@ extern "C" { typedef uint8_t cache_key[CACHE_KEY_SIZE]; +/* WARNING: 3rd party applications might be reading the cache item metadata. + * Do not change these values without making the change widely known. + * Please contact Valve developers and make them aware of this change. + */ +#define CACHE_ITEM_TYPE_UNKNOWN 0x0 +#define CACHE_ITEM_TYPE_GLSL 0x1 + +struct cache_item_metadata { + /** + * The cache item type. This could be used to identify a GLSL cache item, + * a certain type of IR (tgsi, nir, etc), or signal that it is the final + * binary form of the shader. + */ + uint32_t type; + + /** GLSL cache item metadata */ + cache_key *keys; /* sha1 list of shaders that make up the cache item */ + uint32_t num_keys; +}; + struct disk_cache; static inline bool |