Bicameral Engine
GPU-resident engine for a magic-research open-world game
Loading...
Searching...
No Matches
bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop Class Reference
Collaboration diagram for bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop:
[legend]

Public Member Functions

 FrameLoop (const FrameLoopOptions &options, FrameLoopParts &&parts)
bool CreateFrameSlots ()
bool CreateEditor ()
bool CreateSavePoints ()
int Run ()

Private Member Functions

bool RecordRenderLists ()
bool HandleResize ()
void SubmitRender ()
bool WantsScreenshot () const
bool SubmitScreenshot ()
bool WriteScreenshot ()
bool NeedsStopExtraction () const
void CollectSimSubmissions ()
void ReportSimReadback (const sim::ProbeFrameReadback &readback)
void ReportEvents (const sim::ProbeFrameReadback &readback)
void CheckPhysics (const sim::ProbeTickHash &tickHash)
void CollectFrameSlot (uint32_t slotIndex)
void QueueClicks ()
void ApplyPeekChange ()
void QueuePushes ()
std::vector< sim::ProbeCommand > TakeCommands (SimCursor start)
std::vector< sim::ProbeCommand > TakeClickCommands (uint64_t applyTick, uint32_t limit)
void TakeTableSwaps (SimCursor start, uint32_t limit, std::vector< sim::ProbeCommand > &commands)
bool FinishReplay ()
bool SubmitSim ()
void RequestTrace ()
void StartRequestedTrace (SimCursor start)
void CollectTrace (const sim::ProbeFrameReadback &readback)
bool FinishTrace ()
bool RunFrame (Clock::time_point frameStart)
int Finish (bool failed, Clock::time_point start)
bool IsDeviceLost () const
void BuildEditor ()
bool SubmitEditor ()
void ApplyTimeRequest (const editor::TimeRequest &request)
void CheckAutoTime ()
void FilterEditorInput (std::vector< InputEvent > &events) const
editor::EditorStatus MakeEditorStatus () const
editor::GraphPanelStatus MakeGraphPanelStatus () const
std::string RewindUnavailableReason () const
std::vector< uint64_t > SavePointTicks () const
void RequestRewind (uint64_t tick)
uint32_t PrepareRewind ()
uint32_t SaveSlotFor (SimCursor start, uint32_t unitCount, uint32_t restoreFrom) const
std::vector< sim::ProbeCommand > TakeLiveCommands (uint64_t applyTick, uint64_t endApplyTick, uint32_t limit)
void CheckAutoRewind ()
void LogStats (const Stats &stats, Clock::duration elapsed, std::string_view label) const
void AddStats (const Stats &frame)

Private Attributes

FrameLoopOptions m_options
std::unique_ptr< Window > m_window
gpu::Device m_device
gpu::Queue m_direct
gpu::Queue m_compute
gpu::SwapChain m_swapChain
sim::ProbeSim m_sim
sim::ProbePeek m_peek
render::ProbeView m_view
render::DebugViewController m_viewController
std::vector< save::ReplayPlayer > m_replay
save::ReplayRecorder m_recorder
TableHotReload m_tableReload
std::vector< sim::ProbeTableSwap > m_frameTableSwaps
bool m_tableSwapFailed = false
std::vector< render::ScreenshotCapture > m_screenshot
std::vector< TraceCapture > m_traceCapture
bool m_traceRequested = false
bool m_traceWriteFailed = false
render::CellCoordinate m_lastPokedCell
std::array< FrameSlot, FRAME_SLOT_COUNT > m_frames
ComPtr< ID3D12QueryHeap > m_renderTimestamps
ComPtr< ID3D12Resource > m_renderTimestampReadback
uint64_t m_frameNumber = 0
SimScheduler m_scheduler
std::array< SimSubmission, SIM_SLOT_COUNT > m_simSubmissions
uint64_t m_simSubmissionCount = 0
uint64_t m_lastExtraction = 0
uint64_t m_lastExtractionTick = UINT64_MAX
CompletedExtraction m_completedExtraction
std::array< uint64_t, sim::PROBE_EXTRACTION_COUNT > m_lastRenderReading {}
sim::ProbeTickHash m_latestHash
std::unique_ptr< sim::PhysicsWorld > m_physicsCheck
std::vector< sim::ProbeCommand > m_physicsCheckPushes
uint64_t m_physicsCheckMismatches = 0
std::vector< sim::ProbeCommand > m_pendingCommands
std::vector< PendingClick > m_clicks
uint32_t m_nextSequence = 0
editor::TimeControl m_timeControl
std::unique_ptr< editor::EditorOverlay > m_editor
SimCursor m_autoTimeHold
bool m_autoTimeFailed = false
uint32_t m_savePointCount = 0
uint64_t m_rewindRequest = UINT64_MAX
uint32_t m_rewindCount = 0
bool m_extractAfterRewind = false
std::vector< sim::ProbeCommand > m_commandHistory
std::deque< sim::ProbeCommand > m_rewindFeed
uint64_t m_computeFrequency = 0
uint64_t m_directFrequency = 0
Stats m_interval
Stats m_lastInterval
double m_lastIntervalSeconds = 0.0
Stats m_total

Detailed Description

Definition at line 199 of file frame_loop.cpp.

Constructor & Destructor Documentation

◆ FrameLoop()

bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::FrameLoop ( const FrameLoopOptions & options,
FrameLoopParts && parts )
inline

Member Function Documentation

◆ AddStats()

void bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::AddStats ( const Stats & frame)
private

Definition at line 1396 of file frame_loop.cpp.

References bicameral::gpu::AccumulateGraphStats(), AddStats(), and m_total.

Referenced by AddStats(), Finish(), and Run().

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

◆ ApplyPeekChange()

void bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::ApplyPeekChange ( )
private

Definition at line 836 of file frame_loop.cpp.

References ApplyPeekChange(), bicameral::render::PeekView::cell, m_peek, m_viewController, bicameral::sim::PEEK_LEVEL_COUNT, bicameral::render::PEEK_MAX_DEPTH, bicameral::render::PeekView::peeking, bicameral::render::CellCoordinate::x, bicameral::render::CellCoordinate::y, and bicameral::render::CellCoordinate::z.

Referenced by ApplyPeekChange(), and QueueClicks().

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

◆ ApplyTimeRequest()

void bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::ApplyTimeRequest ( const editor::TimeRequest & request)
private

Definition at line 1141 of file frame_loop.cpp.

References bicameral::editor::TimeRequest::Any(), ApplyTimeRequest(), bicameral::Info, bicameral::Log(), m_scheduler, m_timeControl, bicameral::Sim, bicameral::frame::SimCursor::tick, and bicameral::frame::SimCursor::unit.

Referenced by ApplyTimeRequest(), and BuildEditor().

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

◆ BuildEditor()

void bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::BuildEditor ( )
private

Definition at line 1113 of file frame_loop.cpp.

References bicameral::editor::TimeRequest::Any(), ApplyTimeRequest(), bicameral::frame::anonymous_namespace{frame_loop.cpp}::AutoTimeRequest(), BuildEditor(), CheckAutoRewind(), CheckAutoTime(), m_editor, m_frameNumber, m_options, m_timeControl, MakeEditorStatus(), RequestRewind(), and bicameral::editor::TimeRequest::rewindTick.

Referenced by BuildEditor(), and RunFrame().

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

◆ CheckAutoRewind()

void bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::CheckAutoRewind ( )
private

Definition at line 1385 of file frame_loop.cpp.

References CheckAutoRewind(), m_options, m_rewindCount, m_rewindRequest, RequestRewind(), and SavePointTicks().

Referenced by BuildEditor(), and CheckAutoRewind().

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

◆ CheckAutoTime()

void bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::CheckAutoTime ( )
private

Definition at line 1153 of file frame_loop.cpp.

References bicameral::frame::anonymous_namespace{frame_loop.cpp}::AUTO_TIME_HOLD_CHECK_FRAME, bicameral::frame::anonymous_namespace{frame_loop.cpp}::AUTO_TIME_HOLD_FRAME, bicameral::frame::anonymous_namespace{frame_loop.cpp}::AUTO_TIME_STEP_CHECK_FRAME, bicameral::frame::anonymous_namespace{frame_loop.cpp}::AUTO_TIME_STEP_FRAMES, CheckAutoTime(), bicameral::Error, bicameral::Log(), m_autoTimeFailed, m_autoTimeHold, m_frameNumber, m_scheduler, bicameral::Sim, bicameral::frame::SimCursor::tick, and bicameral::frame::SimCursor::unit.

Referenced by BuildEditor(), and CheckAutoTime().

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

◆ CheckPhysics()

void bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::CheckPhysics ( const sim::ProbeTickHash & tickHash)
private

Definition at line 675 of file frame_loop.cpp.

References bicameral::sim::ProbeTickHash::bodyHash, CheckPhysics(), bicameral::Error, bicameral::Log(), m_physicsCheck, m_physicsCheckMismatches, m_physicsCheckPushes, bicameral::frame::anonymous_namespace{frame_loop.cpp}::PushFromCommand(), bicameral::Sim, and bicameral::sim::ProbeTickHash::tick.

Referenced by CheckPhysics(), and ReportSimReadback().

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

◆ CollectFrameSlot()

void bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::CollectFrameSlot ( uint32_t slotIndex)
private

Definition at line 737 of file frame_loop.cpp.

References CollectFrameSlot(), bicameral::frame::anonymous_namespace{frame_loop.cpp}::FRAME_SLOT_COUNT, m_direct, m_directFrequency, m_frames, m_interval, m_renderTimestampReadback, m_scheduler, bicameral::gpu::ReadBuffer(), bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameSlot::renderFence, bicameral::frame::anonymous_namespace{frame_loop.cpp}::TimestampMilliseconds(), and bicameral::frame::anonymous_namespace{frame_loop.cpp}::TIMESTAMPS_PER_FRAME.

