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

#include <readback_ring.h>

Public Member Functions

D3D12_GPU_VIRTUAL_ADDRESS GpuAddress () const
uint32_t SlotCount () const
uint64_t Bytes () const
ID3D12Resource * Buffer () const
void RecordBegin (ID3D12GraphicsCommandList *list) const
void RecordReadbackAndReset (ID3D12GraphicsCommandList *list, uint32_t slot, uint64_t copyBytes=UINT64_MAX) const
bool Read (uint32_t slot, std::span< std::byte > destination) const

Static Public Member Functions

static std::expected< ReadbackRing, std::string > Create (ID3D12Device *device, uint64_t bytes, uint64_t headerBytes, uint32_t slotCount, std::wstring_view name)

Private Member Functions

 ReadbackRing ()=default

Private Attributes

ComPtr< ID3D12Resource > m_buffer
ComPtr< ID3D12Resource > m_zeros
std::vector< ComPtr< ID3D12Resource > > m_readbacks
uint64_t m_bytes = 0
uint64_t m_headerBytes = 0

Detailed Description

Definition at line 23 of file readback_ring.h.

Constructor & Destructor Documentation

◆ ReadbackRing()

bicameral::gpu::ReadbackRing::ReadbackRing ( )
privatedefault

Referenced by Create().

Here is the caller graph for this function:

Member Function Documentation

◆ Buffer()

ID3D12Resource * bicameral::gpu::ReadbackRing::Buffer ( ) const
inlinenodiscard

Definition at line 33 of file readback_ring.h.

References m_buffer.

◆ Bytes()

uint64_t bicameral::gpu::ReadbackRing::Bytes ( ) const
inlinenodiscard

Definition at line 32 of file readback_ring.h.

References m_bytes.

◆ Create()

std::expected< ReadbackRing, std::string > bicameral::gpu::ReadbackRing::Create ( ID3D12Device * device,
uint64_t bytes,
uint64_t headerBytes,
uint32_t slotCount,
std::wstring_view name )
staticnodiscard

Definition at line 11 of file readback_ring.cpp.

References bicameral::gpu::CreateBuffer(), m_buffer, m_bytes, m_headerBytes, m_readbacks, m_zeros, bicameral::gpu::Readback, ReadbackRing(), and bicameral::gpu::UnorderedAccess.

Referenced by bicameral::gpu::DebugRing::Create(), bicameral::gpu::GraphTrace::Create(), bicameral::gpu::WorkGraphStats::Create(), and bicameral::sim::ProbeSim::Create().

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

◆ GpuAddress()

D3D12_GPU_VIRTUAL_ADDRESS bicameral::gpu::ReadbackRing::GpuAddress ( ) const
inlinenodiscard

Definition at line 30 of file readback_ring.h.

References m_buffer.

◆ Read()

bool bicameral::gpu::ReadbackRing::Read ( uint32_t slot,
std::span< std::byte > destination ) const
nodiscard

Definition at line 61 of file readback_ring.cpp.

References m_readbacks, and bicameral::gpu::ReadBuffer().

Here is the call graph for this function:

◆ RecordBegin()

void bicameral::gpu::ReadbackRing::RecordBegin ( ID3D12GraphicsCommandList * list) const

Definition at line 36 of file readback_ring.cpp.

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

Here is the call graph for this function:

◆ RecordReadbackAndReset()

void bicameral::gpu::ReadbackRing::RecordReadbackAndReset ( ID3D12GraphicsCommandList * list,
uint32_t slot,
uint64_t copyBytes = UINT64_MAX ) const

Definition at line 42 of file readback_ring.cpp.

References m_buffer, m_bytes, m_headerBytes, m_readbacks, m_zeros, and bicameral::gpu::Transition().

Here is the call graph for this function:

◆ SlotCount()

uint32_t bicameral::gpu::ReadbackRing::SlotCount ( ) const
inlinenodiscard

Definition at line 31 of file readback_ring.h.

References m_readbacks.

Member Data Documentation

◆ m_buffer

ComPtr<ID3D12Resource> bicameral::gpu::ReadbackRing::m_buffer
private

Definition at line 50 of file readback_ring.h.

Referenced by Buffer(), Create(), GpuAddress(), RecordBegin(), and RecordReadbackAndReset().

◆ m_bytes

uint64_t bicameral::gpu::ReadbackRing::m_bytes = 0
private

Definition at line 53 of file readback_ring.h.

Referenced by Bytes(), Create(), and RecordReadbackAndReset().

◆ m_headerBytes

uint64_t bicameral::gpu::ReadbackRing::m_headerBytes = 0
private

Definition at line 54 of file readback_ring.h.

Referenced by Create(), and RecordReadbackAndReset().

◆ m_readbacks

std::vector<ComPtr<ID3D12Resource> > bicameral::gpu::ReadbackRing::m_readbacks
private

Definition at line 52 of file readback_ring.h.

Referenced by Create(), Read(), RecordReadbackAndReset(), and SlotCount().

◆ m_zeros

ComPtr<ID3D12Resource> bicameral::gpu::ReadbackRing::m_zeros
private

Definition at line 51 of file readback_ring.h.

Referenced by Create(), and RecordReadbackAndReset().


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