MayaFlux 1.0.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 536 of file ShaderProcessor.cpp.

537{
538 if (!is_dispatch_pending()) {
539 return false;
540 }
541
542 auto& foundry = Portal::Graphics::get_shader_foundry();
543
544 if (block) {
545 foundry.wait_for_fence(m_pending_fence);
546 } else if (!foundry.is_fence_signaled(m_pending_fence)) {
547 return false;
548 }
549
550 const auto fence = m_pending_fence;
552
554 m_pending_buffer.reset();
555
557 foundry.release_fence(fence);
558
559 return true;
560}
vk::Fence fence
std::shared_ptr< NetworkGeometryBuffer > buffer
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 buffer, 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(), MayaFlux::Buffers::ComputeProcessor::cleanup(), processing_function(), and set_deferred_submission().

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