mirror of
https://github.com/OpenCut-app/OpenCut.git
synced 2026-07-13 21:52:53 +02:00
fix: align LayerUniformBuffer to 16 bytes for WebGL compat
This commit is contained in:
@@ -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,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user