Skip to content

Commit

Permalink
Update to wgpu v23 + winit 0.30.5
Browse files Browse the repository at this point in the history
  • Loading branch information
jinleili committed Nov 6, 2024
1 parent a6f5cbd commit 237d27f
Show file tree
Hide file tree
Showing 17 changed files with 544 additions and 488 deletions.
467 changes: 217 additions & 250 deletions Cargo.lock

Large diffs are not rendered by default.

33 changes: 32 additions & 1 deletion run-wasm/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,36 @@ fn main() {
let _ = std::fs::create_dir_all(&out_dir);
let _ = copy_items(&[&wgsl_path, &img_path], out_dir, &copy_options);

cargo_run_wasm::run_wasm_with_css("body { margin: 0px; }");
cargo_run_wasm::run_wasm_with_css(
r#"
body, div, canvas { margin: 0px; padding: 0px; }
body {
display: flex;
justify-content: center;
align-items: center;
background: linear-gradient(135deg,
white 0%,
white 49%,
black 49%,
black 51%,
white 51%,
white 100%) repeat;
background-size: 20px 20px;
width: 100vw;
height: 100vh;
}
canvas {
display: block;
width: 100%;
height: 100%;
background-color: #454545;
}
#simuverse_container {
width: 100vw;
height: 100vh;
min-width: 600px;
min-height: 450px;
}
"#,
);
}
30 changes: 14 additions & 16 deletions simuverse/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,29 @@ edition = "2021"
rust-version = "1.80"

[dependencies]
app-surface = "1.1"
app-surface = "1.2.4"
# app-surface = { path = "../../idroid/wgpu-in-app/app-surface" }
egui = { git = "https://github.com/emilk/egui", rev = "d856f7b", default-features = false }
egui_extras = { git = "https://github.com/emilk/egui", package = "egui_extras", rev = "d856f7b" }
egui-wgpu = { git = "https://github.com/emilk/egui", package = "egui-wgpu", rev = "d856f7b" }
egui-winit = { git = "https://github.com/emilk/egui", package = "egui-winit", rev = "d856f7b", default-features = false }
egui = { git = "https://github.com/emilk/egui", rev = "5d6a58b", default-features = false }
egui_extras = { git = "https://github.com/emilk/egui", package = "egui_extras", rev = "5d6a58b" }
egui-wgpu = { git = "https://github.com/emilk/egui", package = "egui-wgpu", rev = "5d6a58b" }
egui-winit = { git = "https://github.com/emilk/egui", package = "egui-winit", rev = "5d6a58b", default-features = false }
# egui = { version="0.28.1", default-features = false }
# egui_extras = { version="0.28.1" }
# egui-wgpu = { version="0.28.1" }
# egui-winit = { version="0.28.1", default-features = false }

webbrowser = { version = "1.0.1" }
# 与 egui 中使用的版本对齐
winit = { version = "=0.30.2" }
winit = { version = "0.30.5" }
raw-window-handle = "0.6"
wgpu = { version = "22.1", features = ["fragile-send-sync-non-atomic-wasm"] }
glam = "0.28"
wgpu = { version = "23", features = ["fragile-send-sync-non-atomic-wasm"] }
glam = "0.29"
# syntax_highlighting 需要 enum-map
enum-map = { version = "2", features = ["serde"] }
bytemuck = "1.18"
env_logger = "0.10"
log = "0.4"
parking_lot = "0.12"
rand = "0.8"
# 为了让 rand 支持 web 环境
getrandom = { version = "0.2", features = ["js"] }
Expand All @@ -48,15 +49,15 @@ truck-modeling = { version = "0.5.1" }
truck-polymesh = { version = "0.5.0" }

[target.'cfg(target_arch = "wasm32")'.dependencies]
web-time = "1"
instant = { version = "0.1.12", features = ["now", "wasm-bindgen"] }
console_error_panic_hook = "0.1.7"
console_log = "1.0"
js-sys = "0.3.70"
fern = "0.6"
js-sys = "0.3.72"
reqwest = "0.11.15"
wasm-bindgen = "=0.2.93"
wasm-bindgen-futures = "0.4.43"
web-sys = { version = "0.3.70", features = [
wasm-bindgen = "0.2.95"
wasm-bindgen-futures = "0.4.45"
web-sys = { version = "0.3.72", features = [
"Blob",
"Document",
'Element',
Expand All @@ -70,7 +71,4 @@ web-sys = { version = "0.3.70", features = [
"Window",
"WorkerGlobalScope",
"XmlHttpRequest",
# Needed by webgpu_sys
"Event",
"EventTarget",
] }
Loading

0 comments on commit 237d27f

Please sign in to comment.