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

#include <device.h>

Collaboration diagram for bicameral::gpu::Device:
[legend]

Classes

struct  MessageSink

Public Member Functions

ID3D12Device5 * Get () const
IDXGIFactory6 * Factory () const
const DeviceOptions & Options () const
uint32_t ValidationErrorCount () const
uint32_t ValidationWarningCount () const

Static Public Member Functions

static std::expected< Device, std::string > Create (AdapterKind kind, const DeviceOptions &options=DefaultDeviceOptions())

Private Member Functions

 Device ()=default

Static Private Member Functions

static void __stdcall OnDebugMessage (D3D12_MESSAGE_CATEGORY category, D3D12_MESSAGE_SEVERITY severity, D3D12_MESSAGE_ID id, LPCSTR description, void *context)
static std::unique_ptr< MessageSink > AttachMessageSink (ID3D12Device5 *device)

Private Attributes

ComPtr< IDXGIFactory6 > m_factory
ComPtr< ID3D12Device5 > m_device
DeviceOptions m_options
std::unique_ptr< MessageSink > m_messageSink

Detailed Description

Definition at line 42 of file device.h.

Constructor & Destructor Documentation

◆ Device()

bicameral::gpu::Device::Device ( )
privatedefault

Referenced by Create().

Here is the caller graph for this function:

Member Function Documentation

◆ AttachMessageSink()

std::unique_ptr< Device::MessageSink > bicameral::gpu::Device::AttachMessageSink ( ID3D12Device5 * device)
staticnodiscardprivate

Definition at line 335 of file device.cpp.

References BICAMERAL_CHECK_HR, bicameral::Gpu, bicameral::Log(), OnDebugMessage(), and bicameral::Warning.

Referenced by Create().

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

◆ Create()

std::expected< Device, std::string > bicameral::gpu::Device::Create ( AdapterKind kind,
const DeviceOptions & options = DefaultDeviceOptions() )
staticnodiscard

Definition at line 313 of file device.cpp.

References AttachMessageSink(), bicameral::gpu::DeviceOptions::debugLayer, bicameral::DescribeHresult(), Device(), Get(), bicameral::gpu::DeviceOptions::gpuBasedValidation, m_device, m_factory, m_messageSink, m_options, bicameral::gpu::DeviceOptions::presentMonitor, and bicameral::gpu::Warp.

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

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

◆ Factory()

IDXGIFactory6 * bicameral::gpu::Device::Factory ( ) const
inlinenodiscard

Definition at line 49 of file device.h.

References m_factory.

◆ Get()

ID3D12Device5 * bicameral::gpu::Device::Get ( ) const
inlinenodiscard

Definition at line 48 of file device.h.

References m_device.

Referenced by Create().

Here is the caller graph for this function:

◆ OnDebugMessage()

void __stdcall bicameral::gpu::Device::OnDebugMessage ( D3D12_MESSAGE_CATEGORY category,
D3D12_MESSAGE_SEVERITY severity,
D3D12_MESSAGE_ID id,
LPCSTR description,
void * context )
staticprivate

Definition at line 356 of file device.cpp.

References bicameral::Error, bicameral::Gpu, bicameral::Log(), and bicameral::Warning.

Referenced by AttachMessageSink().

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

◆ Options()

const DeviceOptions & bicameral::gpu::Device::Options ( ) const
inlinenodiscard

Definition at line 50 of file device.h.

References m_options.

◆ ValidationErrorCount()

uint32_t bicameral::gpu::Device::ValidationErrorCount ( ) const
nodiscard

Definition at line 369 of file device.cpp.

References m_messageSink.

◆ ValidationWarningCount()

uint32_t bicameral::gpu::Device::ValidationWarningCount ( ) const
nodiscard

Definition at line 373 of file device.cpp.

References m_messageSink.

Member Data Documentation

◆ m_device

ComPtr<ID3D12Device5> bicameral::gpu::Device::m_device
private

Definition at line 77 of file device.h.

Referenced by Create(), and Get().

◆ m_factory

ComPtr<IDXGIFactory6> bicameral::gpu::Device::m_factory
private

Definition at line 76 of file device.h.

Referenced by Create(), and Factory().

◆ m_messageSink

std::unique_ptr<MessageSink> bicameral::gpu::Device::m_messageSink
private

Definition at line 79 of file device.h.

Referenced by Create(), ValidationErrorCount(), and ValidationWarningCount().

◆ m_options

DeviceOptions bicameral::gpu::Device::m_options
private

Definition at line 78 of file device.h.

Referenced by Create(), and Options().


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