|
Bicameral Engine
GPU-resident engine for a magic-research open-world game
|
#include <lab_session.h>
Public Member Functions | |
| bool | Place (LabCellPosition cell, std::span< const SpeciesAmount > contents, uint32_t temperatureMilliKelvin) |
| bool | SetTemperature (LabCellPosition cell, uint32_t temperatureMilliKelvin) |
| std::expected< void, std::string > | Step (uint32_t tickCount) |
| std::expected< void, std::string > | Reset () |
| std::expected< void, std::string > | Replay (const LabRecording &recording) |
| uint64_t | NextTick () const |
| const MultiresNest & | Cpu () const |
| const MultiresNest & | Gpu () const |
| const BakedReactionTable & | Table () const |
| const std::optional< LabMismatch > & | Mismatch () const |
| std::optional< uint64_t > | ReplayDivergence () const |
| bool | Replaying () const |
| size_t | PendingCommands () const |
| LabRecording | Recording () const |
Static Public Member Functions | |
| static std::expected< LabSession, std::string > | Create (ID3D12Device5 *device, D3D12_COMMAND_LIST_TYPE queueType, const BakedReactionTable &table) |
Private Member Functions | |
| LabSession (BakedReactionTable table, gpu::ImmediateQueue queue, gpu::DebugRing ring, GpuLabBox box) | |
| bool | Queue (const Command &command) |
| std::vector< Command > | TakeCommands (uint64_t tick) |
| std::expected< void, std::string > | StepOne () |
Private Attributes | |
| BakedReactionTable | m_table |
| gpu::ImmediateQueue | m_queue |
| gpu::DebugRing | m_ring |
| GpuLabBox | m_box |
| MultiresNest | m_cpu |
| MultiresNest | m_read |
| bool | m_uploaded = false |
| uint64_t | m_tick = 0 |
| uint32_t | m_sequence = 0 |
| std::vector< Command > | m_pending |
| std::vector< Command > | m_scheduled |
| std::vector< Command > | m_history |
| std::vector< uint64_t > | m_hashes |
| std::optional< LabMismatch > | m_mismatch |
| std::vector< uint64_t > | m_replayHashes |
| uint64_t | m_replayEnd = 0 |
| std::optional< uint64_t > | m_replayDivergence |
Definition at line 25 of file lab_session.h.
|
private |
Definition at line 26 of file lab_session.cpp.
References m_box, m_cpu, m_queue, m_read, m_ring, m_table, and bicameral::sim::MakeLabBoxNest().
Referenced by Create().
|
inlinenodiscard |
Definition at line 47 of file lab_session.h.
References m_cpu.
|
staticnodiscard |
Definition at line 9 of file lab_session.cpp.
References bicameral::gpu::DebugRing::Create(), bicameral::gpu::ImmediateQueue::Create(), bicameral::sim::GpuLabBox::Create(), and LabSession().
Referenced by bicameral::editor::LabPanel::CreateSession().
|
inlinenodiscard |
Definition at line 48 of file lab_session.h.
References m_read.
|
inlinenodiscard |
Definition at line 50 of file lab_session.h.
References m_mismatch.
|
inlinenodiscard |
Definition at line 46 of file lab_session.h.
References m_tick.
|
inlinenodiscard |
Definition at line 53 of file lab_session.h.
References m_pending.
| bool bicameral::sim::LabSession::Place | ( | LabCellPosition | cell, |
| std::span< const SpeciesAmount > | contents, | ||
| uint32_t | temperatureMilliKelvin ) |
Definition at line 46 of file lab_session.cpp.
References m_sequence, m_tick, bicameral::sim::MakeLabFillCommand(), and Queue().
|
private |
Definition at line 36 of file lab_session.cpp.
References bicameral::sim::LAB_MAX_COMMANDS_PER_TICK, m_pending, and m_sequence.
Referenced by Place(), and SetTemperature().
|
nodiscard |
Definition at line 162 of file lab_session.cpp.
|
nodiscard |
Definition at line 149 of file lab_session.cpp.
References bicameral::sim::LabRecording::commands, bicameral::sim::LabRecording::hashes, m_replayEnd, m_replayHashes, m_scheduled, m_sequence, Reset(), bicameral::sim::Command::sequence, Step(), and bicameral::sim::LabRecording::tickCount.
|
inlinenodiscard |
Definition at line 51 of file lab_session.h.
References m_replayDivergence.
|
inlinenodiscard |
Definition at line 52 of file lab_session.h.
References m_replayEnd, and m_tick.
|
nodiscard |
Definition at line 131 of file lab_session.cpp.
References m_cpu, m_hashes, m_history, m_mismatch, m_pending, m_read, m_replayDivergence, m_replayEnd, m_replayHashes, m_scheduled, m_sequence, m_table, m_tick, m_uploaded, and bicameral::sim::MakeLabBoxNest().
Referenced by Replay().
| bool bicameral::sim::LabSession::SetTemperature | ( | LabCellPosition | cell, |
| uint32_t | temperatureMilliKelvin ) |
Definition at line 51 of file lab_session.cpp.
References m_sequence, m_tick, bicameral::sim::MakeLabTemperatureCommand(), and Queue().
|
nodiscard |
Definition at line 120 of file lab_session.cpp.
References m_mismatch, and StepOne().
Referenced by Replay().
|
nodiscardprivate |
Definition at line 78 of file lab_session.cpp.
References bicameral::sim::FindLabMismatch(), bicameral::sim::HashWholeNest(), m_box, m_cpu, m_hashes, m_history, m_mismatch, m_queue, m_read, m_replayDivergence, m_replayHashes, m_ring, m_table, m_tick, m_uploaded, bicameral::sim::MakeLabBoxNest(), bicameral::sim::StepLabBox(), and TakeCommands().
Referenced by Step().
|
inlinenodiscard |
Definition at line 49 of file lab_session.h.
References m_table.
|
nodiscardprivate |
Definition at line 58 of file lab_session.cpp.
References bicameral::sim::CommandPrecedes(), bicameral::sim::LAB_MAX_COMMANDS_PER_TICK, m_pending, and m_scheduled.
Referenced by StepOne().
|
private |
Definition at line 66 of file lab_session.h.
Referenced by LabSession(), and StepOne().
|
private |
Definition at line 69 of file lab_session.h.
Referenced by Cpu(), LabSession(), Reset(), and StepOne().
|
private |
Definition at line 81 of file lab_session.h.
Referenced by Recording(), Reset(), and StepOne().
|
private |
Definition at line 78 of file lab_session.h.
Referenced by Recording(), Reset(), and StepOne().
|
private |
Definition at line 82 of file lab_session.h.
Referenced by Mismatch(), Reset(), Step(), and StepOne().
|
private |
Definition at line 76 of file lab_session.h.
Referenced by PendingCommands(), Queue(), Reset(), and TakeCommands().
|
private |
Definition at line 64 of file lab_session.h.
Referenced by LabSession(), and StepOne().
|
private |
Definition at line 70 of file lab_session.h.
Referenced by Gpu(), LabSession(), Reset(), and StepOne().
|
private |
Definition at line 85 of file lab_session.h.
Referenced by ReplayDivergence(), Reset(), and StepOne().
|
private |
Definition at line 84 of file lab_session.h.
Referenced by Replay(), Replaying(), and Reset().
|
private |
Definition at line 83 of file lab_session.h.
|
private |
Definition at line 65 of file lab_session.h.
Referenced by LabSession(), and StepOne().
|
private |
Definition at line 77 of file lab_session.h.
Referenced by Replay(), Reset(), and TakeCommands().
|
private |
Definition at line 73 of file lab_session.h.
Referenced by Place(), Queue(), Replay(), Reset(), and SetTemperature().
|
private |
Definition at line 63 of file lab_session.h.
Referenced by LabSession(), Reset(), StepOne(), and Table().
|
private |
Definition at line 72 of file lab_session.h.
Referenced by NextTick(), Place(), Recording(), Replaying(), Reset(), SetTemperature(), and StepOne().
|
private |
Definition at line 71 of file lab_session.h.