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

Namespaces

namespace  anonymous_namespace{hresult.cpp}
namespace  anonymous_namespace{log.cpp}
namespace  anonymous_namespace{log_sinks.cpp}
namespace  anonymous_namespace{singleton.cpp}
namespace  editor
namespace  frame
namespace  gpu
namespace  anonymous_namespace{caps.cpp}
namespace  anonymous_namespace{window.cpp}
namespace  render
namespace  save
namespace  script
namespace  sim
namespace  reaction

Classes

struct  LogRecord
class  LogSink
class  Logger
struct  FormatWithLocation
class  SingletonFinalizer
class  Singleton
struct  InputEvent
class  Window

Typedefs

using HResult = long

Enumerations

enum class  Channel : uint8_t {
  Core , Platform , Gpu , WorkGraph ,
  Sim , Reaction , Physics , Render ,
  Audio , Tool , Count
}
enum class  Level : uint8_t {
  Trace , Debug , Info , Warning ,
  Error , Fatal
}
enum class  PointerButton : uint8_t { Left , Right , Middle }
enum class  InputKind : uint8_t {
  ButtonDown , ButtonUp , PointerMove , Wheel ,
  KeyDown
}

Functions

std::string DescribeHresult (HResult result)
bool CheckHresult (HResult result, Channel channel, std::string_view expression, const std::source_location &location)
std::string_view ChannelName (Channel channel)
std::string_view LevelName (Level level)
char LevelLetter (Level level)
bool ParseLevel (std::string_view text, Level &level)
std::string_view FileNameOnly (std::string_view path)
std::string FormatLogLine (const LogRecord &record, bool withLocation)
Logger & GetLogger ()
template<typename... Args>
void Log (Channel channel, Level level, FormatWithLocation< std::type_identity_t< Args >... > pattern, Args &&... args)
std::unique_ptr< LogSink > CreateConsoleSink ()
std::unique_ptr< LogSink > CreateDebuggerSink ()
std::expected< fs::path, std::string > OpenLogFile (Logger &logger, const fs::path &directory)
fs::path DefaultLogDirectory ()
fs::path ExecutableDirectory ()
std::string ToUtf8 (std::wstring_view text)
std::wstring ToWide (std::string_view text)
int RunCapsProbe ()

Typedef Documentation

◆ HResult

using bicameral::HResult = long

Definition at line 20 of file hresult.h.

Enumeration Type Documentation

◆ Channel

enum class bicameral::Channel : uint8_t
strong
Enumerator
Core 
Platform 
Gpu 
WorkGraph 
Sim 
Reaction 
Physics 
Render 
Audio 
Tool 
Count 

Definition at line 38 of file log.h.

◆ InputKind

enum class bicameral::InputKind : uint8_t
strong
Enumerator
ButtonDown 
ButtonUp 
PointerMove 
Wheel 
KeyDown 

Definition at line 14 of file input.h.

◆ Level

enum class bicameral::Level : uint8_t
strong
Enumerator
Trace 
Debug 
Info 
Warning 
Error 
Fatal 

Definition at line 53 of file log.h.

◆ PointerButton

enum class bicameral::PointerButton : uint8_t
strong
Enumerator
Left 
Right 
Middle 

Definition at line 12 of file input.h.

Function Documentation

◆ ChannelName()

std::string_view bicameral::ChannelName ( Channel channel)
nodiscard

Definition at line 35 of file log.cpp.

Referenced by FormatLogLine(), and bicameral::anonymous_namespace{log_sinks.cpp}::DebuggerSink::Write().

Here is the caller graph for this function:

◆ CheckHresult()

bool bicameral::CheckHresult ( HResult result,
Channel channel,
std::string_view expression,
const std::source_location & location )
nodiscard

Definition at line 99 of file hresult.cpp.

References DescribeHresult(), Error, GetLogger(), bicameral::Logger::IsEnabled(), and bicameral::Logger::Write().

Here is the call graph for this function:

◆ CreateConsoleSink()

std::unique_ptr< LogSink > bicameral::CreateConsoleSink ( )

Definition at line 160 of file log_sinks.cpp.

Referenced by bicameral::Logger::Logger().

Here is the caller graph for this function:

◆ CreateDebuggerSink()

std::unique_ptr< LogSink > bicameral::CreateDebuggerSink ( )

Definition at line 164 of file log_sinks.cpp.

Referenced by bicameral::Logger::Logger().

Here is the caller graph for this function:

◆ DefaultLogDirectory()

fs::path bicameral::DefaultLogDirectory ( )

Definition at line 198 of file log_sinks.cpp.

References ExecutableDirectory().

Referenced by anonymous_namespace{main.cpp}::Run().

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

◆ DescribeHresult()

◆ ExecutableDirectory()

fs::path bicameral::ExecutableDirectory ( )

Definition at line 12 of file paths.cpp.

Referenced by DefaultLogDirectory(), bicameral::script::DefaultPackageRoot(), bicameral::script::DefaultTypeDefinitionsPath(), bicameral::gpu::LoadShader(), and anonymous_namespace{main.cpp}::ParseOptions().

Here is the caller graph for this function:

◆ FileNameOnly()

std::string_view bicameral::FileNameOnly ( std::string_view path)
nodiscard

Definition at line 74 of file log.cpp.

Referenced by FormatLogLine().

Here is the caller graph for this function:

◆ FormatLogLine()

std::string bicameral::FormatLogLine ( const LogRecord & record,
bool withLocation )
nodiscard

Definition at line 79 of file log.cpp.

References bicameral::LogRecord::channel, ChannelName(), bicameral::LogRecord::elapsedSeconds, FileNameOnly(), bicameral::LogRecord::level, LevelLetter(), bicameral::LogRecord::location, and bicameral::LogRecord::message.

Referenced by bicameral::anonymous_namespace{log_sinks.cpp}::ConsoleSink::Write(), bicameral::anonymous_namespace{log_sinks.cpp}::DebuggerSink::Write(), and bicameral::anonymous_namespace{log_sinks.cpp}::FileSink::Write().

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

◆ GetLogger()

Logger & bicameral::GetLogger ( )
inlinenodiscard

Definition at line 120 of file log.h.

References bicameral::Singleton< T >::GetInstance().

Referenced by CheckHresult(), Log(), bicameral::gpu::WorkGraphStats::Report(), and anonymous_namespace{main.cpp}::Run().

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

◆ LevelLetter()

char bicameral::LevelLetter ( Level level)
nodiscard

Definition at line 51 of file log.cpp.

Referenced by FormatLogLine().

Here is the caller graph for this function:

◆ LevelName()

std::string_view bicameral::LevelName ( Level level)
nodiscard

Definition at line 43 of file log.cpp.

Referenced by bicameral::anonymous_namespace{log_sinks.cpp}::DebuggerSink::Write().

Here is the caller graph for this function:

◆ Log()

template<typename... Args>
void bicameral::Log ( Channel channel,
Level level,
FormatWithLocation< std::type_identity_t< Args >... > pattern,
Args &&... args )

Definition at line 140 of file log.h.

References GetLogger(), bicameral::Logger::IsEnabled(), and bicameral::Logger::Write().

Referenced by bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::ApplyTimeRequest(), bicameral::gpu::Device::AttachMessageSink(), bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::CheckAutoTime(), bicameral::save::ReplayPlayer::CheckHash(), bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::CheckPhysics(), bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::CollectTrace(), bicameral::editor::EditorOverlay::Create(), bicameral::gpu::SwapChain::Create(), bicameral::gpu::WorkGraph::Create(), bicameral::sim::ProbeSim::CreateConductGraph(), bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::CreateEditor(), bicameral::gpu::anonymous_namespace{device.cpp}::CreateHardwareDevice(), bicameral::gpu::CreateRootSignature(), bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::CreateSavePoints(), bicameral::sim::ProbeSim::CreateSavePoints(), bicameral::editor::LabPanel::CreateSession(), bicameral::gpu::anonymous_namespace{device.cpp}::CreateWarpDevice(), bicameral::gpu::anonymous_namespace{device.cpp}::EnableDebugFeatures(), bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::Finish(), bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::FinishReplay(), bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::FinishTrace(), bicameral::render::DebugViewController::HandleKey(), bicameral::render::DebugViewController::HandlePeekKey(), bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::HandleResize(), bicameral::sim::anonymous_namespace{probe_sim.cpp}::LoadComputePipeline(), bicameral::editor::EditorOverlay::LoadJapaneseFont(), bicameral::frame::anonymous_namespace{frame_loop.cpp}::LoadWorldReactionTable(), bicameral::gpu::anonymous_namespace{device.cpp}::LogAllocations(), bicameral::gpu::anonymous_namespace{device.cpp}::LogBreadcrumbNode(), bicameral::gpu::LogDeviceRemoved(), bicameral::gpu::anonymous_namespace{debug_ring.cpp}::LogMessage(), bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::LogStats(), bicameral::gpu::anonymous_namespace{debug_ring.cpp}::LogSummary(), bicameral::frame::anonymous_namespace{frame_loop.cpp}::LoopDeviceOptions(), bicameral::gpu::Device::OnDebugMessage(), bicameral::render::DebugViewController::Peek(), bicameral::frame::TableHotReload::Poll(), bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::PrepareRewind(), bicameral::script::LuauSandbox::Print(), bicameral::sim::ProbeSim::ReadFrame(), bicameral::sim::ProbeSim::ReadHashes(), bicameral::sim::ProbeSim::RecordFrame(), bicameral::sim::GpuMultires::RecordImplicitConduction(), bicameral::sim::ProbeSim::RecordPhysics(), bicameral::editor::LabPanel::Report(), bicameral::gpu::WorkGraphStats::Report(), bicameral::anonymous_namespace{caps.cpp}::ReportAdapterIdentity(), bicameral::anonymous_namespace{caps.cpp}::ReportDevice(), bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::ReportEvents(), bicameral::anonymous_namespace{caps.cpp}::ReportIntegerFeatures(), bicameral::anonymous_namespace{caps.cpp}::ReportRuntime(), bicameral::anonymous_namespace{caps.cpp}::ReportWarp(), bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::RequestRewind(), bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::RequestTrace(), anonymous_namespace{main.cpp}::Run(), bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::Run(), bicameral::editor::LabPanel::RunAuto(), RunCapsProbe(), bicameral::frame::RunFrameLoop(), bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::StartRequestedTrace(), bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::SubmitScreenshot(), bicameral::save::ReplayPlayer::TakeCommands(), bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::TakeLiveCommands(), bicameral::frame::TableHotReload::TakeSwaps(), bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::TakeTableSwaps(), bicameral::gpu::anonymous_namespace{device.cpp}::TryCreateHardwareDevice(), bicameral::sim::ProbeSim::ValidateCommands(), bicameral::sim::ProbeSim::ValidateInput(), bicameral::sim::ProbeSim::ValidateSavePoints(), bicameral::sim::ProbeSim::ValidateTableSwap(), bicameral::frame::TraceCapture::Write(), and bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::WriteScreenshot().

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

◆ OpenLogFile()

std::expected< fs::path, std::string > bicameral::OpenLogFile ( Logger & logger,
const fs::path & directory )

Definition at line 168 of file log_sinks.cpp.

References bicameral::Logger::AddSink(), and ToUtf8().

Referenced by anonymous_namespace{main.cpp}::Run().

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

◆ ParseLevel()

bool bicameral::ParseLevel ( std::string_view text,
Level & level )
nodiscard

Definition at line 59 of file log.cpp.

Referenced by anonymous_namespace{main.cpp}::ParseOptions().

Here is the caller graph for this function:

◆ RunCapsProbe()

int bicameral::RunCapsProbe ( )

Definition at line 175 of file caps.cpp.

References BICAMERAL_CHECK_HR, DescribeHresult(), Error, Info, Log(), Platform, ToUtf8(), and Warning.

Referenced by anonymous_namespace{main.cpp}::Run().

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

◆ ToUtf8()

std::string bicameral::ToUtf8 ( std::wstring_view text)

Definition at line 10 of file unicode.cpp.

Referenced by bicameral::gpu::WorkGraph::Create(), bicameral::gpu::anonymous_namespace{device.cpp}::DebugNameOf(), bicameral::gpu::anonymous_namespace{device.cpp}::DescribeWarpModule(), bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::FinishReplay(), bicameral::editor::EditorOverlay::LoadJapaneseFont(), bicameral::gpu::LoadShader(), OpenLogFile(), anonymous_namespace{main.cpp}::ParseCamera(), anonymous_namespace{main.cpp}::ParseCount(), anonymous_namespace{main.cpp}::ParseFrameLoopCount(), anonymous_namespace{main.cpp}::ParseNumbers(), anonymous_namespace{main.cpp}::ParseOptions(), anonymous_namespace{main.cpp}::ParsePeekOption(), anonymous_namespace{main.cpp}::ParseTraceRange(), anonymous_namespace{main.cpp}::ParseViewOption(), bicameral::save::anonymous_namespace{replay_file.cpp}::PathText(), bicameral::anonymous_namespace{caps.cpp}::ReportAdapterIdentity(), bicameral::anonymous_namespace{caps.cpp}::ReportRuntime(), bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::RequestTrace(), anonymous_namespace{main.cpp}::Run(), bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::Run(), RunCapsProbe(), bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::StartRequestedTrace(), bicameral::anonymous_namespace{hresult.cpp}::SystemMessageOf(), bicameral::gpu::anonymous_namespace{device.cpp}::TryCreateHardwareDevice(), bicameral::frame::TraceCapture::Write(), bicameral::render::ScreenshotCapture::WriteBmp(), and bicameral::frame::anonymous_namespace{frame_loop.cpp}::FrameLoop::WriteScreenshot().

Here is the caller graph for this function:

◆ ToWide()

std::wstring bicameral::ToWide ( std::string_view text)

Definition at line 22 of file unicode.cpp.

Referenced by bicameral::gpu::LoadShader(), and bicameral::anonymous_namespace{log_sinks.cpp}::DebuggerSink::Write().

Here is the caller graph for this function: