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

◆ serve_snapshot()

void MayaFlux::Buffers::RelaxationStepProcessor::serve_snapshot ( )
private

Copy the front state buffer to the host and signal RelaxationGridBuffer::snapshot_source(), if a request is pending.

back_buffers are HostVisible | HostCoherent, so download_back_buffer reads mapped_ptr directly with no staging buffer or fenced transfer. The dispatch has completed by this point: submit_and_wait has returned under synchronous submission, and on_dispatch_complete fires under deferred submission.

Definition at line 136 of file RelaxationStepProcessor.cpp.

137{
138 if (!m_grid->consume_snapshot_request()) {
139 return;
140 }
141
142 const auto& front = m_grid->get_buffer_resources().back_buffers[m_grid->front_index()];
143
144 std::vector<uint8_t> bytes(m_grid->get_state_bytes());
145 download_back_buffer(front, bytes.data(), bytes.size(), m_snapshot_staging);
146
147 m_grid->snapshot_source()->signal(bytes);
148}
std::shared_ptr< RelaxationGridBuffer > m_grid
The attached RelaxationGridBuffer, cached for descriptor writes and snapshot reads.
std::shared_ptr< VKBuffer > m_snapshot_staging
Fallback staging buffer for download_back_buffer, unused while back_buffers stays HostVisible | HostC...
void download_back_buffer(const VKBufferResources::GenerationSlot &slot, void *data, size_t size, std::shared_ptr< VKBuffer > &staging)
Download a raw back_buffers slot to host memory.

References MayaFlux::Buffers::download_back_buffer(), m_grid, and m_snapshot_staging.

Referenced by on_dispatch_complete(), and processing_function().

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