updated precision formula & fixed hang (old code)
This commit is contained in:
@@ -46,7 +46,7 @@ impl ComputePipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if len != self.old_len {
|
if len != self.old_len {
|
||||||
println!("len: {}", len);
|
println!("new len: {}", len);
|
||||||
self.old_len = len;
|
self.old_len = len;
|
||||||
self.pipeline = self.pipeline(device, &Self::shader(device, len));
|
self.pipeline = self.pipeline(device, &Self::shader(device, len));
|
||||||
self.work.set(work_vec(size.x, size.y, len));
|
self.work.set(work_vec(size.x, size.y, len));
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ impl Renderer<'_> {
|
|||||||
|
|
||||||
// this comes from the fact that I want (0, 2) and (30, 4)
|
// this comes from the fact that I want (0, 2) and (30, 4)
|
||||||
// probably a much better formula, or better yet let the user select
|
// probably a much better formula, or better yet let the user select
|
||||||
self.len = (camera.zoom.level() as f32 / 15.0 + 2.0).round() as usize;
|
self.len = (camera.zoom.level() as f32 / 32.0 + 2.0).round() as usize;
|
||||||
|
|
||||||
self.compute_pipeline.update(
|
self.compute_pipeline.update(
|
||||||
&self.device,
|
&self.device,
|
||||||
|
|||||||
@@ -44,14 +44,15 @@ impl ChunkView {
|
|||||||
|
|
||||||
let mut visible = HashSet::new();
|
let mut visible = HashSet::new();
|
||||||
let mut x = blc.x.clone();
|
let mut x = blc.x.clone();
|
||||||
while x <= trc.x {
|
// while x <= trc.x {
|
||||||
let mut y = blc.y.clone();
|
// let mut y = blc.y.clone();
|
||||||
while y <= trc.y {
|
// while y <= trc.y {
|
||||||
visible.insert(Vector2::new(x.clone(), y.clone()));
|
// visible.insert(Vector2::new(x.clone(), y.clone()));
|
||||||
y += FixedDec::one();
|
// y += FixedDec::one();
|
||||||
}
|
// }
|
||||||
x += FixedDec::one();
|
// x += FixedDec::one();
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
let new = visible
|
let new = visible
|
||||||
.difference(&self.visible_chunks)
|
.difference(&self.visible_chunks)
|
||||||
|
|||||||
Reference in New Issue
Block a user