From 4b80ec9a81f02d0555afd9a935cfc310689e46b7 Mon Sep 17 00:00:00 2001 From: Davide Tantillo Date: Tue, 14 Oct 2025 12:59:34 +0200 Subject: [PATCH] Removed padUint16ArrayForWebGPU since the bug has been fixed from Scirra. --- .../spine-construct3/src/c3runtime/instance.ts | 18 +----------------- spine-ts/spine-construct3/src/instance.ts | 18 +----------------- 2 files changed, 2 insertions(+), 34 deletions(-) diff --git a/spine-ts/spine-construct3/src/c3runtime/instance.ts b/spine-ts/spine-construct3/src/c3runtime/instance.ts index 125b44a69..d1ea29bcf 100644 --- a/spine-ts/spine-construct3/src/c3runtime/instance.ts +++ b/spine-ts/spine-construct3/src/c3runtime/instance.ts @@ -264,8 +264,7 @@ class DrawingInstance extends globalThis.ISDKWorldInstanceBase { renderer.drawMesh( vertices.subarray(0, numVertices * 3), uvs.subarray(0, numVertices * 2), - // workaround for this bug: https://github.com/Scirra/Construct-bugs/issues/8746 - this.padUint16ArrayForWebGPU(indices.subarray(0, numIndices)), + indices.subarray(0, numIndices), c3colors.subarray(0, numVertices * 4), ); @@ -274,21 +273,6 @@ class DrawingInstance extends globalThis.ISDKWorldInstanceBase { } - padUint16ArrayForWebGPU (originalArray: Uint16Array) { - const currentLength = originalArray.length; - - const alignedLength = Math.ceil(currentLength / 6) * 6; - - if (alignedLength === currentLength) { - return originalArray; - } - - const paddedArray = new Uint16Array(alignedLength); - paddedArray.set(originalArray); - - return paddedArray; - } - _saveToJson () { return { // data to be saved for savegames diff --git a/spine-ts/spine-construct3/src/instance.ts b/spine-ts/spine-construct3/src/instance.ts index 7135c6f21..583486271 100644 --- a/spine-ts/spine-construct3/src/instance.ts +++ b/spine-ts/spine-construct3/src/instance.ts @@ -149,8 +149,7 @@ class MyDrawingInstance extends SDK.IWorldInstanceBase { iRenderer.DrawMesh( vertices.subarray(0, numVertices * 3), uvs.subarray(0, numVertices * 2), - // workaround for this bug: https://github.com/Scirra/Construct-bugs/issues/8746 - this.padUint16ArrayForWebGPU(indices.subarray(0, numIndices)), + indices.subarray(0, numIndices), c3colors, ); @@ -199,21 +198,6 @@ class MyDrawingInstance extends SDK.IWorldInstanceBase { } } - padUint16ArrayForWebGPU (originalArray: Uint16Array) { - const currentLength = originalArray.length; - - const alignedLength = Math.ceil(currentLength / 6) * 6; - - if (alignedLength === currentLength) { - return originalArray; - } - - const paddedArray = new Uint16Array(alignedLength); - paddedArray.set(originalArray); - - return paddedArray; - } - async OnPropertyChanged (id: string, value: EditorPropertyValueType) { console.log(`Prop change - Name: ${id} - Value: ${value}`);