Bicameral Engine
GPU-resident engine for a magic-research open-world game
Loading...
Searching...
No Matches
bicameral::sim::ProbeSim Class Reference

#include <probe_sim.h>

Collaboration diagram for bicameral::sim::ProbeSim:
[legend]

Classes

struct  FrameSlot
struct  StateRegion
struct  SavePoint
struct  QueuedTick

Public Member Functions

uint32_t UnitsPerTick () const
uint32_t HashUnit () const
uint32_t FreeCommandSlots () const
ID3D12CommandList * RecordFrame (uint32_t slot, const ProbeFrameInput &input)
ProbeFrameReadback ReadFrame (uint32_t slot)
void SetTraceFilter (const gpu::GraphTraceFilter &filter)
const gpu::GraphTraceFilter & TraceFilter () const
const gpu::GraphStatsLayout & ConductStatsLayout () const
ID3D12Resource * Extraction (uint32_t target) const
ID3D12Resource * Cells () const
uint64_t ConductBackingMemoryBytes () const
const GpuPhysics * Physics () const
bool CreateSavePoints (ID3D12Device5 *device, uint32_t count)
uint32_t SavePointCount () const
uint64_t SavePointTick (uint32_t index) const
void DiscardSavePointsAfter (uint64_t tick)
uint64_t SavePointBytes () const

Static Public Member Functions

static std::expected< ProbeSim, std::string > Create (ID3D12Device5 *device, D3D12_COMMAND_LIST_TYPE listType, const BakedReactionTable &table, const ProbeSimOptions &options={})
static uint64_t NextApplyTick (uint64_t tick, uint32_t unit)

Static Public Attributes

static constexpr uint32_t FRAME_SLOT_COUNT = 4
static constexpr uint32_t MAX_UNITS_PER_FRAME = 256

Private Member Functions

 ProbeSim (const ProbeSimOptions &options, gpu::ReadbackRing &&events, gpu::DebugRing &&debugRing, gpu::WorkGraphStats &&graphStats, gpu::GraphTrace &&graphTrace)
uint32_t BusyUnitCount () const
uint32_t PhysicsUnitCount () const
bool CreatePipelines (ID3D12Device5 *device)
bool CreateConductGraph (ID3D12Device5 *device)
bool CreateBuffers (ID3D12Device5 *device)
bool CreateWorld (ID3D12Device5 *device, const BakedReactionTable &table, std::span< const reaction::RxCell > initialWorld)
void RecordInitialization (ID3D12GraphicsCommandList10 *list)
bool CreateFrameSlots (ID3D12Device5 *device, D3D12_COMMAND_LIST_TYPE listType)
std::expected< void, std::string > CreatePhysics (ID3D12Device5 *device)
bool ValidateInput (uint32_t slot, const ProbeFrameInput &input) const
bool ValidateCommands (const ProbeFrameInput &input) const
void WriteInput (FrameSlot &frame, const ProbeFrameInput &input) const
void RecordEnqueue (ID3D12GraphicsCommandList10 *list, uint32_t commandCount) const
void TrackCommands (std::span< const ProbeCommand > commands, uint64_t nextApplyTick)
void BindRootArguments (ID3D12GraphicsCommandList10 *list, ID3D12Resource *input) const
void BindRootViews (ID3D12GraphicsCommandList10 *list, ID3D12Resource *input) const
void RecordUnit (ID3D12GraphicsCommandList10 *list, ID3D12Resource *input, uint64_t tick, uint32_t unit, bool tableSwapped)
bool ValidateTableSwap (const ProbeFrameInput &input) const
bool RecordTableSwap (ID3D12GraphicsCommandList10 *list, FrameSlot &frame, const BakedReactionTable &table)
void RecordConduct (ID3D12GraphicsCommandList10 *list, ID3D12Resource *input, uint64_t tick)
void RecordPhysics (ID3D12GraphicsCommandList10 *list, ID3D12Resource *input, uint64_t tick)
void RecordPhysicsInitialization (ID3D12GraphicsCommandList10 *list, ID3D12Resource *input)
void RecordActiveListStates (ID3D12GraphicsCommandList10 *list, D3D12_RESOURCE_STATES before, D3D12_RESOURCE_STATES after) const
void RecordExtract (ID3D12GraphicsCommandList10 *list, uint64_t tick, uint32_t target) const
void RecordExtractAndHook (ID3D12GraphicsCommandList10 *list, uint64_t tick, const ProbeFrameInput &input)
void RecordReadbacks (ID3D12GraphicsCommandList10 *list, uint32_t slot, bool hasHash) const
std::vector< StateRegion > StateRegions (uint64_t tick) const
bool ValidateSavePoints (const ProbeFrameInput &input) const
void RecordSave (ID3D12GraphicsCommandList10 *list, uint32_t index, uint64_t tick)
void RecordRestore (ID3D12GraphicsCommandList10 *list, uint32_t index)
void ResetCommandMirror ()
std::vector< ProbeTickHash > ReadHashes (const FrameSlot &frame) const

