Skip to main content

Crate oximedia_gpu

Crate oximedia_gpu 

Source
Expand description

GPU compute pipeline using WGPU for OxiMedia

This crate provides a cross-platform GPU acceleration layer using WGPU, supporting Vulkan, Metal, DirectX 12, and WebGPU backends.

§Features

  • Color space conversions (RGB ↔ YUV with BT.601, BT.709, BT.2020)
  • Image scaling (nearest, bilinear, bicubic)
  • Convolution filters (blur, sharpen, edge detection)
  • Transform operations (DCT, FFT)
  • Automatic CPU fallback
  • Multi-GPU support

§Example

use oximedia_gpu::GpuContext;

let ctx = GpuContext::new()?;

let input = vec![0u8; 1920 * 1080 * 4];
let mut output = vec![0u8; 1920 * 1080 * 4];

ctx.rgb_to_yuv(&input, &mut output)?;

Re-exports§

pub use accelerator::AcceleratorBuilder;
pub use accelerator::CpuAccelerator;
pub use accelerator::GpuAccelerator;
pub use accelerator::WgpuAccelerator;
pub use buffer::BufferType;
pub use buffer::GpuBuffer;
pub use device::GpuDevice;
pub use device::GpuDeviceInfo;
pub use ops::ColorSpaceConversion;
pub use ops::FilterOperation;
pub use ops::ScaleOperation;
pub use ops::TransformOperation;
pub use backend::Backend;
pub use backend::BackendCapabilities;
pub use backend::BackendType;
pub use backend::CpuBackend;
pub use backend::VulkanBackend;
pub use cache::CacheStats;
pub use cache::PipelineCache;
pub use cache::ShaderCache;
pub use compiler::CompilationError;
pub use compiler::CompilationOptions;
pub use compiler::OptimizationLevel;
pub use compiler::ShaderCompiler;
pub use compiler::ShaderPreprocessor;
pub use compute::ComputeExecutor;
pub use compute::ComputePassBuilder;
pub use compute::ComputePipelineHandle;
pub use compute::ComputePipelineManager;
pub use compute::DispatchHelper;
pub use kernels::ColorConversionKernel;
pub use kernels::ConvolutionKernel;
pub use kernels::FilterKernel;
pub use kernels::ReduceKernel;
pub use kernels::ReduceOp;
pub use kernels::ResizeFilter;
pub use kernels::ResizeKernel;
pub use kernels::TransformKernel;
pub use kernels::TransformType;
pub use memory::ManagedBuffer;
pub use memory::MemoryAllocator;
pub use memory::MemoryPool;
pub use memory::MemoryStats;
pub use queue::AsyncSubmission;
pub use queue::BatchSubmitter;
pub use queue::CommandBufferBuilder;
pub use queue::CommandQueue;
pub use queue::QueueManager;
pub use queue::QueueType;
pub use sync::Barrier;
pub use sync::Event;
pub use sync::Fence;
pub use sync::Semaphore;
pub use histogram::ChannelHistogram;
pub use histogram::ImageHistogram;
pub use motion_detect::MotionAnalysis;
pub use motion_detect::MotionDetector;
pub use motion_detect::MotionRegion;
pub use motion_detect::Sensitivity;
pub use pipeline::GpuPipeline;
pub use pipeline::PipelineMetrics;
pub use pipeline::PipelineNode;
pub use pipeline::PipelineStage;
pub use texture::TextureDescriptor;
pub use texture::TextureFormat;
pub use texture::TexturePool;
pub use video_process::FrameProcessConfig;
pub use video_process::FrameProcessResult;
pub use video_process::VideoFrameProcessor;

Modules§

accelerator
GpuAccelerator trait and hardware acceleration abstraction.
backend
Backend implementations for GPU and CPU compute
buffer
GPU buffer management for staging and device memory
buffer_copy
GPU buffer copy and blit operations.
cache
Pipeline cache management for faster startup and reduced compilation overhead
command_buffer
GPU command buffer recording and submission.
compiler
Runtime shader compilation and management
compute
Compute pipeline management for GPU operations
compute_dispatch
Compute shader dispatch helpers.
compute_pass
GPU compute pass management — pass types, buffer bindings, and pass queues.
descriptor_set
Descriptor set and layout management for GPU pipeline bindings.
device
GPU device management and enumeration
fence_pool
GPU fence pool for efficient synchronization primitive reuse.
gpu_buffer
GPU buffer management for oximedia-gpu.
gpu_fence
GPU fence (synchronization primitive) management for oximedia-gpu.
gpu_profiler
GPU profiling and timing utilities.
gpu_stats
GPU statistics collection and monitoring.
gpu_timer
GPU timing and profiling utilities.
histogram
Multi-channel image histogram analysis.
kernel
GPU kernel management — kernel types, specs, and caching.
kernels
GPU compute kernels library
memory
GPU memory management and allocation tracking
memory_pool
GPU memory pool allocator.
motion_detect
GPU-accelerated motion detection.
occupancy
GPU occupancy calculator and optimization.
ops
GPU compute operations
pipeline
GPU processing pipeline management
queue
Command queue management for GPU operations
render_pass
Render pass configuration and builder for oximedia-gpu.
resource_manager
GPU resource allocation and lifetime tracking.
sampler
Texture sampler configuration and caching.
shader
Shader compilation and pipeline management
shader_cache
GPU shader cache management.
shader_params
Shader parameter management — param types, individual params, and uniform blocks.
sync
Synchronization primitives for GPU operations
sync_primitive
GPU synchronisation primitives (semaphores, fences, barriers).
texture
GPU texture management
upload_queue
Asynchronous upload queue for staging CPU data to GPU buffers.
vertex_buffer
Vertex buffer layout descriptions and management.
video_process
GPU-accelerated video frame processing.
viewport
Viewport and scissor-rectangle management for GPU render passes.
workgroup
GPU workgroup configuration and dispatch sizing.

Structs§

GpuContext
GPU context for compute operations

Enums§

GpuError
Error types for GPU operations

Type Aliases§

Result