invalidate
Remove a key from the cache. This can force the re-creation
of a texture created by ImageSource for example.
gpa is needed to store the texture for deferred destruction
Parameters
Source
Implementation
pub fn invalidate(self: *Cache, gpa: std.mem.Allocator, key: Key) std.mem.Allocator.Error!void {
try self.trash.ensureUnusedCapacity(gpa, 1);
const prev = self.cache.fetchRemove(key);
if (prev) |kv| {
self.trash.appendAssumeCapacity(kv.value);
}
}