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

#include <queue.h>

Public Member Functions

ID3D12CommandQueue * Native () const
uint64_t Submit (std::span< ID3D12CommandList *const > lists)
uint64_t Submit (ID3D12CommandList *list)
void Execute (ID3D12CommandList *list) const
void GpuWait (const Queue &other, uint64_t value) const
uint64_t LastSubmitted () const
uint64_t CompletedValue () const
bool IsComplete (uint64_t value) const
bool IsDeviceLost () const
bool WaitCpu (uint64_t value) const
bool WaitIdle () const
bool Flush ()
uint64_t TimestampFrequency () const

Static Public Member Functions

static std::expected< Queue, std::string > Create (ID3D12Device *device, D3D12_COMMAND_LIST_TYPE type, std::wstring_view name, D3D12_COMMAND_QUEUE_PRIORITY priority=D3D12_COMMAND_QUEUE_PRIORITY_NORMAL)

Private Member Functions

 Queue ()=default

Private Attributes

ComPtr< ID3D12CommandQueue > m_queue
ComPtr< ID3D12Fence > m_fence
uint64_t m_lastSubmitted = 0

Detailed Description

Definition at line 21 of file queue.h.

Constructor & Destructor Documentation

◆ Queue()

bicameral::gpu::Queue::Queue ( )
privatedefault

Referenced by Create(), and GpuWait().

Here is the caller graph for this function:

Member Function Documentation

◆ CompletedValue()

uint64_t bicameral::gpu::Queue::CompletedValue ( ) const
inlinenodiscard

Definition at line 42 of file queue.h.

References m_fence.

Referenced by IsComplete(), and IsDeviceLost().

Here is the caller graph for this function:

◆ Create()

std::expected< Queue, std::string > bicameral::gpu::Queue::Create ( ID3D12Device * device,
D3D12_COMMAND_LIST_TYPE type,
std::wstring_view name,
D3D12_COMMAND_QUEUE_PRIORITY priority = D3D12_COMMAND_QUEUE_PRIORITY_NORMAL )
staticnodiscard

Definition at line 10 of file queue.cpp.

References bicameral::DescribeHresult(), m_fence, m_queue, and Queue().

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:

◆ Execute()

void bicameral::gpu::Queue::Execute ( ID3D12CommandList * list) const

Definition at line 38 of file queue.cpp.

References m_queue.

◆ Flush()

bool bicameral::gpu::Queue::Flush ( )
inline

Definition at line 54 of file queue.h.

References Submit(), and WaitCpu().

Here is the call graph for this function:

◆ GpuWait()

void bicameral::gpu::Queue::GpuWait ( const Queue & other,
uint64_t value ) const

Definition at line 42 of file queue.cpp.

References BICAMERAL_CHECK_HR, bicameral::Gpu, m_fence, m_queue, and Queue().

Here is the call graph for this function:

◆ IsComplete()

bool bicameral::gpu::Queue::IsComplete ( uint64_t value) const
inlinenodiscard

Definition at line 43 of file queue.h.

References CompletedValue().

Referenced by bicameral::editor::EditorOverlay::Submit(), and WaitCpu().

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

◆ IsDeviceLost()

bool bicameral::gpu::Queue::IsDeviceLost ( ) const
inlinenodiscard

Definition at line 46 of file queue.h.

References CompletedValue().

Referenced by WaitCpu().

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

◆ LastSubmitted()

uint64_t bicameral::gpu::Queue::LastSubmitted ( ) const
inlinenodiscard

Definition at line 41 of file queue.h.

References m_lastSubmitted.

◆ Native()

ID3D12CommandQueue * bicameral::gpu::Queue::Native ( ) const
inlinenodiscard

Definition at line 28 of file queue.h.

References m_queue.

Referenced by bicameral::editor::EditorOverlay::InitializeBackends().

Here is the caller graph for this function:

◆ Submit() [1/2]

uint64_t bicameral::gpu::Queue::Submit ( ID3D12CommandList * list)
inline

Definition at line 32 of file queue.h.

References Submit().

Referenced by Submit().

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

◆ Submit() [2/2]

uint64_t bicameral::gpu::Queue::Submit ( std::span< ID3D12CommandList *const > lists)

Definition at line 28 of file queue.cpp.

References BICAMERAL_CHECK_HR, bicameral::Gpu, m_fence, m_lastSubmitted, and m_queue.

Referenced by Flush(), and bicameral::editor::EditorOverlay::Submit().

Here is the caller graph for this function:

◆ TimestampFrequency()

uint64_t bicameral::gpu::Queue::TimestampFrequency ( ) const
nodiscard

Definition at line 63 of file queue.cpp.

References m_queue.

◆ WaitCpu()

bool bicameral::gpu::Queue::WaitCpu ( uint64_t value) const

Definition at line 49 of file queue.cpp.

References BICAMERAL_CHECK_HR, bicameral::Gpu, IsComplete(), IsDeviceLost(), and m_fence.

Referenced by Flush(), bicameral::editor::EditorOverlay::Submit(), and WaitIdle().

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

◆ WaitIdle()

bool bicameral::gpu::Queue::WaitIdle ( ) const
inline

Definition at line 50 of file queue.h.

References m_lastSubmitted, and WaitCpu().

Here is the call graph for this function:

Member Data Documentation

◆ m_fence

ComPtr<ID3D12Fence> bicameral::gpu::Queue::m_fence
private

Definition at line 63 of file queue.h.

Referenced by CompletedValue(), Create(), GpuWait(), Submit(), and WaitCpu().

◆ m_lastSubmitted

uint64_t bicameral::gpu::Queue::m_lastSubmitted = 0
private

Definition at line 64 of file queue.h.

Referenced by LastSubmitted(), Submit(), and WaitIdle().

◆ m_queue

ComPtr<ID3D12CommandQueue> bicameral::gpu::Queue::m_queue
private

Definition at line 62 of file queue.h.

Referenced by Create(), Execute(), GpuWait(), Native(), Submit(), and TimestampFrequency().


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