Skip to content

Commit 794d4ae

Browse files
committed
fix: align LayerUniformBuffer to 16 bytes for WebGL compat
1 parent 011f510 commit 794d4ae

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

apps/web/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"nanoid": "^5.1.5",
5353
"next": "16.1.3",
5454
"next-themes": "^0.4.4",
55-
"opencut-wasm": "^0.2.5",
55+
"opencut-wasm": "^0.2.6",
5656
"pg": "^8.16.2",
5757
"postgres": "^3.4.5",
5858
"radix-ui": "^1.4.3",

rust/crates/compositor/src/compositor.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ struct LayerUniformBuffer {
5757
opacity: f32,
5858
flip_x: f32,
5959
flip_y: f32,
60+
_padding: [f32; 2], // WebGL requires uniform buffer sizes to be multiples of 16 bytes (40 → 48)
6061
}
6162

6263
#[repr(C)]
@@ -549,6 +550,7 @@ impl Compositor {
549550
opacity: layer.opacity,
550551
flip_x: if layer.transform.flip_x { 1.0 } else { 0.0 },
551552
flip_y: if layer.transform.flip_y { 1.0 } else { 0.0 },
553+
_padding: [0.0; 2],
552554
}),
553555
usage: wgpu::BufferUsages::UNIFORM | wgpu::BufferUsages::COPY_DST,
554556
});

0 commit comments

Comments
 (0)