Skip to main content

proof_engine/compute/
mod.rs

1//! GPU Compute Pipeline
2//!
3//! This module provides a complete GPU compute subsystem built on top of OpenGL 4.3+
4//! compute shaders via the `glow` crate. It includes:
5//!
6//! - **buffer**: SSBO management, typed buffers, double-buffered particle buffers,
7//!   atomic counters, buffer pools, memory tracking, mapped ranges, copy engines.
8//! - **dispatch**: Compute shader compilation with `#define` injection, workgroup
9//!   sizing, 1D/2D/3D dispatch, indirect dispatch, pipeline caching, profiling.
10//! - **kernels**: 10 built-in compute kernels as embedded GLSL source strings.
11//! - **sync**: Fence synchronization, memory barriers, async compute queue,
12//!   frame timeline, CPU fallback path, resource transition state machine.
13
14pub mod buffer;
15pub mod dispatch;
16pub mod kernels;
17pub mod sync;
18
19pub use buffer::{
20    TypedBuffer, ParticleBuffer, AtomicCounter, BufferPool, BufferBarrierType,
21    MemoryTracker, MappedRange, BufferCopyEngine, BufferHandle, BufferUsage,
22};
23pub use dispatch::{
24    ShaderSource, ComputeProgram, WorkgroupSize, ComputeDispatch, DispatchDimension,
25    IndirectDispatchArgs, PipelineCache, SpecializationConstant, ComputeProfiler,
26    TimingQuery,
27};
28pub use kernels::{
29    KernelLibrary, KernelId, ParticleIntegrateParams, ParticleEmitParams,
30    ForceFieldDesc, MathFunctionType, FluidDiffuseParams, HistogramParams,
31    PrefixSumPlan, RadixSortPlan, FrustumCullParams, SkinningParams,
32};
33pub use sync::{
34    FenceSync, FenceStatus, MemoryBarrierFlags, PipelineBarrier, AsyncComputeQueue,
35    FrameTimeline, CpuFallback, ResourceTransition, ResourceState,
36};