81 bool initialize(const
std::shared_ptr<Core::VulkanBackend>& backend);
94 [[nodiscard]]
bool is_initialized()
const {
return m_backend !=
nullptr; }
112 std::shared_ptr<Core::VKImage> create_2d(
116 const void* data =
nullptr,
117 uint32_t mip_levels = 1);
128 std::shared_ptr<Core::VKImage> create_3d(
133 const void* data =
nullptr);
142 std::shared_ptr<Core::VKImage> create_cubemap(
145 const void* data =
nullptr);
157 std::shared_ptr<Core::VKImage> create_render_target(
169 std::shared_ptr<Core::VKImage> create_depth_buffer(
172 bool with_stencil =
false);
181 std::shared_ptr<Core::VKImage> create_storage_image(
199 [[nodiscard]] std::shared_ptr<Core::VKImage> create_2d(
219 const std::shared_ptr<Core::VKImage>&
image,
234 const std::shared_ptr<Core::VKImage>&
image,
237 const std::shared_ptr<Buffers::VKBuffer>& staging);
249 const std::shared_ptr<Core::VKImage>&
image,
271 void download_data_async(
272 const std::shared_ptr<Core::VKImage>&
image,
289 void transition_layout(
290 const std::shared_ptr<Core::VKImage>&
image,
291 vk::ImageLayout old_layout,
292 vk::ImageLayout new_layout,
293 uint32_t mip_levels = 1,
294 uint32_t array_layers = 1,
295 vk::ImageAspectFlags aspect_mask = vk::ImageAspectFlagBits::eColor);
309 vk::Sampler get_or_create_sampler(
const SamplerConfig& config);
314 vk::Sampler get_default_sampler();
319 vk::Sampler get_nearest_sampler();
328 static vk::Format to_vulkan_format(
ImageFormat format);
333 static size_t get_bytes_per_pixel(
ImageFormat format);
341 static std::optional<ImageFormat> from_vulkan_format(vk::Format vk_format);
346 static size_t calculate_image_size(
355 static uint32_t get_channel_count(
ImageFormat format);
374 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.
std::variant< std::vector< double >, std::vector< float >, std::vector< uint8_t >, std::vector< uint16_t >, std::vector< uint32_t >, std::vector< std::complex< float > >, std::vector< std::complex< double > >, std::vector< glm::vec2 >, std::vector< glm::vec3 >, std::vector< glm::vec4 >, std::vector< glm::mat4 > > DataVariant
Multi-type data storage for different precision needs.
std::shared_ptr< Kriya::SamplingPipeline > create_sampler(const std::string &filepath, uint32_t num_samples, bool truncate, uint32_t channel, uint64_t max_dur_ms)
Construct a built SamplingPipeline from an audio file.