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

◆ dispatch()

void MayaFlux::Yantra::GpuResourceManager::dispatch ( 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 343 of file GpuResourceManager.cpp.

348{
349 auto& foundry = Portal::Graphics::get_shader_foundry();
350 auto& compute_press = Portal::Graphics::get_compute_press();
351
352 auto cmd_id = foundry.begin_commands(
354
355 compute_press.bind_all(
357 push_constant_data, push_constant_size);
358
359 compute_press.dispatch(cmd_id, groups[0], groups[1], groups[2]);
360
361 for (size_t i = 0; i < bindings.size(); ++i) {
362 const auto et = bindings[i].element_type;
365 const bool is_output = bindings[i].direction == GpuBufferBinding::Direction::OUTPUT
366 || bindings[i].direction == GpuBufferBinding::Direction::INPUT_OUTPUT;
367 if (is_output && !is_image) {
368 foundry.buffer_barrier(
369 cmd_id,
370 m_impl->buffers[i].buffer,
371 vk::AccessFlagBits::eShaderWrite,
372 vk::AccessFlagBits::eHostRead,
373 vk::PipelineStageFlagBits::eComputeShader,
374 vk::PipelineStageFlagBits::eHost);
375 }
376 }
377
378 foundry.submit_and_wait(cmd_id);
379}
Portal::Graphics::ComputePipelineID m_pipeline_id
std::vector< Portal::Graphics::DescriptorSetID > m_descriptor_set_ids
std::unique_ptr< GpuResourceManagerImpl > m_impl
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 MayaFlux::Portal::Graphics::ShaderFoundry::COMPUTE, MayaFlux::Portal::Graphics::get_compute_press(), MayaFlux::Portal::Graphics::get_shader_foundry(), MayaFlux::Yantra::GpuBufferBinding::IMAGE_SAMPLED, MayaFlux::Yantra::GpuBufferBinding::IMAGE_STORAGE, MayaFlux::Yantra::GpuBufferBinding::INPUT_OUTPUT, MayaFlux::is_image(), m_descriptor_set_ids, m_impl, m_pipeline_id, and MayaFlux::Yantra::GpuBufferBinding::OUTPUT.

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

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