Private Attributes

ProbeSimOptions m_options
ComPtr< ID3D12RootSignature > m_rootSignature
ComPtr< ID3D12PipelineState > m_enqueuePipeline
ComPtr< ID3D12PipelineState > m_applyPipeline
ComPtr< ID3D12PipelineState > m_wakeDuePipeline
ComPtr< ID3D12PipelineState > m_refreshTablePipeline
ComPtr< ID3D12PipelineState > m_busyPipeline
ComPtr< ID3D12PipelineState > m_hashCellsPipeline
ComPtr< ID3D12PipelineState > m_flushEventsPipeline
ComPtr< ID3D12PipelineState > m_extractPipeline
std::unique_ptr< gpu::WorkGraph > m_conductGraph
uint32_t m_conductEntrypoint = 0
bool m_conductInitialized = false
ComPtr< ID3D12Resource > m_cells
ComPtr< ID3D12Resource > m_thermal
std::array< ComPtr< ID3D12Resource >, 4 > m_reactionTable
std::array< ComPtr< ID3D12Resource >, 7 > m_initialUploads
bool m_initialized = false
std::array< uint32_t, PROBE_VIEW_SPECIES_COUNT > m_viewSpecies {}
std::array< ComPtr< ID3D12Resource >, PROBE_EXTRACTION_COUNT > m_extractions
ComPtr< ID3D12Resource > m_busySink
std::unique_ptr< GpuPhysics > m_physics
int64_t m_physicsRate = 0
bool m_physicsInitialized = false
ComPtr< ID3D12Resource > m_hashes
ComPtr< ID3D12Resource > m_commandQueue
ComPtr< ID3D12Resource > m_tickEvents
std::array< ComPtr< ID3D12Resource >, 2 > m_activeLists
ComPtr< ID3D12Resource > m_blockSchedule
gpu::ReadbackRing m_events
gpu::DebugRing m_debugRing
gpu::WorkGraphStats m_graphStats
gpu::GraphTrace m_graphTrace
ComPtr< ID3D12QueryHeap > m_timestamps
std::array< FrameSlot, FRAME_SLOT_COUNT > m_slots
std::vector< SavePoint > m_savePoints
ComPtr< ID3D12Resource > m_zeroQueueHeader
uint32_t m_commandTail = 0
uint32_t m_queuedCommandCount = 0
std::vector< QueuedTick > m_queuedTicks
bool m_hasEnqueued = false
ProbeCommand m_lastEnqueued

Detailed Description

Definition at line 201 of file probe_sim.h.

Constructor & Destructor Documentation

◆ ProbeSim()

bicameral::sim::ProbeSim::ProbeSim ( const ProbeSimOptions & options,
gpu::ReadbackRing && events,
gpu::DebugRing && debugRing,
gpu::WorkGraphStats && graphStats,
gpu::GraphTrace && graphTrace )
inlineprivate

Definition at line 298 of file probe_sim.h.

References m_debugRing, m_events, m_graphStats, m_graphTrace, and m_options.

Referenced by Create().

Here is the caller graph for this function:

Member Function Documentation

◆ BindRootArguments()

void bicameral::sim::ProbeSim::BindRootArguments ( ID3D12GraphicsCommandList10 * list,
ID3D12Resource * input ) const
private

Definition at line 665 of file probe_sim.cpp.

References BindRootViews(), and m_rootSignature.

Referenced by RecordFrame(), RecordPhysics(), and RecordPhysicsInitialization().

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

◆ BindRootViews()

void bicameral::sim::ProbeSim::BindRootViews ( ID3D12GraphicsCommandList10 * list,
ID3D12Resource * input ) const
private

Definition at line 671 of file probe_sim.cpp.

References bicameral::gpu::RootSignatureLayout::DebugRingIndex(), bicameral::gpu::RootSignatureLayout::GraphStatsIndex(), bicameral::gpu::RootSignatureLayout::GraphTraceIndex(), m_activeLists, m_blockSchedule, m_busySink, m_cells, m_commandQueue, m_debugRing, m_events, m_extractions, m_graphStats, m_graphTrace, m_hashes, m_physics, m_reactionTable, m_thermal, m_tickEvents, and bicameral::gpu::RootSignatureLayout::SrvIndex().

Referenced by BindRootArguments(), RecordConduct(), and RecordTableSwap().

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

◆ BusyUnitCount()

uint32_t bicameral::sim::ProbeSim::BusyUnitCount ( ) const
inlinenodiscardprivate

Definition at line 306 of file probe_sim.h.

References m_options.

Referenced by UnitsPerTick().

Here is the caller graph for this function:

◆ Cells()

ID3D12Resource * bicameral::sim::ProbeSim::Cells ( ) const
inlinenodiscard

Definition at line 249 of file probe_sim.h.

References m_cells.

◆ ConductBackingMemoryBytes()

uint64_t bicameral::sim::ProbeSim::ConductBackingMemoryBytes ( ) const
inlinenodiscard

Definition at line 252 of file probe_sim.h.

References m_conductGraph.

◆ ConductStatsLayout()

const gpu::GraphStatsLayout & bicameral::sim::ProbeSim::ConductStatsLayout ( ) const
inlinenodiscard

Definition at line 242 of file probe_sim.h.

References m_graphStats.

◆ Create()

std::expected< ProbeSim, std::string > bicameral::sim::ProbeSim::Create ( ID3D12Device5 * device,
D3D12_COMMAND_LIST_TYPE listType,
const BakedReactionTable & table,
const ProbeSimOptions & options = {} )
staticnodiscard

Definition at line 179 of file probe_sim.cpp.

References bicameral::sim::ProbeSimOptions::busyIterations, bicameral::sim::ProbeSimOptions::busyPieces, bicameral::gpu::DebugRing::Create(), bicameral::gpu::GraphTrace::Create(), bicameral::gpu::ReadbackRing::Create(), bicameral::gpu::WorkGraphStats::Create(), FRAME_SLOT_COUNT, bicameral::sim::ProbeSimOptions::initialWorld, ProbeSim(), bicameral::sim::ProbeSimOptions::trace, and bicameral::sim::ProbeSimOptions::traceCapacity.

Referenced by bicameral::frame::anonymous_namespace{frame_loop.cpp}::CreateSimulation().

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

◆ CreateBuffers()

bool bicameral::sim::ProbeSim::CreateBuffers ( ID3D12Device5 * device)
nodiscardprivate

Definition at line 266 of file probe_sim.cpp.

References bicameral::gpu::CreateBuffer(), FRAME_SLOT_COUNT, m_activeLists, m_blockSchedule, m_busySink, m_cells, m_commandQueue, m_extractions, m_hashes, m_thermal, m_tickEvents, m_timestamps, and bicameral::gpu::UnorderedAccess.

Here is the call graph for this function:

◆ CreateConductGraph()

bool bicameral::sim::ProbeSim::CreateConductGraph ( ID3D12Device5 * device)
nodiscardprivate

Definition at line 247 of file probe_sim.cpp.

References bicameral::gpu::WorkGraph::Create(), bicameral::Error, bicameral::gpu::LoadShader(), bicameral::Log(), m_conductEntrypoint, m_conductGraph, m_rootSignature, and bicameral::Sim.

Referenced by CreatePipelines().

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

◆ CreateFrameSlots()

bool bicameral::sim::ProbeSim::CreateFrameSlots ( ID3D12Device5 * device,
D3D12_COMMAND_LIST_TYPE listType )
nodiscardprivate

Definition at line 403 of file probe_sim.cpp.

References bicameral::gpu::CreateBuffer(), m_slots, bicameral::gpu::Readback, and bicameral::gpu::Upload.

Here is the call graph for this function:

◆ CreatePhysics()

std::expected< void, std::string > bicameral::sim::ProbeSim::CreatePhysics ( ID3D12Device5 * device)
nodiscardprivate

Definition at line 311 of file probe_sim.cpp.

References bicameral::sim::GpuPhysics::Create(), m_options, m_physics, and m_physicsRate.

Here is the call graph for this function:

◆ CreatePipelines()

bool bicameral::sim::ProbeSim::CreatePipelines ( ID3D12Device5 * device)
nodiscardprivate

Definition at line 227 of file probe_sim.cpp.

References CreateConductGraph(), bicameral::gpu::CreateRootSignature(), m_applyPipeline, m_busyPipeline, m_enqueuePipeline, m_extractPipeline, m_flushEventsPipeline, m_hashCellsPipeline, m_refreshTablePipeline, m_rootSignature, and m_wakeDuePipeline.

Here is the call graph for this function:

◆ CreateSavePoints()

bool bicameral::sim::ProbeSim::CreateSavePoints ( ID3D12Device5 * device,
uint32_t count )
nodiscard

Definition at line 50 of file probe_save_point.cpp.

References bicameral::sim::ProbeSim::SavePoint::buffers, bicameral::gpu::CreateBuffer(), bicameral::Error, bicameral::Log(), m_savePoints, m_zeroQueueHeader, bicameral::Sim, StateRegions(), and bicameral::gpu::UnorderedAccess.

Here is the call graph for this function:

◆ CreateWorld()

bool bicameral::sim::ProbeSim::CreateWorld ( ID3D12Device5 * device,
const BakedReactionTable & table,
std::span< const reaction::RxCell > initialWorld )
nodiscardprivate

◆ DiscardSavePointsAfter()

void bicameral::sim::ProbeSim::DiscardSavePointsAfter ( uint64_t tick)
inline

Definition at line 266 of file probe_sim.h.

References m_savePoints.

◆ Extraction()

ID3D12Resource * bicameral::sim::ProbeSim::Extraction ( uint32_t target) const
inlinenodiscard

