@taole/giftstage 0.3.0 → 0.3.2
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/dist/gift-stage.cjs +3 -3
- package/dist/gift-stage.es.js +114 -87
- package/dist/plugin/playback-scope.d.ts +1 -0
- package/package.json +1 -1
package/dist/gift-stage.es.js
CHANGED
|
@@ -3686,10 +3686,15 @@ const hg = class CA {
|
|
|
3686
3686
|
return this.currentDrawResult = $("backend-lost", "WebGPU device is lost"), this.rejectSVGAFastPathDraw(), this.currentDrawResult;
|
|
3687
3687
|
if (!this.passEncoder)
|
|
3688
3688
|
return this.rejectSVGAFastPathDraw(), this.currentDrawResult = $("invalid-command", "WebGPU frame is not active"), this.currentDrawResult;
|
|
3689
|
+
if ((A.stencil != null && A.stencil !== "none" || g === "clip-mask" || g === "clip-mask-instanced" || g === "svga-frame-table-clip-mask") && !this.frameUsesStencil)
|
|
3690
|
+
return this.rejectSVGAFastPathDraw(), this.currentDrawResult = $(
|
|
3691
|
+
"invalid-command",
|
|
3692
|
+
`WebGPU ${g} requires a depth-stencil attachment in the active frame`
|
|
3693
|
+
), this.currentDrawResult;
|
|
3689
3694
|
try {
|
|
3690
3695
|
this.drawInternal(A);
|
|
3691
|
-
} catch (
|
|
3692
|
-
return this.currentDrawResult = $("submission-error", this.errorMessage(
|
|
3696
|
+
} catch (B) {
|
|
3697
|
+
return this.currentDrawResult = $("submission-error", this.errorMessage(B)), this.currentDrawRecorded || this.rejectSVGAFastPathDraw(), this.currentDrawResult;
|
|
3693
3698
|
}
|
|
3694
3699
|
return this.currentDrawRecorded || this.rejectSVGAFastPathDraw(), this.currentDrawResult;
|
|
3695
3700
|
}
|
|
@@ -3927,12 +3932,12 @@ const hg = class CA {
|
|
|
3927
3932
|
rA,
|
|
3928
3933
|
this.storageBindOffsetAlign
|
|
3929
3934
|
), this.writeInstancedStorageShadow(QA, UA, rA), this.performanceSVGADynamicUploadWrites++, this.performanceSVGADynamicUploadBytes += rA, x && BA >= 0 && (this.svgaCompactSlotStateUploadId = BA, this.svgaCompactSlotStateStorageBase = QA, this.svgaCompactSlotStateByteLength = rA));
|
|
3930
|
-
const V = A.motionTrackIndex, YA = A.motionTrackBuffer, kA = A.motionTrackGlobalsBuffer, W = YA ? this.buffers.get(YA.id) : null, pA = kA ? this.buffers.get(kA.id) : null, LA = Math.floor((D = A.motionTrackSampleCount) != null ? D : 0), ag = Math.floor(V != null ? V : -1), OA = (ag + 1) * LA * 8 * 4, KA = ag >= 0 && LA >= 1 && (W == null ? void 0 : W.usage) === "storage" && (pA == null ? void 0 : pA.usage) === "uniform" && W.buffer.size >= OA && pA.buffer.size >= 32,
|
|
3935
|
+
const V = A.motionTrackIndex, YA = A.motionTrackBuffer, kA = A.motionTrackGlobalsBuffer, W = YA ? this.buffers.get(YA.id) : null, pA = kA ? this.buffers.get(kA.id) : null, LA = Math.floor((D = A.motionTrackSampleCount) != null ? D : 0), ag = Math.floor(V != null ? V : -1), OA = (ag + 1) * LA * 8 * 4, KA = ag >= 0 && LA >= 1 && (W == null ? void 0 : W.usage) === "storage" && (pA == null ? void 0 : pA.usage) === "uniform" && W.buffer.size >= OA && pA.buffer.size >= 32, TA = A.stencil === "test" ? "test" : A.stencil === "write" ? "write" : A.stencil === "clear" ? "clear" : this.frameUsesStencil ? "pass" : "none", sA = l ? this.ensureSVGAFrameTableMeshPipeline(
|
|
3931
3936
|
A.shader,
|
|
3932
|
-
|
|
3933
|
-
) : this.ensureSVGAFrameTablePipeline(
|
|
3937
|
+
TA
|
|
3938
|
+
) : this.ensureSVGAFrameTablePipeline(TA === "test" ? "test" : TA === "pass" ? "pass" : "none");
|
|
3934
3939
|
this.lastDrawPipeline !== sA.pipeline && (w.setPipeline(sA.pipeline), this.lastDrawPipeline = sA.pipeline, this.lastInstancedTextureBindGroup = null);
|
|
3935
|
-
const L =
|
|
3940
|
+
const L = TA === "test" || TA === "write" ? 1 : 0;
|
|
3936
3941
|
this.frameUsesStencil && this.lastStencilRef !== L && (w.setStencilReference(L), this.lastStencilRef = L);
|
|
3937
3942
|
const EA = A.uniforms.u_projection;
|
|
3938
3943
|
if (!(EA instanceof Float32Array) || EA.length < 16) return;
|
|
@@ -4002,20 +4007,20 @@ const hg = class CA {
|
|
|
4002
4007
|
}), this.instancedTextureBindGroupCache.set(eA, tA)), w.setBindGroup(1, tA), this.lastVertexBufferId !== A.vertexBuffer.id && (w.setVertexBuffer(0, Bg.buffer), this.lastVertexBufferId = A.vertexBuffer.id), this.lastIndexBufferId !== A.indexBuffer.id && (w.setIndexBuffer(AA.buffer, "uint32"), this.lastIndexBufferId = A.indexBuffer.id), w.drawIndexed(A.indexCount, F, 0, 0, 0), this.recordSubmittedDraw();
|
|
4003
4008
|
}
|
|
4004
4009
|
resolveSVGAFrameTableSlotUniform(A, g, I) {
|
|
4005
|
-
var B, Q, E, i, e, t, a, o, s, n, r, h, c, D, w, l, F, d, y, G, f, u, R, M, N, S, Y, U, k, m, J, q, _, Z, x, X, v, gA, UA, yA, rA, BA, Ig, QA, V, YA, kA, W, pA, LA, ag, OA, KA,
|
|
4010
|
+
var B, Q, E, i, e, t, a, o, s, n, r, h, c, D, w, l, F, d, y, G, f, u, R, M, N, S, Y, U, k, m, J, q, _, Z, x, X, v, gA, UA, yA, rA, BA, Ig, QA, V, YA, kA, W, pA, LA, ag, OA, KA, TA, sA;
|
|
4006
4011
|
const L = (Q = (B = A.svgaFrameTableSlotState) != null ? B : A.svgaSlotState) != null ? Q : A.uniforms.u_svgaSlotState instanceof Float32Array ? A.uniforms.u_svgaSlotState : A.uniforms.u_slotState instanceof Float32Array ? A.uniforms.u_slotState : null, EA = A.uniforms.u_transform, Bg = A.uniforms.u_clipRect, AA = A.svgaFrameTableParentAffine, DA = A.svgaFrameTableParentTranslate, IA = A.svgaFrameTableClipRect, pg = A.svgaFrameIndex != null || A.svgaFrameTableFrameIndex != null || A.frameTableFrameIndex != null, Kg = A.svgaFrameTableOpacity != null || typeof A.uniforms.u_opacity == "number", Cg = A.uniforms.u_projection;
|
|
4007
4012
|
if (!(Cg instanceof Float32Array) || Cg.length < 16) return null;
|
|
4008
|
-
let GA = 1, fA = 0, dA = 0, iA = 1, eA = 0, tA = 0, hA = (E = A.svgaFrameTableOpacity) != null ? E : typeof A.uniforms.u_opacity == "number" ? A.uniforms.u_opacity : 1, aA = (t = (e = (i = A.svgaFrameIndex) != null ? i : A.svgaFrameTableFrameIndex) != null ? e : A.frameTableFrameIndex) != null ? t : 0, nA = 0, RA = 0, uA = this.canvas.width,
|
|
4013
|
+
let GA = 1, fA = 0, dA = 0, iA = 1, eA = 0, tA = 0, hA = (E = A.svgaFrameTableOpacity) != null ? E : typeof A.uniforms.u_opacity == "number" ? A.uniforms.u_opacity : 1, aA = (t = (e = (i = A.svgaFrameIndex) != null ? i : A.svgaFrameTableFrameIndex) != null ? e : A.frameTableFrameIndex) != null ? t : 0, nA = 0, RA = 0, uA = this.canvas.width, vA = this.canvas.height, Qg = 0, Wg = (a = A.svgaFrameTableAtlasPage) != null ? a : -1, PA = (h = (r = (n = (s = (o = A.svgaFrameTableMetadataBase) != null ? o : A.svgaFrameTableSpriteBase) != null ? s : A.frameTableSpriteBase) != null ? n : A.svgaSpriteMetadataBase) != null ? r : A.svgaSpriteBase) != null ? h : 0;
|
|
4009
4014
|
if (AA && AA.length >= 4)
|
|
4010
|
-
GA = (c = AA[0]) != null ? c : GA, fA = (D = AA[1]) != null ? D : fA, dA = (w = AA[2]) != null ? w : dA, iA = (l = AA[3]) != null ? l : iA, DA && DA.length >= 2 && (eA = (F = DA[0]) != null ? F : eA, tA = (d = DA[1]) != null ? d : tA), IA && IA.length >= 4 && (nA = (y = IA[0]) != null ? y : nA, RA = (G = IA[1]) != null ? G : RA, uA = (f = IA[2]) != null ? f : uA,
|
|
4015
|
+
GA = (c = AA[0]) != null ? c : GA, fA = (D = AA[1]) != null ? D : fA, dA = (w = AA[2]) != null ? w : dA, iA = (l = AA[3]) != null ? l : iA, DA && DA.length >= 2 && (eA = (F = DA[0]) != null ? F : eA, tA = (d = DA[1]) != null ? d : tA), IA && IA.length >= 4 && (nA = (y = IA[0]) != null ? y : nA, RA = (G = IA[1]) != null ? G : RA, uA = (f = IA[2]) != null ? f : uA, vA = (u = IA[3]) != null ? u : vA, Qg = 1);
|
|
4011
4016
|
else if (L && L.length >= 13)
|
|
4012
|
-
GA = (R = L[0]) != null ? R : GA, fA = (M = L[1]) != null ? M : fA, dA = (N = L[2]) != null ? N : dA, iA = (S = L[3]) != null ? S : iA, eA = (Y = L[4]) != null ? Y : eA, tA = (U = L[5]) != null ? U : tA, Kg || (hA = (k = L[6]) != null ? k : hA), pg || (aA = (m = L[7]) != null ? m : aA), nA = (J = L[8]) != null ? J : nA, RA = (q = L[9]) != null ? q : RA, uA = (_ = L[10]) != null ? _ : uA,
|
|
4017
|
+
GA = (R = L[0]) != null ? R : GA, fA = (M = L[1]) != null ? M : fA, dA = (N = L[2]) != null ? N : dA, iA = (S = L[3]) != null ? S : iA, eA = (Y = L[4]) != null ? Y : eA, tA = (U = L[5]) != null ? U : tA, Kg || (hA = (k = L[6]) != null ? k : hA), pg || (aA = (m = L[7]) != null ? m : aA), nA = (J = L[8]) != null ? J : nA, RA = (q = L[9]) != null ? q : RA, uA = (_ = L[10]) != null ? _ : uA, vA = (Z = L[11]) != null ? Z : vA, Qg = ((x = L[12]) != null ? x : 0) > 0.5 ? 1 : 0, A.svgaFrameTableMetadataBase == null && A.svgaFrameTableSpriteBase == null && A.frameTableSpriteBase == null && A.svgaSpriteMetadataBase == null && A.svgaSpriteBase == null && L.length >= 14 && (PA = (X = L[13]) != null ? X : PA);
|
|
4013
4018
|
else if (EA instanceof Float32Array && EA.length >= 16) {
|
|
4014
4019
|
GA = (v = EA[0]) != null ? v : GA, fA = (gA = EA[1]) != null ? gA : fA, dA = (UA = EA[4]) != null ? UA : dA, iA = (yA = EA[5]) != null ? yA : iA, eA = (rA = EA[12]) != null ? rA : eA, tA = (BA = EA[13]) != null ? BA : tA;
|
|
4015
4020
|
const _g = Bg instanceof Float32Array && Bg.length >= 4 ? Bg : IA;
|
|
4016
|
-
_g && _g.length >= 4 && (nA = (Ig = _g[0]) != null ? Ig : nA, RA = (QA = _g[1]) != null ? QA : RA, uA = (V = _g[2]) != null ? V : uA,
|
|
4021
|
+
_g && _g.length >= 4 && (nA = (Ig = _g[0]) != null ? Ig : nA, RA = (QA = _g[1]) != null ? QA : RA, uA = (V = _g[2]) != null ? V : uA, vA = (YA = _g[3]) != null ? YA : vA, Qg = typeof A.uniforms.u_clipEnabled == "number" ? A.uniforms.u_clipEnabled > 0.5 ? 1 : 0 : 1);
|
|
4017
4022
|
}
|
|
4018
|
-
return AA && L && L.length >= 13 && (DA || (eA = (kA = L[4]) != null ? kA : eA, tA = (W = L[5]) != null ? W : tA), Kg || (hA = (pA = L[6]) != null ? pA : hA), pg || (aA = (LA = L[7]) != null ? LA : aA), IA || (nA = (ag = L[8]) != null ? ag : nA, RA = (OA = L[9]) != null ? OA : RA, uA = (KA = L[10]) != null ? KA : uA,
|
|
4023
|
+
return AA && L && L.length >= 13 && (DA || (eA = (kA = L[4]) != null ? kA : eA, tA = (W = L[5]) != null ? W : tA), Kg || (hA = (pA = L[6]) != null ? pA : hA), pg || (aA = (LA = L[7]) != null ? LA : aA), IA || (nA = (ag = L[8]) != null ? ag : nA, RA = (OA = L[9]) != null ? OA : RA, uA = (KA = L[10]) != null ? KA : uA, vA = (TA = L[11]) != null ? TA : vA, Qg = ((sA = L[12]) != null ? sA : 0) > 0.5 ? 1 : 0)), Number.isFinite(hA) || (hA = 1), Number.isFinite(aA) || (aA = 0), Number.isFinite(PA) || (PA = 0), Number.isFinite(Wg) || (Wg = -1), aA = Math.max(0, Math.min(I - 1, Math.floor(aA))), PA = Math.max(0, Math.floor(PA)), ![GA, fA, dA, iA, eA, tA, hA].every(Number.isFinite) || g < 1 ? null : {
|
|
4019
4024
|
parentA: GA,
|
|
4020
4025
|
parentB: fA,
|
|
4021
4026
|
parentC: dA,
|
|
@@ -4027,7 +4032,7 @@ const hg = class CA {
|
|
|
4027
4032
|
clipX0: nA,
|
|
4028
4033
|
clipY0: RA,
|
|
4029
4034
|
clipX1: uA,
|
|
4030
|
-
clipY1:
|
|
4035
|
+
clipY1: vA,
|
|
4031
4036
|
clipEnabled: Qg,
|
|
4032
4037
|
metadataBase: PA,
|
|
4033
4038
|
atlasPage: Math.max(-1, Math.floor(Wg))
|
|
@@ -4229,7 +4234,7 @@ function dC(C, A, g) {
|
|
|
4229
4234
|
}
|
|
4230
4235
|
return I;
|
|
4231
4236
|
}
|
|
4232
|
-
function
|
|
4237
|
+
function WA(C, A, g) {
|
|
4233
4238
|
const I = dC(C, C.VERTEX_SHADER, A), B = dC(C, C.FRAGMENT_SHADER, g), Q = C.createProgram();
|
|
4234
4239
|
if (!Q)
|
|
4235
4240
|
throw C.deleteShader(I), C.deleteShader(B), new Error("Failed to create program");
|
|
@@ -4258,7 +4263,7 @@ function pI(C) {
|
|
|
4258
4263
|
return typeof A.displayHeight == "number" && A.displayHeight > 0 ? A.displayHeight : typeof A.codedHeight == "number" && A.codedHeight > 0 ? A.codedHeight : typeof A.videoHeight == "number" && A.videoHeight > 0 ? A.videoHeight : typeof A.naturalHeight == "number" && A.naturalHeight > 0 ? A.naturalHeight : typeof A.height == "number" && A.height > 0 ? A.height : 0;
|
|
4259
4264
|
}
|
|
4260
4265
|
var si = Object.defineProperty, ni = (C, A, g) => A in C ? si(C, A, { enumerable: !0, configurable: !0, writable: !0, value: g }) : C[A] = g, H = (C, A, g) => ni(C, typeof A != "symbol" ? A + "" : A, g);
|
|
4261
|
-
const vI = "svga-frame-table-instanced-premul", uC = 8, ri = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]), hi = new Float32Array([1, 1]), SA = class
|
|
4266
|
+
const vI = "svga-frame-table-instanced-premul", uC = 8, ri = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]), hi = new Float32Array([1, 1]), SA = class bA {
|
|
4262
4267
|
constructor(A, g = !0) {
|
|
4263
4268
|
H(this, "type", "webgl2"), H(this, "supportsAtomicFrameReplay", !0), H(this, "canvas"), H(this, "maxTextureSize", 4096), H(this, "antialias"), H(this, "gl"), H(this, "nextId", 1), H(this, "buffers", /* @__PURE__ */ new Map()), H(this, "textures", /* @__PURE__ */ new Map()), H(this, "frameTables", /* @__PURE__ */ new Map()), H(this, "ownedFrameTableMetadataIds", /* @__PURE__ */ new Set()), H(this, "programs", /* @__PURE__ */ new Map()), H(this, "vertexArrays", /* @__PURE__ */ new Map()), H(this, "cachedDrawProgram", null), H(this, "cachedTex0Id", null), H(this, "cachedFrameTableId", null), H(this, "cachedFrameMetadataId", null), H(this, "cachedProjectionRef", null), H(this, "cachedProjectionShader", null), H(this, "videoUploadCanvas", null), H(this, "videoUploadCtx", null), H(this, "videoElementPreferCanvasBridge", oi()), H(this, "videoElementDirectUploadValidated", !1), H(this, "maxVertexTextureImageUnits", 0), H(this, "svgaFrameTableSupported", !1), H(this, "instancedSvgaInstanceGLBuffer", null), H(this, "svgaSlotStateTexture", null), H(this, "svgaSlotStateTextureWidth", 0), H(this, "svgaSlotStateTextureHeight", 0), H(this, "svgaSlotStateUploadScratch", new Float32Array(0)), H(this, "svgaSlotStateUploadId", -1), H(this, "svgaTableInfoScratch", new Int32Array(4)), H(this, "svgaTableSizeScratch", new Int32Array(2)), H(this, "svgaMetadataSizeScratch", new Int32Array(2)), H(this, "instancedClipMaskGLBuffer", null), H(this, "instancedAlphaInstanceGLBuffer", null), H(this, "performanceBufferWrites", 0), H(this, "performanceBufferWriteBytes", 0), H(this, "performanceStorageBufferWrites", 0), H(this, "performanceStorageBufferWriteBytes", 0), H(this, "performanceSubmittedDrawCalls", 0), H(this, "performanceRejectedDrawCalls", 0), H(this, "performanceSVGADynamicUploadWrites", 0), H(this, "performanceSVGADynamicUploadBytes", 0), H(this, "runtimeSubmittedDrawCalls", 0), H(this, "runtimeRejectedDrawCalls", 0), H(this, "currentDrawResult", $(
|
|
4264
4269
|
"invalid-command",
|
|
@@ -4317,19 +4322,19 @@ const vI = "svga-frame-table-instanced-premul", uC = 8, ri = new Float32Array([1
|
|
|
4317
4322
|
this.currentDrawRecorded = !0, this.currentDrawResult.submitted && (this.currentDrawResult = $("invalid-command", "WebGL2 draw was rejected")), this.performanceRejectedDrawCalls++, this.runtimeRejectedDrawCalls++;
|
|
4318
4323
|
}
|
|
4319
4324
|
initPrograms() {
|
|
4320
|
-
const A = this.gl, g =
|
|
4325
|
+
const A = this.gl, g = WA(A, P.svgaBatchPremul.vert, P.svgaBatchPremul.frag);
|
|
4321
4326
|
this.programs.set(
|
|
4322
4327
|
"svga-batch-premul",
|
|
4323
4328
|
this.makeProgramEntry(g, { transform: !0, opacity: !0 })
|
|
4324
4329
|
), this.bindProgramSamplers(g, { u_atlas: 0 });
|
|
4325
|
-
const I =
|
|
4330
|
+
const I = WA(
|
|
4326
4331
|
A,
|
|
4327
4332
|
P.svgaInstancedPremul.vert,
|
|
4328
4333
|
P.svgaInstancedPremul.frag
|
|
4329
4334
|
);
|
|
4330
4335
|
if (this.programs.set("svga-instanced-premul", this.makeProgramEntry(I)), this.bindProgramSamplers(I, { u_atlas: 0 }), this.maxVertexTextureImageUnits >= 2 && this.maxTextureSize >= 3)
|
|
4331
4336
|
try {
|
|
4332
|
-
const n =
|
|
4337
|
+
const n = WA(
|
|
4333
4338
|
A,
|
|
4334
4339
|
P.svgaFrameTableInstancedPremul.vert,
|
|
4335
4340
|
P.svgaFrameTableInstancedPremul.frag
|
|
@@ -4364,7 +4369,7 @@ const vI = "svga-frame-table-instanced-premul", uC = 8, ri = new Float32Array([1
|
|
|
4364
4369
|
u_spriteMetadata: 2,
|
|
4365
4370
|
u_slotStates: 3
|
|
4366
4371
|
});
|
|
4367
|
-
const r =
|
|
4372
|
+
const r = WA(
|
|
4368
4373
|
A,
|
|
4369
4374
|
P.svgaFrameTableShape.vert,
|
|
4370
4375
|
P.svgaFrameTableShape.frag
|
|
@@ -4388,7 +4393,7 @@ const vI = "svga-frame-table-instanced-premul", uC = 8, ri = new Float32Array([1
|
|
|
4388
4393
|
compactSlotStateEnabled: !0
|
|
4389
4394
|
})
|
|
4390
4395
|
), this.bindProgramSamplers(r, { u_frameTable: 0, u_slotStates: 3 });
|
|
4391
|
-
const h =
|
|
4396
|
+
const h = WA(
|
|
4392
4397
|
A,
|
|
4393
4398
|
P.svgaFrameTableClipMask.vert,
|
|
4394
4399
|
P.svgaFrameTableClipMask.frag
|
|
@@ -4414,7 +4419,7 @@ const vI = "svga-frame-table-instanced-premul", uC = 8, ri = new Float32Array([1
|
|
|
4414
4419
|
} catch (n) {
|
|
4415
4420
|
this.svgaFrameTableSupported = !1, console.warn("[WebGL2] SVGA frame-table shader unavailable; using CPU reference path.", n);
|
|
4416
4421
|
}
|
|
4417
|
-
const B =
|
|
4422
|
+
const B = WA(A, P.vap.vert, P.vap.frag);
|
|
4418
4423
|
this.programs.set(
|
|
4419
4424
|
"vap",
|
|
4420
4425
|
this.makeProgramEntry(B, {
|
|
@@ -4424,12 +4429,12 @@ const vI = "svga-frame-table-instanced-premul", uC = 8, ri = new Float32Array([1
|
|
|
4424
4429
|
rgbPremultiplied: !0
|
|
4425
4430
|
})
|
|
4426
4431
|
), this.bindProgramSamplers(B, { u_video: 0 });
|
|
4427
|
-
const Q =
|
|
4432
|
+
const Q = WA(A, P.vapMixOverlay.vert, P.vapMixOverlay.frag);
|
|
4428
4433
|
this.programs.set(
|
|
4429
4434
|
"vap-mix-overlay",
|
|
4430
4435
|
this.makeProgramEntry(Q, { transform: !0, atlasRemap: !0, opacity: !0 })
|
|
4431
4436
|
), this.bindProgramSamplers(Q, { u_resource: 0, u_video: 1 });
|
|
4432
|
-
const E =
|
|
4437
|
+
const E = WA(A, P.alphaVideo.vert, P.alphaVideo.frag);
|
|
4433
4438
|
this.programs.set(
|
|
4434
4439
|
"alpha-video",
|
|
4435
4440
|
this.makeProgramEntry(E, {
|
|
@@ -4439,28 +4444,28 @@ const vI = "svga-frame-table-instanced-premul", uC = 8, ri = new Float32Array([1
|
|
|
4439
4444
|
rgbPremultiplied: !0
|
|
4440
4445
|
})
|
|
4441
4446
|
), this.bindProgramSamplers(E, { u_video: 0 });
|
|
4442
|
-
const i =
|
|
4447
|
+
const i = WA(A, P.rgbaTextured.vert, P.rgbaTextured.frag);
|
|
4443
4448
|
this.programs.set(
|
|
4444
4449
|
"rgba-textured",
|
|
4445
4450
|
this.makeProgramEntry(i, { transform: !0, atlasRemap: !0, opacity: !0 })
|
|
4446
4451
|
), this.bindProgramSamplers(i, { u_video: 0 });
|
|
4447
|
-
const e =
|
|
4452
|
+
const e = WA(
|
|
4448
4453
|
A,
|
|
4449
4454
|
P.alphaVideoInstanced.vert,
|
|
4450
4455
|
P.alphaVideoInstanced.frag
|
|
4451
4456
|
);
|
|
4452
4457
|
this.programs.set("alpha-video-instanced", this.makeProgramEntry(e)), this.bindProgramSamplers(e, { u_video: 0 });
|
|
4453
|
-
const t =
|
|
4458
|
+
const t = WA(A, P.vapInstanced.vert, P.vapInstanced.frag);
|
|
4454
4459
|
this.programs.set("vap-instanced", this.makeProgramEntry(t)), this.bindProgramSamplers(t, { u_video: 0 });
|
|
4455
|
-
const a =
|
|
4460
|
+
const a = WA(A, P.clipMask.vert, P.clipMask.frag);
|
|
4456
4461
|
this.programs.set("clip-mask", this.makeProgramEntry(a, { transform: !0 }));
|
|
4457
|
-
const o =
|
|
4462
|
+
const o = WA(
|
|
4458
4463
|
A,
|
|
4459
4464
|
P.clipMaskInstanced.vert,
|
|
4460
4465
|
P.clipMaskInstanced.frag
|
|
4461
4466
|
);
|
|
4462
4467
|
this.programs.set("clip-mask-instanced", this.makeProgramEntry(o));
|
|
4463
|
-
const s =
|
|
4468
|
+
const s = WA(
|
|
4464
4469
|
A,
|
|
4465
4470
|
P.particleInstanced.vert,
|
|
4466
4471
|
P.particleInstanced.frag
|
|
@@ -4470,7 +4475,7 @@ const vI = "svga-frame-table-instanced-premul", uC = 8, ri = new Float32Array([1
|
|
|
4470
4475
|
ensureParticleSpriteProgram() {
|
|
4471
4476
|
let A = this.programs.get("particle-sprite-instanced");
|
|
4472
4477
|
if (A) return A;
|
|
4473
|
-
const g =
|
|
4478
|
+
const g = WA(
|
|
4474
4479
|
this.gl,
|
|
4475
4480
|
P.particleSpriteInstanced.vert,
|
|
4476
4481
|
P.particleSpriteInstanced.frag
|
|
@@ -5076,7 +5081,7 @@ const vI = "svga-frame-table-instanced-premul", uC = 8, ri = new Float32Array([1
|
|
|
5076
5081
|
if (!this.instancedSvgaInstanceGLBuffer) {
|
|
5077
5082
|
const g = A.createBuffer();
|
|
5078
5083
|
if (!g) throw new Error("createBuffer failed");
|
|
5079
|
-
A.bindVertexArray(null), A.bindBuffer(A.ARRAY_BUFFER, g), A.bufferData(A.ARRAY_BUFFER,
|
|
5084
|
+
A.bindVertexArray(null), A.bindBuffer(A.ARRAY_BUFFER, g), A.bufferData(A.ARRAY_BUFFER, bA.INST_SVGA_GL_BYTES, A.DYNAMIC_DRAW), this.instancedSvgaInstanceGLBuffer = g;
|
|
5080
5085
|
}
|
|
5081
5086
|
return this.instancedSvgaInstanceGLBuffer;
|
|
5082
5087
|
}
|
|
@@ -5094,19 +5099,19 @@ const vI = "svga-frame-table-instanced-premul", uC = 8, ri = new Float32Array([1
|
|
|
5094
5099
|
return e !== t.length && (this.svgaSlotStateUploadScratch.length < e && (this.svgaSlotStateUploadScratch = new Float32Array(e)), this.svgaSlotStateUploadScratch.fill(0, 0, e), this.svgaSlotStateUploadScratch.set(t), a = this.svgaSlotStateUploadScratch.subarray(0, e)), B.texSubImage2D(B.TEXTURE_2D, 0, 0, 0, E, i, B.RGBA, B.FLOAT, a, 0), this.performanceSVGADynamicUploadWrites++, this.performanceSVGADynamicUploadBytes += g * $A * Float32Array.BYTES_PER_ELEMENT, this.svgaSlotStateUploadId = I, { width: E, height: i };
|
|
5095
5100
|
}
|
|
5096
5101
|
resolveSVGAFrameTableSlotState(A, g) {
|
|
5097
|
-
var I, B, Q, E, i, e, t, a, o, s, n, r, h, c, D, w, l, F, d, y, G, f, u, R, M, N, S, Y, U, k, m, J, q, _, Z, x, X, v, gA, UA, yA, rA, BA, Ig, QA, V, YA, kA, W, pA, LA, ag, OA, KA,
|
|
5102
|
+
var I, B, Q, E, i, e, t, a, o, s, n, r, h, c, D, w, l, F, d, y, G, f, u, R, M, N, S, Y, U, k, m, J, q, _, Z, x, X, v, gA, UA, yA, rA, BA, Ig, QA, V, YA, kA, W, pA, LA, ag, OA, KA, TA;
|
|
5098
5103
|
const sA = A.uniforms, L = (B = (I = A.svgaFrameTableSlotState) != null ? I : A.svgaSlotState) != null ? B : sA.u_svgaSlotState instanceof Float32Array ? sA.u_svgaSlotState : sA.u_slotState instanceof Float32Array ? sA.u_slotState : null, EA = sA.u_transform, Bg = sA.u_clipRect, AA = A.svgaFrameTableParentAffine, DA = A.svgaFrameTableParentTranslate, IA = A.svgaFrameTableClipRect, pg = A.svgaFrameIndex != null || A.svgaFrameTableFrameIndex != null || A.frameTableFrameIndex != null, Kg = A.svgaFrameTableOpacity != null || typeof sA.u_opacity == "number";
|
|
5099
|
-
let Cg = 1, GA = 0, fA = 0, dA = 1, iA = 0, eA = 0, tA = (Q = A.svgaFrameTableOpacity) != null ? Q : typeof sA.u_opacity == "number" ? sA.u_opacity : 1, hA = (e = (i = (E = A.svgaFrameIndex) != null ? E : A.svgaFrameTableFrameIndex) != null ? i : A.frameTableFrameIndex) != null ? e : 0, aA = 0, nA = 0, RA = this.canvas.width, uA = this.canvas.height,
|
|
5104
|
+
let Cg = 1, GA = 0, fA = 0, dA = 1, iA = 0, eA = 0, tA = (Q = A.svgaFrameTableOpacity) != null ? Q : typeof sA.u_opacity == "number" ? sA.u_opacity : 1, hA = (e = (i = (E = A.svgaFrameIndex) != null ? E : A.svgaFrameTableFrameIndex) != null ? i : A.frameTableFrameIndex) != null ? e : 0, aA = 0, nA = 0, RA = this.canvas.width, uA = this.canvas.height, vA = 0, Qg = (n = (s = (o = (a = (t = A.svgaFrameTableMetadataBase) != null ? t : A.svgaFrameTableSpriteBase) != null ? a : A.frameTableSpriteBase) != null ? o : A.svgaSpriteMetadataBase) != null ? s : A.svgaSpriteBase) != null ? n : 0, Wg = (r = A.svgaFrameTableAtlasPage) != null ? r : -1;
|
|
5100
5105
|
if (AA && AA.length >= 4)
|
|
5101
|
-
Cg = (h = AA[0]) != null ? h : Cg, GA = (c = AA[1]) != null ? c : GA, fA = (D = AA[2]) != null ? D : fA, dA = (w = AA[3]) != null ? w : dA, DA && DA.length >= 2 && (iA = (l = DA[0]) != null ? l : iA, eA = (F = DA[1]) != null ? F : eA), IA && IA.length >= 4 && (aA = (d = IA[0]) != null ? d : aA, nA = (y = IA[1]) != null ? y : nA, RA = (G = IA[2]) != null ? G : RA, uA = (f = IA[3]) != null ? f : uA,
|
|
5106
|
+
Cg = (h = AA[0]) != null ? h : Cg, GA = (c = AA[1]) != null ? c : GA, fA = (D = AA[2]) != null ? D : fA, dA = (w = AA[3]) != null ? w : dA, DA && DA.length >= 2 && (iA = (l = DA[0]) != null ? l : iA, eA = (F = DA[1]) != null ? F : eA), IA && IA.length >= 4 && (aA = (d = IA[0]) != null ? d : aA, nA = (y = IA[1]) != null ? y : nA, RA = (G = IA[2]) != null ? G : RA, uA = (f = IA[3]) != null ? f : uA, vA = 1);
|
|
5102
5107
|
else if (L && L.length >= 13)
|
|
5103
|
-
Cg = (u = L[0]) != null ? u : Cg, GA = (R = L[1]) != null ? R : GA, fA = (M = L[2]) != null ? M : fA, dA = (N = L[3]) != null ? N : dA, iA = (S = L[4]) != null ? S : iA, eA = (Y = L[5]) != null ? Y : eA, Kg || (tA = (U = L[6]) != null ? U : tA), pg || (hA = (k = L[7]) != null ? k : hA), aA = (m = L[8]) != null ? m : aA, nA = (J = L[9]) != null ? J : nA, RA = (q = L[10]) != null ? q : RA, uA = (_ = L[11]) != null ? _ : uA,
|
|
5108
|
+
Cg = (u = L[0]) != null ? u : Cg, GA = (R = L[1]) != null ? R : GA, fA = (M = L[2]) != null ? M : fA, dA = (N = L[3]) != null ? N : dA, iA = (S = L[4]) != null ? S : iA, eA = (Y = L[5]) != null ? Y : eA, Kg || (tA = (U = L[6]) != null ? U : tA), pg || (hA = (k = L[7]) != null ? k : hA), aA = (m = L[8]) != null ? m : aA, nA = (J = L[9]) != null ? J : nA, RA = (q = L[10]) != null ? q : RA, uA = (_ = L[11]) != null ? _ : uA, vA = ((Z = L[12]) != null ? Z : 0) > 0.5 ? 1 : 0, A.svgaFrameTableMetadataBase == null && A.svgaFrameTableSpriteBase == null && A.frameTableSpriteBase == null && A.svgaSpriteMetadataBase == null && A.svgaSpriteBase == null && L.length >= 14 && (Qg = (x = L[13]) != null ? x : Qg);
|
|
5104
5109
|
else if (EA instanceof Float32Array && EA.length >= 16) {
|
|
5105
5110
|
Cg = (X = EA[0]) != null ? X : Cg, GA = (v = EA[1]) != null ? v : GA, fA = (gA = EA[4]) != null ? gA : fA, dA = (UA = EA[5]) != null ? UA : dA, iA = (yA = EA[12]) != null ? yA : iA, eA = (rA = EA[13]) != null ? rA : eA;
|
|
5106
5111
|
const PA = Bg instanceof Float32Array && Bg.length >= 4 ? Bg : IA;
|
|
5107
|
-
PA && PA.length >= 4 && (aA = (BA = PA[0]) != null ? BA : aA, nA = (Ig = PA[1]) != null ? Ig : nA, RA = (QA = PA[2]) != null ? QA : RA, uA = (V = PA[3]) != null ? V : uA,
|
|
5112
|
+
PA && PA.length >= 4 && (aA = (BA = PA[0]) != null ? BA : aA, nA = (Ig = PA[1]) != null ? Ig : nA, RA = (QA = PA[2]) != null ? QA : RA, uA = (V = PA[3]) != null ? V : uA, vA = typeof sA.u_clipEnabled == "number" ? sA.u_clipEnabled > 0.5 ? 1 : 0 : 1);
|
|
5108
5113
|
}
|
|
5109
|
-
return AA && L && L.length >= 13 && (DA || (iA = (YA = L[4]) != null ? YA : iA, eA = (kA = L[5]) != null ? kA : eA), Kg || (tA = (W = L[6]) != null ? W : tA), pg || (hA = (pA = L[7]) != null ? pA : hA), IA || (aA = (LA = L[8]) != null ? LA : aA, nA = (ag = L[9]) != null ? ag : nA, RA = (OA = L[10]) != null ? OA : RA, uA = (KA = L[11]) != null ? KA : uA,
|
|
5114
|
+
return AA && L && L.length >= 13 && (DA || (iA = (YA = L[4]) != null ? YA : iA, eA = (kA = L[5]) != null ? kA : eA), Kg || (tA = (W = L[6]) != null ? W : tA), pg || (hA = (pA = L[7]) != null ? pA : hA), IA || (aA = (LA = L[8]) != null ? LA : aA, nA = (ag = L[9]) != null ? ag : nA, RA = (OA = L[10]) != null ? OA : RA, uA = (KA = L[11]) != null ? KA : uA, vA = ((TA = L[12]) != null ? TA : 0) > 0.5 ? 1 : 0)), Number.isFinite(tA) || (tA = 1), Number.isFinite(hA) || (hA = 0), Number.isFinite(Qg) || (Qg = 0), Number.isFinite(Wg) || (Wg = -1), hA = Math.max(0, Math.min(Math.max(1, g) - 1, Math.floor(hA))), Qg = Math.max(0, Math.floor(Qg)), [Cg, GA, fA, dA, iA, eA, tA, aA, nA, RA, uA].every(Number.isFinite) ? {
|
|
5110
5115
|
parentA: Cg,
|
|
5111
5116
|
parentB: GA,
|
|
5112
5117
|
parentC: fA,
|
|
@@ -5119,7 +5124,7 @@ const vI = "svga-frame-table-instanced-premul", uC = 8, ri = new Float32Array([1
|
|
|
5119
5124
|
clipY0: nA,
|
|
5120
5125
|
clipX1: RA,
|
|
5121
5126
|
clipY1: uA,
|
|
5122
|
-
clipEnabled:
|
|
5127
|
+
clipEnabled: vA,
|
|
5123
5128
|
metadataBase: Qg,
|
|
5124
5129
|
atlasPage: Math.max(-1, Math.floor(Wg))
|
|
5125
5130
|
} : null;
|
|
@@ -5208,12 +5213,12 @@ const vI = "svga-frame-table-instanced-premul", uC = 8, ri = new Float32Array([1
|
|
|
5208
5213
|
this.applyProjectionUniform(W, kA, A.uniforms.u_projection);
|
|
5209
5214
|
const KA = this.svgaTableInfoScratch;
|
|
5210
5215
|
KA[0] = q, KA[1] = _, KA[2] = 3, KA[3] = 0;
|
|
5211
|
-
const
|
|
5212
|
-
|
|
5216
|
+
const TA = this.svgaTableSizeScratch;
|
|
5217
|
+
TA[0] = Y.width, TA[1] = Y.height;
|
|
5213
5218
|
const sA = this.svgaMetadataSizeScratch;
|
|
5214
5219
|
sA[0] = k.width, sA[1] = k.height;
|
|
5215
5220
|
const L = R;
|
|
5216
|
-
if (W.tableInfoLoc && ((F = L.uniform4iv) == null || F.call(L, W.tableInfoLoc, KA)), W.frameTableSizeLoc && ((d = L.uniform2iv) == null || d.call(L, W.frameTableSizeLoc,
|
|
5221
|
+
if (W.tableInfoLoc && ((F = L.uniform4iv) == null || F.call(L, W.tableInfoLoc, KA)), W.frameTableSizeLoc && ((d = L.uniform2iv) == null || d.call(L, W.frameTableSizeLoc, TA)), W.spriteMetadataSizeLoc && ((y = L.uniform2iv) == null || y.call(L, W.spriteMetadataSizeLoc, sA)), W.spriteMetadataStrideLoc && R.uniform1i(W.spriteMetadataStrideLoc, QA), W.spriteBaseLoc && R.uniform1i(W.spriteBaseLoc, V.metadataBase), W.frameIndexLoc && R.uniform1i(W.frameIndexLoc, V.frameIndex), W.parentAffineLoc && R.uniform4f(W.parentAffineLoc, V.parentA, V.parentB, V.parentC, V.parentD), W.parentTranslateLoc && R.uniform2f(W.parentTranslateLoc, V.tx, V.ty), W.slotOpacityLoc && R.uniform1f(W.slotOpacityLoc, V.opacity), W.atlasPageLoc && R.uniform1i(W.atlasPageLoc, V.atlasPage), W.clipRectLoc && R.uniform4f(W.clipRectLoc, V.clipX0, V.clipY0, V.clipX1, V.clipY1), W.clipEnabledLoc && R.uniform1f(W.clipEnabledLoc, V.clipEnabled), W.canvasHeightLoc && R.uniform1f(W.canvasHeightLoc, this.canvas.height), W.instanceStateEnabledLoc && R.uniform1f(W.instanceStateEnabledLoc, yA ? 1 : 0), W.compactSlotStateEnabledLoc && R.uniform1f(W.compactSlotStateEnabledLoc, UA ? 1 : 0), W.spritesPerSlotLoc && R.uniform1i(W.spritesPerSlotLoc, UA ? gA : 1), W.slotStateSizeLoc) {
|
|
5217
5222
|
const AA = new Int32Array([
|
|
5218
5223
|
(G = OA == null ? void 0 : OA.width) != null ? G : 1,
|
|
5219
5224
|
(f = OA == null ? void 0 : OA.height) != null ? f : 1
|
|
@@ -5335,8 +5340,8 @@ const vI = "svga-frame-table-instanced-premul", uC = 8, ri = new Float32Array([1
|
|
|
5335
5340
|
drawInstancedSvgaGL(A) {
|
|
5336
5341
|
var g, I;
|
|
5337
5342
|
const B = this.gl, Q = (g = A.instanceCount) != null ? g : 0, E = A.instanceData;
|
|
5338
|
-
if (Q < 1 || !E || E.length < Q *
|
|
5339
|
-
if (Q >
|
|
5343
|
+
if (Q < 1 || !E || E.length < Q * bA.INST_SVGA_GL_FLOATS) return;
|
|
5344
|
+
if (Q > bA.INST_SVGA_GL_MAX) {
|
|
5340
5345
|
console.warn("[WebGL2] svga-instanced-premul: instanceCount exceeds max", Q);
|
|
5341
5346
|
return;
|
|
5342
5347
|
}
|
|
@@ -5355,8 +5360,8 @@ const vI = "svga-frame-table-instanced-premul", uC = 8, ri = new Float32Array([1
|
|
|
5355
5360
|
const a = this.buffers.get(A.vertexBuffer.id), o = this.buffers.get(A.indexBuffer.id);
|
|
5356
5361
|
if (!a || !o) return;
|
|
5357
5362
|
const s = this.ensureInstancedSvgaInstanceBuffer();
|
|
5358
|
-
if (B.bindBuffer(B.ARRAY_BUFFER, s), B.bufferSubData(B.ARRAY_BUFFER, 0, E, 0, Q *
|
|
5359
|
-
const n =
|
|
5363
|
+
if (B.bindBuffer(B.ARRAY_BUFFER, s), B.bufferSubData(B.ARRAY_BUFFER, 0, E, 0, Q * bA.INST_SVGA_GL_FLOATS), this.performanceSVGADynamicUploadWrites++, this.performanceSVGADynamicUploadBytes += Q * bA.INST_SVGA_GL_FLOATS * Float32Array.BYTES_PER_ELEMENT, this.bindCachedVertexArray(e, A.vertexBuffer.id, A.indexBuffer.id)) {
|
|
5364
|
+
const n = bA.INST_SVGA_GL_STRIDE;
|
|
5360
5365
|
B.bindBuffer(B.ARRAY_BUFFER, s), B.enableVertexAttribArray(1), B.vertexAttribPointer(1, 4, B.FLOAT, !1, n, 0), B.vertexAttribDivisor(1, 1), B.enableVertexAttribArray(2), B.vertexAttribPointer(2, 3, B.FLOAT, !1, n, 16), B.vertexAttribDivisor(2, 1), B.enableVertexAttribArray(3), B.vertexAttribPointer(3, 4, B.FLOAT, !1, n, 28), B.vertexAttribDivisor(3, 1), B.enableVertexAttribArray(4), B.vertexAttribIPointer(4, 2, B.UNSIGNED_INT, n, 44), B.vertexAttribDivisor(4, 1), B.bindBuffer(B.ARRAY_BUFFER, a.buffer), B.enableVertexAttribArray(0), B.vertexAttribPointer(0, 2, B.FLOAT, !1, 8, 0), B.vertexAttribDivisor(0, 0), B.bindBuffer(B.ELEMENT_ARRAY_BUFFER, o.buffer);
|
|
5361
5366
|
}
|
|
5362
5367
|
B.drawElementsInstanced(B.TRIANGLES, A.indexCount, B.UNSIGNED_INT, 0, Q), this.recordSubmittedDraw(), i !== "none" && (B.disable(B.STENCIL_TEST), B.colorMask(!0, !0, !0, !0));
|
|
@@ -5368,7 +5373,7 @@ const vI = "svga-frame-table-instanced-premul", uC = 8, ri = new Float32Array([1
|
|
|
5368
5373
|
if (!g) throw new Error("createBuffer failed");
|
|
5369
5374
|
A.bindVertexArray(null), A.bindBuffer(A.ARRAY_BUFFER, g), A.bufferData(
|
|
5370
5375
|
A.ARRAY_BUFFER,
|
|
5371
|
-
|
|
5376
|
+
bA.INST_CLIP_MASK_GL_BYTES,
|
|
5372
5377
|
A.DYNAMIC_DRAW
|
|
5373
5378
|
), this.instancedClipMaskGLBuffer = g;
|
|
5374
5379
|
}
|
|
@@ -5377,9 +5382,9 @@ const vI = "svga-frame-table-instanced-premul", uC = 8, ri = new Float32Array([1
|
|
|
5377
5382
|
drawInstancedClipMaskGL(A) {
|
|
5378
5383
|
var g, I;
|
|
5379
5384
|
const B = this.gl, Q = (g = A.instanceCount) != null ? g : 0, E = A.instanceData;
|
|
5380
|
-
if (Q < 1 || !E || E.length < Q *
|
|
5385
|
+
if (Q < 1 || !E || E.length < Q * bA.INST_CLIP_MASK_GL_FLOATS)
|
|
5381
5386
|
return;
|
|
5382
|
-
if (Q >
|
|
5387
|
+
if (Q > bA.INST_CLIP_MASK_GL_MAX) {
|
|
5383
5388
|
console.warn(
|
|
5384
5389
|
"[WebGL2] clip-mask-instanced: instanceCount exceeds max",
|
|
5385
5390
|
Q
|
|
@@ -5398,9 +5403,9 @@ const vI = "svga-frame-table-instanced-premul", uC = 8, ri = new Float32Array([1
|
|
|
5398
5403
|
0,
|
|
5399
5404
|
E,
|
|
5400
5405
|
0,
|
|
5401
|
-
Q *
|
|
5406
|
+
Q * bA.INST_CLIP_MASK_GL_FLOATS
|
|
5402
5407
|
), this.bindCachedVertexArray(i, A.vertexBuffer.id, A.indexBuffer.id)) {
|
|
5403
|
-
const n =
|
|
5408
|
+
const n = bA.INST_CLIP_MASK_GL_STRIDE;
|
|
5404
5409
|
B.bindBuffer(B.ARRAY_BUFFER, s), B.enableVertexAttribArray(1), B.vertexAttribPointer(1, 4, B.FLOAT, !1, n, 0), B.vertexAttribDivisor(1, 1), B.enableVertexAttribArray(2), B.vertexAttribPointer(2, 2, B.FLOAT, !1, n, 16), B.vertexAttribDivisor(2, 1), B.bindBuffer(B.ARRAY_BUFFER, t.buffer), B.enableVertexAttribArray(0), B.vertexAttribPointer(0, 2, B.FLOAT, !1, 8, 0), B.vertexAttribDivisor(0, 0), B.bindBuffer(B.ELEMENT_ARRAY_BUFFER, a.buffer);
|
|
5405
5410
|
}
|
|
5406
5411
|
B.drawElementsInstanced(
|
|
@@ -5416,7 +5421,7 @@ const vI = "svga-frame-table-instanced-premul", uC = 8, ri = new Float32Array([1
|
|
|
5416
5421
|
if (!this.instancedAlphaInstanceGLBuffer) {
|
|
5417
5422
|
const g = A.createBuffer();
|
|
5418
5423
|
if (!g) throw new Error("createBuffer failed");
|
|
5419
|
-
A.bindVertexArray(null), A.bindBuffer(A.ARRAY_BUFFER, g), A.bufferData(A.ARRAY_BUFFER,
|
|
5424
|
+
A.bindVertexArray(null), A.bindBuffer(A.ARRAY_BUFFER, g), A.bufferData(A.ARRAY_BUFFER, bA.INST_ALPHA_GL_BYTES, A.DYNAMIC_DRAW), this.instancedAlphaInstanceGLBuffer = g;
|
|
5420
5425
|
}
|
|
5421
5426
|
return this.instancedAlphaInstanceGLBuffer;
|
|
5422
5427
|
}
|
|
@@ -5424,7 +5429,7 @@ const vI = "svga-frame-table-instanced-premul", uC = 8, ri = new Float32Array([1
|
|
|
5424
5429
|
var g;
|
|
5425
5430
|
const I = this.gl, B = (g = A.instanceCount) != null ? g : 0, Q = A.instanceData;
|
|
5426
5431
|
if (B < 1 || !Q || Q.length < B * 12) return;
|
|
5427
|
-
if (B >
|
|
5432
|
+
if (B > bA.INST_ALPHA_GL_MAX) {
|
|
5428
5433
|
console.warn("[WebGL2] alpha-video-instanced: instanceCount exceeds max", B);
|
|
5429
5434
|
return;
|
|
5430
5435
|
}
|
|
@@ -5459,7 +5464,7 @@ const vI = "svga-frame-table-instanced-premul", uC = 8, ri = new Float32Array([1
|
|
|
5459
5464
|
if (!this.instancedVapInstanceGLBuffer) {
|
|
5460
5465
|
const g = A.createBuffer();
|
|
5461
5466
|
if (!g) throw new Error("createBuffer failed");
|
|
5462
|
-
A.bindVertexArray(null), A.bindBuffer(A.ARRAY_BUFFER, g), A.bufferData(A.ARRAY_BUFFER,
|
|
5467
|
+
A.bindVertexArray(null), A.bindBuffer(A.ARRAY_BUFFER, g), A.bufferData(A.ARRAY_BUFFER, bA.INST_VAP_GL_BYTES, A.DYNAMIC_DRAW), this.instancedVapInstanceGLBuffer = g;
|
|
5463
5468
|
}
|
|
5464
5469
|
return this.instancedVapInstanceGLBuffer;
|
|
5465
5470
|
}
|
|
@@ -5467,7 +5472,7 @@ const vI = "svga-frame-table-instanced-premul", uC = 8, ri = new Float32Array([1
|
|
|
5467
5472
|
var g;
|
|
5468
5473
|
const I = this.gl, B = (g = A.instanceCount) != null ? g : 0, Q = A.instanceData;
|
|
5469
5474
|
if (B < 1 || !Q || Q.length < B * 32) return;
|
|
5470
|
-
if (B >
|
|
5475
|
+
if (B > bA.INST_VAP_GL_MAX) {
|
|
5471
5476
|
console.warn("[WebGL2] vap-instanced: instanceCount exceeds max", B);
|
|
5472
5477
|
return;
|
|
5473
5478
|
}
|
|
@@ -6115,32 +6120,32 @@ function fB(C, A, g) {
|
|
|
6115
6120
|
return E;
|
|
6116
6121
|
}
|
|
6117
6122
|
function Ni(C, A, g) {
|
|
6118
|
-
const I = UC(C, z.__wbindgen_malloc), B =
|
|
6119
|
-
var Q = UC(A, z.__wbindgen_malloc), E =
|
|
6123
|
+
const I = UC(C, z.__wbindgen_malloc), B = qA;
|
|
6124
|
+
var Q = UC(A, z.__wbindgen_malloc), E = qA, i = JQ(g, z.__wbindgen_malloc), e = qA;
|
|
6120
6125
|
return z.build_batch_vertices(I, B, Q, E, A, i, e, g) >>> 0;
|
|
6121
6126
|
}
|
|
6122
6127
|
function Ui(C) {
|
|
6123
|
-
const A = yB(C, z.__wbindgen_malloc), g =
|
|
6128
|
+
const A = yB(C, z.__wbindgen_malloc), g = qA, I = z.decode_svga(A, g);
|
|
6124
6129
|
if (I[2])
|
|
6125
6130
|
throw KI(I[1]);
|
|
6126
6131
|
return KI(I[0]);
|
|
6127
6132
|
}
|
|
6128
6133
|
function ki(C) {
|
|
6129
|
-
const A = yB(C, z.__wbindgen_malloc), g =
|
|
6134
|
+
const A = yB(C, z.__wbindgen_malloc), g = qA, I = z.decode_svga_payload(A, g);
|
|
6130
6135
|
if (I[3])
|
|
6131
6136
|
throw KI(I[2]);
|
|
6132
6137
|
var B = FB(I[0], I[1]).slice();
|
|
6133
6138
|
return z.__wbindgen_free(I[0], I[1] * 1, 1), B;
|
|
6134
6139
|
}
|
|
6135
6140
|
function Yi(C) {
|
|
6136
|
-
const A = yB(C, z.__wbindgen_malloc), g =
|
|
6141
|
+
const A = yB(C, z.__wbindgen_malloc), g = qA, I = z.decode_svga_payload_profiled(A, g);
|
|
6137
6142
|
if (I[3])
|
|
6138
6143
|
throw KI(I[2]);
|
|
6139
6144
|
var B = FB(I[0], I[1]).slice();
|
|
6140
6145
|
return z.__wbindgen_free(I[0], I[1] * 1, 1), B;
|
|
6141
6146
|
}
|
|
6142
6147
|
function pi(C) {
|
|
6143
|
-
const A = yB(C, z.__wbindgen_malloc), g =
|
|
6148
|
+
const A = yB(C, z.__wbindgen_malloc), g = qA, I = z.inflate(A, g);
|
|
6144
6149
|
if (I[3])
|
|
6145
6150
|
throw KI(I[2]);
|
|
6146
6151
|
var B = FB(I[0], I[1]).slice();
|
|
@@ -6153,7 +6158,7 @@ function Ki() {
|
|
|
6153
6158
|
return z.take_svga_payload_profile();
|
|
6154
6159
|
}
|
|
6155
6160
|
function mi(C, A) {
|
|
6156
|
-
const g = xi(C, z.__wbindgen_malloc), I =
|
|
6161
|
+
const g = xi(C, z.__wbindgen_malloc), I = qA, B = JQ(A, z.__wbindgen_malloc), Q = qA, E = z.triangulate_clip_polygons(g, I, B, Q);
|
|
6157
6162
|
var i = Ji(E[0], E[1]).slice();
|
|
6158
6163
|
return z.__wbindgen_free(E[0], E[1] * 4, 4), i;
|
|
6159
6164
|
}
|
|
@@ -6166,7 +6171,7 @@ function KQ() {
|
|
|
6166
6171
|
return Error(MB(A, g));
|
|
6167
6172
|
},
|
|
6168
6173
|
__wbg_String_8564e559799eccda: function(A, g) {
|
|
6169
|
-
const I = String(g), B = bi(I, z.__wbindgen_malloc, z.__wbindgen_realloc), Q =
|
|
6174
|
+
const I = String(g), B = bi(I, z.__wbindgen_malloc, z.__wbindgen_realloc), Q = qA;
|
|
6170
6175
|
NC().setInt32(A + 4, Q, !0), NC().setInt32(A + 0, B, !0);
|
|
6171
6176
|
},
|
|
6172
6177
|
__wbg___wbindgen_copy_to_typed_array_a4db337751e0b328: function(A, g, I) {
|
|
@@ -6246,24 +6251,24 @@ function iI() {
|
|
|
6246
6251
|
}
|
|
6247
6252
|
function JQ(C, A) {
|
|
6248
6253
|
const g = A(C.length * 4, 4) >>> 0;
|
|
6249
|
-
return mQ().set(C, g / 4),
|
|
6254
|
+
return mQ().set(C, g / 4), qA = C.length, g;
|
|
6250
6255
|
}
|
|
6251
6256
|
function yB(C, A) {
|
|
6252
6257
|
const g = A(C.length * 1, 1) >>> 0;
|
|
6253
|
-
return iI().set(C, g / 1),
|
|
6258
|
+
return iI().set(C, g / 1), qA = C.length, g;
|
|
6254
6259
|
}
|
|
6255
6260
|
function UC(C, A) {
|
|
6256
6261
|
const g = A(C.length * 4, 4) >>> 0;
|
|
6257
|
-
return Li().set(C, g / 4),
|
|
6262
|
+
return Li().set(C, g / 4), qA = C.length, g;
|
|
6258
6263
|
}
|
|
6259
6264
|
function xi(C, A) {
|
|
6260
6265
|
const g = A(C.length * 8, 8) >>> 0;
|
|
6261
|
-
return Hi().set(C, g / 8),
|
|
6266
|
+
return Hi().set(C, g / 8), qA = C.length, g;
|
|
6262
6267
|
}
|
|
6263
6268
|
function bi(C, A, g) {
|
|
6264
6269
|
if (g === void 0) {
|
|
6265
6270
|
const i = dI.encode(C), e = A(i.length, 1) >>> 0;
|
|
6266
|
-
return iI().subarray(e, e + i.length).set(i),
|
|
6271
|
+
return iI().subarray(e, e + i.length).set(i), qA = i.length, e;
|
|
6267
6272
|
}
|
|
6268
6273
|
let I = C.length, B = A(I, 1) >>> 0;
|
|
6269
6274
|
const Q = iI();
|
|
@@ -6278,7 +6283,7 @@ function bi(C, A, g) {
|
|
|
6278
6283
|
const i = iI().subarray(B + E, B + I), e = dI.encodeInto(C, i);
|
|
6279
6284
|
E += e.written, B = g(B, I, E, 1) >>> 0;
|
|
6280
6285
|
}
|
|
6281
|
-
return
|
|
6286
|
+
return qA = E, B;
|
|
6282
6287
|
}
|
|
6283
6288
|
function KI(C) {
|
|
6284
6289
|
const A = z.__wbindgen_externrefs.get(C);
|
|
@@ -6299,7 +6304,7 @@ const dI = new TextEncoder();
|
|
|
6299
6304
|
written: g.length
|
|
6300
6305
|
};
|
|
6301
6306
|
});
|
|
6302
|
-
let
|
|
6307
|
+
let qA = 0, z;
|
|
6303
6308
|
function LQ(C, A) {
|
|
6304
6309
|
return z = C.exports, Zg = null, DI = null, lI = null, wI = null, FI = null, z.__wbindgen_start(), z;
|
|
6305
6310
|
}
|
|
@@ -8836,7 +8841,7 @@ const PI = 6, jI = { x: 0, y: 0, w: 1, h: 1 }, nC = class IC {
|
|
|
8836
8841
|
requiresStencil(A) {
|
|
8837
8842
|
var g, I, B, Q, E;
|
|
8838
8843
|
for (const i of A) {
|
|
8839
|
-
if (i.type !== "svga" || !i.videoEntity || i.
|
|
8844
|
+
if (i.type !== "svga" || !i.videoEntity || i.state !== "playing" && i.state !== "fly" && i.state !== "stopped")
|
|
8840
8845
|
continue;
|
|
8841
8846
|
const e = this.resolveRenderableFrame(i, i.videoEntity);
|
|
8842
8847
|
if (e == null) continue;
|
|
@@ -8849,6 +8854,7 @@ const PI = 6, jI = { x: 0, y: 0, w: 1, h: 1 }, nC = class IC {
|
|
|
8849
8854
|
continue;
|
|
8850
8855
|
}
|
|
8851
8856
|
}
|
|
8857
|
+
if (i.opacity < 0.05) continue;
|
|
8852
8858
|
const t = this.getFrameClipMode(i.videoEntity, e);
|
|
8853
8859
|
if (t === 2 || t === 1 && ((E = i.rotation) != null ? E : 0) !== 0) return !0;
|
|
8854
8860
|
}
|
|
@@ -11106,10 +11112,10 @@ function hI(C, A, g, I = { left: 0, right: 0, top: 0, bottom: 0 }) {
|
|
|
11106
11112
|
const [B, Q, E, i] = C;
|
|
11107
11113
|
return I.left = B / A, I.right = (B + E) / A, I.top = (g - Q) / g, I.bottom = (g - Q - i) / g, I;
|
|
11108
11114
|
}
|
|
11109
|
-
var lt = Object.defineProperty, wt = (C, A, g) => A in C ? lt(C, A, { enumerable: !0, configurable: !0, writable: !0, value: g }) : C[A] = g,
|
|
11115
|
+
var lt = Object.defineProperty, wt = (C, A, g) => A in C ? lt(C, A, { enumerable: !0, configurable: !0, writable: !0, value: g }) : C[A] = g, VA = (C, A, g) => wt(C, typeof A != "symbol" ? A + "" : A, g);
|
|
11110
11116
|
class jQ {
|
|
11111
11117
|
constructor(A) {
|
|
11112
|
-
|
|
11118
|
+
VA(this, "onFrameAvailable"), VA(this, "frameInfo", /* @__PURE__ */ new Map()), VA(this, "pending", /* @__PURE__ */ new Set()), VA(this, "lastHandle", /* @__PURE__ */ new Map()), VA(this, "started", /* @__PURE__ */ new Set()), VA(this, "firstUploaded", /* @__PURE__ */ new Set()), VA(this, "forceTimeFallback", /* @__PURE__ */ new Set()), VA(this, "lastArmAt", /* @__PURE__ */ new Map()), VA(this, "lastCallbackAt", /* @__PURE__ */ new Map()), VA(this, "lastProgressAt", /* @__PURE__ */ new Map()), VA(this, "lastRecoveryAt", /* @__PURE__ */ new Map()), VA(this, "stallLogged", /* @__PURE__ */ new Set()), VA(this, "stagnationLogged", /* @__PURE__ */ new Set()), VA(this, "lastTimeFallback", /* @__PURE__ */ new Map()), VA(this, "healthTimers", /* @__PURE__ */ new Map()), this.onFrameAvailable = A;
|
|
11113
11119
|
}
|
|
11114
11120
|
/**
|
|
11115
11121
|
* Returns true when `updateTexture` should run for this slot: first time, or a new decoded frame was signaled.
|
|
@@ -18961,10 +18967,10 @@ class _B {
|
|
|
18961
18967
|
this._released || (this._released = !0, this.gpuGlobalsBuffer && ((A = this.backend) == null || A.deleteBuffer(this.gpuGlobalsBuffer)), this.table.release());
|
|
18962
18968
|
}
|
|
18963
18969
|
}
|
|
18964
|
-
var ls = Object.defineProperty, ws = (C, A, g) => A in C ? ls(C, A, { enumerable: !0, configurable: !0, writable: !0, value: g }) : C[A] = g,
|
|
18970
|
+
var ls = Object.defineProperty, ws = (C, A, g) => A in C ? ls(C, A, { enumerable: !0, configurable: !0, writable: !0, value: g }) : C[A] = g, xA = (C, A, g) => ws(C, typeof A != "symbol" ? A + "" : A, g);
|
|
18965
18971
|
class Fs {
|
|
18966
18972
|
constructor(A, g = `scope-${xQ()}`) {
|
|
18967
|
-
|
|
18973
|
+
xA(this, "id"), xA(this, "host"), xA(this, "controller", new AbortController()), xA(this, "gifts", /* @__PURE__ */ new Map()), xA(this, "tracks", /* @__PURE__ */ new Set()), xA(this, "bindings", /* @__PURE__ */ new Set()), xA(this, "particleBatches", /* @__PURE__ */ new Set()), xA(this, "particleBatchGroups", /* @__PURE__ */ new Set()), xA(this, "frameListeners", /* @__PURE__ */ new Set()), xA(this, "finishListeners", /* @__PURE__ */ new Set()), xA(this, "unregisterController"), xA(this, "_state", "idle"), xA(this, "_currentTimeMs", 0), xA(this, "durationMs", 0), xA(this, "lastTickAtMs", 0), xA(this, "playbackRevision", 0), this.host = A, this.id = g, this.unregisterController = A.registerFrameController(this);
|
|
18968
18974
|
}
|
|
18969
18975
|
get signal() {
|
|
18970
18976
|
return this.controller.signal;
|
|
@@ -18993,7 +18999,11 @@ class Fs {
|
|
|
18993
18999
|
createMotionTrack(A) {
|
|
18994
19000
|
this.assertAlive();
|
|
18995
19001
|
const g = new _B(this.host.backend, A);
|
|
18996
|
-
|
|
19002
|
+
this.tracks.add(g);
|
|
19003
|
+
const I = g.release.bind(g);
|
|
19004
|
+
return g.release = () => {
|
|
19005
|
+
I(), this.tracks.delete(g);
|
|
19006
|
+
}, g;
|
|
18997
19007
|
}
|
|
18998
19008
|
createParticleBatch(A) {
|
|
18999
19009
|
this.assertAlive();
|
|
@@ -19047,47 +19057,48 @@ class Fs {
|
|
|
19047
19057
|
}
|
|
19048
19058
|
start(A) {
|
|
19049
19059
|
var g;
|
|
19050
|
-
this.assertAlive(), this.durationMs = Math.max(0, A.durationMs), this._currentTimeMs = Math.max(0, Math.min(this.durationMs, (g = A.fromMs) != null ? g : 0)), this.lastTickAtMs = performance.now(), this._state = "playing";
|
|
19060
|
+
this.assertAlive(), this.playbackRevision++, this.durationMs = Math.max(0, A.durationMs), this._currentTimeMs = Math.max(0, Math.min(this.durationMs, (g = A.fromMs) != null ? g : 0)), this.lastTickAtMs = performance.now(), this._state = "playing";
|
|
19051
19061
|
for (const I of this.gifts.values()) I.resume();
|
|
19052
19062
|
this.applyMediaTime(this._currentTimeMs, !0, !0), this.applyAll(this._currentTimeMs), this.applyParticleTime(this._currentTimeMs), this.host.invalidate(!0);
|
|
19053
19063
|
}
|
|
19054
19064
|
pause() {
|
|
19055
19065
|
if (this._state === "playing") {
|
|
19056
|
-
this._state = "paused";
|
|
19066
|
+
this.playbackRevision++, this._state = "paused";
|
|
19057
19067
|
for (const A of this.gifts.values()) A.pause();
|
|
19058
19068
|
}
|
|
19059
19069
|
}
|
|
19060
19070
|
resume() {
|
|
19061
19071
|
if (this._state === "paused") {
|
|
19062
|
-
this.lastTickAtMs = performance.now(), this._state = "playing";
|
|
19072
|
+
this.playbackRevision++, this.lastTickAtMs = performance.now(), this._state = "playing";
|
|
19063
19073
|
for (const A of this.gifts.values()) A.resume();
|
|
19064
19074
|
this.applyMediaTime(this._currentTimeMs, !1, !0), this.host.invalidate(!0);
|
|
19065
19075
|
}
|
|
19066
19076
|
}
|
|
19067
19077
|
seek(A) {
|
|
19068
|
-
this.assertAlive(), this._currentTimeMs = Math.max(0, Math.min(this.durationMs, A)), this._state === "playing" && (this.lastTickAtMs = performance.now()), this.applyAll(this._currentTimeMs), this.applyParticleTime(this._currentTimeMs), this.applyMediaTime(this._currentTimeMs, !1, !0), this.emitFrame(0), this.host.invalidate();
|
|
19078
|
+
this.assertAlive(), this.playbackRevision++, this._currentTimeMs = Math.max(0, Math.min(this.durationMs, A)), this._state === "playing" && (this.lastTickAtMs = performance.now()), this.applyAll(this._currentTimeMs), this.applyParticleTime(this._currentTimeMs), this.applyMediaTime(this._currentTimeMs, !1, !0), this.emitFrame(0), this.host.invalidate();
|
|
19069
19079
|
}
|
|
19070
19080
|
stop() {
|
|
19071
19081
|
if (!(this._state === "destroyed" || this._state === "stopped")) {
|
|
19072
|
-
this._state = "stopped";
|
|
19082
|
+
this.playbackRevision++, this._state = "stopped";
|
|
19073
19083
|
for (const A of this.gifts.values()) A.pause();
|
|
19074
19084
|
this.host.invalidate();
|
|
19075
19085
|
}
|
|
19076
19086
|
}
|
|
19077
19087
|
tick(A, g) {
|
|
19078
19088
|
if (this._state !== "playing") return !1;
|
|
19079
|
-
const I = Math.max(0, g),
|
|
19080
|
-
if (this.lastTickAtMs = A, this._currentTimeMs = Math.min(this.durationMs, this._currentTimeMs +
|
|
19089
|
+
const I = this.playbackRevision, B = Math.max(0, g), Q = this.lastTickAtMs > 0 ? Math.max(0, A - this.lastTickAtMs) : B, E = Math.min(B, Q);
|
|
19090
|
+
if (this.lastTickAtMs = A, this._currentTimeMs = Math.min(this.durationMs, this._currentTimeMs + E), this.applyAll(this._currentTimeMs), this.applyParticleTime(this._currentTimeMs), this.applyMediaTime(this._currentTimeMs), I !== this.playbackRevision || (this.emitFrame(E), I !== this.playbackRevision)) return !0;
|
|
19091
|
+
if (this._currentTimeMs >= this.durationMs) {
|
|
19081
19092
|
this._state = "stopped";
|
|
19082
|
-
for (const
|
|
19083
|
-
for (const
|
|
19093
|
+
for (const i of this.gifts.values()) i.pause();
|
|
19094
|
+
for (const i of this.finishListeners) i();
|
|
19084
19095
|
}
|
|
19085
19096
|
return !0;
|
|
19086
19097
|
}
|
|
19087
19098
|
destroy() {
|
|
19088
19099
|
var A;
|
|
19089
19100
|
if (this._state !== "destroyed") {
|
|
19090
|
-
this._state = "destroyed", this.controller.abort(), (A = this.unregisterController) == null || A.call(this), this.unregisterController = null;
|
|
19101
|
+
this.playbackRevision++, this._state = "destroyed", this.controller.abort(), (A = this.unregisterController) == null || A.call(this), this.unregisterController = null;
|
|
19091
19102
|
for (const g of this.bindings) this.bindings.delete(g);
|
|
19092
19103
|
for (const g of this.gifts.values()) this.host.removeGift(g.id);
|
|
19093
19104
|
this.gifts.clear();
|
|
@@ -21271,11 +21282,27 @@ const Fg = class zA {
|
|
|
21271
21282
|
preload: (e, t, a) => this.preload(e, t, a),
|
|
21272
21283
|
createParticleAtlas: async (e) => {
|
|
21273
21284
|
const t = await this.createParticleAtlas(e);
|
|
21274
|
-
|
|
21285
|
+
I.add(t);
|
|
21286
|
+
const a = t.destroy.bind(t);
|
|
21287
|
+
return t.destroy = () => {
|
|
21288
|
+
try {
|
|
21289
|
+
a();
|
|
21290
|
+
} finally {
|
|
21291
|
+
I.delete(t);
|
|
21292
|
+
}
|
|
21293
|
+
}, t;
|
|
21275
21294
|
},
|
|
21276
21295
|
createPlaybackScope: (e) => {
|
|
21277
21296
|
const t = this.createPlaybackScope(e);
|
|
21278
|
-
|
|
21297
|
+
g.add(t);
|
|
21298
|
+
const a = t.destroy.bind(t);
|
|
21299
|
+
return t.destroy = () => {
|
|
21300
|
+
try {
|
|
21301
|
+
a();
|
|
21302
|
+
} finally {
|
|
21303
|
+
g.delete(t);
|
|
21304
|
+
}
|
|
21305
|
+
}, t;
|
|
21279
21306
|
}
|
|
21280
21307
|
}, Q = await A.setup(B);
|
|
21281
21308
|
let E = !1;
|
|
@@ -16,6 +16,7 @@ export declare class PlaybackScopeImpl implements PlaybackScope, PlaybackFrameCo
|
|
|
16
16
|
private _currentTimeMs;
|
|
17
17
|
private durationMs;
|
|
18
18
|
private lastTickAtMs;
|
|
19
|
+
private playbackRevision;
|
|
19
20
|
constructor(host: PlaybackScopeHost, id?: string);
|
|
20
21
|
get signal(): AbortSignal;
|
|
21
22
|
get state(): PlaybackScopeState;
|