MayaFlux 0.5.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 474 of file GpuResourceManager.cpp.

479{
480 auto& unit = unit_for(key);
481 auto& foundry = Portal::Graphics::get_shader_foundry();
482 auto& compute_press = Portal::Graphics::get_compute_press();
483
484 auto cmd_id = foundry.begin_commands(
486
487 compute_press.bind_all(
488 cmd_id, unit.pipeline_id, unit.descriptor_set_ids,
489 push_constant_data, push_constant_size);
490
491 compute_press.dispatch(cmd_id, groups[0], groups[1], groups[2]);
492
493 for (const auto& b : bindings) {
494 const auto et = b.element_type;
497 const bool is_output = b.direction == GpuBufferBinding::Direction::OUTPUT
499
500 const bool is_shared = m_shared->slots.contains({ b.set, static_cast<size_t>(b.binding) });
501 if (is_output && !is_image && !is_shared
502 && static_cast<size_t>(b.binding) < unit.impl->buffers.size()) {
503 foundry.buffer_barrier(
504 cmd_id,
505 unit.impl->buffers[b.binding].buffer,
506 vk::AccessFlagBits::eShaderWrite,
507 vk::AccessFlagBits::eHostRead,
508 vk::PipelineStageFlagBits::eComputeShader,
509 vk::PipelineStageFlagBits::eHost);
510 }
511 }
512
513 foundry.submit_and_wait(cmd_id);
514}
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:108

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: