MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ container_image()

std::shared_ptr< Core::VKImage > MayaFlux::Yantra::TextureExecutionContext::container_image ( const Kakshya::TextureContainer &  container,
uint32_t  layer 
)
inlineprivate

The container's pixels as a GPU image, without allocating one per call.

The context retains its own image. TextureLoom creates one when its allocation properties change, then the container uploads current pixels into it on every call.

The image is reused in place, so the previous dispatch on this context must have completed before the next call, as it must for the output image.

Returns
The input image, or nullptr when the container has no usable data.

Definition at line 610 of file TextureExecutionContext.hpp.

612 {
613 const uint32_t layers = container.get_layer_count();
614 const bool array = layers > 1;
615 const ImageKey key {
616 .width = container.get_width(),
617 .height = container.get_height(),
618 .layers = layers,
619 .format = container.get_format(),
621 };
622
623 const size_t staging_bytes = container.byte_size() * (array ? layers : 1U);
624 if (!m_upload_staging) {
626 } else if (staging_bytes > m_upload_staging->get_size_bytes()) {
627 m_upload_staging->resize(
628 static_cast<size_t>(static_cast<float>(staging_bytes) * Buffers::k_buffer_growth_factor), false);
629 }
630
633 if (!image)
634 return nullptr;
635
636 const bool uploaded = array
637 ? container.upload_image_array(image, m_upload_staging)
638 : container.upload_image(image, layer, m_upload_staging);
639 return uploaded ? image : nullptr;
640 }
IO::ImageData image
Definition Decoder.cpp:47
std::shared_ptr< Core::VKImage > acquire_cached_image(ImageCacheEntry &entry, const ImageKey &key)
Reuse a matching image in an owner-held entry or create it once.
std::shared_ptr< Buffers::VKBuffer > m_upload_staging
Portal::Graphics::ImageCacheEntry m_input_cache
std::shared_ptr< VKBuffer > create_image_staging_buffer(size_t size)
Allocate a persistent host-visible staging buffer sized for repeated streaming uploads to an image of...
constexpr float k_buffer_growth_factor
The creation parameters of an image.

References MayaFlux::Kakshya::TextureContainer::byte_size(), MayaFlux::Kakshya::TextureContainer::get_format(), MayaFlux::Kakshya::TextureContainer::get_height(), MayaFlux::Kakshya::TextureContainer::get_layer_count(), MayaFlux::Kakshya::TextureContainer::get_width(), image, MayaFlux::Kakshya::TextureContainer::upload_image(), MayaFlux::Kakshya::TextureContainer::upload_image_array(), and MayaFlux::Portal::Graphics::ImageKey::width.

+ Here is the call graph for this function: