SDL_HashTable is now optionally thread-safe

Fixes https://github.com/libsdl-org/SDL/issues/11635
This commit is contained in:
Sam Lantinga
2024-12-12 11:51:27 -08:00
parent e0cee83a3a
commit 61511c48a4
12 changed files with 175 additions and 181 deletions

View File

@@ -83,7 +83,7 @@ static void NukePipelineCacheEntry(const void *key, const void *value, void *dat
bool GPU_InitPipelineCache(GPU_PipelineCache *cache, SDL_GPUDevice *device)
{
// FIXME how many buckets do we need?
cache->table = SDL_CreateHashTable(device, 32, HashPassthrough, MatchPipelineCacheKey, NukePipelineCacheEntry, true);
cache->table = SDL_CreateHashTable(device, 32, HashPassthrough, MatchPipelineCacheKey, NukePipelineCacheEntry, false, true);
if (!cache->table) {
return false;
}