diff --git a/crates/viewer/re_renderer/src/importer/stl.rs b/crates/viewer/re_renderer/src/importer/stl.rs index fad815c7c250..30b1ad98a677 100644 --- a/crates/viewer/re_renderer/src/importer/stl.rs +++ b/crates/viewer/re_renderer/src/importer/stl.rs @@ -23,7 +23,6 @@ pub enum StlImportError { pub fn load_stl_from_buffer( buffer: &[u8], ctx: &RenderContext, - _texture_key: u64, ) -> Result, StlImportError> { re_tracing::profile_function!(); diff --git a/crates/viewer/re_renderer/src/renderer/mesh_renderer.rs b/crates/viewer/re_renderer/src/renderer/mesh_renderer.rs index f5724677f0fa..230dc552809b 100644 --- a/crates/viewer/re_renderer/src/renderer/mesh_renderer.rs +++ b/crates/viewer/re_renderer/src/renderer/mesh_renderer.rs @@ -110,6 +110,7 @@ impl DrawData for MeshDrawData { type Renderer = MeshRenderer; } +#[derive(Clone)] pub struct MeshInstance { /// Gpu mesh used by this instance pub gpu_mesh: Arc, @@ -131,20 +132,6 @@ pub struct MeshInstance { pub picking_layer_id: PickingLayerId, } -impl Clone for MeshInstance { - #[inline] - fn clone(&self) -> Self { - Self { - gpu_mesh: self.gpu_mesh.clone(), - mesh: self.mesh.clone(), - world_from_mesh: self.world_from_mesh, - additive_tint: self.additive_tint, - outline_mask_ids: self.outline_mask_ids, - picking_layer_id: self.picking_layer_id, - } - } -} - impl MeshInstance { /// Creates a new instance of a mesh with all fields set to default except for required ones. pub fn new(gpu_mesh: Arc) -> Self { diff --git a/crates/viewer/re_space_view_spatial/src/mesh_cache.rs b/crates/viewer/re_space_view_spatial/src/mesh_cache.rs index 9c919932ba7a..0baafbc4bb4d 100644 --- a/crates/viewer/re_space_view_spatial/src/mesh_cache.rs +++ b/crates/viewer/re_space_view_spatial/src/mesh_cache.rs @@ -38,10 +38,6 @@ pub struct MeshCache(HashMap pub enum AnyMesh<'a> { Asset { asset: &'a re_types::archetypes::Asset3D, - - /// If there are any textures associated with that asset (albedo etc), they use this - /// hash for texture manager lookup. - texture_key: u64, }, Mesh { mesh: &'a re_types::archetypes::Mesh3D, diff --git a/crates/viewer/re_space_view_spatial/src/mesh_loader.rs b/crates/viewer/re_space_view_spatial/src/mesh_loader.rs index 3758cc5920f1..a4d9076545a2 100644 --- a/crates/viewer/re_space_view_spatial/src/mesh_loader.rs +++ b/crates/viewer/re_space_view_spatial/src/mesh_loader.rs @@ -33,9 +33,7 @@ impl LoadedMesh { ) -> anyhow::Result { // TODO(emilk): load CpuMesh in background thread. match mesh { - AnyMesh::Asset { asset, texture_key } => { - Ok(Self::load_asset3d(name, asset, texture_key, render_ctx)?) - } + AnyMesh::Asset { asset } => Ok(Self::load_asset3d(name, asset, render_ctx)?), AnyMesh::Mesh { mesh, texture_key } => { Ok(Self::load_mesh3d(name, mesh, texture_key, render_ctx)?) } @@ -47,7 +45,6 @@ impl LoadedMesh { media_type: &MediaType, asset3d: &Asset3D, render_ctx: &RenderContext, - texture_key: u64, ) -> anyhow::Result { re_tracing::profile_function!(); @@ -58,9 +55,7 @@ impl LoadedMesh { re_renderer::importer::gltf::load_gltf_from_buffer(&name, bytes, render_ctx)? } MediaType::OBJ => re_renderer::importer::obj::load_obj_from_buffer(bytes, render_ctx)?, - MediaType::STL => { - re_renderer::importer::stl::load_stl_from_buffer(bytes, render_ctx, texture_key)? - } + MediaType::STL => re_renderer::importer::stl::load_stl_from_buffer(bytes, render_ctx)?, _ => anyhow::bail!("{media_type} files are not supported"), }; @@ -88,7 +83,6 @@ impl LoadedMesh { fn load_asset3d( name: String, asset3d: &Asset3D, - texture_key: u64, render_ctx: &RenderContext, ) -> anyhow::Result { re_tracing::profile_function!(); @@ -96,7 +90,7 @@ impl LoadedMesh { let media_type = MediaType::or_guess_from_data(asset3d.media_type.clone(), asset3d.blob.as_slice()) .ok_or_else(|| anyhow::anyhow!("couldn't guess media type"))?; - let slf = Self::load_asset3d_parts(name, &media_type, asset3d, render_ctx, texture_key)?; + let slf = Self::load_asset3d_parts(name, &media_type, asset3d, render_ctx)?; Ok(slf) } diff --git a/crates/viewer/re_space_view_spatial/src/visualizers/assets3d.rs b/crates/viewer/re_space_view_spatial/src/visualizers/assets3d.rs index 0c2a0559b0e5..67dc144fde9a 100644 --- a/crates/viewer/re_space_view_spatial/src/visualizers/assets3d.rs +++ b/crates/viewer/re_space_view_spatial/src/visualizers/assets3d.rs @@ -77,7 +77,6 @@ impl Asset3DVisualizer { media_type: data.media_type.clone().map(Into::into), albedo_factor: data.albedo_factor.copied(), }, - texture_key: re_log_types::hash::Hash64::hash(&key).hash64(), }, render_ctx, )