@ludicon/spark.js 0.0.10 → 0.0.11

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/README.md CHANGED
@@ -8,7 +8,7 @@ Real-time texture compression library for the Web.
8
8
 
9
9
  It enables the use of standard image formats in WebGPU applications transcoding them at load-time to native GPU formats like BC7, ASTC, and ETC2, using fast, high-quality GPU encoders.
10
10
 
11
- > [Try the demo viewer](https://ludicon.com/sparkjs/viewer/)
11
+ > Try the [image viewer](https://ludicon.com/sparkjs/viewer/) or the [gltf demo](https://ludicon.com/sparkjs/gltf-demo/)
12
12
 
13
13
  ---
14
14
 
package/dist/spark.esm.js CHANGED
@@ -466,7 +466,7 @@ class Spark {
466
466
  */
467
467
  static async create(device, options = {}) {
468
468
  const instance = new Spark();
469
- await instance.#init(device, options.preload ?? false);
469
+ await instance.#init(device, options.preload ?? false, options.useTimestampQueries ?? false);
470
470
  return instance;
471
471
  }
472
472
  /**
@@ -822,7 +822,7 @@ class Spark {
822
822
  const elapsedMilliseconds = elapsedNanoseconds / 1e6;
823
823
  return elapsedMilliseconds;
824
824
  }
825
- async #init(device, preload) {
825
+ async #init(device, preload, useTimestampQueries) {
826
826
  assert(device, "device is required");
827
827
  assert(isWebGPU(device), "device is not a WebGPU device");
828
828
  this.#device = device;
@@ -838,7 +838,7 @@ class Spark {
838
838
  });
839
839
  this.#device.queue.writeBuffer(this.#uniformBuffer[i], 0, new Uint32Array([i]));
840
840
  }
841
- if (this.#device.features.has("timestamp-query")) {
841
+ if (useTimestampQueries && this.#device.features.has("timestamp-query")) {
842
842
  const webkitVersion = getSafariVersion();
843
843
  const firefoxVersion = getFirefoxVersion();
844
844
  if ((!webkitVersion || webkitVersion >= 26) && !firefoxVersion) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ludicon/spark.js",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "description": "Real-Time GPU Texture Codecs for the Web",
5
5
  "main": "dist/spark.esm.js",
6
6
  "module": "dist/spark.esm.js",