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

◆ completed_frame_count()

uint64_t MayaFlux::Core::BackendWindowHandler::completed_frame_count ( const WindowRenderContext &  ctx) const
private

Submitted frames of a window whose GPU work has finished.

Parameters
ctxWindow render context

Never blocks. A slot reset for acquisition but not yet resubmitted holds the id of its previous, finished submission, so the result can only understate completion.

Definition at line 1226 of file BackendWindowHandler.cpp.

1227{
1228 const auto device = m_context.get_device();
1229
1230 uint64_t oldest_pending = ctx.submitted_frames + 1;
1231 for (size_t slot = 0; slot < ctx.in_flight.size(); ++slot) {
1232 const uint64_t submission = ctx.slot_submission[slot];
1233 if (submission == 0) {
1234 continue;
1235 }
1236 if (device.getFenceStatus(ctx.in_flight[slot]) == vk::Result::eNotReady) {
1237 oldest_pending = std::min(oldest_pending, submission);
1238 }
1239 }
1240
1241 return oldest_pending - 1;
1242}
vk::PhysicalDevice device
Definition VKDevice.cpp:121
vk::Device get_device() const
Get logical device.
Definition VKContext.hpp:49

References device, MayaFlux::Core::WindowRenderContext::in_flight, MayaFlux::Core::WindowRenderContext::slot_submission, and MayaFlux::Core::WindowRenderContext::submitted_frames.

Referenced by setup_backend_service().

+ Here is the caller graph for this function: