diff --git a/crates/re_renderer/shader/lines.wgsl b/crates/re_renderer/shader/lines.wgsl index e214d302f558..afe22189f9c4 100644 --- a/crates/re_renderer/shader/lines.wgsl +++ b/crates/re_renderer/shader/lines.wgsl @@ -13,6 +13,11 @@ var position_data_texture: texture_2d; struct DrawDataUniformBuffer { size_boost_in_points: f32, + // In actuality there is way more padding than this since we align all our uniform buffers to + // 256bytes in order to allow them to be buffer-suballocations. + // However, wgpu doesn't know this at this point and therefore requires `DownlevelFlags::BUFFER_BINDINGS_NOT_16_BYTE_ALIGNED` + // if we wouldn't add padding here, which isn't available on WebGL. + _padding: Vec4, }; @group(1) @binding(2) var draw_data: DrawDataUniformBuffer; diff --git a/crates/re_renderer/shader/point_cloud.wgsl b/crates/re_renderer/shader/point_cloud.wgsl index 86b12cfd2214..6984ce45d6b6 100644 --- a/crates/re_renderer/shader/point_cloud.wgsl +++ b/crates/re_renderer/shader/point_cloud.wgsl @@ -12,6 +12,11 @@ var color_texture: texture_2d; struct DrawDataUniformBuffer { size_boost_in_points: f32, + // In actuality there is way more padding than this since we align all our uniform buffers to + // 256bytes in order to allow them to be buffer-suballocations. + // However, wgpu doesn't know this at this point and therefore requires `DownlevelFlags::BUFFER_BINDINGS_NOT_16_BYTE_ALIGNED` + // if we wouldn't add padding here, which isn't available on WebGL. + _padding: Vec4, }; @group(1) @binding(2) var draw_data: DrawDataUniformBuffer;