diff options
| author | Maze Winther <mazewinther@gmail.com> | 2026-04-18 15:01:59 +0200 |
|---|---|---|
| committer | Maze Winther <mazewinther@gmail.com> | 2026-04-18 15:01:59 +0200 |
| commit | 794d4ae149f50bc24c793ba1e9cc2312e0d21f37 (patch) | |
| tree | 0dd2ad883aa1e1a90707062d2987fe4961e46793 | |
| parent | 011f51051c9750706978d6c89ce84dd15560c335 (diff) | |
| download | opencut-794d4ae149f50bc24c793ba1e9cc2312e0d21f37.tar.gz | |
fix: align LayerUniformBuffer to 16 bytes for WebGL compat
| -rw-r--r-- | apps/web/package.json | 2 | ||||
| -rw-r--r-- | rust/crates/compositor/src/compositor.rs | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/apps/web/package.json b/apps/web/package.json index 004ee5d7..69aa7931 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -52,7 +52,7 @@ "nanoid": "^5.1.5", "next": "16.1.3", "next-themes": "^0.4.4", - "opencut-wasm": "^0.2.5", + "opencut-wasm": "^0.2.6", "pg": "^8.16.2", "postgres": "^3.4.5", "radix-ui": "^1.4.3", diff --git a/rust/crates/compositor/src/compositor.rs b/rust/crates/compositor/src/compositor.rs index 92d253d1..c0e6ec3b 100644 --- a/rust/crates/compositor/src/compositor.rs +++ b/rust/crates/compositor/src/compositor.rs @@ -57,6 +57,7 @@ struct LayerUniformBuffer { opacity: f32, flip_x: f32, flip_y: f32, + _padding: [f32; 2], // WebGL requires uniform buffer sizes to be multiples of 16 bytes (40 → 48) } #[repr(C)] @@ -549,6 +550,7 @@ impl Compositor { opacity: layer.opacity, flip_x: if layer.transform.flip_x { 1.0 } else { 0.0 }, flip_y: if layer.transform.flip_y { 1.0 } else { 0.0 }, + _padding: [0.0; 2], }), usage: wgpu::BufferUsages::UNIFORM | wgpu::BufferUsages::COPY_DST, }); |
