From b2ece42822225fd67a1286a2ef51f7b76c634255 Mon Sep 17 00:00:00 2001 From: quou Date: Thu, 26 Dec 2024 16:11:33 +1100 Subject: seperate descriptor sets from pipelines to allow swapping out shader resources without recreating pipelines --- qstd/str.c | 9 +++++++++ qstd/str.h | 1 + 2 files changed, 10 insertions(+) (limited to 'qstd') diff --git a/qstd/str.c b/qstd/str.c index 49ad396..2c74d4b 100644 --- a/qstd/str.c +++ b/qstd/str.c @@ -11,6 +11,15 @@ uint64_t fnv1a64(uint8_t* buf, size_t size) { return hash; } +uint64_t fnv1a64_2(uint64_t hash, uint8_t* buf, size_t size) { + size_t i; + for (i = 0; i < size; i++, buf++) { + hash ^= *buf; + hash *= 0x100000001b3; + } + return hash; +} + uint32_t hash_string(const char* s) { uint32_t h = 2166136261u; for (; *s; s++) { diff --git a/qstd/str.h b/qstd/str.h index 308e92d..011fc27 100644 --- a/qstd/str.h +++ b/qstd/str.h @@ -7,6 +7,7 @@ struct Arena; uint64_t fnv1a64(uint8_t* buf, size_t size); +uint64_t fnv1a64_2(uint64_t h, uint8_t* buf, size_t size); uint32_t hash_string(const char* s); int string_equal(const char* a, const char* b); -- cgit v1.2.3-54-g00ecf