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

◆ resolve_pending_dispatch()

bool MayaFlux::Buffers::ShaderProcessor::resolve_pending_dispatch ( bool  block)

Resolve an outstanding asynchronous submission.

Parameters
blockTrue to wait for the fence, false to return immediately when it is not yet signaled.
Returns
True if a submission was resolved by this call.

On resolution invokes on_dispatch_complete, then release_fence, which also frees the associated command buffer. Invoked with block=false at the top of processing_function and with block=true from cleanup.

Definition at line 483 of file ShaderProcessor.cpp.

484{
485 if (!is_dispatch_pending()) {
486 return false;
487 }
488
489 auto& foundry = Portal::Graphics::get_shader_foundry();
490
491 if (block) {
492 foundry.wait_for_fence(m_pending_fence);
493 } else if (!foundry.is_fence_signaled(m_pending_fence)) {
494 return false;
495 }
496
497 const auto fence = m_pending_fence;
498 auto buffer = m_pending_buffer;
499
501 m_pending_buffer.reset();
502
503 on_dispatch_complete(buffer);
504 foundry.release_fence(fence);
505
506 return true;
507}
vk::Fence fence
std::shared_ptr< VKBuffer > m_pending_buffer
Buffer retained for the outstanding submission.
Portal::Graphics::FenceID m_pending_fence
Outstanding async submission, if any.
virtual void on_dispatch_complete(const std::shared_ptr< VKBuffer > &buffer)
Called once when an asynchronous submission is observed complete.
bool is_dispatch_pending() const
True while an asynchronous submission is outstanding.
constexpr FenceID INVALID_FENCE
MAYAFLUX_API ShaderFoundry & get_shader_foundry()
Get the global shader compiler instance.

References fence, MayaFlux::Portal::Graphics::get_shader_foundry(), MayaFlux::Portal::Graphics::INVALID_FENCE, is_dispatch_pending(), m_pending_buffer, m_pending_fence, and on_dispatch_complete().

Referenced by cleanup(), processing_function(), and set_deferred_submission().

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