diff options
| author | 3gg <3gg@shellblade.net> | 2025-11-01 14:22:34 -0700 |
|---|---|---|
| committer | 3gg <3gg@shellblade.net> | 2025-11-01 14:22:34 -0700 |
| commit | f494baf976c4494dd0ea4e755907cf49b026eb5d (patch) | |
| tree | 3df754e78b711e56cb5e4b775f2caa803ba93b0c /src/core/core_impl.h | |
| parent | f2bac7f22ee0314edee5bee90d62d79afbd68171 (diff) | |
Better hashing of shaders
Diffstat (limited to 'src/core/core_impl.h')
| -rw-r--r-- | src/core/core_impl.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/core/core_impl.h b/src/core/core_impl.h index eefdfbe..320532d 100644 --- a/src/core/core_impl.h +++ b/src/core/core_impl.h | |||
| @@ -15,16 +15,18 @@ | |||
| 15 | 15 | ||
| 16 | #include <stdint.h> | 16 | #include <stdint.h> |
| 17 | 17 | ||
| 18 | typedef uint32_t hash_t; | ||
| 19 | |||
| 18 | // TODO: Make a generic (hash, void*) structure and define functions over it. | 20 | // TODO: Make a generic (hash, void*) structure and define functions over it. |
| 19 | // Then define a macro that defines type-safe macros given the type of the | 21 | // Then define a macro that defines type-safe macros given the type of the |
| 20 | // entry. | 22 | // entry. |
| 21 | typedef struct ShaderCacheEntry { | 23 | typedef struct ShaderCacheEntry { |
| 22 | uint64_t hash; | 24 | hash_t hash; |
| 23 | Shader* shader; | 25 | Shader* shader; |
| 24 | } ShaderCacheEntry; | 26 | } ShaderCacheEntry; |
| 25 | 27 | ||
| 26 | typedef struct ShaderProgramCacheEntry { | 28 | typedef struct ShaderProgramCacheEntry { |
| 27 | uint64_t hash; | 29 | hash_t hash; |
| 28 | ShaderProgram* program; | 30 | ShaderProgram* program; |
| 29 | } ShaderProgramCacheEntry; | 31 | } ShaderProgramCacheEntry; |
| 30 | 32 | ||
