summaryrefslogtreecommitdiff
path: root/rust/crates/gpu/src/lib.rs
diff options
context:
space:
mode:
authorMaze Winther <mazewinther@gmail.com>2026-04-07 01:09:13 +0200
committerMaze Winther <mazewinther@gmail.com>2026-04-07 01:09:13 +0200
commite4b67094e757917588fb624a30aa046667403add (patch)
tree55452692eac69a5a63b58f2a5cdb701dd7023d68 /rust/crates/gpu/src/lib.rs
parent79df73643185c02493364a077402726d1fa7b9ec (diff)
downloadopencut-e4b67094e757917588fb624a30aa046667403add.tar.gz
refactor: split effects and masks into dedicated rust crates, introduce MediaTime and FrameRate
Diffstat (limited to 'rust/crates/gpu/src/lib.rs')
-rw-r--r--rust/crates/gpu/src/lib.rs23
1 files changed, 2 insertions, 21 deletions
diff --git a/rust/crates/gpu/src/lib.rs b/rust/crates/gpu/src/lib.rs
index c53e63ab..b6ca6c1c 100644
--- a/rust/crates/gpu/src/lib.rs
+++ b/rust/crates/gpu/src/lib.rs
@@ -1,17 +1,12 @@
mod context;
-mod effect_pipeline;
-mod mask_feather;
-mod sdf_pipeline;
-mod shader_registry;
use thiserror::Error;
-pub use wgpu;
pub use context::GpuContext;
-pub use effect_pipeline::{ApplyEffectsOptions, EffectPass, UniformValue};
-pub use mask_feather::ApplyMaskFeatherOptions;
+pub use wgpu;
pub const GPU_TEXTURE_FORMAT: wgpu::TextureFormat = wgpu::TextureFormat::Bgra8Unorm;
+pub const FULLSCREEN_SHADER_SOURCE: &str = include_str!("shaders/fullscreen.wgsl");
#[derive(Debug, Error)]
pub enum GpuError {
@@ -23,18 +18,4 @@ pub enum GpuError {
CreateSurface(#[from] wgpu::CreateSurfaceError),
#[error("The output surface does not support the required texture format")]
UnsupportedSurfaceFormat,
- #[error("Unknown effect shader '{shader}'")]
- UnknownEffectShader { shader: String },
- #[error("Missing uniform '{uniform}' for shader '{shader}'")]
- MissingUniform { shader: String, uniform: String },
- #[error("Uniform '{uniform}' for shader '{shader}' must be a number")]
- InvalidNumberUniform { shader: String, uniform: String },
- #[error("Uniform '{uniform}' for shader '{shader}' must be a vector of length {expected_length}")]
- InvalidVectorUniform {
- shader: String,
- uniform: String,
- expected_length: usize,
- },
- #[error("Shader '{shader}' does not support uniform '{uniform}'")]
- UnsupportedUniform { shader: String, uniform: String },
}