Skip to content

Synapse Engine v2.0.0 - Fully GPU-Driven & Data-Oriented Architecture#1

Merged
TamasPetii merged 144 commits into
mainfrom
remake
Apr 3, 2026
Merged

Synapse Engine v2.0.0 - Fully GPU-Driven & Data-Oriented Architecture#1
TamasPetii merged 144 commits into
mainfrom
remake

Conversation

@TamasPetii

Copy link
Copy Markdown
Owner

Pull Request: Synapse Engine v2.0.0 - Fully GPU-Driven & Data-Oriented Architecture

Overview

This pull request introduces a massive 150-commit rewrite of the Synapse Engine.

The architecture has been completely migrated from a legacy Object-Oriented, CPU-bound model to a strict Data-Oriented Design (DOD) approach.

The rendering backend is now a 100% GPU-driven, bindless Vulkan pipeline utilizing Multi-Draw Indirect (MDI) and Mesh Shaders.


Core Architecture & ECS

Segmented Entity Pool (ECS)

Replaced the legacy ECS with a cache-friendly memory layout that categorizes entities into:

  • Static
  • Dynamic
  • Streamed

This improves memory locality and significantly reduces cache misses during system iteration.

Dynamic Skipping Optimization

System iterations now track pool states to automatically skip unchanged dynamic components, drastically reducing CPU overhead.

Massive Multithreading (Taskflow)

Integrated Taskflow to fully parallelize the engine loop.

The following operations are now executed asynchronously through a dependency graph:

  • system updates
  • Assimp mesh loading
  • animation loading
  • GPU buffer staging

MVI Editor UI

Implemented a Model-View-Intent (MVI) architecture for the ImGui editor with full support for:

  • Undo / Redo
  • Gizmo state management

Physics & Dependencies

Integrated Jolt Physics as the physics backend.

Dependency management has been transitioned to vcpkg (manifest mode).

Additional serialization support added with Boost.JSON.


GPU-Driven Rendering Pipeline

Bindless MDI Pipeline

The entire scene dispatch now relies on:

  • a single global instance buffer
  • a global indirect draw command buffer

Using:

  • vkCmdDrawIndirectCount
  • vkCmdDrawMeshTasksIndirectCountEXT

Dual Pipeline Execution

Meshes can dynamically switch between:

  • Traditional Pipeline → Vertex / Fragment
  • Mesh Shader Pipeline → Task / Mesh

Both can coexist in the same scene.

WBOIT Integration

Implemented Weighted Blended Order-Independent Transparency (WBOIT) for transparent materials.

This guarantees accurate blending without depth sorting.

O(1) Render Submission

The entire complex scene is submitted in exactly 8 draw calls.

Draw calls are strictly categorized by:

  • pipeline type
  • material type
  • transparency
  • culling side

Categories:

  • Traditional Opaque 1-sided
  • Traditional Opaque 2-sided
  • Traditional Transparent 1-sided
  • Traditional Transparent 2-sided
  • Mesh Opaque 1-sided
  • Mesh Opaque 2-sided
  • Mesh Transparent 1-sided
  • Mesh Transparent 2-sided

Global Material Indirection

Introduced a GPU-side Material Lookup Table.

This allows instances sharing the same base mesh to override materials without breaking the batch.


Advanced Culling Systems

2-Phase Compute Culling

Implemented a fully GPU-driven 2-phase culling pipeline.

Phase 1 — Model-Level Culling

Performs:

  • frustum culling
  • occlusion culling

Using bounding spheres and aabb.

Phase 2 — Mesh-Level Culling

Individual meshes are culled through Indirect Compute Dispatch.

Subgroup Optimizations

Replaced standard atomics with Subgroup Operations in compute shaders.

Used specifically for incrementing Indirect Draw Command instance counters.

Task Shader Culling

Integrated meshlet-level culling directly into the Task Shader stage.

Invisible geometry is rejected before reaching the mesh stage.

Light Culling

Implemented dedicated GPU and CPU-driven culling passes for:

  • Point Lights
  • Spot Lights

HiZ Map Generation

Rewrote the Hierarchical Z-Buffer generator.

Now safely handles odd-resolution texture edge cases for accurate occlusion culling.


Assets, Dynamic LODs & Animation

Offset-Based Dynamic LODs

Integrated meshoptimizer to generate:

  • up to 4 LOD levels
  • meshlets per mesh

LOD selection is performed dynamically at runtime based on camera distance.

Uses offset descriptors, eliminating unnecessary index buffer duplication.

Vertex Pulling Animation

Rewrote skeletal animation to work without baked bone data in the vertex struct.

Animations now use:

  • bindless vertex pulling
  • separate animation address buffers

This allows the same vertex shader to process both:

  • static meshes
  • animated meshes

Per-Frame Animated Colliders

The ColliderProcessor now calculates accurate:

  • bounding spheres
  • AABBs

for animated models every frame on background threads.

This data is fed into GPU culling passes.

Unified Image Architecture

Created a unified image processing pipeline:

  • ImageBuilder
  • ImageSource (File / Procedural)
  • ImageProcessor

Supports:

  • runtime CPU mipmap generation
  • runtime GPU mipmap generation
  • procedural height map generation

Tooling, Profiling & Debugging

Vulkan Timestamp Profiler

Built a custom stall-free, N-buffered GPU Timestamp Query profiler.

Integrated with:

  • in-engine dashboard
  • file logger

Tracks pass-by-pass timings for:

  • Compute
  • Graphics
  • Transfer

All measured in milliseconds.

Visual Collider Debugging

Added 1-draw-call collider visualization for:

  • sphere colliders
  • AABB colliders
  • model level
  • mesh level
  • meshlet level

Editor Depth Pass for WBOIT

Added a secondary:

  • depth pass
  • EntityID pass

for transparent objects.

This solves the WBOIT depth-write issue and enables:

  • pixel-perfect mouse picking
  • accurate Gizmo manipulation

inside the editor.


Summary

This PR represents a complete next-generation engine architecture overhaul, focused on:

  • GPU-driven rendering
  • data-oriented systems
  • aggressive batching
  • advanced compute culling
  • modern mesh shader workflows
  • scalable tooling and profiling

The result is a significantly more scalable, cache-efficient, and high-performance rendering engine.

…ings.

- Vcpkg will download all the necessary packages, headers, libs, dlls.
…/registry test + CI/CD google test pipeline added
…n (VK_EXT_shader_object)

- Changed vcpkg to be static-md -> To fix shaderc and spriv reflection diamond lib include problems!!!
- BinarySemaphore
- TimelineSemaphore
- Fence
@TamasPetii TamasPetii self-assigned this Apr 3, 2026
@TamasPetii TamasPetii merged commit 41a6878 into main Apr 3, 2026
1 check failed
@TamasPetii TamasPetii deleted the remake branch May 14, 2026 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant