oximedia-gpu
Cross-platform GPU compute pipeline for OxiMedia using WGPU, supporting Vulkan, Metal, DirectX 12, and WebGPU backends.
Part of the oximedia workspace — a comprehensive pure-Rust media processing framework.
Features
- Color Space Conversions — RGB ↔ YUV with BT.601, BT.709, BT.2020 matrices
- Image Scaling — Nearest, bilinear, and bicubic interpolation on GPU
- Convolution Filters — Blur, sharpen, edge detection kernels
- Transform Operations — DCT and FFT on GPU
- Automatic CPU Fallback — Graceful degradation when GPU unavailable
- Multi-GPU Support — Select and use multiple GPU devices
- Cross-platform — Vulkan, Metal, DirectX 12, WebGPU via WGPU
- Shader Cache — Compiled shader caching for faster startup
- Memory Pool — Efficient GPU buffer pool management
- Command Buffer — Batched GPU command recording
- Compute Pass — Structured compute pass dispatch
- Descriptor Sets — Resource binding management
- Render Pass — GPU render pass management
- Fence Pool — GPU fence lifecycle management
- Vertex Buffer — Vertex data management
- Sampler — Texture sampler configuration
- Profiling — GPU timer, stats, and profiler
- Video Processing — Frame processing pipelines
- Histogram — GPU-accelerated histogram computation
- Motion Detection — GPU-accelerated motion detection
- Texture — Texture management and operations
- Occupancy — Compute occupancy analysis
- Workgroup — Workgroup sizing and dispatch
Usage
Add to your Cargo.toml:
[]
= "0.1.3"
use GpuContext;
API Overview
Core types:
GpuContext— Main GPU context and entry pointGpuBuffer,GpuFence— GPU resource types
Device and backend:
device— GPU device enumeration and selectionbackend— Backend initialization (Vulkan/Metal/DX12/WebGPU)accelerator— High-level acceleration interface
Buffer and memory:
buffer,gpu_buffer— Buffer allocation and managementmemory,memory_pool— GPU memory poolvertex_buffer— Vertex buffer managementbuffer_copy— Buffer copy operationsupload_queue— Staging buffer upload queue
Shader management:
shader,shader_cache,shader_params— Shader compilation and caching
Compute pipeline:
compute,compute_pass,compute_dispatch— Compute operationspipeline— Compute pipeline configurationkernels,kernel— Compute kernel definitionsdescriptor_set— Resource descriptor bindingworkgroup— Workgroup configuration
Rendering:
render_pass— GPU render passtexture— Texture managementsampler— Sampler configurationviewport— Viewport configuration
Synchronization:
queue— Command queue managementsync,sync_primitive— Fence and semaphore synchronizationfence_pool— Fence lifecycle management
High-level operations:
ops— High-level GPU operations (color conversion, scaling)video_process— Video frame processing pipelinehistogram— Histogram computation kernelmotion_detect— Motion detection kernelcache— Operation result caching
Profiling:
gpu_profiler— GPU profilinggpu_timer— GPU timing queriesgpu_stats— GPU statistics collectionresource_manager— GPU resource lifecycle trackingoccupancy— Compute occupancy analysis
License
Apache-2.0 — Copyright 2024-2026 COOLJAPAN OU (Team Kitasan)