From 635900a38c1cb556c6b9ac82e0b05851f9df0bb3 Mon Sep 17 00:00:00 2001 From: Clement Rey Date: Thu, 19 Dec 2024 14:57:29 +0100 Subject: [PATCH] we already have iter_blob, turns out --- crates/viewer/re_view_spatial/src/visualizers/meshes.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/crates/viewer/re_view_spatial/src/visualizers/meshes.rs b/crates/viewer/re_view_spatial/src/visualizers/meshes.rs index d5e83f60f9d2..4df17df2f938 100644 --- a/crates/viewer/re_view_spatial/src/visualizers/meshes.rs +++ b/crates/viewer/re_view_spatial/src/visualizers/meshes.rs @@ -214,8 +214,7 @@ impl VisualizerSystem for Mesh3DVisualizer { all_vertex_texcoords.primitive_array::<2, f32>(), all_triangle_indices.primitive_array::<3, u32>(), all_albedo_factors.primitive::(), - // TODO(cmc): Provide a `iter_blob`. - all_albedo_buffers.component_slow::(), + all_albedo_buffers.buffer(), // Legit call to `component_slow`, `ImageFormat` is real complicated. all_albedo_formats.component_slow::(), all_class_ids.primitive::(), @@ -250,7 +249,11 @@ impl VisualizerSystem for Mesh3DVisualizer { bytemuck::cast_slice(albedo_factors) }) .first(), - albedo_buffer: albedo_buffers.unwrap_or_default().first().cloned(), // shallow clone + albedo_buffer: albedo_buffers + .unwrap_or_default() + .first() + .cloned() + .map(Into::into), // shallow clone albedo_format: albedo_formats.unwrap_or_default().first().copied(), class_ids: class_ids .map_or(&[], |class_ids| bytemuck::cast_slice(class_ids)),