93 bool initialize(const
std::shared_ptr<Core::VulkanBackend>& backend);
106 [[nodiscard]]
bool is_initialized()
const {
return m_backend !=
nullptr; }
124 std::shared_ptr<Core::VKImage> create_2d(
128 const void* data =
nullptr,
129 uint32_t mip_levels = 1);
140 std::shared_ptr<Core::VKImage> create_3d(
145 const void* data =
nullptr);
154 std::shared_ptr<Core::VKImage> create_cubemap(
157 const void* data =
nullptr);
169 std::shared_ptr<Core::VKImage> create_render_target(
181 std::shared_ptr<Core::VKImage> create_depth_buffer(
184 bool with_stencil =
false);
193 std::shared_ptr<Core::VKImage> create_storage_image(
212 const std::shared_ptr<Core::VKImage>& image,
227 const std::shared_ptr<Core::VKImage>& image,
230 const std::shared_ptr<Buffers::VKBuffer>& staging);
242 const std::shared_ptr<Core::VKImage>& image,
258 vk::Sampler get_or_create_sampler(
const SamplerConfig& config);
263 vk::Sampler get_default_sampler();
268 vk::Sampler get_nearest_sampler();
277 static vk::Format to_vulkan_format(
ImageFormat format);
282 static size_t get_bytes_per_pixel(
ImageFormat format);
287 static size_t calculate_image_size(
310 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.