Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples-gpu/hello-worker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import("./wasm/hello.js").then(module => module.default());
6 changes: 5 additions & 1 deletion examples-gpu/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"skybox",
// "texture-arrays",
// "water",
"hello-worker",
];
const list = document.createElement("ul");
for (let exampleName of exampleNames) {
Expand All @@ -82,7 +83,10 @@
const currentExample = new URLSearchParams(window.location.search).get(
"example"
);
if (currentExample) {
if (currentExample === "hello-worker") {
console.info("Note: loading modules in web workers is currently not supported on Firefox");
const worker = new Worker("hello-worker.js", { type: "module" });
} else if (currentExample) {
import(`./wasm/${currentExample}.js`).then((module) => module.default());
} else {
window.location.assign(
Expand Down