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

◆ on_before_gpu_dispatch()

void MayaFlux::Yantra::TextureExecutionContext::on_before_gpu_dispatch ( const std::vector< std::vector< double > > &  ,
const DataStructureInfo &   
)
inlineoverrideprotectedvirtual

Stages the pending TextureContainer at the declared input image binding and, in CONTAINER or IMAGE mode, allocates the output storage image at the declared output binding.

Reimplemented from MayaFlux::Yantra::GpuDispatchCore.

Definition at line 429 of file TextureExecutionContext.hpp.

432 {
436
437 auto& in_slot = input_slot();
438 if (in_slot.binding.element_type == GpuBufferBinding::ElementType::IMAGE_STORAGE) {
440 } else {
441 stage_image_at(in_slot.binding.binding, img, GpuBufferBinding::ElementType::IMAGE_SAMPLED, sampler);
442 }
443 in_slot.image = img;
444
447 const uint32_t ow = m_output_dim_override
448 ? m_output_dim_override->first
449 : m_pending_container->get_width();
450 const uint32_t oh = m_output_dim_override
451 ? m_output_dim_override->second
452 : m_pending_container->get_height();
453 prepare_output_image(ow, oh);
454 }
455 }
456 }
vk::Sampler get_default_linear()
Get a default linear sampler.
void stage_image_at(size_t binding_index, std::shared_ptr< Core::VKImage > image, GpuBufferBinding::ElementType kind, vk::Sampler sampler=nullptr)
Register a VKImage at an explicit binding index.
std::shared_ptr< Kakshya::TextureContainer > m_pending_container
void prepare_output_image(uint32_t width, uint32_t height)
Allocates the output storage image and stages it at the declared output binding.
ImageSlot & input_slot()
Find the declared input image slot.
std::optional< std::pair< uint32_t, uint32_t > > m_output_dim_override
@ IMAGE
Transition output image to shader-read layout; no CPU download.
@ CONTAINER
Download storage image at binding 0 into a TextureContainer.
std::shared_ptr< Core::VKImage > container_image(const Kakshya::TextureContainer &container, uint32_t layer)
The container's pixels as a GPU image, without allocating one per call.