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

◆ dispatch()

void MayaFlux::Yantra::GpuResourceManager::dispatch ( const std::string &  key,
const std::array< uint32_t, 3 > &  groups,
const std::vector< GpuBufferBinding > &  bindings,
const uint8_t *  push_constant_data,
size_t  push_constant_size 
)

Definition at line 593 of file GpuResourceManager.cpp.

598{
599 auto& unit = unit_for(key);
600 auto& foundry = Portal::Graphics::get_shader_foundry();
601 auto& compute_press = Portal::Graphics::get_compute_press();
602
603 auto cmd_id = foundry.begin_commands(
605
606 compute_press.bind_all(
607 cmd_id, unit.pipeline_id, unit.descriptor_set_ids,
608 push_constant_data, push_constant_size);
609
610 compute_press.dispatch(cmd_id, groups[0], groups[1], groups[2]);
611
612 for (const auto& b : bindings) {
613 const auto et = b.element_type;
616 const bool is_output = b.direction == GpuBufferBinding::Direction::OUTPUT
618
619 const bool is_shared = m_shared->slots.contains({ b.set, static_cast<size_t>(b.binding) });
620 if (is_output && !is_image && !is_shared
621 && static_cast<size_t>(b.binding) < unit.impl->buffers.size()
622 && unit.impl->buffers[b.binding].buffer) {
623 foundry.buffer_barrier(
624 cmd_id,
625 unit.impl->buffers[b.binding].buffer,
626 vk::AccessFlagBits::eShaderWrite,
627 vk::AccessFlagBits::eHostRead,
628 vk::PipelineStageFlagBits::eComputeShader,
629 vk::PipelineStageFlagBits::eHost);
630 }
631 }
632
633 foundry.submit_and_wait(cmd_id);
634}
size_t b
std::unique_ptr< SharedBuffers > m_shared
PipelineUnit & unit_for(const std::string &key)
MAYAFLUX_API ShaderFoundry & get_shader_foundry()
Get the global shader compiler instance.
MAYAFLUX_API ComputePress & get_compute_press()
bool is_image(const fs::path &filepath)
Definition Depot.cpp:136

References b, MayaFlux::Portal::Graphics::ShaderFoundry::COMPUTE, MayaFlux::Portal::Graphics::get_compute_press(), MayaFlux::Portal::Graphics::get_shader_foundry(), MayaFlux::Portal::Graphics::GpuBufferBinding::IMAGE_SAMPLED, MayaFlux::Portal::Graphics::GpuBufferBinding::IMAGE_STORAGE, MayaFlux::Portal::Graphics::GpuBufferBinding::INPUT_OUTPUT, MayaFlux::is_image(), m_shared, MayaFlux::Portal::Graphics::GpuBufferBinding::OUTPUT, and unit_for().

Referenced by MayaFlux::Yantra::GpuDispatchCore::dispatch_core().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: