wgsl-renderer 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/index.js CHANGED
@@ -462,7 +462,8 @@ var WGSLRenderer = class {
462
462
  getPassTexture(passName, options) {
463
463
  const pass = this.passes.find((pass$1) => pass$1.name === passName);
464
464
  if (!pass) throw new Error(`Cannot find pass named '${passName}'. Available passes: [${this.passes.map((p) => p.name).join(", ")}]`);
465
- if ((options?.format ?? "rgba8unorm") !== pass.format) throw new Error(`Format must be set to ${pass.format}, pass name: '${passName}'`);
465
+ const f = options?.format ?? "rgba8unorm";
466
+ if (pass.format && f !== pass.format) throw new Error(`Format must be set to ${pass.format}, pass name: '${passName}'`);
466
467
  return PassTextureRef.create(passName, options);
467
468
  }
468
469
  /**
package/dist/esm/index.js CHANGED
@@ -461,7 +461,8 @@ var WGSLRenderer = class {
461
461
  getPassTexture(passName, options) {
462
462
  const pass = this.passes.find((pass$1) => pass$1.name === passName);
463
463
  if (!pass) throw new Error(`Cannot find pass named '${passName}'. Available passes: [${this.passes.map((p) => p.name).join(", ")}]`);
464
- if ((options?.format ?? "rgba8unorm") !== pass.format) throw new Error(`Format must be set to ${pass.format}, pass name: '${passName}'`);
464
+ const f = options?.format ?? "rgba8unorm";
465
+ if (pass.format && f !== pass.format) throw new Error(`Format must be set to ${pass.format}, pass name: '${passName}'`);
465
466
  return PassTextureRef.create(passName, options);
466
467
  }
467
468
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wgsl-renderer",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "A multi-pass renderer based on WebGPU and WGSL.",
5
5
  "type": "module",
6
6
  "main": "./dist/cjs/index.js",