SBgl 0.1.0
A graphics framework in C99
Loading...
Searching...
No Matches
sbgl_VoxelSystem Struct Reference

Internal state for the voxel system. This structure adheres to Data-Oriented Design principles by maintaining contiguous arrays and minimizing pointer indirection. More...

Collaboration diagram for sbgl_VoxelSystem:

Data Fields

sbgl_Contextctx
 Pointer to the active engine context.
 
SblArena poolArena
 Arena for the CPU-side management pool for chunk slots.
 
VoxelPoolpool
 Pointer to the CPU-side management pool for chunk slots.
 
uint32_t chunk_radius
 Radius (in chunks) for visibility and generation logic.
 
bool enable_telemetry
 Enables console output for performance metrics.
 
sbgl_ComputePipeline genPipe
 Compute pipeline for initial chunk generation.
 
sbgl_ComputePipeline shellPipe
 Compute pipeline for shell/boundary processing.
 
sbgl_ComputePipeline cullPipe
 Compute pipeline for frustum culling and indirect command generation.
 
sbgl_Buffer maskBuf
 GPU buffer storing the presence mask for all active chunks.
 
sbgl_Buffer instBuf
 GPU buffer containing per-instance data for visible chunks.
 
sbgl_Buffer materialPaletteBuf
 GPU buffer storing the material palette attributes.
 
sbgl_Buffer aabbBuf [2]
 GPU buffer storing Axis-Aligned Bounding Boxes for culling. Double-buffered.
 
sbgl_AABBcpuAABB
 CPU-side mirror of AABB data to avoid mapping the previous frame's GPU buffer.
 
sbgl_Buffer indirectCmdBuf [2]
 Double-buffered GPU storage for indirect draw commands. Double buffering prevents CPU-GPU synchronization stalls during command recording.
 
sbgl_Buffer shellCountsBuf
 GPU storage for shell/active instance counts.
 
sbgl_ivec3 last_cam_chunk
 World-space chunk coordinates of the camera in the previous frame.
 
sbgl_Vec3 camera_pos
 Current world-space position of the camera.
 
uint32_t frame_idx
 Monotonically increasing index for double-buffer rotation.
 
uint64_t total_frames
 Total number of frames processed for LRU tracking.
 
float telemetry_timer
 Timer for periodic telemetry reporting.
 
uint32_t fps_frames
 Frame counter for FPS calculation.
 
double last_update_time
 Time of the previous update for delta calculation.
 

Detailed Description

Internal state for the voxel system. This structure adheres to Data-Oriented Design principles by maintaining contiguous arrays and minimizing pointer indirection.

Definition at line 70 of file sbgl_voxel.c.

Field Documentation

◆ aabbBuf

sbgl_Buffer sbgl_VoxelSystem::aabbBuf[2]

GPU buffer storing Axis-Aligned Bounding Boxes for culling. Double-buffered.

Definition at line 105 of file sbgl_voxel.c.

◆ camera_pos

sbgl_Vec3 sbgl_VoxelSystem::camera_pos

Current world-space position of the camera.

Definition at line 125 of file sbgl_voxel.c.

◆ chunk_radius

uint32_t sbgl_VoxelSystem::chunk_radius

Radius (in chunks) for visibility and generation logic.

Definition at line 81 of file sbgl_voxel.c.

◆ cpuAABB

sbgl_AABB* sbgl_VoxelSystem::cpuAABB

CPU-side mirror of AABB data to avoid mapping the previous frame's GPU buffer.

Definition at line 108 of file sbgl_voxel.c.

◆ ctx

sbgl_Context* sbgl_VoxelSystem::ctx

Pointer to the active engine context.

Definition at line 72 of file sbgl_voxel.c.

◆ cullPipe

sbgl_ComputePipeline sbgl_VoxelSystem::cullPipe

Compute pipeline for frustum culling and indirect command generation.

Definition at line 93 of file sbgl_voxel.c.

◆ enable_telemetry

bool sbgl_VoxelSystem::enable_telemetry

Enables console output for performance metrics.

Definition at line 84 of file sbgl_voxel.c.

◆ fps_frames

uint32_t sbgl_VoxelSystem::fps_frames

Frame counter for FPS calculation.

Definition at line 137 of file sbgl_voxel.c.

◆ frame_idx

uint32_t sbgl_VoxelSystem::frame_idx

Monotonically increasing index for double-buffer rotation.

Definition at line 128 of file sbgl_voxel.c.

◆ genPipe

sbgl_ComputePipeline sbgl_VoxelSystem::genPipe

Compute pipeline for initial chunk generation.

Definition at line 87 of file sbgl_voxel.c.

◆ indirectCmdBuf

sbgl_Buffer sbgl_VoxelSystem::indirectCmdBuf[2]

Double-buffered GPU storage for indirect draw commands. Double buffering prevents CPU-GPU synchronization stalls during command recording.

Definition at line 114 of file sbgl_voxel.c.

◆ instBuf

sbgl_Buffer sbgl_VoxelSystem::instBuf

GPU buffer containing per-instance data for visible chunks.

Definition at line 99 of file sbgl_voxel.c.

◆ last_cam_chunk

sbgl_ivec3 sbgl_VoxelSystem::last_cam_chunk

World-space chunk coordinates of the camera in the previous frame.

Definition at line 122 of file sbgl_voxel.c.

◆ last_update_time

double sbgl_VoxelSystem::last_update_time

Time of the previous update for delta calculation.

Definition at line 140 of file sbgl_voxel.c.

◆ maskBuf

sbgl_Buffer sbgl_VoxelSystem::maskBuf

GPU buffer storing the presence mask for all active chunks.

Definition at line 96 of file sbgl_voxel.c.

◆ materialPaletteBuf

sbgl_Buffer sbgl_VoxelSystem::materialPaletteBuf

GPU buffer storing the material palette attributes.

Definition at line 102 of file sbgl_voxel.c.

◆ pool

VoxelPool* sbgl_VoxelSystem::pool

Pointer to the CPU-side management pool for chunk slots.

Definition at line 78 of file sbgl_voxel.c.

◆ poolArena

SblArena sbgl_VoxelSystem::poolArena

Arena for the CPU-side management pool for chunk slots.

Definition at line 75 of file sbgl_voxel.c.

◆ shellCountsBuf

sbgl_Buffer sbgl_VoxelSystem::shellCountsBuf

GPU storage for shell/active instance counts.

Definition at line 119 of file sbgl_voxel.c.

◆ shellPipe

sbgl_ComputePipeline sbgl_VoxelSystem::shellPipe

Compute pipeline for shell/boundary processing.

Definition at line 90 of file sbgl_voxel.c.

◆ telemetry_timer

float sbgl_VoxelSystem::telemetry_timer

Timer for periodic telemetry reporting.

Definition at line 134 of file sbgl_voxel.c.

◆ total_frames

uint64_t sbgl_VoxelSystem::total_frames

Total number of frames processed for LRU tracking.

Definition at line 131 of file sbgl_voxel.c.


The documentation for this struct was generated from the following file: