fix: align LayerUniformBuffer to 16 bytes for WebGL compat

This commit is contained in:
Maze Winther
2026-04-18 15:01:59 +02:00
parent 011f51051c
commit 794d4ae149
2 changed files with 3 additions and 1 deletions
+2
View File
@@ -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,
});