summaryrefslogtreecommitdiffstats
path: root/src/util/disk_cache.h
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2017-10-11 12:00:27 +1100
committerTimothy Arceri <[email protected]>2017-10-12 08:52:38 +1100
commit142162529233680631a246c8920e66d02ee4e94b (patch)
tree358f7ff5a49cbc36bea3a5ba2e919d4ef122c5e9 /src/util/disk_cache.h
parent7664aaf331220f39bf306b4c8afd62966df1391a (diff)
radv: create on-disk shader cache
This is the drivers on-disk cache intended to be used as a fallback as opposed to the pipeline cache provided by apps. Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/util/disk_cache.h')
-rw-r--r--src/util/disk_cache.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/util/disk_cache.h b/src/util/disk_cache.h
index d2e4d9a69c7..488b297ead2 100644
--- a/src/util/disk_cache.h
+++ b/src/util/disk_cache.h
@@ -65,6 +65,21 @@ struct cache_item_metadata {
struct disk_cache;
+static inline char *
+disk_cache_format_hex_id(char *buf, const uint8_t *hex_id, unsigned size)
+{
+ static const char hex_digits[] = "0123456789abcdef";
+ unsigned i;
+
+ for (i = 0; i < size; i += 2) {
+ buf[i] = hex_digits[hex_id[i >> 1] >> 4];
+ buf[i + 1] = hex_digits[hex_id[i >> 1] & 0x0f];
+ }
+ buf[i] = '\0';
+
+ return buf;
+}
+
static inline bool
disk_cache_get_function_timestamp(void *ptr, uint32_t* timestamp)
{