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,
235 const std::shared_ptr<Core::VKImage>&
image,
238 const std::shared_ptr<Buffers::VKBuffer>& staging,
bool deferred =
false);
250 const std::shared_ptr<Core::VKImage>&
image,
272 void download_data_async(
273 const std::shared_ptr<Core::VKImage>&
image,
290 void transition_layout(
291 const std::shared_ptr<Core::VKImage>&
image,
292 vk::ImageLayout old_layout,
293 vk::ImageLayout new_layout,
294 uint32_t mip_levels = 1,
295 uint32_t array_layers = 1,
296 vk::ImageAspectFlags aspect_mask = vk::ImageAspectFlagBits::eColor);
310 vk::Sampler get_or_create_sampler(
const SamplerConfig& config);
315 vk::Sampler get_default_sampler();
320 vk::Sampler get_nearest_sampler();
329 static vk::Format to_vulkan_format(
ImageFormat format);
334 static size_t get_bytes_per_pixel(
ImageFormat format);
342 static std::optional<ImageFormat> from_vulkan_format(vk::Format vk_format);
347 static size_t calculate_image_size(
356 static uint32_t get_channel_count(
ImageFormat format);
375 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.