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

#include <gpu_implicit_levels.h>

Collaboration diagram for bicameral::sim::GpuImplicitLevels:
[legend]

Classes

struct  Constants

Public Member Functions

void RecordBuild (ID3D12GraphicsCommandList *list, D3D12_GPU_VIRTUAL_ADDRESS debugRing, const GpuImplicitBuild &build)
void RecordCopyTo (ID3D12GraphicsCommandList *list, GpuImplicit &implicit)
void RecordTimestamp (ID3D12GraphicsCommandList *list, uint32_t index)
void RecordReadback (ID3D12GraphicsCommandList *list)
std::expected< GpuImplicitLevelSystem, std::string > Read () const
std::vector< uint64_t > ReadTimestamps (uint32_t count) const
uint32_t DispatchCount () const

Static Public Member Functions

static std::expected< GpuImplicitLevels, std::string > Create (ID3D12Device5 *device, const GpuImplicitBuild &build, const GpuImplicitLevelLimits &limits)

Static Public Attributes

static constexpr uint32_t MAX_TIMESTAMPS = 8

Private Member Functions

 GpuImplicitLevels ()=default
void Dispatch (ID3D12GraphicsCommandList *list, uint32_t pass, uint32_t groups)
bool UsesTail () const
void BeginSkippable (ID3D12GraphicsCommandList *list, uint32_t coarsening)
void EndSkippable (ID3D12GraphicsCommandList *list)

Private Attributes

Constants m_constants
uint32_t m_dispatchRounds = 0
uint64_t m_workBytes = 0
ComPtr< ID3D12RootSignature > m_rootSignature
std::vector< ComPtr< ID3D12PipelineState > > m_pipelines
ComPtr< ID3D12Resource > m_work
ComPtr< ID3D12Resource > m_nodes
ComPtr< ID3D12Resource > m_links
ComPtr< ID3D12Resource > m_children
ComPtr< ID3D12Resource > m_predicate
ComPtr< ID3D12Resource > m_headerReadback
ComPtr< ID3D12Resource > m_nodesReadback
ComPtr< ID3D12Resource > m_linksReadback
ComPtr< ID3D12Resource > m_childrenReadback
ComPtr< ID3D12QueryHeap > m_timestamps
ComPtr< ID3D12Resource > m_timestampReadback
uint32_t m_timestampCount = 0

Detailed Description

Definition at line 57 of file gpu_implicit_levels.h.

Constructor & Destructor Documentation

◆ GpuImplicitLevels()

bicameral::sim::GpuImplicitLevels::GpuImplicitLevels ( )
privatedefault

Referenced by Create().

Here is the caller graph for this function:

Member Function Documentation

◆ BeginSkippable()

void bicameral::sim::GpuImplicitLevels::BeginSkippable ( ID3D12GraphicsCommandList * list,
uint32_t coarsening )
private

Definition at line 231 of file gpu_implicit_levels.cpp.

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

Referenced by RecordBuild().

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

◆ Create()

std::expected< GpuImplicitLevels, std::string > bicameral::sim::GpuImplicitLevels::Create ( ID3D12Device5 * device,
const GpuImplicitBuild & build,
const GpuImplicitLevelLimits & limits )
staticnodiscard

Definition at line 150 of file gpu_implicit_levels.cpp.

References bicameral::sim::GpuImplicitBuild::CellKeysWord(), bicameral::sim::GpuImplicitBuildLimits::cells, bicameral::gpu::CreateBuffer(), bicameral::gpu::CreateComputePipeline(), bicameral::gpu::CreateRootSignature(), bicameral::sim::GpuImplicitLevelLimits::dispatchRounds, bicameral::sim::GpuImplicitLevels::Constants::facesByte, bicameral::sim::GpuImplicitBuild::FacesOffset(), GpuImplicitLevels(), bicameral::sim::GpuImplicitLevels::Constants::keysWord, bicameral::sim::GpuImplicitLevels::Constants::levelLinks, bicameral::sim::GpuImplicitLevelLimits::levels, bicameral::sim::GpuImplicitBuild::Limits(), bicameral::sim::GpuImplicitLevelLimits::links, bicameral::sim::GpuImplicitLevels::Constants::linkTableMask, bicameral::sim::GpuImplicitBuild::ListCellsWord(), bicameral::sim::GpuImplicitLevels::Constants::listCellsWord, bicameral::sim::GpuImplicitLevels::Constants::listsByte, bicameral::sim::GpuImplicitBuild::ListsOffset(), bicameral::gpu::LoadShader(), m_children, m_childrenReadback, m_constants, m_dispatchRounds, m_headerReadback, m_links, m_linksReadback, m_nodes, m_nodesReadback, m_pipelines, m_predicate, m_rootSignature, m_timestampReadback, m_timestamps, m_work, m_workBytes, MAX_TIMESTAMPS, bicameral::sim::GpuImplicitLevels::Constants::maxCells, bicameral::sim::GpuImplicitLevels::Constants::maxLevels, bicameral::sim::GpuImplicitLevels::Constants::maxLinks, bicameral::sim::GpuImplicitLevels::Constants::maxNodes, bicameral::sim::GpuImplicitLevelLimits::nodes, bicameral::sim::GpuImplicitLevels::Constants::nodeTableMask, bicameral::gpu::Readback, bicameral::sim::GpuImplicitLevelLimits::tailMaxNodes, bicameral::sim::GpuImplicitLevels::Constants::tailMaxNodes, bicameral::sim::GpuImplicitBuildLimits::unknowns, and bicameral::gpu::UnorderedAccess.

Referenced by bicameral::sim::GpuMultiresImplicit::Create().

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

◆ Dispatch()

void bicameral::sim::GpuImplicitLevels::Dispatch ( ID3D12GraphicsCommandList * list,
uint32_t pass,
uint32_t groups )
private

Definition at line 223 of file gpu_implicit_levels.cpp.

References Dispatch(), m_constants, m_pipelines, and bicameral::gpu::RootSignatureLayout::RootConstantIndex().

Referenced by Dispatch(), and RecordBuild().

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

◆ DispatchCount()

uint32_t bicameral::sim::GpuImplicitLevels::DispatchCount ( ) const
nodiscard

Definition at line 306 of file gpu_implicit_levels.cpp.

References m_dispatchRounds, and UsesTail().

Here is the call graph for this function:

◆ EndSkippable()

void bicameral::sim::GpuImplicitLevels::EndSkippable ( ID3D12GraphicsCommandList * list)
private

Definition at line 238 of file gpu_implicit_levels.cpp.

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

Referenced by RecordBuild().

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

◆ Read()

◆ ReadTimestamps()

std::vector< uint64_t > bicameral::sim::GpuImplicitLevels::ReadTimestamps ( uint32_t count) const
nodiscard

Definition at line 378 of file gpu_implicit_levels.cpp.

References m_timestampCount, m_timestampReadback, and bicameral::gpu::ReadBuffer().

Here is the call graph for this function:

◆ RecordBuild()

void bicameral::sim::GpuImplicitLevels::RecordBuild ( ID3D12GraphicsCommandList * list,
D3D12_GPU_VIRTUAL_ADDRESS debugRing,
const GpuImplicitBuild & build )

Definition at line 245 of file gpu_implicit_levels.cpp.

References BeginSkippable(), bicameral::gpu::RootSignatureLayout::DebugRingIndex(), Dispatch(), EndSkippable(), m_children, m_constants, m_dispatchRounds, m_links, m_nodes, m_predicate, m_rootSignature, m_work, bicameral::sim::GpuImplicitBuild::SystemBuffer(), UsesTail(), and bicameral::sim::GpuImplicitBuild::WorkBuffer().

Here is the call graph for this function:

◆ RecordCopyTo()

void bicameral::sim::GpuImplicitLevels::RecordCopyTo ( ID3D12GraphicsCommandList * list,
GpuImplicit & implicit )

Definition at line 310 of file gpu_implicit_levels.cpp.

References m_children, m_links, m_nodes, m_work, bicameral::sim::GpuImplicit::RecordCopyLevels(), and bicameral::gpu::Transition().

Here is the call graph for this function:

◆ RecordReadback()

void bicameral::sim::GpuImplicitLevels::RecordReadback ( ID3D12GraphicsCommandList * list)

◆ RecordTimestamp()

void bicameral::sim::GpuImplicitLevels::RecordTimestamp ( ID3D12GraphicsCommandList * list,
uint32_t index )

Definition at line 326 of file gpu_implicit_levels.cpp.

References m_timestampCount, m_timestamps, and MAX_TIMESTAMPS.

◆ UsesTail()

bool bicameral::sim::GpuImplicitLevels::UsesTail ( ) const
nodiscardprivate

Definition at line 302 of file gpu_implicit_levels.cpp.

References m_constants, and m_dispatchRounds.

Referenced by DispatchCount(), and RecordBuild().

Here is the caller graph for this function:

Member Data Documentation

◆ m_children

ComPtr<ID3D12Resource> bicameral::sim::GpuImplicitLevels::m_children
private

Definition at line 113 of file gpu_implicit_levels.h.

Referenced by Create(), RecordBuild(), RecordCopyTo(), and RecordReadback().

◆ m_childrenReadback

ComPtr<ID3D12Resource> bicameral::sim::GpuImplicitLevels::m_childrenReadback
private

Definition at line 118 of file gpu_implicit_levels.h.

Referenced by Create(), Read(), and RecordReadback().

◆ m_constants

Constants bicameral::sim::GpuImplicitLevels::m_constants
private

Definition at line 104 of file gpu_implicit_levels.h.

Referenced by Create(), Dispatch(), Read(), RecordBuild(), and UsesTail().

◆ m_dispatchRounds

uint32_t bicameral::sim::GpuImplicitLevels::m_dispatchRounds = 0
private

Definition at line 105 of file gpu_implicit_levels.h.

Referenced by Create(), DispatchCount(), RecordBuild(), and UsesTail().

◆ m_headerReadback

ComPtr<ID3D12Resource> bicameral::sim::GpuImplicitLevels::m_headerReadback
private

Definition at line 115 of file gpu_implicit_levels.h.

Referenced by Create(), Read(), and RecordReadback().

◆ m_links

ComPtr<ID3D12Resource> bicameral::sim::GpuImplicitLevels::m_links
private

Definition at line 112 of file gpu_implicit_levels.h.

Referenced by Create(), RecordBuild(), RecordCopyTo(), and RecordReadback().

◆ m_linksReadback

ComPtr<ID3D12Resource> bicameral::sim::GpuImplicitLevels::m_linksReadback
private

Definition at line 117 of file gpu_implicit_levels.h.

Referenced by Create(), Read(), and RecordReadback().

◆ m_nodes

ComPtr<ID3D12Resource> bicameral::sim::GpuImplicitLevels::m_nodes
private

Definition at line 111 of file gpu_implicit_levels.h.

Referenced by Create(), RecordBuild(), RecordCopyTo(), and RecordReadback().

◆ m_nodesReadback

ComPtr<ID3D12Resource> bicameral::sim::GpuImplicitLevels::m_nodesReadback
private

Definition at line 116 of file gpu_implicit_levels.h.

Referenced by Create(), Read(), and RecordReadback().

◆ m_pipelines

std::vector<ComPtr<ID3D12PipelineState> > bicameral::sim::GpuImplicitLevels::m_pipelines
private

Definition at line 109 of file gpu_implicit_levels.h.

Referenced by Create(), and Dispatch().

◆ m_predicate

ComPtr<ID3D12Resource> bicameral::sim::GpuImplicitLevels::m_predicate
private

Definition at line 114 of file gpu_implicit_levels.h.

Referenced by BeginSkippable(), Create(), EndSkippable(), and RecordBuild().

◆ m_rootSignature

ComPtr<ID3D12RootSignature> bicameral::sim::GpuImplicitLevels::m_rootSignature
private

Definition at line 108 of file gpu_implicit_levels.h.

Referenced by Create(), and RecordBuild().

◆ m_timestampCount

uint32_t bicameral::sim::GpuImplicitLevels::m_timestampCount = 0
private

Definition at line 121 of file gpu_implicit_levels.h.

Referenced by ReadTimestamps(), RecordReadback(), and RecordTimestamp().

◆ m_timestampReadback

ComPtr<ID3D12Resource> bicameral::sim::GpuImplicitLevels::m_timestampReadback
private

Definition at line 120 of file gpu_implicit_levels.h.

Referenced by Create(), ReadTimestamps(), and RecordReadback().

◆ m_timestamps

ComPtr<ID3D12QueryHeap> bicameral::sim::GpuImplicitLevels::m_timestamps
private

Definition at line 119 of file gpu_implicit_levels.h.

Referenced by Create(), RecordReadback(), and RecordTimestamp().

◆ m_work

ComPtr<ID3D12Resource> bicameral::sim::GpuImplicitLevels::m_work
private

Definition at line 110 of file gpu_implicit_levels.h.

Referenced by Create(), RecordBuild(), RecordCopyTo(), and RecordReadback().

◆ m_workBytes

uint64_t bicameral::sim::GpuImplicitLevels::m_workBytes = 0
private

Definition at line 106 of file gpu_implicit_levels.h.

Referenced by Create().

◆ MAX_TIMESTAMPS

uint32_t bicameral::sim::GpuImplicitLevels::MAX_TIMESTAMPS = 8
staticconstexpr

Definition at line 59 of file gpu_implicit_levels.h.

Referenced by Create(), and RecordTimestamp().


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