Referenced by CollectFrameSlot(), HandleResize(), and SubmitRender().

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

◆ CollectSimSubmissions()

void bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::CollectSimSubmissions ( )
private

◆ CollectTrace()

void bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::CollectTrace ( const sim::ProbeFrameReadback & readback)
private

Definition at line 1642 of file frame_loop.cpp.

References bicameral::frame::TraceCapture::Add(), CollectTrace(), bicameral::sim::ProbeFrameReadback::droppedTraceCount, bicameral::Error, bicameral::frame::TraceCapture::IsComplete(), bicameral::Log(), m_latestHash, m_sim, m_traceCapture, m_traceWriteFailed, bicameral::Sim, bicameral::sim::ProbeFrameReadback::trace, and bicameral::frame::TraceCapture::Write().

Referenced by CollectTrace(), and ReportSimReadback().

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

◆ CreateEditor()

bool bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::CreateEditor ( )
nodiscard

Definition at line 1079 of file frame_loop.cpp.

References bicameral::editor::EditorOverlay::Create(), CreateEditor(), bicameral::Error, bicameral::gpu::SwapChain::FORMAT, bicameral::frame::anonymous_namespace{frame_loop.cpp}::FRAME_SLOT_COUNT, bicameral::Log(), m_device, m_direct, m_editor, m_options, m_window, and bicameral::Render.

Referenced by CreateEditor().

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

◆ CreateFrameSlots()

bool bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::CreateFrameSlots ( )
nodiscard

Definition at line 521 of file frame_loop.cpp.

References bicameral::frame::anonymous_namespace{frame_loop.cpp}::CONSTANTS_BYTES, bicameral::gpu::CreateBuffer(), CreateFrameSlots(), bicameral::frame::anonymous_namespace{frame_loop.cpp}::FRAME_SLOT_COUNT, m_device, m_frames, m_renderTimestampReadback, m_renderTimestamps, bicameral::gpu::Readback, RecordRenderLists(), bicameral::frame::anonymous_namespace{frame_loop.cpp}::TIMESTAMPS_PER_FRAME, and bicameral::gpu::Upload.

Referenced by CreateFrameSlots().

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

◆ CreateSavePoints()

bool bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::CreateSavePoints ( )
nodiscard

Definition at line 1246 of file frame_loop.cpp.

References bicameral::frame::AUTO_SAVE_POINTS, CreateSavePoints(), bicameral::frame::DEFAULT_EDITOR_SAVE_POINTS, bicameral::Error, bicameral::Info, bicameral::Log(), m_device, m_options, m_savePointCount, m_scheduler, m_sim, bicameral::frame::MAX_SAVE_POINTS, and bicameral::Sim.

Referenced by CreateSavePoints().

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

◆ FilterEditorInput()

void bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::FilterEditorInput ( std::vector< InputEvent > & events) const
private

Definition at line 1098 of file frame_loop.cpp.

References bicameral::ButtonDown, FilterEditorInput(), bicameral::KeyDown, bicameral::InputEvent::kind, m_editor, and bicameral::Wheel.

Referenced by FilterEditorInput(), and QueueClicks().

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

◆ Finish()

int bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::Finish ( bool failed,
Clock::time_point start )
private

Definition at line 1544 of file frame_loop.cpp.

References AddStats(), CollectSimSubmissions(), bicameral::Core, bicameral::Error, Finish(), FinishReplay(), FinishTrace(), bicameral::Gpu, IsDeviceLost(), bicameral::Log(), bicameral::gpu::LogDeviceRemoved(), LogStats(), m_autoTimeFailed, m_compute, m_device, m_direct, m_editor, m_interval, m_options, m_rewindCount, m_screenshot, m_total, bicameral::Render, bicameral::Sim, and WriteScreenshot().

Referenced by Finish(), and Run().

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

◆ FinishReplay()

bool bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::FinishReplay ( )
nodiscardprivate

Definition at line 1676 of file frame_loop.cpp.

References bicameral::save::ReplayFile::commands, bicameral::Error, bicameral::save::ReplayPlayer::Finished(), FinishReplay(), bicameral::save::ReplayPlayer::HashCount(), bicameral::Info, bicameral::save::ReplayPlayer::LateCommands(), bicameral::Log(), m_options, m_recorder, m_replay, bicameral::save::ReplayPlayer::Matches(), bicameral::save::ReplayPlayer::Mismatches(), bicameral::save::ReplayPlayer::Passed(), bicameral::Sim, bicameral::save::ReplayFile::tickHashes, bicameral::ToUtf8(), and bicameral::save::WriteReplayFile().

Referenced by Finish(), and FinishReplay().

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

◆ FinishTrace()

bool bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::FinishTrace ( )
nodiscardprivate

Definition at line 1662 of file frame_loop.cpp.

References bicameral::Error, FinishTrace(), bicameral::Log(), m_traceCapture, m_traceWriteFailed, and bicameral::Sim.

