Bicameral Engine
GPU-resident engine for a magic-research open-world game
Loading...
Searching...
No Matches
bicameral::sim::anonymous_namespace{gpu_multires.cpp} Namespace Reference

Classes

struct  RefineRecord
struct  ActivityHeader
struct  ObserverRecord
struct  ChainRecord

Enumerations

enum  Entry : uint8_t { EntryRefine , EntryCoarsenRequest , EntryPullBack , EntryRemoveShadow }
enum  ActivityEntry : uint8_t { ActivityEntrySeed , ActivityEntryObserver , ActivityEntryExpand }
enum  TreePass : uint8_t {
  PassResolve , PassSettle , PassAllocate , PassRelease ,
  PassClearIndex , PassFillIndex , PassQuiet , PassExpand ,
  PassFoldCheck , PassFold , PassFractions , PassQuietCheck
}
enum  ConductPass : uint8_t {
  ConductPassBegin , ConductPassMark , ConductPassPrepare , ConductPassFlows ,
  ConductPassApply , ConductPassEnd
}

Functions

uint32_t ImplicitFlags (const MultiresStepOptions &options)
uint32_t SubcycleFlags (uint32_t flags, const MultiresStepOptions &options, uint32_t substep)
uint32_t GroupsFor (uint32_t threads, uint32_t perGroup)
template<typename T>
ComPtr< ID3D12Resource > CreateFilledUpload (ID3D12Device *device, std::span< const T > data)
bool WriteUpload (ID3D12Resource *upload, std::span< const std::byte > bytes)
std::expected< ComPtr< ID3D12PipelineState >, std::string > LoadComputePipeline (ID3D12Device5 *device, ID3D12RootSignature *rootSignature, const char *path)
void UavBarrier (ID3D12GraphicsCommandList10 *list)

Variables

constexpr uint32_t ROOT_CONSTANT_COUNT = 25
constexpr uint32_t EXTERNAL_VIEW_FIRST = 4
constexpr uint32_t UAV_COUNT = 14
constexpr uint32_t ACTIVITY_VIEW = 13
constexpr gpu::RootSignatureLayout ROOT_LAYOUT
constexpr uint32_t TREE_THREADS = 64
constexpr std::array< const char *, 12 > TREE_SHADERS
constexpr std::array< const char *, 6 > CONDUCT_SHADERS
constexpr uint32_t STEP_FLAG_CONDUCTION = 1
constexpr uint32_t STEP_FLAG_LISTED = 2
constexpr uint32_t STEP_FLAG_SUBSTEP_WAKE = 4
constexpr uint32_t STEP_FLAG_WAKE_SEEDS = 16
constexpr uint32_t STEP_FLAG_IMPLICIT = 8
constexpr uint32_t STEP_IMPLICIT_GAP_SHIFT = 5
constexpr uint32_t MAX_GPU_IMPLICIT_GAP = 8
constexpr uint32_t STEP_FLAG_BITS = 0xFF
constexpr uint32_t STEP_SUBSTEP_SHIFT = 8
constexpr uint32_t STEP_GAP_SHIFT = 14
constexpr uint32_t STEP_BASE_SHIFT = 16
constexpr uint32_t WAKE_THREADS = 64
constexpr uint64_t CONDUCT_MARK_BYTES = 16 * sizeof(uint32_t)
constexpr uint64_t CONDUCT_DELTA_BYTES = 16
constexpr uint32_t GRAPH_INPUT_REFINE_HEADER = 0
constexpr uint32_t GRAPH_INPUT_COARSEN_HEADER = 32
constexpr uint32_t REFINE_RECORD_BYTES = 24
constexpr uint32_t GRAPH_INPUT_BYTES = 64 + ((REFINE_RECORD_BYTES + 4) * (MR_MAX_REQUESTS + 1))
constexpr uint32_t GRAPH_INPUT_EXPAND_HEADER = (GRAPH_INPUT_BYTES + 15) & ~15u
constexpr std::array< uint32_t, 4 > GRAPH_INPUT_CONDUCT_HEADERS
constexpr uint32_t GRAPH_INPUT_EXPAND_RECORDS = GRAPH_INPUT_EXPAND_HEADER + 160
constexpr uint64_t ACTIVITY_EMPTY_BYTES = sizeof(ActivityHeader) + sizeof(uint32_t)
constexpr uint64_t ACTIVITY_EMPTY_STRIDE = 64
constexpr uint64_t ACTIVITY_FIRST_OFFSET = 2 * ACTIVITY_EMPTY_STRIDE
constexpr uint64_t REQUEST_UPLOAD_BYTES = (uint64_t{MR_MAX_REQUESTS} * sizeof(MrRequest)) + 256

