Optimize viewer shaders and camera controls; sample GPU profiles asynchronously

Amp-Thread-ID: https://ampcode.com/threads/T-01a0b382-1e79-712b-abd1-d29201c9bb5e
Co-authored-by: Heaust Azure <heaust.azure@gmail.com>
This commit is contained in:
Amp
2026-09-18 11:52:09 +00:00
co-authored by heaust
parent bc957cf40d
commit eb8aa0e9dc
21 changed files with 762 additions and 174 deletions
+10 -10
View File
@@ -34,12 +34,20 @@ const fxNodeImports = {
},
};
const coreWorker = await build({
...browser,
entryPoints: [path.join(root, "core", "worker.js")],
external: ["./pkg/yawn_core.js"],
write: false,
});
const coreWorkerSource = coreWorker.outputFiles[0].text;
const workerFiles = new Map([
[
path.join(root, "core", "index.js"),
{
url: "./worker.js",
source: await fs.readFile(path.join(root, "core", "worker.js"), "utf8"),
source: coreWorkerSource,
},
],
[
@@ -113,15 +121,7 @@ await Promise.all([
entryPoints: [path.join(fxNodeSource, "worker", "fxnode.worker.ts")],
outfile: path.join(output, "fxnode-worker.js"),
}),
build({
bundle: false,
entryPoints: [path.join(root, "core", "worker.js")],
format: "esm",
legalComments: "none",
minify: true,
outfile: path.join(output, "worker.js"),
target: "es2022",
}),
fs.writeFile(path.join(output, "worker.js"), coreWorkerSource),
build({
...browser,
entryPoints: [