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 309 of file GpuResourceManager.cpp.

314{
315 auto& foundry = Portal::Graphics::get_shader_foundry();
316 auto& compute_press = Portal::Graphics::get_compute_press();
317
318 auto cmd_id = foundry.begin_commands(
320
321 compute_press.bind_all(
323 push_constant_data, push_constant_size);
324
325 compute_press.dispatch(cmd_id, groups[0], groups[1], groups[2]);
326
327 for (size_t i = 0; i < bindings.size(); ++i) {
328 const auto et = bindings[i].element_type;
331 const bool is_output = bindings[i].direction == GpuBufferBinding::Direction::OUTPUT
332 || bindings[i].direction == GpuBufferBinding::Direction::INPUT_OUTPUT;
333 if (is_output && !is_image) {
334 foundry.buffer_barrier(
335 cmd_id,
336 m_impl->buffers[i].buffer,
337 vk::AccessFlagBits::eShaderWrite,
338 vk::AccessFlagBits::eHostRead,
339 vk::PipelineStageFlagBits::eComputeShader,
340 vk::PipelineStageFlagBits::eHost);
341 }
342 }
343
344 foundry.submit_and_wait(cmd_id);
345}
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:43

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: