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:
+10
-10
@@ -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: [
|
||||
|
||||
Reference in New Issue
Block a user