Skip to content

Commit

Permalink
fix: fixed wasm
Browse files Browse the repository at this point in the history
  • Loading branch information
lukexor committed Nov 11, 2024
1 parent 37cbbd5 commit bd27814
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ with (import <nixpkgs> {
];
targets = ["wasm32-unknown-unknown"];
}))
trunk
udev
];

Expand Down
6 changes: 5 additions & 1 deletion tetanes/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ tracing.workspace = true
tracing-subscriber.workspace = true
uuid = { version = "1.10", features = ["v4", "fast-rng", "serde"] }
webbrowser = { version = "1.0", features = ["hardened", "disable-wsl"] }
wgpu = { version = "23.0", features = ["webgl", "webgpu"] }
wgpu = { version = "23.0", features = [
"webgl",
"webgpu",
"fragile-send-sync-non-atomic-wasm", # Safe because we're not enabling atomics
] }
winit = { version = "0.30", features = ["serde"] }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
Expand Down
4 changes: 0 additions & 4 deletions tetanes/src/nes/renderer/gui/ppu_viewer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,10 +345,6 @@ impl PpuViewer {

let open = Arc::clone(&self.open);
let state = Arc::clone(&self.state);
// let Some(cfg) = self.resources.take() else {
// warn!("PpuViewer::prepare was not called with required resources");
// return;
// };

let mut viewport_builder = egui::ViewportBuilder::default()
.with_title(Self::TITLE)
Expand Down
2 changes: 1 addition & 1 deletion tetanes/src/sys/platform/wasm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ pub mod renderer {
(viewport_ui_cb, raw_input.take())
};

let mut output = ctx.run(raw_input, |ctx| match viewport_ui_cb {
let mut output = ctx.run(raw_input, |ctx| match &viewport_ui_cb {
Some(viewport_ui_cb) => viewport_ui_cb(ctx),
None => gui.borrow_mut().ui(ctx, None),
});
Expand Down

0 comments on commit bd27814

Please sign in to comment.