Cache transcoded textures

This commit is contained in:
Guillaume Meunier
2025-10-25 10:30:29 +02:00
parent 7d76367d2c
commit a9ad5195b7
13 changed files with 421 additions and 59 deletions
+21 -9
View File
@@ -33,17 +33,29 @@ class scene_loader
thread_safe<vk::raii::Queue> & queue;
uint32_t queue_family_index;
std::shared_ptr<renderer::material> default_material;
std::filesystem::path texture_cache;
std::shared_ptr<entt::registry> operator()(
std::span<const std::byte> data,
const std::string & name = "",
const std::filesystem::path & parent_path = "",
const std::filesystem::path & gltf_texture_cache = "",
std::function<void(float)> progress_cb = {});
public:
scene_loader(vk::raii::Device & device, vk::raii::PhysicalDevice physical_device, thread_safe<vk::raii::Queue> & queue, uint32_t queue_family_index, std::shared_ptr<renderer::material> default_material) :
device(device),
physical_device(physical_device),
queue(queue),
queue_family_index(queue_family_index),
default_material(default_material)
{}
scene_loader(
vk::raii::Device & device,
vk::raii::PhysicalDevice physical_device,
thread_safe<vk::raii::Queue> & queue,
uint32_t queue_family_index,
std::shared_ptr<renderer::material> default_material,
std::filesystem::path texture_cache);
scene_loader(const scene_loader &) = default;
std::shared_ptr<entt::registry> operator()(const std::filesystem::path & gltf_path, std::function<void(float)> progress_cb = {});
std::shared_ptr<entt::registry> operator()(std::span<const std::byte> data, const std::string & name = "", const std::filesystem::path & parent_path = "", std::function<void(float)> progress_cb = {});
std::shared_ptr<entt::registry> operator()(
const std::filesystem::path & gltf_path,
std::function<void(float)> progress_cb = {});
void clear_texture_cache();
};