@next2d/renderer 3.12.1 → 3.13.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@next2d/renderer",
3
- "version": "3.12.1",
3
+ "version": "3.13.0",
4
4
  "description": "Next2D Renderer Package",
5
5
  "author": "Toshiyuki Ienaga<ienaga@next2d.app> (https://github.com/ienaga/)",
6
6
  "license": "MIT",
@@ -24,9 +24,9 @@
24
24
  "url": "git+https://github.com/Next2D/Player.git"
25
25
  },
26
26
  "dependencies": {
27
- "@next2d/webgl": "3.12.1",
28
- "@next2d/webgpu": "3.12.1",
29
- "@next2d/cache": "3.12.1",
30
- "@next2d/texture-packer": "3.12.1"
27
+ "@next2d/webgl": "3.13.0",
28
+ "@next2d/webgpu": "3.13.0",
29
+ "@next2d/cache": "3.13.0",
30
+ "@next2d/texture-packer": "3.13.0"
31
31
  }
32
32
  }
@@ -32,6 +32,16 @@ export const execute = async (canvas, device_pixel_ratio) => {
32
32
  if (!device) {
33
33
  throw new Error("WebGPU device not available");
34
34
  }
35
+ void device.lost.then((info) => {
36
+ if (info.reason !== "destroyed") {
37
+ globalThis.postMessage({ "message": "rendererFailure", "reason": "device-lost" });
38
+ }
39
+ });
40
+ device.addEventListener("uncapturederror", (event) => {
41
+ if (event.error instanceof GPUOutOfMemoryError) {
42
+ globalThis.postMessage({ "message": "rendererFailure", "reason": "gpu-memory" });
43
+ }
44
+ });
35
45
  const context = canvas.getContext("webgpu");
36
46
  if (!context) {
37
47
  throw new Error("WebGPU context not available");
@@ -15,5 +15,5 @@ export const execute = (text_format) => {
15
15
  if (text_format.bold) {
16
16
  fontStyle += "bold ";
17
17
  }
18
- return `${fontStyle}${text_format.size}px '${text_format.font}','sans-serif'`;
18
+ return `${fontStyle}${text_format.size}px '${text_format.font}',sans-serif`;
19
19
  };