Bicameral Engine
GPU-resident engine for a magic-research open-world game
Loading...
Searching...
No Matches
bicameral::frame::anonymous_namespace{frame_loop.cpp} Namespace Reference

Classes

struct  FrameSlot
struct  SimSubmission
struct  CompletedExtraction
struct  PendingClick
struct  Stats
struct  FrameLoopParts
class  FrameLoop

Typedefs

using Clock = chr::steady_clock

Functions

editor::TimeRequest AutoTimeRequest (uint64_t frame)
double Milliseconds (Clock::duration duration)
double TimestampMilliseconds (uint64_t ticks, uint64_t frequency)
double TimestampMilliseconds (uint64_t begin, uint64_t end, uint64_t frequency)
std::expected< std::unique_ptr< Window >, std::string > CreateWindowForLoop ()
gpu::DeviceOptions LoopDeviceOptions (const FrameLoopOptions &options)
std::expected< sim::ProbeSim, std::string > CreateSimulation (ID3D12Device5 *device, const FrameLoopOptions &options, const sim::BakedReactionTable &reactionTable)
std::expected< std::shared_ptr< const script::LoadedReactionTable >, std::string > LoadWorldReactionTable (const FrameLoopOptions &options)
std::expected< FrameLoopParts, std::string > CreateParts (const FrameLoopOptions &options)
void PushFromCommand (sim::PhysicsWorld &world, const sim::ProbeCommand &command)

Variables

constexpr uint32_t FRAME_SLOT_COUNT = gpu::SwapChain::BUFFER_COUNT
constexpr uint32_t SIM_SLOT_COUNT = sim::ProbeSim::FRAME_SLOT_COUNT
constexpr uint32_t INITIAL_CLIENT_WIDTH = 1280
constexpr uint32_t INITIAL_CLIENT_HEIGHT = 720
constexpr uint32_t FRAME_WAIT_TIMEOUT_MS = 100
constexpr uint32_t CONSTANTS_BYTES = 256
constexpr uint32_t TIMESTAMPS_PER_FRAME = 2
constexpr uint32_t AUTO_CLICK_INTERVAL_FRAMES = 20
constexpr auto STATS_INTERVAL = chr::seconds(1)
constexpr auto MINIMIZED_SLEEP = chr::milliseconds(16)
constexpr uint64_t TRACE_KEY_TICKS = 60
constexpr uint32_t TRACE_KEY_RADIUS_CELLS = 8
constexpr uint64_t AUTO_TRACE_FRAME = 30
constexpr uint64_t AUTO_PUSH_FRAME = 60
constexpr uint64_t AUTO_TIME_PAUSE_FRAME = 20
constexpr uint64_t AUTO_TIME_HOLD_FRAME = 36
constexpr uint64_t AUTO_TIME_HOLD_CHECK_FRAME = 44
constexpr std::array< uint64_t, 3 > AUTO_TIME_STEP_FRAMES = {45, 50, 55}
constexpr uint64_t AUTO_TIME_STEP_CHECK_FRAME = 64
constexpr uint64_t AUTO_TIME_FASTER_FRAME = 65
constexpr uint64_t AUTO_TIME_RESUME_FRAME = 70
constexpr uint64_t AUTO_TIME_SLOWER_FRAME = 100
constexpr uint64_t AUTO_TIME_NORMAL_FRAME = 130
constexpr uint32_t PUSH_IMPULSE_MILLINEWTON_SECONDS = 5'000'000

Typedef Documentation

◆ Clock

using bicameral::frame::anonymous_namespace{frame_loop.cpp}::Clock = chr::steady_clock

Definition at line 52 of file frame_loop.cpp.

Function Documentation

◆ AutoTimeRequest()

editor::TimeRequest bicameral::frame::anonymous_namespace{frame_loop.cpp}::AutoTimeRequest ( uint64_t frame)

Definition at line 82 of file frame_loop.cpp.

References AUTO_TIME_FASTER_FRAME, AUTO_TIME_NORMAL_FRAME, AUTO_TIME_PAUSE_FRAME, AUTO_TIME_RESUME_FRAME, AUTO_TIME_SLOWER_FRAME, AUTO_TIME_STEP_FRAMES, and AutoTimeRequest().

Referenced by AutoTimeRequest(), and bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::BuildEditor().

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

◆ CreateParts()

std::expected< FrameLoopParts, std::string > bicameral::frame::anonymous_namespace{frame_loop.cpp}::CreateParts ( const FrameLoopOptions & options)

◆ CreateSimulation()

std::expected< sim::ProbeSim, std::string > bicameral::frame::anonymous_namespace{frame_loop.cpp}::CreateSimulation ( ID3D12Device5 * device,
const FrameLoopOptions & options,
const sim::BakedReactionTable & reactionTable )

Definition at line 413 of file frame_loop.cpp.

References bicameral::sim::ProbeSim::Create(), CreateSimulation(), bicameral::sim::MakeProbeStackScene(), bicameral::frame::FrameLoopOptions::physics, bicameral::frame::FrameLoopOptions::physicsComputeBroadphase, bicameral::frame::FrameLoopOptions::simLoad, bicameral::frame::FrameLoopOptions::simSplit, bicameral::frame::FrameLoopOptions::trace, and bicameral::frame::TRACE_CAPACITY_PER_FRAME.

Referenced by CreateParts(), and CreateSimulation().

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

◆ CreateWindowForLoop()

std::expected< std::unique_ptr< Window >, std::string > bicameral::frame::anonymous_namespace{frame_loop.cpp}::CreateWindowForLoop ( )

Definition at line 389 of file frame_loop.cpp.

References bicameral::Window::Create(), CreateWindowForLoop(), INITIAL_CLIENT_HEIGHT, and INITIAL_CLIENT_WIDTH.

Referenced by CreateParts(), and CreateWindowForLoop().

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

◆ LoadWorldReactionTable()

std::expected< std::shared_ptr< const script::LoadedReactionTable >, std::string > bicameral::frame::anonymous_namespace{frame_loop.cpp}::LoadWorldReactionTable ( const FrameLoopOptions & options)

Definition at line 430 of file frame_loop.cpp.

References bicameral::Info, bicameral::script::LoadReactionTable(), LoadWorldReactionTable(), bicameral::Log(), bicameral::script::PackageRejection::package, bicameral::frame::FrameLoopOptions::packageRoot, bicameral::script::PackageRejection::reason, bicameral::Sim, and bicameral::Warning.

Referenced by CreateParts(), and LoadWorldReactionTable().

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

◆ LoopDeviceOptions()

gpu::DeviceOptions bicameral::frame::anonymous_namespace{frame_loop.cpp}::LoopDeviceOptions ( const FrameLoopOptions & options)

Definition at line 402 of file frame_loop.cpp.

References bicameral::gpu::DefaultDeviceOptions(), bicameral::Gpu, bicameral::gpu::DeviceOptions::gpuBasedValidation, bicameral::Info, bicameral::Log(), LoopDeviceOptions(), and bicameral::frame::FrameLoopOptions::physics.

Referenced by CreateParts(), and LoopDeviceOptions().

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

◆ Milliseconds()

double bicameral::frame::anonymous_namespace{frame_loop.cpp}::Milliseconds ( Clock::duration duration)

Definition at line 104 of file frame_loop.cpp.

References Milliseconds().

Referenced by Milliseconds(), bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::ReportEvents(), and bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::RunFrame().

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

◆ PushFromCommand()

void bicameral::frame::anonymous_namespace{frame_loop.cpp}::PushFromCommand ( sim::PhysicsWorld & world,
const sim::ProbeCommand & command )

Definition at line 661 of file frame_loop.cpp.

References bicameral::sim::Command::payload, bicameral::sim::PhysicsWorld::Push(), and PushFromCommand().

Referenced by bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::CheckPhysics(), and PushFromCommand().

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

◆ TimestampMilliseconds() [1/2]

double bicameral::frame::anonymous_namespace{frame_loop.cpp}::TimestampMilliseconds ( uint64_t begin,
uint64_t end,
uint64_t frequency )

Definition at line 114 of file frame_loop.cpp.

References TimestampMilliseconds().

Here is the call graph for this function:

◆ TimestampMilliseconds() [2/2]

double bicameral::frame::anonymous_namespace{frame_loop.cpp}::TimestampMilliseconds ( uint64_t ticks,
uint64_t frequency )

Definition at line 108 of file frame_loop.cpp.

References TimestampMilliseconds().

Referenced by bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::CollectFrameSlot(), bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::ReportSimReadback(), TimestampMilliseconds(), and TimestampMilliseconds().

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

Variable Documentation

◆ AUTO_CLICK_INTERVAL_FRAMES

uint32_t bicameral::frame::anonymous_namespace{frame_loop.cpp}::AUTO_CLICK_INTERVAL_FRAMES = 20
constexpr

◆ AUTO_PUSH_FRAME

uint64_t bicameral::frame::anonymous_namespace{frame_loop.cpp}::AUTO_PUSH_FRAME = 60
constexpr

◆ AUTO_TIME_FASTER_FRAME

uint64_t bicameral::frame::anonymous_namespace{frame_loop.cpp}::AUTO_TIME_FASTER_FRAME = 65
constexpr

Definition at line 77 of file frame_loop.cpp.

Referenced by AutoTimeRequest().

◆ AUTO_TIME_HOLD_CHECK_FRAME

uint64_t bicameral::frame::anonymous_namespace{frame_loop.cpp}::AUTO_TIME_HOLD_CHECK_FRAME = 44
constexpr

◆ AUTO_TIME_HOLD_FRAME

uint64_t bicameral::frame::anonymous_namespace{frame_loop.cpp}::AUTO_TIME_HOLD_FRAME = 36
constexpr

◆ AUTO_TIME_NORMAL_FRAME

uint64_t bicameral::frame::anonymous_namespace{frame_loop.cpp}::AUTO_TIME_NORMAL_FRAME = 130
constexpr

Definition at line 80 of file frame_loop.cpp.

Referenced by AutoTimeRequest().

◆ AUTO_TIME_PAUSE_FRAME

uint64_t bicameral::frame::anonymous_namespace{frame_loop.cpp}::AUTO_TIME_PAUSE_FRAME = 20
constexpr

Definition at line 72 of file frame_loop.cpp.

Referenced by AutoTimeRequest().

◆ AUTO_TIME_RESUME_FRAME

uint64_t bicameral::frame::anonymous_namespace{frame_loop.cpp}::AUTO_TIME_RESUME_FRAME = 70
constexpr

Definition at line 78 of file frame_loop.cpp.

Referenced by AutoTimeRequest().

◆ AUTO_TIME_SLOWER_FRAME

uint64_t bicameral::frame::anonymous_namespace{frame_loop.cpp}::AUTO_TIME_SLOWER_FRAME = 100
constexpr

Definition at line 79 of file frame_loop.cpp.

Referenced by AutoTimeRequest().

◆ AUTO_TIME_STEP_CHECK_FRAME

uint64_t bicameral::frame::anonymous_namespace{frame_loop.cpp}::AUTO_TIME_STEP_CHECK_FRAME = 64
constexpr

◆ AUTO_TIME_STEP_FRAMES

std::array<uint64_t, 3> bicameral::frame::anonymous_namespace{frame_loop.cpp}::AUTO_TIME_STEP_FRAMES = {45, 50, 55}
constexpr

◆ AUTO_TRACE_FRAME

uint64_t bicameral::frame::anonymous_namespace{frame_loop.cpp}::AUTO_TRACE_FRAME = 30
constexpr

◆ CONSTANTS_BYTES

uint32_t bicameral::frame::anonymous_namespace{frame_loop.cpp}::CONSTANTS_BYTES = 256
constexpr

◆ FRAME_SLOT_COUNT

◆ FRAME_WAIT_TIMEOUT_MS

uint32_t bicameral::frame::anonymous_namespace{frame_loop.cpp}::FRAME_WAIT_TIMEOUT_MS = 100
constexpr

◆ INITIAL_CLIENT_HEIGHT

uint32_t bicameral::frame::anonymous_namespace{frame_loop.cpp}::INITIAL_CLIENT_HEIGHT = 720
constexpr

Definition at line 57 of file frame_loop.cpp.

Referenced by CreateWindowForLoop().

◆ INITIAL_CLIENT_WIDTH

uint32_t bicameral::frame::anonymous_namespace{frame_loop.cpp}::INITIAL_CLIENT_WIDTH = 1280
constexpr

Definition at line 56 of file frame_loop.cpp.

Referenced by CreateWindowForLoop().

◆ MINIMIZED_SLEEP

auto bicameral::frame::anonymous_namespace{frame_loop.cpp}::MINIMIZED_SLEEP = chr::milliseconds(16)
constexpr

◆ PUSH_IMPULSE_MILLINEWTON_SECONDS

uint32_t bicameral::frame::anonymous_namespace{frame_loop.cpp}::PUSH_IMPULSE_MILLINEWTON_SECONDS = 5'000'000
constexpr

◆ SIM_SLOT_COUNT

uint32_t bicameral::frame::anonymous_namespace{frame_loop.cpp}::SIM_SLOT_COUNT = sim::ProbeSim::FRAME_SLOT_COUNT
constexpr

◆ STATS_INTERVAL

auto bicameral::frame::anonymous_namespace{frame_loop.cpp}::STATS_INTERVAL = chr::seconds(1)
constexpr

◆ TIMESTAMPS_PER_FRAME

◆ TRACE_KEY_RADIUS_CELLS

uint32_t bicameral::frame::anonymous_namespace{frame_loop.cpp}::TRACE_KEY_RADIUS_CELLS = 8
constexpr

◆ TRACE_KEY_TICKS

uint64_t bicameral::frame::anonymous_namespace{frame_loop.cpp}::TRACE_KEY_TICKS = 60
constexpr