Enumeration Type Documentation

◆ ActivityEntry

enum bicameral::sim::anonymous_namespace{gpu_multires.cpp}::ActivityEntry : uint8_t
Enumerator
ActivityEntrySeed 
ActivityEntryObserver 
ActivityEntryExpand 

Definition at line 45 of file gpu_multires.cpp.

◆ ConductPass

enum bicameral::sim::anonymous_namespace{gpu_multires.cpp}::ConductPass : uint8_t
Enumerator
ConductPassBegin 
ConductPassMark 
ConductPassPrepare 
ConductPassFlows 
ConductPassApply 
ConductPassEnd 

Definition at line 69 of file gpu_multires.cpp.

◆ Entry

enum bicameral::sim::anonymous_namespace{gpu_multires.cpp}::Entry : uint8_t
Enumerator
EntryRefine 
EntryCoarsenRequest 
EntryPullBack 
EntryRemoveShadow 

Definition at line 37 of file gpu_multires.cpp.

◆ TreePass

enum bicameral::sim::anonymous_namespace{gpu_multires.cpp}::TreePass : uint8_t
Enumerator
PassResolve 
PassSettle 
PassAllocate 
PassRelease 
PassClearIndex 
PassFillIndex 
PassQuiet 
PassExpand 
PassFoldCheck 
PassFold 
PassFractions 
PassQuietCheck 

Definition at line 48 of file gpu_multires.cpp.

Function Documentation

◆ CreateFilledUpload()

template<typename T>
ComPtr< ID3D12Resource > bicameral::sim::anonymous_namespace{gpu_multires.cpp}::CreateFilledUpload ( ID3D12Device * device,
std::span< const T > data )

Definition at line 190 of file gpu_multires.cpp.

References bicameral::gpu::CreateBuffer(), CreateFilledUpload(), and bicameral::gpu::Upload.

Referenced by CreateFilledUpload().

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

◆ GroupsFor()

uint32_t bicameral::sim::anonymous_namespace{gpu_multires.cpp}::GroupsFor ( uint32_t threads,
uint32_t perGroup )

Definition at line 180 of file gpu_multires.cpp.

References GroupsFor().

Referenced by GroupsFor().

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

◆ ImplicitFlags()

uint32_t bicameral::sim::anonymous_namespace{gpu_multires.cpp}::ImplicitFlags ( const MultiresStepOptions & options)

Definition at line 99 of file gpu_multires.cpp.

References bicameral::sim::MultiresStepOptions::implicitConduction, ImplicitFlags(), bicameral::sim::MultiresStepOptions::implicitMaxGap, MAX_GPU_IMPLICIT_GAP, bicameral::sim::MultiresStepOptions::maxSubcycleGap, STEP_FLAG_IMPLICIT, and STEP_IMPLICIT_GAP_SHIFT.

Referenced by ImplicitFlags(), and SubcycleFlags().

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

◆ LoadComputePipeline()

std::expected< ComPtr< ID3D12PipelineState >, std::string > bicameral::sim::anonymous_namespace{gpu_multires.cpp}::LoadComputePipeline ( ID3D12Device5 * device,
ID3D12RootSignature * rootSignature,
const char * path )

Definition at line 217 of file gpu_multires.cpp.

References bicameral::gpu::CreateComputePipeline(), LoadComputePipeline(), and bicameral::gpu::LoadShader().

Referenced by LoadComputePipeline().

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

◆ SubcycleFlags()

uint32_t bicameral::sim::anonymous_namespace{gpu_multires.cpp}::SubcycleFlags ( uint32_t flags,
const MultiresStepOptions & options,
uint32_t substep )

Definition at line 112 of file gpu_multires.cpp.

References ImplicitFlags(), bicameral::sim::MultiresStepOptions::maxSubcycleGap, bicameral::sim::MULTIRES_MAX_SUBCYCLE_GAP, STEP_BASE_SHIFT, STEP_FLAG_BITS, STEP_GAP_SHIFT, STEP_SUBSTEP_SHIFT, bicameral::sim::MultiresStepOptions::subcycleBaseLevel, and SubcycleFlags().

Referenced by SubcycleFlags().

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

◆ UavBarrier()

void bicameral::sim::anonymous_namespace{gpu_multires.cpp}::UavBarrier ( ID3D12GraphicsCommandList10 * list)

Definition at line 231 of file gpu_multires.cpp.

References bicameral::gpu::UavBarrier(), and UavBarrier().

Referenced by UavBarrier().

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

◆ WriteUpload()

bool bicameral::sim::anonymous_namespace{gpu_multires.cpp}::WriteUpload ( ID3D12Resource * upload,
std::span< const std::byte > bytes )

Definition at line 204 of file gpu_multires.cpp.

References WriteUpload().

Referenced by WriteUpload().

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

Variable Documentation

◆ ACTIVITY_EMPTY_BYTES

uint64_t bicameral::sim::anonymous_namespace{gpu_multires.cpp}::ACTIVITY_EMPTY_BYTES = sizeof(ActivityHeader) + sizeof(uint32_t)
constexpr

Definition at line 167 of file gpu_multires.cpp.

◆ ACTIVITY_EMPTY_STRIDE

uint64_t bicameral::sim::anonymous_namespace{gpu_multires.cpp}::ACTIVITY_EMPTY_STRIDE = 64
constexpr

Definition at line 168 of file gpu_multires.cpp.

◆ ACTIVITY_FIRST_OFFSET

uint64_t bicameral::sim::anonymous_namespace{gpu_multires.cpp}::ACTIVITY_FIRST_OFFSET = 2 * ACTIVITY_EMPTY_STRIDE
constexpr

Definition at line 169 of file gpu_multires.cpp.

◆ ACTIVITY_VIEW

uint32_t bicameral::sim::anonymous_namespace{gpu_multires.cpp}::ACTIVITY_VIEW = 13
constexpr

Definition at line 32 of file gpu_multires.cpp.

◆ CONDUCT_DELTA_BYTES

uint64_t bicameral::sim::anonymous_namespace{gpu_multires.cpp}::CONDUCT_DELTA_BYTES = 16
constexpr

Definition at line 124 of file gpu_multires.cpp.

◆ CONDUCT_MARK_BYTES

uint64_t bicameral::sim::anonymous_namespace{gpu_multires.cpp}::CONDUCT_MARK_BYTES = 16 * sizeof(uint32_t)
constexpr

Definition at line 123 of file gpu_multires.cpp.

◆ CONDUCT_SHADERS

std::array<const char*, 6> bicameral::sim::anonymous_namespace{gpu_multires.cpp}::CONDUCT_SHADERS
constexpr
Initial value:
= {
"sim/multires_conduct_begin.cso", "sim/multires_conduct_mark.cso", "sim/multires_conduct_prepare.cso",
"sim/multires_conduct_flows.cso", "sim/multires_conduct_apply.cso", "sim/multires_conduct_end.cso"}

Definition at line 77 of file gpu_multires.cpp.

◆ EXTERNAL_VIEW_FIRST

uint32_t bicameral::sim::anonymous_namespace{gpu_multires.cpp}::EXTERNAL_VIEW_FIRST = 4
constexpr

Definition at line 30 of file gpu_multires.cpp.

◆ GRAPH_INPUT_BYTES

uint32_t bicameral::sim::anonymous_namespace{gpu_multires.cpp}::GRAPH_INPUT_BYTES = 64 + ((REFINE_RECORD_BYTES + 4) * (MR_MAX_REQUESTS + 1))
constexpr

Definition at line 130 of file gpu_multires.cpp.

◆ GRAPH_INPUT_COARSEN_HEADER

uint32_t bicameral::sim::anonymous_namespace{gpu_multires.cpp}::GRAPH_INPUT_COARSEN_HEADER = 32
constexpr

Definition at line 128 of file gpu_multires.cpp.

◆ GRAPH_INPUT_CONDUCT_HEADERS

std::array<uint32_t, 4> bicameral::sim::anonymous_namespace{gpu_multires.cpp}::GRAPH_INPUT_CONDUCT_HEADERS
constexpr

◆ GRAPH_INPUT_EXPAND_HEADER

uint32_t bicameral::sim::anonymous_namespace{gpu_multires.cpp}::GRAPH_INPUT_EXPAND_HEADER = (GRAPH_INPUT_BYTES + 15) & ~15u
constexpr

Definition at line 131 of file gpu_multires.cpp.

◆ GRAPH_INPUT_EXPAND_RECORDS

uint32_t bicameral::sim::anonymous_namespace{gpu_multires.cpp}::GRAPH_INPUT_EXPAND_RECORDS = GRAPH_INPUT_EXPAND_HEADER + 160
constexpr

Definition at line 136 of file gpu_multires.cpp.

◆ GRAPH_INPUT_REFINE_HEADER

uint32_t bicameral::sim::anonymous_namespace{gpu_multires.cpp}::GRAPH_INPUT_REFINE_HEADER = 0
constexpr

Definition at line 127 of file gpu_multires.cpp.

◆ MAX_GPU_IMPLICIT_GAP

uint32_t bicameral::sim::anonymous_namespace{gpu_multires.cpp}::MAX_GPU_IMPLICIT_GAP = 8
constexpr

Definition at line 88 of file gpu_multires.cpp.

Referenced by ImplicitFlags().

◆ REFINE_RECORD_BYTES

uint32_t bicameral::sim::anonymous_namespace{gpu_multires.cpp}::REFINE_RECORD_BYTES = 24
constexpr

Definition at line 129 of file gpu_multires.cpp.

◆ REQUEST_UPLOAD_BYTES

uint64_t bicameral::sim::anonymous_namespace{gpu_multires.cpp}::REQUEST_UPLOAD_BYTES = (uint64_t{MR_MAX_REQUESTS} * sizeof(MrRequest)) + 256
constexpr

Definition at line 178 of file gpu_multires.cpp.

◆ ROOT_CONSTANT_COUNT

uint32_t bicameral::sim::anonymous_namespace{gpu_multires.cpp}::ROOT_CONSTANT_COUNT = 25
constexpr

Definition at line 29 of file gpu_multires.cpp.

◆ ROOT_LAYOUT

gpu::RootSignatureLayout bicameral::sim::anonymous_namespace{gpu_multires.cpp}::ROOT_LAYOUT
constexpr
Initial value:
{
.uavCount = UAV_COUNT, .rootConstantCount = ROOT_CONSTANT_COUNT, .debugRing = true, .srvCount = 4}

Definition at line 33 of file gpu_multires.cpp.

◆ STEP_BASE_SHIFT

uint32_t bicameral::sim::anonymous_namespace{gpu_multires.cpp}::STEP_BASE_SHIFT = 16
constexpr

Definition at line 92 of file gpu_multires.cpp.

Referenced by SubcycleFlags().

◆ STEP_FLAG_BITS

uint32_t bicameral::sim::anonymous_namespace{gpu_multires.cpp}::STEP_FLAG_BITS = 0xFF
constexpr

Definition at line 89 of file gpu_multires.cpp.

Referenced by SubcycleFlags().

◆ STEP_FLAG_CONDUCTION

uint32_t bicameral::sim::anonymous_namespace{gpu_multires.cpp}::STEP_FLAG_CONDUCTION = 1
constexpr

Definition at line 82 of file gpu_multires.cpp.

◆ STEP_FLAG_IMPLICIT

uint32_t bicameral::sim::anonymous_namespace{gpu_multires.cpp}::STEP_FLAG_IMPLICIT = 8
constexpr

Definition at line 86 of file gpu_multires.cpp.

Referenced by ImplicitFlags().

◆ STEP_FLAG_LISTED

uint32_t bicameral::sim::anonymous_namespace{gpu_multires.cpp}::STEP_FLAG_LISTED = 2
constexpr

Definition at line 83 of file gpu_multires.cpp.

◆ STEP_FLAG_SUBSTEP_WAKE

uint32_t bicameral::sim::anonymous_namespace{gpu_multires.cpp}::STEP_FLAG_SUBSTEP_WAKE = 4
constexpr

Definition at line 84 of file gpu_multires.cpp.

◆ STEP_FLAG_WAKE_SEEDS

uint32_t bicameral::sim::anonymous_namespace{gpu_multires.cpp}::STEP_FLAG_WAKE_SEEDS = 16
constexpr

Definition at line 85 of file gpu_multires.cpp.

◆ STEP_GAP_SHIFT

uint32_t bicameral::sim::anonymous_namespace{gpu_multires.cpp}::STEP_GAP_SHIFT = 14
constexpr

Definition at line 91 of file gpu_multires.cpp.

Referenced by SubcycleFlags().

◆ STEP_IMPLICIT_GAP_SHIFT

uint32_t bicameral::sim::anonymous_namespace{gpu_multires.cpp}::STEP_IMPLICIT_GAP_SHIFT = 5
constexpr

Definition at line 87 of file gpu_multires.cpp.

Referenced by ImplicitFlags().

◆ STEP_SUBSTEP_SHIFT

uint32_t bicameral::sim::anonymous_namespace{gpu_multires.cpp}::STEP_SUBSTEP_SHIFT = 8
constexpr

Definition at line 90 of file gpu_multires.cpp.

Referenced by SubcycleFlags().

◆ TREE_SHADERS

std::array<const char*, 12> bicameral::sim::anonymous_namespace{gpu_multires.cpp}::TREE_SHADERS
constexpr
Initial value:
= {
"sim/multires_tree_resolve.cso", "sim/multires_tree_settle.cso", "sim/multires_tree_allocate.cso",
"sim/multires_tree_release.cso", "sim/multires_tree_clear_index.cso", "sim/multires_tree_fill_index.cso",
"sim/multires_tree_quiet.cso", "sim/multires_tree_expand.cso", "sim/multires_tree_fold_check.cso",
"sim/multires_tree_fold.cso", "sim/multires_tree_fractions.cso", "sim/multires_tree_quiet_check.cso"}

Definition at line 62 of file gpu_multires.cpp.

◆ TREE_THREADS

uint32_t bicameral::sim::anonymous_namespace{gpu_multires.cpp}::TREE_THREADS = 64
constexpr

Definition at line 35 of file gpu_multires.cpp.

◆ UAV_COUNT

uint32_t bicameral::sim::anonymous_namespace{gpu_multires.cpp}::UAV_COUNT = 14
constexpr

Definition at line 31 of file gpu_multires.cpp.

◆ WAKE_THREADS

uint32_t bicameral::sim::anonymous_namespace{gpu_multires.cpp}::WAKE_THREADS = 64
constexpr

Definition at line 95 of file gpu_multires.cpp.