Referenced by Finish(), and FinishTrace().

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

◆ HandleResize()

bool bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::HandleResize ( )
private

Definition at line 585 of file frame_loop.cpp.

References CollectFrameSlot(), CollectSimSubmissions(), bicameral::frame::anonymous_namespace{frame_loop.cpp}::FRAME_SLOT_COUNT, HandleResize(), bicameral::Info, bicameral::Log(), m_compute, m_device, m_direct, m_swapChain, m_window, RecordRenderLists(), and bicameral::Render.

Referenced by HandleResize(), and Run().

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

◆ IsDeviceLost()

bool bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::IsDeviceLost ( ) const
nodiscardprivate

Definition at line 1072 of file frame_loop.cpp.

References IsDeviceLost(), m_compute, m_device, and m_direct.

Referenced by Finish(), IsDeviceLost(), and RunFrame().

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

◆ LogStats()

void bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::LogStats ( const Stats & stats,
Clock::duration elapsed,
std::string_view label ) const
private

Definition at line 1415 of file frame_loop.cpp.

References bicameral::frame::anonymous_namespace{frame_loop.cpp}::Stats::conductGraph, bicameral::Core, bicameral::frame::anonymous_namespace{frame_loop.cpp}::Stats::cpuMaxMilliseconds, bicameral::frame::anonymous_namespace{frame_loop.cpp}::Stats::cpuMilliseconds, bicameral::frame::anonymous_namespace{frame_loop.cpp}::Stats::cpuWaits, bicameral::frame::anonymous_namespace{frame_loop.cpp}::Stats::events, bicameral::gpu::FormatGraphStats(), bicameral::frame::anonymous_namespace{frame_loop.cpp}::Stats::frames, bicameral::Info, bicameral::Log(), LogStats(), m_latestHash, m_scheduler, m_sim, bicameral::gpu::GraphStatsSnapshot::nodes, bicameral::frame::anonymous_namespace{frame_loop.cpp}::Stats::presentMilliseconds, bicameral::frame::anonymous_namespace{frame_loop.cpp}::Stats::renderFramesMeasured, bicameral::frame::anonymous_namespace{frame_loop.cpp}::Stats::renderGpuMilliseconds, bicameral::frame::anonymous_namespace{frame_loop.cpp}::Stats::simGpuMilliseconds, bicameral::frame::anonymous_namespace{frame_loop.cpp}::Stats::simSubmissions, bicameral::frame::anonymous_namespace{frame_loop.cpp}::Stats::simSubmissionsMeasured, bicameral::frame::anonymous_namespace{frame_loop.cpp}::Stats::skippedExtractions, bicameral::frame::anonymous_namespace{frame_loop.cpp}::Stats::skippedSubmissions, bicameral::frame::anonymous_namespace{frame_loop.cpp}::Stats::ticks, bicameral::frame::anonymous_namespace{frame_loop.cpp}::Stats::units, and bicameral::WorkGraph.

Referenced by Finish(), LogStats(), and Run().

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

◆ MakeEditorStatus()

◆ MakeGraphPanelStatus()

editor::GraphPanelStatus bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::MakeGraphPanelStatus ( ) const
nodiscardprivate

Definition at line 1216 of file frame_loop.cpp.

References bicameral::frame::anonymous_namespace{frame_loop.cpp}::Stats::conductGraph, m_lastInterval, m_sim, MakeGraphPanelStatus(), bicameral::frame::anonymous_namespace{frame_loop.cpp}::Stats::ticks, bicameral::frame::anonymous_namespace{frame_loop.cpp}::Stats::unitGpuMilliseconds, and bicameral::editor::GraphPanelStatus::units.

Referenced by MakeEditorStatus(), and MakeGraphPanelStatus().

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

◆ NeedsStopExtraction()

bool bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::NeedsStopExtraction ( ) const
nodiscardprivate

Definition at line 1015 of file frame_loop.cpp.

References m_lastExtractionTick, m_options, m_scheduler, and NeedsStopExtraction().

Referenced by NeedsStopExtraction(), and SubmitSim().

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

◆ PrepareRewind()

uint32_t bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::PrepareRewind ( )
nodiscardprivate

Definition at line 1308 of file frame_loop.cpp.

References CollectSimSubmissions(), bicameral::Info, bicameral::Log(), m_commandHistory, m_compute, m_extractAfterRewind, m_replay, m_rewindCount, m_rewindFeed, m_rewindRequest, m_savePointCount, m_scheduler, m_sim, bicameral::sim::NO_SAVE_POINT, PrepareRewind(), bicameral::Sim, bicameral::sim::Command::targetTick, bicameral::frame::SimCursor::tick, and bicameral::frame::SimCursor::unit.

Referenced by PrepareRewind(), and SubmitSim().

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

◆ QueueClicks()

void bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::QueueClicks ( )
private

Definition at line 763 of file frame_loop.cpp.

References ApplyPeekChange(), bicameral::frame::anonymous_namespace{frame_loop.cpp}::AUTO_CLICK_INTERVAL_FRAMES, bicameral::frame::anonymous_namespace{frame_loop.cpp}::AUTO_TRACE_FRAME, bicameral::render::CellOnSlice(), FilterEditorInput(), bicameral::KeyDown, m_clicks, m_frameNumber, m_lastPokedCell, m_nextSequence, m_options, m_pendingCommands, m_replay, m_swapChain, m_viewController, m_window, bicameral::sim::MakePokeCommand(), QueueClicks(), QueuePushes(), and RequestTrace().

Referenced by QueueClicks(), and RunFrame().

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

◆ QueuePushes()

void bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::QueuePushes ( )
private

Definition at line 805 of file frame_loop.cpp.

References bicameral::frame::anonymous_namespace{frame_loop.cpp}::AUTO_PUSH_FRAME, m_frameNumber, m_nextSequence, m_options, m_pendingCommands, m_viewController, bicameral::sim::MakePushCommand(), bicameral::frame::anonymous_namespace{frame_loop.cpp}::PUSH_IMPULSE_MILLINEWTON_SECONDS, and QueuePushes().

Referenced by QueueClicks(), and QueuePushes().

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

◆ RecordRenderLists()

bool bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::RecordRenderLists ( )
private

Definition at line 555 of file frame_loop.cpp.

References bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameSlot::allocator, bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameSlot::constants, bicameral::frame::anonymous_namespace{frame_loop.cpp}::FRAME_SLOT_COUNT, bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameSlot::list, m_frames, m_renderTimestampReadback, m_renderTimestamps, m_sim, m_swapChain, m_view, RecordRenderLists(), and bicameral::frame::anonymous_namespace{frame_loop.cpp}::TIMESTAMPS_PER_FRAME.

Referenced by CreateFrameSlots(), HandleResize(), and RecordRenderLists().

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

◆ ReportEvents()

void bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::ReportEvents ( const sim::ProbeFrameReadback & readback)
private

◆ ReportSimReadback()

void bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::ReportSimReadback ( const sim::ProbeFrameReadback & readback)
private

◆ RequestRewind()

void bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::RequestRewind ( uint64_t tick)
private

Definition at line 1296 of file frame_loop.cpp.

References bicameral::Log(), m_rewindRequest, RequestRewind(), RewindUnavailableReason(), SavePointTicks(), bicameral::Sim, and bicameral::Warning.

Referenced by BuildEditor(), CheckAutoRewind(), and RequestRewind().

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

◆ RequestTrace()

void bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::RequestTrace ( )
private

Definition at line 1602 of file frame_loop.cpp.

References bicameral::Log(), m_traceCapture, m_traceRequested, RequestTrace(), bicameral::Sim, bicameral::ToUtf8(), and bicameral::Warning.

Referenced by QueueClicks(), and RequestTrace().

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

◆ RewindUnavailableReason()

std::string bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::RewindUnavailableReason ( ) const
nodiscardprivate

Definition at line 1267 of file frame_loop.cpp.

References m_options, m_physicsCheck, m_savePointCount, m_traceCapture, and RewindUnavailableReason().

Referenced by MakeEditorStatus(), RequestRewind(), and RewindUnavailableReason().

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

◆ Run()

int bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::Run ( )
nodiscard

◆ RunFrame()

bool bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::RunFrame ( Clock::time_point frameStart)
private

Definition at line 1450 of file frame_loop.cpp.

References BuildEditor(), CollectSimSubmissions(), IsDeviceLost(), m_frameNumber, m_interval, m_options, m_swapChain, m_tableReload, bicameral::frame::anonymous_namespace{frame_loop.cpp}::Milliseconds(), QueueClicks(), RunFrame(), SubmitEditor(), SubmitRender(), SubmitScreenshot(), and SubmitSim().

Referenced by Run(), and RunFrame().

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

◆ SavePointTicks()

std::vector< uint64_t > bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::SavePointTicks ( ) const
nodiscardprivate

Definition at line 1283 of file frame_loop.cpp.

References m_savePointCount, m_sim, and SavePointTicks().

Referenced by CheckAutoRewind(), MakeEditorStatus(), RequestRewind(), and SavePointTicks().

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

◆ SaveSlotFor()

uint32_t bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::SaveSlotFor ( SimCursor start,
uint32_t unitCount,
uint32_t restoreFrom ) const
nodiscardprivate

Definition at line 1347 of file frame_loop.cpp.

References m_options, m_savePointCount, m_simSubmissionCount, bicameral::sim::NO_SAVE_POINT, SaveSlotFor(), bicameral::frame::SimCursor::tick, and bicameral::frame::SimCursor::unit.

Referenced by SaveSlotFor(), and SubmitSim().

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

◆ StartRequestedTrace()

void bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::StartRequestedTrace ( SimCursor start)
private

◆ SubmitEditor()

bool bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::SubmitEditor ( )
nodiscardprivate

Definition at line 1132 of file frame_loop.cpp.

References m_direct, m_editor, m_swapChain, and SubmitEditor().

Referenced by RunFrame(), and SubmitEditor().

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

◆ SubmitRender()

void bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::SubmitRender ( )
private

Definition at line 1001 of file frame_loop.cpp.

References CollectFrameSlot(), bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameSlot::list, m_completedExtraction, m_compute, m_direct, m_frames, m_lastRenderReading, m_swapChain, m_viewController, bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameSlot::mappedConstants, bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameSlot::renderFence, and SubmitRender().

Referenced by RunFrame(), and SubmitRender().

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

◆ SubmitScreenshot()

bool bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::SubmitScreenshot ( )
nodiscardprivate

Definition at line 1034 of file frame_loop.cpp.

References bicameral::render::ScreenshotCapture::Create(), bicameral::Error, bicameral::Log(), m_device, m_direct, m_screenshot, m_swapChain, bicameral::Render, SubmitScreenshot(), and WantsScreenshot().

Referenced by RunFrame(), and SubmitScreenshot().

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

◆ SubmitSim()

bool bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::SubmitSim ( )
private

Definition at line 921 of file frame_loop.cpp.

References m_completedExtraction, m_compute, m_direct, m_extractAfterRewind, m_frameTableSwaps, m_interval, m_lastExtraction, m_lastExtractionTick, m_lastRenderReading, m_peek, m_rewindRequest, m_scheduler, m_sim, m_simSubmissionCount, m_simSubmissions, m_tableSwapFailed, NeedsStopExtraction(), bicameral::sim::NO_SAVE_POINT, PrepareRewind(), bicameral::frame::anonymous_namespace{frame_loop.cpp}::SimSubmission::read, SaveSlotFor(), bicameral::frame::anonymous_namespace{frame_loop.cpp}::SIM_SLOT_COUNT, StartRequestedTrace(), SubmitSim(), TakeCommands(), bicameral::frame::SimCursor::tick, and bicameral::frame::SimCursor::unit.

Referenced by RunFrame(), and SubmitSim().

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

◆ TakeClickCommands()

std::vector< sim::ProbeCommand > bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::TakeClickCommands ( uint64_t applyTick,
uint32_t limit )
nodiscardprivate

Definition at line 893 of file frame_loop.cpp.

References bicameral::frame::anonymous_namespace{frame_loop.cpp}::PendingClick::cell, m_clicks, m_pendingCommands, TakeClickCommands(), and bicameral::frame::anonymous_namespace{frame_loop.cpp}::PendingClick::tick.

Referenced by TakeClickCommands(), and TakeLiveCommands().

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

◆ TakeCommands()

std::vector< sim::ProbeCommand > bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::TakeCommands ( SimCursor start)
nodiscardprivate

Definition at line 851 of file frame_loop.cpp.

References m_options, m_physicsCheck, m_physicsCheckPushes, m_recorder, m_replay, m_scheduler, m_sim, bicameral::sim::ProbeSim::NextApplyTick(), TakeCommands(), TakeLiveCommands(), TakeTableSwaps(), bicameral::frame::SimCursor::tick, bicameral::sim::Command::type, and bicameral::frame::SimCursor::unit.

Referenced by SubmitSim(), and TakeCommands().

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

◆ TakeLiveCommands()

std::vector< sim::ProbeCommand > bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::TakeLiveCommands ( uint64_t applyTick,
uint64_t endApplyTick,
uint32_t limit )
nodiscardprivate

Definition at line 1359 of file frame_loop.cpp.

References bicameral::Error, bicameral::Log(), m_commandHistory, m_rewindFeed, bicameral::sim::Command::sequence, bicameral::Sim, TakeClickCommands(), TakeLiveCommands(), and bicameral::sim::Command::targetTick.

Referenced by TakeCommands(), and TakeLiveCommands().

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

◆ TakeTableSwaps()

void bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::TakeTableSwaps ( SimCursor start,
uint32_t limit,
std::vector< sim::ProbeCommand > & commands )
private

Definition at line 877 of file frame_loop.cpp.

References bicameral::Error, bicameral::Log(), m_frameTableSwaps, m_nextSequence, m_replay, m_scheduler, m_sim, m_tableReload, m_tableSwapFailed, bicameral::Sim, TakeTableSwaps(), bicameral::frame::SimCursor::tick, and bicameral::frame::SimCursor::unit.

Referenced by TakeCommands(), and TakeTableSwaps().

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

◆ WantsScreenshot()

bool bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::WantsScreenshot ( ) const
nodiscardprivate

Definition at line 1022 of file frame_loop.cpp.

References m_completedExtraction, m_frameNumber, m_options, m_scheduler, m_screenshot, and WantsScreenshot().

Referenced by SubmitScreenshot(), and WantsScreenshot().

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

◆ WriteScreenshot()

bool bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::WriteScreenshot ( )
nodiscardprivate

Definition at line 1056 of file frame_loop.cpp.

