mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-04 14:24:53 +08:00
Removed padUint16ArrayForWebGPU since the bug has been fixed from Scirra.
This commit is contained in:
parent
eac735e5a9
commit
4b80ec9a81
@ -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
|
||||
|
||||
@ -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}`);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user