feat: remove warning and increase performance
This commit is contained in:
+2
-1
@@ -8,7 +8,6 @@ bytemuck = { version = "1.25.2", features = ["derive"] }
|
|||||||
dashu-float = "0.6.0"
|
dashu-float = "0.6.0"
|
||||||
eframe = { version = "0.36.2", default-features = false, features = ["wgpu", "default_fonts", "x11", "wayland", "accesskit"] }
|
eframe = { version = "0.36.2", default-features = false, features = ["wgpu", "default_fonts", "x11", "wayland", "accesskit"] }
|
||||||
egui = "0.36.2"
|
egui = "0.36.2"
|
||||||
futures-channel = { version = "0.3.34", default-features = false, features = ["alloc", "std"] }
|
|
||||||
log = "0.4.34"
|
log = "0.4.34"
|
||||||
png = "0.18.1"
|
png = "0.18.1"
|
||||||
|
|
||||||
@@ -16,6 +15,7 @@ png = "0.18.1"
|
|||||||
env_logger = "0.11.11"
|
env_logger = "0.11.11"
|
||||||
|
|
||||||
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
||||||
|
futures-channel = { version = "0.3.34", default-features = false, features = ["alloc", "std"] }
|
||||||
console_error_panic_hook = "0.1.7"
|
console_error_panic_hook = "0.1.7"
|
||||||
console_log = "1.1.0"
|
console_log = "1.1.0"
|
||||||
js-sys = "0.3.105"
|
js-sys = "0.3.105"
|
||||||
@@ -26,6 +26,7 @@ web-sys = { version = "0.3.105", features = ["Window", "Location", "Url", "UrlSe
|
|||||||
# Release: optimize hard (fractal math is hot).
|
# Release: optimize hard (fractal math is hot).
|
||||||
[profile.release]
|
[profile.release]
|
||||||
opt-level = 3
|
opt-level = 3
|
||||||
|
codegen-units = 1
|
||||||
|
|
||||||
# Dev: keep our own crate debuggable, but optimize dependencies (dashu, wgpu,
|
# Dev: keep our own crate debuggable, but optimize dependencies (dashu, wgpu,
|
||||||
# egui) so the explorer is actually interactive during development.
|
# egui) so the explorer is actually interactive during development.
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ pub struct Uniforms {
|
|||||||
/// pixel size changes:
|
/// pixel size changes:
|
||||||
/// * `data_view` — the iteration pass's output (see [`DATA_FORMAT`]).
|
/// * `data_view` — the iteration pass's output (see [`DATA_FORMAT`]).
|
||||||
/// * `color_view` — the colourise pass's output; the blit source.
|
/// * `color_view` — the colourise pass's output; the blit source.
|
||||||
/// plus the bind groups that read them.
|
/// plus the bind groups that read them.
|
||||||
struct CacheTarget {
|
struct CacheTarget {
|
||||||
data_view: wgpu::TextureView,
|
data_view: wgpu::TextureView,
|
||||||
color_view: wgpu::TextureView,
|
color_view: wgpu::TextureView,
|
||||||
|
|||||||
+14
-11
@@ -33,16 +33,19 @@ impl ShareState {
|
|||||||
pub fn encode(&self) -> String {
|
pub fn encode(&self) -> String {
|
||||||
let mut s = String::new();
|
let mut s = String::new();
|
||||||
s.push_str(if self.julia { "m=j" } else { "m=m" });
|
s.push_str(if self.julia { "m=j" } else { "m=m" });
|
||||||
s.push_str(&format!("&f={}", match self.kind {
|
s.push_str(&format!(
|
||||||
FractalKind::Mandelbrot => "mandel",
|
"&f={}",
|
||||||
FractalKind::BurningShip => "burning",
|
match self.kind {
|
||||||
FractalKind::Multibrot => "multi",
|
FractalKind::Mandelbrot => "mandel",
|
||||||
FractalKind::Tricorn => "tricorn",
|
FractalKind::BurningShip => "burning",
|
||||||
FractalKind::Celtic => "celtic",
|
FractalKind::Multibrot => "multi",
|
||||||
FractalKind::Perpendicular => "perp",
|
FractalKind::Tricorn => "tricorn",
|
||||||
FractalKind::Buffalo => "buffalo",
|
FractalKind::Celtic => "celtic",
|
||||||
FractalKind::Phoenix => "phoenix",
|
FractalKind::Perpendicular => "perp",
|
||||||
}));
|
FractalKind::Buffalo => "buffalo",
|
||||||
|
FractalKind::Phoenix => "phoenix",
|
||||||
|
}
|
||||||
|
));
|
||||||
s.push_str(&format!("&pw={}", self.power));
|
s.push_str(&format!("&pw={}", self.power));
|
||||||
s.push_str(&format!(
|
s.push_str(&format!(
|
||||||
"&re={}&im={}&hh={}&it={}",
|
"&re={}&im={}&hh={}&it={}",
|
||||||
@@ -79,7 +82,7 @@ impl ShareState {
|
|||||||
"perp" => FractalKind::Perpendicular,
|
"perp" => FractalKind::Perpendicular,
|
||||||
"buffalo" => FractalKind::Buffalo,
|
"buffalo" => FractalKind::Buffalo,
|
||||||
"phoenix" => FractalKind::Phoenix,
|
"phoenix" => FractalKind::Phoenix,
|
||||||
_ => FractalKind::Mandelbrot
|
_ => FractalKind::Mandelbrot,
|
||||||
})
|
})
|
||||||
.unwrap_or(FractalKind::Mandelbrot),
|
.unwrap_or(FractalKind::Mandelbrot),
|
||||||
power: map.get("pw").and_then(|s| s.parse().ok()).unwrap_or(2),
|
power: map.get("pw").and_then(|s| s.parse().ok()).unwrap_or(2),
|
||||||
|
|||||||
Reference in New Issue
Block a user