Repository navigation
Hardware Acceleration Systems
Audience: Programmers
Thread Context: GPU work is submitted from the main render thread. Async compute is D3D11 immediate-dispatch today, designed for D3D12/Vulkan async queues later. DXR TLAS is rebuilt per frame inside
GraphicsEngine::RenderScene().Platform/Backend Scope: D3D11/D3D12 primary on Windows. All D3D code is behind
#ifdef SPARK_PLATFORM_WINDOWSwith stub fallbacks. Mesh shaders are D3D12/Vulkan only (D3D11 falls back to traditional rendering). DirectStorage uses an async-I/O fallback on all platforms (SDK not linked). DXR is gated behindSPARK_HARDWARE_RT.
SparkEngine implements GPU hardware acceleration across eight systems: GPU compute particles, GPU skinning, async compute scheduling, GPU-driven indirect rendering, DXR ray tracing, GPU clustered light culling, DirectStorage I/O, and a mesh-shader pipeline. Much of the infrastructure had been built but not wired; this work activated existing systems and added new GPU-driven capabilities.
All files confirmed present 2026-06-08.
| System | Header | Impl | Shaders | Tests |
|---|---|---|---|---|
| GPU Compute Particles | Graphics/GPUParticleSystem.h |
GPUParticleSystem.cpp |
ParticleSimulate/Emit/BitonicSort.hlsl |
TestGPUParticleSystem.cpp (11) |
| GPU Skinning | Graphics/GPUSkinning.h |
GPUSkinning.cpp |
SkinningCS.hlsl |
TestGPUSkinning.cpp (9) |
| Async Compute | Graphics/AsyncComputeScheduler.h |
AsyncComputeScheduler.cpp |
— |
TestAsyncComputeScheduler.cpp (9) |
| GPU-Driven Renderer | Graphics/GPUDrivenRenderer.h |
GPUDrivenRenderer.cpp |
GPUCull.hlsl, HiZBuild.hlsl
|
TestGPUDrivenRenderer.cpp (12) |
| GPU Cluster Culling | Graphics/GPUClusterCulling.h |
GPUClusterCulling.cpp |
ClusterCull.hlsl |
TestGPUClusterCulling.cpp (11) |
| DirectStorage | Engine/Streaming/DirectStorageLoader.h |
DirectStorageLoader.cpp |
— |
TestDirectStorageLoader.cpp (11) |
| Mesh Shader Pipeline | Graphics/MeshShaderPipeline.h |
MeshShaderPipeline.cpp |
MeshletMS/AS.hlsl |
TestMeshShaderPipeline.cpp (9) |
-
DXR — wired into
GraphicsEngine::RenderScene(). Verified 2026-06-08 inSparkEngine/Source/Graphics/GraphicsEngineWindows.cpp: under#ifdef SPARK_HARDWARE_RT, the renderer rebuilds the TLAS each frame (dxr.BuildTLAS(m_dxrInstances)) and dispatches enabled RT effects (reflections, shadows, AO, GI). AHybridRTpath selectsRayTracingBackend::HardwareDXRwhen available.
Note on file layout: the original audit placed the DXR hook in
GraphicsEngine.cpp. The renderer has since been split per-platform; the DXR wiring now lives inGraphicsEngineWindows.cpp(withGraphicsRenderPipelinesWindows.cppalso referencingSPARK_HARDWARE_RT). Supporting RT code:Graphics/RHI/DXRSupport.{h,cpp},Graphics/HybridRT/HybridRTManager.cpp, andGraphics/RHI/Metal/MetalRayTracing.mmfor the Metal backend.
- All D3D11 code behind
#ifdef SPARK_PLATFORM_WINDOWSwith stub fallbacks. - GPU particles use append/consume structured buffers + bitonic sort.
- GPU skinning stores bones as compact 4×3 matrices (48 bytes vs 64 for 4×4).
- Async compute is D3D11 immediate-dispatch now, designed for D3D12/Vulkan async queues later.
- GPU-driven renderer: HiZ + frustum-cull compute shader → visibility buffer → indirect draw.
- DirectStorage exposes the full API with a transparent async-file-I/O fallback.
- Mesh-shader pipeline includes a meshlet builder with greedy triangle packing.
- Compute shaders:
Shaders/HLSL/Compute/ - Mesh shaders:
Shaders/HLSL/MeshShaders/ - C++ systems:
SparkEngine/Source/Graphics/ - DirectStorage:
SparkEngine/Source/Engine/Streaming/ - Tests:
Tests/(7 files, ~72 tests)
-
GPUParticleSystem.cppexceeds the ~500-line guideline but is one cohesive unit. - The mesh-shader pipeline is D3D12/Vulkan only; D3D11 falls back to traditional rendering.
- DirectStorage currently uses the fallback path on all platforms — verified 2026-06-08 in
DirectStorageLoader.cpp: comments note "async I/O fallback since full queue integration requires a D3D12 device" and "DirectStorage is Windows-only; Linux/macOS use async I/O fallback." The SDK is not linked.
- Original entry:
.claude/knowledge/hardware-acceleration-systems.md(last updated 2026-03-28). - Verified against codebase 2026-06-08.
Status changes / verifications found during freshening:
- All 7 new-system header/impl pairs and all 7 test files confirmed present.
-
DXR wiring moved file: now in
GraphicsEngineWindows.cpp(the renderer was split per-platform), notGraphicsEngine.cpp.BuildTLASper-frame call andSPARK_HARDWARE_RTgate confirmed. - DirectStorage still on the fallback path (SDK not linked) — confirmed by in-file comments.
- Metal ray-tracing backend (
MetalRayTracing.mm) now present alongside the DXR/HybridRT paths. - No regressions; all named systems still present.
Published from 2b03dc797148. Edit the canonical source in wiki/.
- Documentation
- Docs route
- Wiki index
- Guides
- Tutorials
- Samples
- Examples
- API Reference
- API route
- Reference
- Build Guide
- Dependencies
- FAQ
- Changelog
- Roadmap
- Contributing
- Code of Conduct
- Home
- FAQ
- Getting Started
- Quick-Start Tutorial
- Making Your First Game
- Making Your First Multiplayer Game
- Artist Workflow Guide
- Editor Walkthrough
- Migration Guide
- How SparkEngine Works
- Architecture Overview
- Engine Architecture Flowchart
- Creating a Game Module
- Game Modules (catalog)
- Entity Component System
- Rendering and Graphics
- Physics
- Cloth Simulation
- Audio
- Input System
- Camera System
- Scripting with AngelScript
- Visual Scripting
- AI and Navigation
- Animation
- 2D Systems
- Networking
- Dedicated Server
- Multiplayer Quick Start
- Area Server Architecture
- Scene Management
- Large World Support
- Collaborative Editing
- Coroutine System
- Event System
- Event Response System
- Job System
- UI System
- UI Layout Extensions
- Localization
- Dialogue System
- Destruction System
- Replay System
- Achievement System
- Loading System
- Mod System
- Content Delivery
- Tween System
- Memory Integrity
- Gameplay Systems
- Terrain and Procedural Generation
- Save System
- Persistence System
- Day Night Cycle and Weather
- Cinematic Sequencer
- Runtime Prefabs
- SparkEditor
- Editor Tutorials
- SparkConsole
- SparkDaemon
- Shader Pipeline
- Asset Pipeline
- Asset Validation
- Asset Migration
- Game Packaging
- Online Services
- DataTable System
- Loot and Crafting System
- CSG System
- Font System
- Timer Manager
- Movie Render Pipeline
- HLOD and World Partition
- Remote Debug System
- Selection Manager
- Asset Dependency Graph
- Editor Automation
- File Watcher
- Project Templates
- System Requirements
- VR Support
- Mobile Platform
- Accessibility
- Platform Input
- Platform Certification
- Cross-Compilation: Wine Testing
- RHI Abstraction Layer
- D3D11 Backend
- D3D12 Backend
- Vulkan Backend
- OpenGL Backend
- Metal Backend
- DXR Raytracing
- Hybrid Ray Tracing
- Upscaling (DLSS/FSR)
- Render Graph
- Shader Graph
- GPU Particles
- GPU-Driven Rendering
- Volumetric Fog
- Volumetric Clouds
- Global Illumination
- Virtual Texturing
- Water Rendering
- Clustered Lighting
- Material System
- Post-Processing
- Shadow System
- Particle System
- Decal System
- Sky and Atmosphere
- Foliage System
- Mesh Shaders
- Neural Rendering
- Configuration Reference
- Performance Tips
- Benchmark Framework
- Threading Model
- Fuzz Policy and Parser Security
- Memory Safety
- Memory Management Patterns
- Build System and CMake Modules
- Profiler and Debugging
- Performance Profiling Guide
- Telemetry System
- Crash Reporting
- Golden Image Testing
- Utilities
- Testing
- Fuzz Policy and Parser Security
- Codebase Statistics
- Codebase Health
- Error Handling Patterns
- Hot Reload Overview
- Troubleshooting
- Contributing
- Workflow Patterns
- Build Optimizations
- CI Reproducible Builds
- GitHub API and PR Checks
- Git Rebase Conflicts
- Clang-Format
- Code Quality Violations
- AI Bloat Pattern
- MinGW + Wine Cross-Compilation
- Live Editor Testing
- Engine & Renderer Landscape
- DuetOS Portability Catalog
- Five-Engine Analysis
- Eleven-Engine Analysis
- ThorVG / Unity Graphics Analysis
- Advanced Techniques Catalog
- Third-Party Library Evaluation
- Engine Viability Evaluation
- Engine Feature Recommendations
- Project Recommendations
- Mac Compatibility Analysis
- Codebase Observations
- Codebase Bloat Audit
- Test Suite Audit
- Documentation Coverage Audit
- ThirdParty Dependencies Audit
- Load Test Baseline
- Gameplay Systems Status
- SparkGame Module Status
- Stub and Abandoned Features
- Memory Integrity System
- Memory Safety Evaluation
- Hardware Acceleration Systems
- Jolt Physics Integration
- GPU/CPU Separation Plan
- Daemon Services Architecture
- Reflection & Polymorphism Refactoring Plan
- SparkBuild In-Tree
- Wine No-JobSystem Breakthrough
- Wine Role and Fallback Tiers