90 bool initialize(const
std::shared_ptr<Core::VulkanBackend>& backend);
103 [[nodiscard]]
bool is_initialized()
const {
return m_backend !=
nullptr; }
121 std::shared_ptr<Core::VKImage> create_2d(
125 const void* data =
nullptr,
126 uint32_t mip_levels = 1);
137 std::shared_ptr<Core::VKImage> create_3d(
142 const void* data =
nullptr);
151 std::shared_ptr<Core::VKImage> create_cubemap(
154 const void* data =
nullptr);
166 std::shared_ptr<Core::VKImage> create_render_target(
178 std::shared_ptr<Core::VKImage> create_depth_buffer(
181 bool with_stencil =
false);
190 std::shared_ptr<Core::VKImage> create_storage_image(
209 const std::shared_ptr<Core::VKImage>& image,
223 const std::shared_ptr<Core::VKImage>& image,
239 vk::Sampler get_or_create_sampler(
const SamplerConfig& config);
244 vk::Sampler get_default_sampler();
249 vk::Sampler get_nearest_sampler();
258 static vk::Format to_vulkan_format(
ImageFormat format);
263 static size_t get_bytes_per_pixel(
ImageFormat format);
268 static size_t calculate_image_size(
291 static size_t hash_sampler_config(
const SamplerConfig& config);
TextureLoom(const TextureLoom &)=delete
static TextureLoom & instance()
std::shared_ptr< Core::VulkanBackend > m_backend
TextureLoom(TextureLoom &&) noexcept=default
TextureLoom & operator=(const TextureLoom &)=delete
std::vector< std::shared_ptr< Core::VKImage > > m_textures
static bool s_initialized
std::unordered_map< size_t, vk::Sampler > m_sampler_cache
Portal-level texture creation and management.