References bicameral::Error, bicameral::Info, bicameral::Log(), m_options, m_screenshot, bicameral::Render, bicameral::ToUtf8(), and WriteScreenshot().

Referenced by Finish(), and WriteScreenshot().

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

Member Data Documentation

◆ m_autoTimeFailed

bool bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::m_autoTimeFailed = false
private

Definition at line 367 of file frame_loop.cpp.

Referenced by CheckAutoTime(), and Finish().

◆ m_autoTimeHold

SimCursor bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::m_autoTimeHold
private

Definition at line 366 of file frame_loop.cpp.

Referenced by CheckAutoTime().

◆ m_clicks

std::vector<PendingClick> bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::m_clicks
private

Definition at line 360 of file frame_loop.cpp.

Referenced by QueueClicks(), ReportEvents(), and TakeClickCommands().

◆ m_commandHistory

std::vector<sim::ProbeCommand> bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::m_commandHistory
private

Definition at line 375 of file frame_loop.cpp.

Referenced by PrepareRewind(), and TakeLiveCommands().

◆ m_completedExtraction

CompletedExtraction bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::m_completedExtraction
private

Definition at line 347 of file frame_loop.cpp.

Referenced by CollectSimSubmissions(), SubmitRender(), SubmitSim(), and WantsScreenshot().

◆ m_compute

gpu::Queue bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::m_compute
private

◆ m_computeFrequency

uint64_t bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::m_computeFrequency = 0
private

Definition at line 379 of file frame_loop.cpp.

Referenced by ReportSimReadback().

◆ m_device

gpu::Device bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::m_device
private

◆ m_direct

gpu::Queue bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::m_direct
private

◆ m_directFrequency

uint64_t bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::m_directFrequency = 0
private

Definition at line 380 of file frame_loop.cpp.

Referenced by CollectFrameSlot().

◆ m_editor

std::unique_ptr<editor::EditorOverlay> bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::m_editor
private

Definition at line 365 of file frame_loop.cpp.

Referenced by BuildEditor(), CreateEditor(), FilterEditorInput(), Finish(), and SubmitEditor().

◆ m_extractAfterRewind

bool bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::m_extractAfterRewind = false
private

Definition at line 373 of file frame_loop.cpp.

Referenced by PrepareRewind(), and SubmitSim().

◆ m_frameNumber

uint64_t bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::m_frameNumber = 0
private

◆ m_frames

std::array<FrameSlot, FRAME_SLOT_COUNT> bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::m_frames
private

◆ m_frameTableSwaps

std::vector<sim::ProbeTableSwap> bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::m_frameTableSwaps
private

Definition at line 323 of file frame_loop.cpp.

Referenced by SubmitSim(), and TakeTableSwaps().

◆ m_interval

Stats bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::m_interval
private

◆ m_lastExtraction

uint64_t bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::m_lastExtraction = 0
private

Definition at line 345 of file frame_loop.cpp.

Referenced by SubmitSim().

◆ m_lastExtractionTick

uint64_t bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::m_lastExtractionTick = UINT64_MAX
private

Definition at line 346 of file frame_loop.cpp.

Referenced by NeedsStopExtraction(), and SubmitSim().

◆ m_lastInterval

Stats bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::m_lastInterval
private

Definition at line 382 of file frame_loop.cpp.

Referenced by MakeEditorStatus(), MakeGraphPanelStatus(), and Run().

◆ m_lastIntervalSeconds

double bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::m_lastIntervalSeconds = 0.0
private

Definition at line 383 of file frame_loop.cpp.

Referenced by MakeEditorStatus(), and Run().

◆ m_lastPokedCell

render::CellCoordinate bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::m_lastPokedCell
private
Initial value:
{.x = sim::PROBE_GRID_SIZE / 2,
.y = sim::PROBE_GRID_SIZE / 2,
.z = sim::PROBE_GRID_SIZE / 2}

Definition at line 331 of file frame_loop.cpp.

Referenced by QueueClicks(), and StartRequestedTrace().

◆ m_lastRenderReading

std::array<uint64_t, sim::PROBE_EXTRACTION_COUNT> bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::m_lastRenderReading {}
private

Definition at line 350 of file frame_loop.cpp.

Referenced by SubmitRender(), and SubmitSim().

◆ m_latestHash

sim::ProbeTickHash bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::m_latestHash
private

Definition at line 351 of file frame_loop.cpp.

Referenced by CollectTrace(), LogStats(), MakeEditorStatus(), and ReportSimReadback().

◆ m_nextSequence

uint32_t bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::m_nextSequence = 0
private

Definition at line 361 of file frame_loop.cpp.

Referenced by QueueClicks(), QueuePushes(), and TakeTableSwaps().

◆ m_options

◆ m_peek

sim::ProbePeek bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::m_peek
private

Definition at line 314 of file frame_loop.cpp.

Referenced by ApplyPeekChange(), FrameLoop(), and SubmitSim().

◆ m_pendingCommands

std::vector<sim::ProbeCommand> bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::m_pendingCommands
private

Definition at line 359 of file frame_loop.cpp.

Referenced by MakeEditorStatus(), QueueClicks(), QueuePushes(), and TakeClickCommands().

◆ m_physicsCheck

std::unique_ptr<sim::PhysicsWorld> bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::m_physicsCheck
private

◆ m_physicsCheckMismatches

uint64_t bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::m_physicsCheckMismatches = 0
private

Definition at line 356 of file frame_loop.cpp.

Referenced by CheckPhysics().

◆ m_physicsCheckPushes

std::vector<sim::ProbeCommand> bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::m_physicsCheckPushes
private

Definition at line 355 of file frame_loop.cpp.

Referenced by CheckPhysics(), and TakeCommands().

◆ m_recorder

save::ReplayRecorder bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::m_recorder
private

Definition at line 320 of file frame_loop.cpp.

Referenced by FinishReplay(), ReportSimReadback(), and TakeCommands().

◆ m_renderTimestampReadback

ComPtr<ID3D12Resource> bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::m_renderTimestampReadback
private

Definition at line 338 of file frame_loop.cpp.

Referenced by CollectFrameSlot(), CreateFrameSlots(), and RecordRenderLists().

◆ m_renderTimestamps

ComPtr<ID3D12QueryHeap> bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::m_renderTimestamps
private

Definition at line 337 of file frame_loop.cpp.

Referenced by CreateFrameSlots(), and RecordRenderLists().

◆ m_replay

std::vector<save::ReplayPlayer> bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::m_replay
private

◆ m_rewindCount

uint32_t bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::m_rewindCount = 0
private

Definition at line 372 of file frame_loop.cpp.

Referenced by CheckAutoRewind(), Finish(), and PrepareRewind().

◆ m_rewindFeed

std::deque<sim::ProbeCommand> bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::m_rewindFeed
private

Definition at line 376 of file frame_loop.cpp.

Referenced by PrepareRewind(), and TakeLiveCommands().

◆ m_rewindRequest

uint64_t bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::m_rewindRequest = UINT64_MAX
private

Definition at line 371 of file frame_loop.cpp.

Referenced by CheckAutoRewind(), PrepareRewind(), RequestRewind(), and SubmitSim().

◆ m_savePointCount

uint32_t bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::m_savePointCount = 0
private

◆ m_scheduler

SimScheduler bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::m_scheduler
private

◆ m_screenshot

std::vector<render::ScreenshotCapture> bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::m_screenshot
private

Definition at line 325 of file frame_loop.cpp.

Referenced by Finish(), Run(), SubmitScreenshot(), WantsScreenshot(), and WriteScreenshot().

◆ m_sim

◆ m_simSubmissionCount

uint64_t bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::m_simSubmissionCount = 0
private

Definition at line 344 of file frame_loop.cpp.

Referenced by CollectSimSubmissions(), SaveSlotFor(), and SubmitSim().

◆ m_simSubmissions

std::array<SimSubmission, SIM_SLOT_COUNT> bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::m_simSubmissions
private

Definition at line 343 of file frame_loop.cpp.

Referenced by CollectSimSubmissions(), and SubmitSim().

◆ m_swapChain

gpu::SwapChain bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::m_swapChain
private

◆ m_tableReload

TableHotReload bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::m_tableReload
private

Definition at line 322 of file frame_loop.cpp.

Referenced by FrameLoop(), MakeEditorStatus(), RunFrame(), and TakeTableSwaps().

◆ m_tableSwapFailed

bool bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::m_tableSwapFailed = false
private

Definition at line 324 of file frame_loop.cpp.

Referenced by SubmitSim(), and TakeTableSwaps().

◆ m_timeControl

editor::TimeControl bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::m_timeControl
private

Definition at line 364 of file frame_loop.cpp.

Referenced by ApplyTimeRequest(), BuildEditor(), and Run().

◆ m_total

Stats bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::m_total
private

Definition at line 384 of file frame_loop.cpp.

Referenced by AddStats(), and Finish().

◆ m_traceCapture

std::vector<TraceCapture> bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::m_traceCapture
private

◆ m_traceRequested

bool bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::m_traceRequested = false
private

Definition at line 329 of file frame_loop.cpp.

Referenced by RequestTrace(), and StartRequestedTrace().

◆ m_traceWriteFailed

bool bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::m_traceWriteFailed = false
private

Definition at line 330 of file frame_loop.cpp.

Referenced by CollectTrace(), and FinishTrace().

◆ m_view

render::ProbeView bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::m_view
private

Definition at line 315 of file frame_loop.cpp.

Referenced by FrameLoop(), and RecordRenderLists().

◆ m_viewController

render::DebugViewController bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::m_viewController
private

◆ m_window

std::unique_ptr<Window> bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::m_window
private

Definition at line 306 of file frame_loop.cpp.

Referenced by CreateEditor(), FrameLoop(), HandleResize(), QueueClicks(), and Run().


The documentation for this class was generated from the following file: