diff options
-rw-r--r-- | client/src/renderer.rs | 3 | ||||
-rw-r--r-- | client/src/scene_prepare.rs | 9 |
2 files changed, 8 insertions, 4 deletions
diff --git a/client/src/renderer.rs b/client/src/renderer.rs index 6a37320..2684ed0 100644 --- a/client/src/renderer.rs +++ b/client/src/renderer.rs @@ -119,7 +119,8 @@ impl<'a> Renderer<'a> { }); let depth = depth.create_view(&TextureViewDescriptor::default()); - for _ in 0..2 { + // TODO multithreading introduces double-loading some resources. fix that before increasing thread count + for _ in 0..1 { let scene_prepare = scene_prepare.clone(); let downloader = downloader.clone(); spawn(move || { diff --git a/client/src/scene_prepare.rs b/client/src/scene_prepare.rs index ad0f5e4..97ab166 100644 --- a/client/src/scene_prepare.rs +++ b/client/src/scene_prepare.rs @@ -181,7 +181,7 @@ impl ScenePreparer { self.index_buffers.insert( pres.clone(), (Arc::new(buffer), (buf.len() * 3) as u32), - buf.len(), + buf.len() * size_of::<u32>() * 3, ); debug!( "index buffer created (len={}, took {:?}) {pres}", @@ -199,8 +199,11 @@ impl ScenePreparer { label: Some("vertex attribute"), usage: BufferUsages::VERTEX | BufferUsages::COPY_DST, }); - self.vertex_buffers - .insert(pres.clone(), Arc::new(buffer), buf.len()); + self.vertex_buffers.insert( + pres.clone(), + Arc::new(buffer), + buf.len() * size_of::<f32>(), + ); debug!( "vertex attribute buffer created (len={}, took {:?}) {pres}", buf.len() / size_of::<f32>(), |