mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +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(
|
renderer.drawMesh(
|
||||||
vertices.subarray(0, numVertices * 3),
|
vertices.subarray(0, numVertices * 3),
|
||||||
uvs.subarray(0, numVertices * 2),
|
uvs.subarray(0, numVertices * 2),
|
||||||
// workaround for this bug: https://github.com/Scirra/Construct-bugs/issues/8746
|
indices.subarray(0, numIndices),
|
||||||
this.padUint16ArrayForWebGPU(indices.subarray(0, numIndices)),
|
|
||||||
c3colors.subarray(0, numVertices * 4),
|
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 () {
|
_saveToJson () {
|
||||||
return {
|
return {
|
||||||
// data to be saved for savegames
|
// data to be saved for savegames
|
||||||
|
|||||||
@ -149,8 +149,7 @@ class MyDrawingInstance extends SDK.IWorldInstanceBase {
|
|||||||
iRenderer.DrawMesh(
|
iRenderer.DrawMesh(
|
||||||
vertices.subarray(0, numVertices * 3),
|
vertices.subarray(0, numVertices * 3),
|
||||||
uvs.subarray(0, numVertices * 2),
|
uvs.subarray(0, numVertices * 2),
|
||||||
// workaround for this bug: https://github.com/Scirra/Construct-bugs/issues/8746
|
indices.subarray(0, numIndices),
|
||||||
this.padUint16ArrayForWebGPU(indices.subarray(0, numIndices)),
|
|
||||||
c3colors,
|
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) {
|
async OnPropertyChanged (id: string, value: EditorPropertyValueType) {
|
||||||
console.log(`Prop change - Name: ${id} - Value: ${value}`);
|
console.log(`Prop change - Name: ${id} - Value: ${value}`);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user