Skip to main content

Module compute

Module compute 

Source
Expand description

GPU Compute Pipeline

This module provides a complete GPU compute subsystem built on top of OpenGL 4.3+ compute shaders via the glow crate. It includes:

  • buffer: SSBO management, typed buffers, double-buffered particle buffers, atomic counters, buffer pools, memory tracking, mapped ranges, copy engines.
  • dispatch: Compute shader compilation with #define injection, workgroup sizing, 1D/2D/3D dispatch, indirect dispatch, pipeline caching, profiling.
  • kernels: 10 built-in compute kernels as embedded GLSL source strings.
  • sync: Fence synchronization, memory barriers, async compute queue, frame timeline, CPU fallback path, resource transition state machine.

Re-exports§

pub use buffer::TypedBuffer;
pub use buffer::ParticleBuffer;
pub use buffer::AtomicCounter;
pub use buffer::BufferPool;
pub use buffer::BufferBarrierType;
pub use buffer::MemoryTracker;
pub use buffer::MappedRange;
pub use buffer::BufferCopyEngine;
pub use buffer::BufferHandle;
pub use buffer::BufferUsage;
pub use dispatch::ShaderSource;
pub use dispatch::ComputeProgram;
pub use dispatch::WorkgroupSize;
pub use dispatch::ComputeDispatch;
pub use dispatch::DispatchDimension;
pub use dispatch::IndirectDispatchArgs;
pub use dispatch::PipelineCache;
pub use dispatch::SpecializationConstant;
pub use dispatch::ComputeProfiler;
pub use dispatch::TimingQuery;
pub use kernels::KernelLibrary;
pub use kernels::KernelId;
pub use kernels::ParticleIntegrateParams;
pub use kernels::ParticleEmitParams;
pub use kernels::ForceFieldDesc;
pub use kernels::MathFunctionType;
pub use kernels::FluidDiffuseParams;
pub use kernels::HistogramParams;
pub use kernels::PrefixSumPlan;
pub use kernels::RadixSortPlan;
pub use kernels::FrustumCullParams;
pub use kernels::SkinningParams;
pub use sync::FenceSync;
pub use sync::FenceStatus;
pub use sync::MemoryBarrierFlags;
pub use sync::PipelineBarrier;
pub use sync::AsyncComputeQueue;
pub use sync::FrameTimeline;
pub use sync::CpuFallback;
pub use sync::ResourceTransition;
pub use sync::ResourceState;

Modules§

buffer
SSBO management: typed buffers, double-buffering, atomic counters, buffer pools, barrier types, memory tracking, mapped ranges, copy engine.
dispatch
Compute shader compilation, dispatch, pipeline caching, and profiling.
kernels
Built-in compute kernels as embedded GLSL source strings.
sync
Compute-to-render synchronization: fences, memory barriers, async compute queue, frame timeline, CPU fallback, resource state machine.