Definition at line 246 of file probe_sim.h.

References m_extractions.

◆ FreeCommandSlots()

uint32_t bicameral::sim::ProbeSim::FreeCommandSlots ( ) const
inlinenodiscard

Definition at line 227 of file probe_sim.h.

References m_queuedCommandCount.

Referenced by ValidateCommands().

Here is the caller graph for this function:

◆ HashUnit()

uint32_t bicameral::sim::ProbeSim::HashUnit ( ) const
inlinenodiscard

Definition at line 218 of file probe_sim.h.

References UnitsPerTick().

Referenced by RecordFrame(), and RecordUnit().

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

◆ NextApplyTick()

uint64_t bicameral::sim::ProbeSim::NextApplyTick ( uint64_t tick,
uint32_t unit )
inlinestaticnodiscard

Definition at line 222 of file probe_sim.h.

Referenced by RecordFrame(), bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::StartRequestedTrace(), bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::TakeCommands(), and ValidateCommands().

Here is the caller graph for this function:

◆ Physics()

const GpuPhysics * bicameral::sim::ProbeSim::Physics ( ) const
inlinenodiscard

Definition at line 255 of file probe_sim.h.

References m_physics.

◆ PhysicsUnitCount()

uint32_t bicameral::sim::ProbeSim::PhysicsUnitCount ( ) const
inlinenodiscardprivate

Definition at line 307 of file probe_sim.h.

References m_physics.

Referenced by UnitsPerTick().

Here is the caller graph for this function:

◆ ReadFrame()

◆ ReadHashes()

std::vector< ProbeTickHash > bicameral::sim::ProbeSim::ReadHashes ( const FrameSlot & frame) const
nodiscardprivate

Definition at line 912 of file probe_sim.cpp.

References bicameral::Error, bicameral::Log(), bicameral::gpu::ReadBuffer(), bicameral::Sim, and UnitsPerTick().

Referenced by ReadFrame().

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

◆ RecordActiveListStates()

void bicameral::sim::ProbeSim::RecordActiveListStates ( ID3D12GraphicsCommandList10 * list,
D3D12_RESOURCE_STATES before,
D3D12_RESOURCE_STATES after ) const
private

Definition at line 817 of file probe_sim.cpp.

References m_activeLists, and bicameral::gpu::Transition().

Referenced by RecordFrame().

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

◆ RecordConduct()

void bicameral::sim::ProbeSim::RecordConduct ( ID3D12GraphicsCommandList10 * list,
ID3D12Resource * input,
uint64_t tick )
private

Definition at line 779 of file probe_sim.cpp.

References BindRootViews(), bicameral::gpu::WorkGraph::DispatchFromGpu(), m_activeLists, m_conductGraph, m_conductInitialized, and bicameral::gpu::Transition().

Referenced by RecordUnit().

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

◆ RecordEnqueue()

void bicameral::sim::ProbeSim::RecordEnqueue ( ID3D12GraphicsCommandList10 * list,
uint32_t commandCount ) const
private

Definition at line 630 of file probe_sim.cpp.

References m_enqueuePipeline, and bicameral::gpu::UavBarrier().

Referenced by RecordFrame().

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

◆ RecordExtract()

void bicameral::sim::ProbeSim::RecordExtract ( ID3D12GraphicsCommandList10 * list,
uint64_t tick,
uint32_t target ) const
private

Definition at line 824 of file probe_sim.cpp.

References m_extractPipeline.

Referenced by RecordExtractAndHook().

Here is the caller graph for this function:

◆ RecordExtractAndHook()

void bicameral::sim::ProbeSim::RecordExtractAndHook ( ID3D12GraphicsCommandList10 * list,
uint64_t tick,
const ProbeFrameInput & input )
private

Definition at line 615 of file probe_sim.cpp.

References bicameral::sim::ProbeFrameInput::afterExtract, bicameral::sim::ProbeFrameInput::extractionTarget, m_cells, m_debugRing, m_extractions, RecordExtract(), and bicameral::gpu::UavBarrier().

Referenced by RecordFrame().

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

◆ RecordFrame()

◆ RecordInitialization()

void bicameral::sim::ProbeSim::RecordInitialization ( ID3D12GraphicsCommandList10 * list)
private

Definition at line 371 of file probe_sim.cpp.

References m_blockSchedule, m_cells, m_initialized, m_initialUploads, m_reactionTable, m_thermal, and bicameral::gpu::Transition().

Referenced by RecordFrame().

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

◆ RecordPhysics()

void bicameral::sim::ProbeSim::RecordPhysics ( ID3D12GraphicsCommandList10 * list,
ID3D12Resource * input,
uint64_t tick )
private

Definition at line 809 of file probe_sim.cpp.

References BindRootArguments(), bicameral::Error, bicameral::Log(), m_debugRing, m_physics, and bicameral::Sim.

Referenced by RecordUnit().

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

◆ RecordPhysicsInitialization()

void bicameral::sim::ProbeSim::RecordPhysicsInitialization ( ID3D12GraphicsCommandList10 * list,
ID3D12Resource * input )
private

Definition at line 798 of file probe_sim.cpp.

References BindRootArguments(), m_debugRing, m_physics, and m_physicsInitialized.

Referenced by RecordFrame().

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

◆ RecordReadbacks()

void bicameral::sim::ProbeSim::RecordReadbacks ( ID3D12GraphicsCommandList10 * list,
uint32_t slot,
bool hasHash ) const
private

Definition at line 831 of file probe_sim.cpp.

References m_debugRing, m_events, m_graphStats, m_graphTrace, m_hashes, m_slots, bicameral::gpu::RecordCopyToReadback(), and bicameral::gpu::Transition().

Referenced by RecordFrame().

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

◆ RecordRestore()

void bicameral::sim::ProbeSim::RecordRestore ( ID3D12GraphicsCommandList10 * list,
uint32_t index )
private

Definition at line 164 of file probe_save_point.cpp.

References bicameral::sim::ProbeSim::SavePoint::buffers, bicameral::sim::ProbeSim::StateRegion::bytes, bicameral::sim::ProbeSim::StateRegion::generationBytes, m_commandQueue, m_physics, m_savePoints, m_zeroQueueHeader, bicameral::sim::ProbeSim::SavePoint::physics, bicameral::sim::ProbeSim::StateRegion::resource, StateRegions(), and bicameral::sim::ProbeSim::SavePoint::tick.

Referenced by RecordFrame().

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

◆ RecordSave()

void bicameral::sim::ProbeSim::RecordSave ( ID3D12GraphicsCommandList10 * list,
uint32_t index,
uint64_t tick )
private

Definition at line 142 of file probe_save_point.cpp.

References bicameral::sim::ProbeSim::SavePoint::buffers, m_physics, m_savePoints, bicameral::sim::ProbeSim::SavePoint::physics, StateRegions(), and bicameral::sim::ProbeSim::SavePoint::tick.

Referenced by RecordFrame().

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

◆ RecordTableSwap()

bool bicameral::sim::ProbeSim::RecordTableSwap ( ID3D12GraphicsCommandList10 * list,
FrameSlot & frame,
const BakedReactionTable & table )
nodiscardprivate

Definition at line 740 of file probe_sim.cpp.

References BindRootViews(), bicameral::gpu::CreateBuffer(), m_reactionTable, bicameral::sim::BakedReactionTable::rates, bicameral::sim::BakedReactionTable::ruleIndex, bicameral::sim::BakedReactionTable::rules, bicameral::sim::BakedReactionTable::species, bicameral::gpu::Transition(), and bicameral::gpu::UnorderedAccess.

Referenced by RecordFrame().

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

◆ RecordUnit()

void bicameral::sim::ProbeSim::RecordUnit ( ID3D12GraphicsCommandList10 * list,
ID3D12Resource * input,
uint64_t tick,
uint32_t unit,
bool tableSwapped )
private

Definition at line 699 of file probe_sim.cpp.

References HashUnit(), m_applyPipeline, m_busyPipeline, m_flushEventsPipeline, m_hashCellsPipeline, m_physics, m_refreshTablePipeline, m_wakeDuePipeline, RecordConduct(), RecordPhysics(), and bicameral::gpu::UavBarrier().

Referenced by RecordFrame().

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

◆ ResetCommandMirror()

void bicameral::sim::ProbeSim::ResetCommandMirror ( )
private

Definition at line 196 of file probe_save_point.cpp.

References m_commandTail, m_hasEnqueued, m_queuedCommandCount, and m_queuedTicks.

Referenced by RecordFrame().

Here is the caller graph for this function:

◆ SavePointBytes()

uint64_t bicameral::sim::ProbeSim::SavePointBytes ( ) const
nodiscard

Definition at line 83 of file probe_save_point.cpp.

References StateRegions().

Here is the call graph for this function:

◆ SavePointCount()

uint32_t bicameral::sim::ProbeSim::SavePointCount ( ) const
inlinenodiscard

Definition at line 260 of file probe_sim.h.

References m_savePoints.

◆ SavePointTick()

uint64_t bicameral::sim::ProbeSim::SavePointTick ( uint32_t index) const
inlinenodiscard

Definition at line 262 of file probe_sim.h.

References m_savePoints.

◆ SetTraceFilter()

void bicameral::sim::ProbeSim::SetTraceFilter ( const gpu::GraphTraceFilter & filter)
inline

Definition at line 238 of file probe_sim.h.

References m_graphTrace.

◆ StateRegions()

std::vector< ProbeSim::StateRegion > bicameral::sim::ProbeSim::StateRegions ( uint64_t tick) const
nodiscardprivate

Definition at line 92 of file probe_save_point.cpp.

References m_activeLists, m_blockSchedule, m_cells, m_hashes, m_physics, m_thermal, and m_tickEvents.

Referenced by CreateSavePoints(), RecordRestore(), RecordSave(), and SavePointBytes().

Here is the caller graph for this function:

◆ TraceFilter()

const gpu::GraphTraceFilter & bicameral::sim::ProbeSim::TraceFilter ( ) const
inlinenodiscard

Definition at line 239 of file probe_sim.h.

References m_graphTrace.

◆ TrackCommands()

void bicameral::sim::ProbeSim::TrackCommands ( std::span< const ProbeCommand > commands,
uint64_t nextApplyTick )
private

Definition at line 642 of file probe_sim.cpp.

References bicameral::sim::ProbeSim::QueuedTick::count, m_commandTail, m_hasEnqueued, m_lastEnqueued, m_queuedCommandCount, m_queuedTicks, and bicameral::sim::ProbeSim::QueuedTick::targetTick.

Referenced by RecordFrame().

Here is the caller graph for this function:

◆ UnitsPerTick()

uint32_t bicameral::sim::ProbeSim::UnitsPerTick ( ) const
inlinenodiscard

Definition at line 214 of file probe_sim.h.

References BusyUnitCount(), and PhysicsUnitCount().

Referenced by HashUnit(), ReadHashes(), RecordFrame(), ValidateInput(), and ValidateTableSwap().

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

◆ ValidateCommands()

bool bicameral::sim::ProbeSim::ValidateCommands ( const ProbeFrameInput & input) const
nodiscardprivate

Definition at line 463 of file probe_sim.cpp.

References bicameral::sim::CommandPrecedes(), bicameral::sim::ProbeFrameInput::commands, bicameral::Error, bicameral::sim::ProbeFrameInput::firstTick, bicameral::sim::ProbeFrameInput::firstUnit, FreeCommandSlots(), bicameral::Log(), m_hasEnqueued, m_lastEnqueued, NextApplyTick(), bicameral::sim::NO_SAVE_POINT, bicameral::sim::ProbeFrameInput::restoreFrom, bicameral::sim::Command::sequence, bicameral::Sim, and bicameral::sim::Command::targetTick.

Referenced by ValidateInput().

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

◆ ValidateInput()

bool bicameral::sim::ProbeSim::ValidateInput ( uint32_t slot,
const ProbeFrameInput & input ) const
nodiscardprivate

Definition at line 431 of file probe_sim.cpp.

References bicameral::sim::ProbeFrameInput::commands, bicameral::Error, bicameral::sim::ProbeFrameInput::extractionTarget, bicameral::sim::ProbeFrameInput::firstUnit, FRAME_SLOT_COUNT, bicameral::Log(), MAX_UNITS_PER_FRAME, bicameral::Sim, bicameral::sim::ProbeFrameInput::unitCount, UnitsPerTick(), ValidateCommands(), ValidateSavePoints(), and ValidateTableSwap().

Referenced by RecordFrame().

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

◆ ValidateSavePoints()

bool bicameral::sim::ProbeSim::ValidateSavePoints ( const ProbeFrameInput & input) const
nodiscardprivate

Definition at line 120 of file probe_save_point.cpp.

References bicameral::Error, bicameral::sim::ProbeFrameInput::firstTick, bicameral::sim::ProbeFrameInput::firstUnit, bicameral::Log(), m_initialized, m_savePoints, bicameral::sim::NO_SAVE_POINT, bicameral::sim::ProbeFrameInput::restoreFrom, bicameral::sim::ProbeFrameInput::saveTo, and bicameral::Sim.

Referenced by ValidateInput().

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

◆ ValidateTableSwap()

bool bicameral::sim::ProbeSim::ValidateTableSwap ( const ProbeFrameInput & input) const
nodiscardprivate

Definition at line 446 of file probe_sim.cpp.

References bicameral::Error, bicameral::sim::ProbeFrameInput::firstTick, bicameral::sim::ProbeFrameInput::firstUnit, bicameral::Log(), bicameral::Sim, bicameral::sim::ProbeTableSwap::table, bicameral::sim::ProbeFrameInput::tableSwaps, bicameral::sim::ProbeTableSwap::tick, bicameral::sim::ProbeFrameInput::unitCount, and UnitsPerTick().

Referenced by ValidateInput().

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

◆ WriteInput()

void bicameral::sim::ProbeSim::WriteInput ( FrameSlot & frame,
const ProbeFrameInput & input ) const
private

Definition at line 491 of file probe_sim.cpp.

References bicameral::sim::ProbeFrameInput::commands, m_activeLists, m_commandTail, m_conductEntrypoint, m_options, m_physics, m_physicsRate, and m_viewSpecies.

Referenced by RecordFrame().

Here is the caller graph for this function:

Member Data Documentation

◆ FRAME_SLOT_COUNT

uint32_t bicameral::sim::ProbeSim::FRAME_SLOT_COUNT = 4
staticconstexpr

Definition at line 203 of file probe_sim.h.

Referenced by Create(), CreateBuffers(), and ValidateInput().

◆ m_activeLists

std::array<ComPtr<ID3D12Resource>, 2> bicameral::sim::ProbeSim::m_activeLists
private

◆ m_applyPipeline

ComPtr<ID3D12PipelineState> bicameral::sim::ProbeSim::m_applyPipeline
private

Definition at line 373 of file probe_sim.h.

Referenced by CreatePipelines(), and RecordUnit().

◆ m_blockSchedule

ComPtr<ID3D12Resource> bicameral::sim::ProbeSim::m_blockSchedule
private

Definition at line 411 of file probe_sim.h.

Referenced by BindRootViews(), CreateBuffers(), RecordInitialization(), and StateRegions().

◆ m_busyPipeline

ComPtr<ID3D12PipelineState> bicameral::sim::ProbeSim::m_busyPipeline
private

Definition at line 377 of file probe_sim.h.

Referenced by CreatePipelines(), and RecordUnit().

◆ m_busySink

ComPtr<ID3D12Resource> bicameral::sim::ProbeSim::m_busySink
private

Definition at line 397 of file probe_sim.h.

Referenced by BindRootViews(), and CreateBuffers().

◆ m_cells

ComPtr<ID3D12Resource> bicameral::sim::ProbeSim::m_cells
private

◆ m_commandQueue

ComPtr<ID3D12Resource> bicameral::sim::ProbeSim::m_commandQueue
private

Definition at line 406 of file probe_sim.h.

Referenced by BindRootViews(), CreateBuffers(), and RecordRestore().

◆ m_commandTail

uint32_t bicameral::sim::ProbeSim::m_commandTail = 0
private

Definition at line 431 of file probe_sim.h.

Referenced by ResetCommandMirror(), TrackCommands(), and WriteInput().

◆ m_conductEntrypoint

uint32_t bicameral::sim::ProbeSim::m_conductEntrypoint = 0
private

Definition at line 384 of file probe_sim.h.

Referenced by CreateConductGraph(), and WriteInput().

◆ m_conductGraph

std::unique_ptr<gpu::WorkGraph> bicameral::sim::ProbeSim::m_conductGraph
private

Definition at line 383 of file probe_sim.h.

Referenced by ConductBackingMemoryBytes(), CreateConductGraph(), and RecordConduct().

◆ m_conductInitialized

bool bicameral::sim::ProbeSim::m_conductInitialized = false
private

Definition at line 385 of file probe_sim.h.

Referenced by RecordConduct().

◆ m_debugRing

gpu::DebugRing bicameral::sim::ProbeSim::m_debugRing
private

◆ m_enqueuePipeline

ComPtr<ID3D12PipelineState> bicameral::sim::ProbeSim::m_enqueuePipeline
private

Definition at line 372 of file probe_sim.h.

Referenced by CreatePipelines(), and RecordEnqueue().

◆ m_events

gpu::ReadbackRing bicameral::sim::ProbeSim::m_events
private

Definition at line 414 of file probe_sim.h.

Referenced by BindRootViews(), ProbeSim(), ReadFrame(), RecordFrame(), and RecordReadbacks().

◆ m_extractions

std::array<ComPtr<ID3D12Resource>, PROBE_EXTRACTION_COUNT> bicameral::sim::ProbeSim::m_extractions
private

Definition at line 396 of file probe_sim.h.

Referenced by BindRootViews(), CreateBuffers(), Extraction(), and RecordExtractAndHook().

◆ m_extractPipeline

ComPtr<ID3D12PipelineState> bicameral::sim::ProbeSim::m_extractPipeline
private

Definition at line 380 of file probe_sim.h.

Referenced by CreatePipelines(), and RecordExtract().

◆ m_flushEventsPipeline

ComPtr<ID3D12PipelineState> bicameral::sim::ProbeSim::m_flushEventsPipeline
private

Definition at line 379 of file probe_sim.h.

Referenced by CreatePipelines(), and RecordUnit().

◆ m_graphStats

gpu::WorkGraphStats bicameral::sim::ProbeSim::m_graphStats
private

◆ m_graphTrace

gpu::GraphTrace bicameral::sim::ProbeSim::m_graphTrace
private

◆ m_hasEnqueued

bool bicameral::sim::ProbeSim::m_hasEnqueued = false
private

Definition at line 434 of file probe_sim.h.

Referenced by ResetCommandMirror(), TrackCommands(), and ValidateCommands().

◆ m_hashCellsPipeline

ComPtr<ID3D12PipelineState> bicameral::sim::ProbeSim::m_hashCellsPipeline
private

Definition at line 378 of file probe_sim.h.

Referenced by CreatePipelines(), and RecordUnit().

◆ m_hashes

ComPtr<ID3D12Resource> bicameral::sim::ProbeSim::m_hashes
private

Definition at line 405 of file probe_sim.h.

Referenced by BindRootViews(), CreateBuffers(), RecordFrame(), RecordReadbacks(), and StateRegions().

◆ m_initialized

bool bicameral::sim::ProbeSim::m_initialized = false
private

Definition at line 394 of file probe_sim.h.

Referenced by RecordFrame(), RecordInitialization(), and ValidateSavePoints().

◆ m_initialUploads

std::array<ComPtr<ID3D12Resource>, 7> bicameral::sim::ProbeSim::m_initialUploads
private

Definition at line 393 of file probe_sim.h.

Referenced by CreateWorld(), and RecordInitialization().

◆ m_lastEnqueued

ProbeCommand bicameral::sim::ProbeSim::m_lastEnqueued
private

Definition at line 435 of file probe_sim.h.

Referenced by TrackCommands(), and ValidateCommands().

◆ m_options

ProbeSimOptions bicameral::sim::ProbeSim::m_options
private

Definition at line 368 of file probe_sim.h.

Referenced by BusyUnitCount(), CreatePhysics(), ProbeSim(), and WriteInput().

◆ m_physics

◆ m_physicsInitialized

bool bicameral::sim::ProbeSim::m_physicsInitialized = false
private

Definition at line 402 of file probe_sim.h.

Referenced by RecordPhysicsInitialization().

◆ m_physicsRate

int64_t bicameral::sim::ProbeSim::m_physicsRate = 0
private

Definition at line 401 of file probe_sim.h.

Referenced by CreatePhysics(), and WriteInput().

◆ m_queuedCommandCount

uint32_t bicameral::sim::ProbeSim::m_queuedCommandCount = 0
private

Definition at line 432 of file probe_sim.h.

Referenced by FreeCommandSlots(), ResetCommandMirror(), and TrackCommands().

◆ m_queuedTicks

std::vector<QueuedTick> bicameral::sim::ProbeSim::m_queuedTicks
private

Definition at line 433 of file probe_sim.h.

Referenced by ResetCommandMirror(), and TrackCommands().

◆ m_reactionTable

std::array<ComPtr<ID3D12Resource>, 4> bicameral::sim::ProbeSim::m_reactionTable
private

Definition at line 391 of file probe_sim.h.

Referenced by BindRootViews(), CreateWorld(), RecordInitialization(), and RecordTableSwap().

◆ m_refreshTablePipeline

ComPtr<ID3D12PipelineState> bicameral::sim::ProbeSim::m_refreshTablePipeline
private

Definition at line 376 of file probe_sim.h.

Referenced by CreatePipelines(), and RecordUnit().

◆ m_rootSignature

ComPtr<ID3D12RootSignature> bicameral::sim::ProbeSim::m_rootSignature
private

Definition at line 371 of file probe_sim.h.

Referenced by BindRootArguments(), CreateConductGraph(), and CreatePipelines().

◆ m_savePoints

std::vector<SavePoint> bicameral::sim::ProbeSim::m_savePoints
private

◆ m_slots

std::array<FrameSlot, FRAME_SLOT_COUNT> bicameral::sim::ProbeSim::m_slots
private

Definition at line 419 of file probe_sim.h.

Referenced by CreateFrameSlots(), ReadFrame(), RecordFrame(), and RecordReadbacks().

◆ m_thermal

ComPtr<ID3D12Resource> bicameral::sim::ProbeSim::m_thermal
private

Definition at line 389 of file probe_sim.h.

Referenced by BindRootViews(), CreateBuffers(), RecordInitialization(), and StateRegions().

◆ m_tickEvents

ComPtr<ID3D12Resource> bicameral::sim::ProbeSim::m_tickEvents
private

Definition at line 407 of file probe_sim.h.

Referenced by BindRootViews(), CreateBuffers(), and StateRegions().

◆ m_timestamps

ComPtr<ID3D12QueryHeap> bicameral::sim::ProbeSim::m_timestamps
private

Definition at line 418 of file probe_sim.h.

Referenced by CreateBuffers(), and RecordFrame().

◆ m_viewSpecies

std::array<uint32_t, PROBE_VIEW_SPECIES_COUNT> bicameral::sim::ProbeSim::m_viewSpecies {}
private

Definition at line 395 of file probe_sim.h.

Referenced by CreateWorld(), and WriteInput().

◆ m_wakeDuePipeline

ComPtr<ID3D12PipelineState> bicameral::sim::ProbeSim::m_wakeDuePipeline
private

Definition at line 374 of file probe_sim.h.

Referenced by CreatePipelines(), and RecordUnit().

◆ m_zeroQueueHeader

ComPtr<ID3D12Resource> bicameral::sim::ProbeSim::m_zeroQueueHeader
private

Definition at line 423 of file probe_sim.h.

Referenced by CreateSavePoints(), and RecordRestore().

◆ MAX_UNITS_PER_FRAME

uint32_t bicameral::sim::ProbeSim::MAX_UNITS_PER_FRAME = 256
staticconstexpr

Definition at line 204 of file probe_sim.h.

Referenced by ValidateInput().


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