mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-19 14:01:08 +01:00
23 lines
567 B
JavaScript
23 lines
567 B
JavaScript
export async function start() {
|
|
let url = new URL(window.location.href);
|
|
let name = url.searchParams.get("name");
|
|
let wasm = url.searchParams.get("wasm");
|
|
|
|
let wasm_paths = await (await fetch("./wasm_paths.json")).json();
|
|
let wasm_script = wasm_paths[wasm];
|
|
|
|
if (wasm_script == null) {
|
|
throw new Error("can't find wasm file");
|
|
}
|
|
|
|
const { default: init, run_test, run_gpu_report } = await import(wasm_script);
|
|
|
|
init().then(async () => {
|
|
if (name == null) {
|
|
await run_gpu_report();
|
|
} else {
|
|
await run_test(name);
|
|
}
|
|
});
|
|
}
|