Avoid global variables for the shader cache

This commit is contained in:
Guillaume Meunier
2025-10-25 10:30:29 +02:00
parent a9f774c67c
commit 1e03b6e672
8 changed files with 53 additions and 15 deletions
+2 -4
View File
@@ -75,11 +75,9 @@ struct image_loader
return load(pixels.data(), pixels.size() * sizeof(T), extent, format, name);
}
template <typename... Args>
std::shared_ptr<loaded_image> operator()(Args &&... args)
std::shared_ptr<loaded_image> operator()(std::span<const std::byte> bytes, bool srgb, const std::string & name = "", bool premultiply = false)
{
auto result = std::make_shared<loaded_image>(load(std::forward<Args>(args)...));
return result;
return std::make_shared<loaded_image>(load(bytes, srgb, name, premultiply));
}
private: