SBgl 0.1.0
A graphics framework in C99
Loading...
Searching...
No Matches
SBgl Roadmap

SBgl is a bare-metal graphics framework in C99. This roadmap outlines the development milestones and technical goals.

HAL & Context Foundation

  • Define Internal Input HAL for decoupled physical input (sbgl_input.h)
  • Integrate arena allocator for zero-isolated-malloc allocation (sbl_arena.h)
  • Centralize shared opaque types to prevent C99 redefinition conflicts (sbgl_types.h)

Native Wayland & Vulkan Clear

  • Implement native Linux Wayland platform layer using XDG-Shell protocols
  • Implement Linux X11 platform layer for legacy display server support
  • Implement Win32 platform layer with full virtual key mapping
  • Implement Dynamic Vulkan Loading (no build-time link dependency)
  • Initialize Vulkan 1.3 with Dynamic Rendering enabled (no RenderPass boilerplate)
  • Implement automatic Swapchain recreation and window resizing support
  • Stabilization of Arena allocator for self-contained context management
  • Implement Data-Oriented Design (DOD) Input API for batch processing

Core Matrix & Math (simd-ready)

  • Implement SIMD-ready Vector math (Vec2, Vec3, Vec4) using SoA-friendly layouts
  • Implement Matrix math (Mat4) for 3D transformations
  • Implement Quaternion math for rotations

Camera System & Batch Collision

  • Implement Camera system (Orthographic and Perspective)
  • Implement Ray-casting and basic collision math optimized for batch testing

Vertex Buffers & Triangle Rendering

  • Implement Vertex Buffer and Index Buffer management with DOD alignment
  • Implement Shader loading and SPIR-V integration
  • Implement Batch-oriented Geometry rendering (Transformation pipelines)

Context-Based Backend Refactor (Multi-Context Support)

  • Transition graphics backend to use context-local state pointers
  • Enable multi-window and multi-threaded execution environments

API Standardization & Error Handling

  • Implement sbgl_Result status tracking in the context
  • Standardize naming conventions across the public API surface
  • Implement split error architecture (core sbgl_Result + backend VkResult detail)
  • Implement categorized logging system with file output and rotation
  • Implement platform layer error propagation via sbgl_platform_Result
  • Implement validation layer integration with debug callback routing

GPU Optimization & Batching (MDI/Bit-packing)

  • Implement Bit-Packing for vertex data (32-bit compressed formats)
  • Implement 16-byte Command Packet Header (Mesh/Material/Flag packing)
  • Implement Procedural Vertex Generation using gl_VertexIndex
  • Implement Shader Storage Buffer Objects (SSBOs) for per-instance data
  • Implement Multi-Draw Indirect (MDI) for single-call batching
  • Implement Persistent Transient GPU Buffers (eliminated per-frame allocations)
  • Optimize Radix Sort for 8-bit passes and hot-path zero-allocation
  • Implement Greedy Meshing algorithms (Replaced by GPU Procedural Synthesis)
  • Implement Infinite Voxel World (2.5D Chunked Instancing)
  • Granular Profiling (per-queue timestamps)

Multi-Threaded Architecture

Thread-Local Memory

  • Implement thread-local SblArena per worker thread to eliminate allocator contention
  • Add per-frame ring buffers for transient allocations with thread-safe recycling
  • Implement thread-safe memory allocation interface for shared GPU resources

Parallel Command Recording

  • Implement VkCommandBuffer Secondary Buffers for parallel recording across threads
  • Add lock-free render queue submission with thread-safe packet merging
  • Implement per-thread command recording contexts with automatic synchronization
  • Add synchronization barriers between recording and submission phases

Job System Foundation

  • Implement data-parallel job dispatch system with work-stealing queues
  • Add dependency graph-based job scheduling (lock-free, no mutex in hot path)
  • Implement frame-to-frame job handoff without global synchronization points
  • Add job profiling and bottleneck analysis tooling

Multi-Context & Multi-Window

  • Enable true multi-window with independent rendering threads per window
  • Add thread-safe context sharing for cross-window resource management
  • Implement thread-local input state processing with consolidated event dispatch
  • Add GPU fence-based synchronization for cross-thread resource lifetime

Synchronization Strategy

  • Implement fine-grained locking for shared data structures
  • Add lock-free data structures for high-frequency subsystems (render queues, input)
  • Implement multi-fence GPU synchronization for parallel frame processing
  • Add pipeline stage profiling to identify synchronization bottlenecks

High-Level rendering (Text/Sprites)

  • Implement 2D Sprite batching system (utilizing MDI)
  • Implement Text rendering using signed-distance fields (SDF)
  • Implement Primitive batching (Circles, Lines, Gradients)
  • Implement Render-to-texture support
  • Implement Post-processing pipeline

Future Considerations

  • Full 3D Voxel Grid rendering (Caves, Overhangs)
  • macOS Platform Layer (Cocoa) and MoltenVK integration
  • Android/NDK Platform support
  • WebAssembly (Wasm) backend via WebGPU
  • Audio HAL and Backend