mirror of
https://github.com/Rezmason/matrix.git
synced 2026-04-17 05:49:30 -07:00
Added cache check to WebGPU renderer's loadShader method. Un-commented entries into config.js. Inclusions are now explicit dynamic import lambdas, so the cache functions can detect and call them; however, webpack and rollup seem to use them differently.
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
export default async () => {
|
||||
let glMatrix, createREGL;
|
||||
let glMatrix, createREGL, inclusions;
|
||||
|
||||
try {
|
||||
glMatrix = await import("gl-matrix");
|
||||
createREGL = (await import("regl")).default;
|
||||
inclusions = (await import("./inclusions.js")).default;
|
||||
} catch {
|
||||
const loadJS = (src) =>
|
||||
new Promise((resolve, reject) => {
|
||||
@@ -14,7 +15,8 @@ export default async () => {
|
||||
await Promise.all([loadJS("lib/regl.min.js"), loadJS("lib/gl-matrix.js")]);
|
||||
glMatrix = globalThis.glMatrix;
|
||||
createREGL = globalThis.createREGL;
|
||||
inclusions = [];
|
||||
}
|
||||
|
||||
return { glMatrix, createREGL };
|
||||
return { glMatrix, createREGL, inclusions };
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user