summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-01-19 17:03:08 +0100
committermetamuffin <metamuffin@disroot.org>2025-01-19 17:03:08 +0100
commit314a2e3944aa490938f422106b0f2ad1a61228cd (patch)
tree91cdbfea55fe5e93bb3470683762d0b77b0ffe8d /client
parentf6fa92e62f0c5ec2150ae22fcfb54c7dc49e5d9b (diff)
downloadweareserver-314a2e3944aa490938f422106b0f2ad1a61228cd.tar
weareserver-314a2e3944aa490938f422106b0f2ad1a61228cd.tar.bz2
weareserver-314a2e3944aa490938f422106b0f2ad1a61228cd.tar.zst
client: fix gpu size misscalculation
Diffstat (limited to 'client')
-rw-r--r--client/src/renderer.rs3
-rw-r--r--client/src/scene_prepare.rs9
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>(),