@genai-fi/nanogpt 0.7.2 → 0.8.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/dist/Generator.d.ts +36 -4
- package/dist/Generator.js +183 -69
- package/dist/{RealDiv-Dy0p8Bvo.js → RealDiv-N8TpOMYv.js} +14 -14
- package/dist/{Reshape-DvudQDvJ.js → Reshape-B-lWQRnF.js} +1 -1
- package/dist/{Reshape-DH5srBP0.js → Reshape-Bo8HzP8V.js} +5 -5
- package/dist/TeachableLLM.d.ts +6 -6
- package/dist/TeachableLLM.js +51 -50
- package/dist/Trainer.d.ts +19 -3
- package/dist/Trainer.js +71 -28
- package/dist/{axis_util-BzbKo31C.js → axis_util-DubwyOhW.js} +3 -3
- package/dist/backend.js +2 -2
- package/dist/{backend_util-TE7aTPhZ.js → backend_util-BJ-_jSeK.js} +46 -46
- package/dist/{broadcast_to-CdbwV-Dj.js → broadcast_to-BYfCp5iL.js} +2 -2
- package/dist/{concat-CsxrgovM.js → concat-BmDqqFsa.js} +1 -1
- package/dist/{dataset-CtdBYwjo.js → dataset-CJmEGu6D.js} +5 -5
- package/dist/{dropout-DYs5QFGQ.js → dropout-sx0sjVAT.js} +8 -8
- package/dist/exports_initializers-DAKM8UO9.js +16 -0
- package/dist/{gather-CMMy2KEG.js → gather-C1siEkdp.js} +1 -1
- package/dist/{gelu-C-dPj6Ku.js → gelu-Bd3UBBxg.js} +1 -1
- package/dist/{gpgpu_math-DGNLNL4I.js → gpgpu_math-TFLxaLkw.js} +26 -26
- package/dist/{index-CLthM0TO.js → index-BaPo_0H8.js} +185 -185
- package/dist/{index-BoWRt-10.js → index-CUQrfsw_.js} +266 -265
- package/dist/{kernel_funcs_utils-BYKWV8Aa.js → kernel_funcs_utils-P9aFa232.js} +9 -9
- package/dist/layers/BaseLayer.d.ts +8 -13
- package/dist/layers/BaseLayer.js +25 -13
- package/dist/layers/CausalSelfAttention.d.ts +3 -2
- package/dist/layers/CausalSelfAttention.js +28 -28
- package/dist/layers/MLP.d.ts +3 -2
- package/dist/layers/MLP.js +16 -20
- package/dist/layers/PositionEmbedding.d.ts +9 -0
- package/dist/layers/PositionEmbedding.js +45 -0
- package/dist/layers/RMSNorm.d.ts +3 -2
- package/dist/layers/RMSNorm.js +6 -6
- package/dist/layers/RoPECache.d.ts +1 -1
- package/dist/layers/RoPECache.js +4 -4
- package/dist/layers/TiedEmbedding.d.ts +3 -2
- package/dist/layers/TiedEmbedding.js +29 -7
- package/dist/layers/TransformerBlock.d.ts +3 -2
- package/dist/layers/TransformerBlock.js +1 -1
- package/dist/loader/load.d.ts +2 -2
- package/dist/loader/loadHF.d.ts +2 -2
- package/dist/loader/loadTransformers.d.ts +4 -2
- package/dist/loader/loadTransformers.js +10 -9
- package/dist/loader/newZipLoad.d.ts +2 -2
- package/dist/loader/oldZipLoad.d.ts +2 -2
- package/dist/loader/oldZipLoad.js +42 -51
- package/dist/loader/save.d.ts +8 -0
- package/dist/loader/save.js +62 -0
- package/dist/{log_sum_exp-DbjkV734.js → log_sum_exp-C142qZqY.js} +14 -14
- package/dist/main.d.ts +5 -4
- package/dist/main.js +22 -18
- package/dist/{mat_mul-8m8pfdcx.js → mat_mul-DMkduNJu.js} +1 -1
- package/dist/{max-Ddnnb5xe.js → max-B3JOcNGb.js} +1 -1
- package/dist/mod-uUuj4gSb.js +27 -0
- package/dist/models/NanoGPTV1.d.ts +15 -0
- package/dist/models/NanoGPTV1.js +71 -0
- package/dist/{config.d.ts → models/config.d.ts} +1 -0
- package/dist/{config.js → models/config.js} +1 -0
- package/dist/models/factory.d.ts +3 -0
- package/dist/models/factory.js +14 -0
- package/dist/models/model.d.ts +26 -0
- package/dist/models/model.js +68 -0
- package/dist/{mulmat_packed_gpu-VSekgsNv.js → mulmat_packed_gpu-Cm2gw-c8.js} +1 -1
- package/dist/{ones-Dj0SDhHf.js → ones-ZdgQGBCP.js} +2 -2
- package/dist/ops/adamAdjust.js +1 -1
- package/dist/ops/adamMoments.js +1 -1
- package/dist/ops/appendCache.js +3 -3
- package/dist/ops/attentionMask.js +1 -1
- package/dist/ops/cpu/adamAdjust.js +9 -9
- package/dist/ops/cpu/adamMoments.js +2 -2
- package/dist/ops/cpu/appendCache.js +2 -2
- package/dist/ops/cpu/attentionMask.js +5 -5
- package/dist/ops/cpu/fusedSoftmax.js +2 -2
- package/dist/ops/cpu/gatherSub.js +3 -3
- package/dist/ops/cpu/gelu.js +1 -1
- package/dist/ops/cpu/matMulGelu.js +2 -2
- package/dist/ops/cpu/matMulMul.js +1 -1
- package/dist/ops/cpu/mulDropout.js +1 -1
- package/dist/ops/cpu/normRMS.js +1 -1
- package/dist/ops/cpu/qkv.js +3 -3
- package/dist/ops/cpu/rope.js +5 -5
- package/dist/ops/cpu/scatterSub.js +11 -11
- package/dist/ops/fusedSoftmax.js +1 -1
- package/dist/ops/gatherSub.js +1 -1
- package/dist/ops/gelu.js +2 -2
- package/dist/ops/grads/attentionMask.js +1 -1
- package/dist/ops/grads/fusedSoftmax.js +2 -2
- package/dist/ops/grads/gelu.js +2 -2
- package/dist/ops/grads/matMulGelu.js +1 -1
- package/dist/ops/grads/normRMS.js +1 -1
- package/dist/ops/grads/qkv.js +1 -1
- package/dist/ops/grads/rope.js +1 -1
- package/dist/ops/matMulGelu.js +1 -1
- package/dist/ops/matMulMul.js +1 -1
- package/dist/ops/mulDrop.js +1 -1
- package/dist/ops/normRMS.js +1 -1
- package/dist/ops/qkv.js +1 -1
- package/dist/ops/rope.js +4 -4
- package/dist/ops/scatterSub.js +1 -1
- package/dist/ops/webgl/adamAdjust.js +2 -2
- package/dist/ops/webgl/adamMoments.js +1 -1
- package/dist/ops/webgl/appendCache.js +1 -1
- package/dist/ops/webgl/attentionMask.js +1 -1
- package/dist/ops/webgl/fusedSoftmax.js +4 -4
- package/dist/ops/webgl/gatherSub.js +1 -1
- package/dist/ops/webgl/gelu.js +2 -2
- package/dist/ops/webgl/log.js +3 -3
- package/dist/ops/webgl/matMulGelu.js +10 -10
- package/dist/ops/webgl/matMulMul.js +1 -1
- package/dist/ops/webgl/mulDropout.js +1 -1
- package/dist/ops/webgl/normRMS.js +2 -2
- package/dist/ops/webgl/qkv.js +1 -1
- package/dist/ops/webgl/rope.js +1 -1
- package/dist/ops/webgl/scatterSub.js +1 -1
- package/dist/ops/webgpu/adamAdjust.js +3 -3
- package/dist/ops/webgpu/adamMoments.js +3 -3
- package/dist/ops/webgpu/appendCache.js +3 -3
- package/dist/ops/webgpu/attentionMask.js +3 -3
- package/dist/ops/webgpu/gatherSub.js +3 -3
- package/dist/ops/webgpu/gelu.js +3 -3
- package/dist/ops/webgpu/normRMS.js +2 -2
- package/dist/ops/webgpu/normRMSGrad.js +5 -5
- package/dist/ops/webgpu/qkv.js +3 -3
- package/dist/ops/webgpu/rope.js +3 -3
- package/dist/ops/webgpu/scatterSub.js +3 -3
- package/dist/ops/webgpu/utils/reductions.js +4 -4
- package/dist/{ops-BFGCx8Ri.js → ops-C_1K_-35.js} +103 -103
- package/dist/{random_width-sZORGo5k.js → random_width-D8Pwy_na.js} +136 -136
- package/dist/{range-CRuAh-gd.js → range-LVHrSLdi.js} +1 -1
- package/dist/{reciprocal-BvGAyKyu.js → reciprocal-CaR9e67G.js} +1 -1
- package/dist/{register_all_kernels-BwDSRN-f.js → register_all_kernels-DUshvVWP.js} +2026 -2049
- package/dist/{reshape-CdBq1WJ6.js → reshape-DEfQGSin.js} +1 -1
- package/dist/{scatter_nd_util-DUstGbU1.js → scatter_nd_util-CUPPNLaA.js} +1 -1
- package/dist/{selu_util-BJEXVvjX.js → selu_util-8vv5JxQV.js} +3 -3
- package/dist/{shared-B8ztnyEk.js → shared-CkNorDcU.js} +83 -83
- package/dist/{shared-wS99K7_n.js → shared-D1elLckx.js} +1 -1
- package/dist/{sin-BeA3tsEd.js → sin-D2CKKmyR.js} +1 -1
- package/dist/{slice-BiOsknYS.js → slice-BnyE-M_7.js} +1 -1
- package/dist/{softmax-Bv_6lyMX.js → softmax-DLoZWYBx.js} +1 -1
- package/dist/{split-B-dikLRw.js → split-By_n4TKP.js} +1 -1
- package/dist/{stack-B17UN2nn.js → stack-DkdFLq37.js} +1 -1
- package/dist/{sum-66ew2byf.js → sum-l_0SqM4h.js} +3 -3
- package/dist/{tensor-JwS7ZYY6.js → tensor-BAQdLqoU.js} +1 -1
- package/dist/{tensor2d-wxPAnDQy.js → tensor2d-BHy261cI.js} +1 -1
- package/dist/training/Adam.js +2 -2
- package/dist/training/AdamExt.js +1 -1
- package/dist/training/DatasetBuilder.js +2 -2
- package/dist/training/Evaluator.d.ts +2 -2
- package/dist/training/FullTrainer.d.ts +16 -3
- package/dist/training/FullTrainer.js +91 -53
- package/dist/training/Trainer.d.ts +25 -3
- package/dist/training/Trainer.js +39 -47
- package/dist/training/sparseCrossEntropy.js +9 -9
- package/dist/utilities/dummy.d.ts +4 -4
- package/dist/utilities/dummy.js +13 -13
- package/dist/utilities/multinomialCPU.js +2 -2
- package/dist/utilities/parameters.d.ts +1 -1
- package/dist/utilities/performance.js +1 -1
- package/dist/utilities/profile.js +1 -1
- package/dist/utilities/safetensors.js +2 -2
- package/dist/utilities/weights.js +2 -2
- package/dist/{variable-BuddVFLa.js → variable-C9hihzDB.js} +1 -1
- package/dist/{webgpu_program-PFzf1hAQ.js → webgpu_program-dFEVbDPL.js} +1 -1
- package/dist/{webgpu_util-D____QpY.js → webgpu_util-DLImlSc6.js} +27 -27
- package/dist/{zeros--BdLQ3oG.js → zeros-VZ72lWXM.js} +1 -1
- package/package.json +2 -3
- package/dist/NanoGPTModel.d.ts +0 -52
- package/dist/NanoGPTModel.js +0 -203
- package/dist/TiedEmbedding-BxOerUmB.js +0 -43
- package/dist/utilities/generate.d.ts +0 -3
- package/dist/utilities/generate.js +0 -22
- package/dist/utilities/save.d.ts +0 -9
- package/dist/utilities/save.js +0 -61
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as l, C as h, E as m,
|
|
1
|
+
import { B as l, C as h, E as m, am as p, L as c, an as d, ae as g, n as u, T as V, o as v, q as N, a as w } from "./index-CUQrfsw_.js";
|
|
2
2
|
import { s as f } from "./index-C4L8Cm77.js";
|
|
3
3
|
/**
|
|
4
4
|
* @license
|
|
@@ -16,11 +16,11 @@ import { s as f } from "./index-C4L8Cm77.js";
|
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
* =============================================================================
|
|
18
18
|
*/
|
|
19
|
-
function
|
|
19
|
+
function x(r) {
|
|
20
20
|
const e = { x: h(r, "x", "floor", "float32") };
|
|
21
21
|
return m.runKernel(p, e);
|
|
22
22
|
}
|
|
23
|
-
const
|
|
23
|
+
const b = /* @__PURE__ */ l({ floor_: x });
|
|
24
24
|
/**
|
|
25
25
|
* @license
|
|
26
26
|
* Copyright 2018 Google LLC. All Rights Reserved.
|
|
@@ -176,18 +176,18 @@ function E(r, t) {
|
|
|
176
176
|
* limitations under the License.
|
|
177
177
|
* =============================================================================
|
|
178
178
|
*/
|
|
179
|
-
function
|
|
179
|
+
function R(r, t, e, s) {
|
|
180
180
|
const n = h(r, "x", "dropout");
|
|
181
181
|
if (u(n.dtype === "float32", () => `x has to be a floating point tensor since it's going to be scaled, but got a ${n.dtype} tensor instead.`), u(t >= 0 && t < 1, () => `rate must be a float in the range [0, 1), but got ${t}.`), t === 0)
|
|
182
182
|
return r instanceof V ? n.clone() : n;
|
|
183
|
-
const o = E(n, e), a = 1 - t, i = v(
|
|
183
|
+
const o = E(n, e), a = 1 - t, i = v(b(N(D(o, 0, 1, "float32", s), a)), a);
|
|
184
184
|
return w(n, i);
|
|
185
185
|
}
|
|
186
|
-
const
|
|
186
|
+
const q = /* @__PURE__ */ l({ dropout_: R });
|
|
187
187
|
export {
|
|
188
188
|
T as M,
|
|
189
189
|
D as a,
|
|
190
|
-
|
|
191
|
-
|
|
190
|
+
q as d,
|
|
191
|
+
b as f,
|
|
192
192
|
_ as r
|
|
193
193
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { R as o } from "./random_width-D8Pwy_na.js";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright 2018 Google LLC
|
|
5
|
+
*
|
|
6
|
+
* Use of this source code is governed by an MIT-style
|
|
7
|
+
* license that can be found in the LICENSE file or at
|
|
8
|
+
* https://opensource.org/licenses/MIT.
|
|
9
|
+
* =============================================================================
|
|
10
|
+
*/
|
|
11
|
+
function m(r) {
|
|
12
|
+
return new o(r);
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
m as r
|
|
16
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { aC as z, af as v, aD as oe, aE as ie, aF as ae, n as F, aG as me, aH as J, a2 as B, aI as I, ae as T, j as E, aJ as H, aK as $e, aL as Y, ad as Te } from "./index-CUQrfsw_.js";
|
|
2
2
|
import "./index-Tf7vU29b.js";
|
|
3
|
-
import { b as Se } from "./backend_util-
|
|
3
|
+
import { b as Se } from "./backend_util-BJ-_jSeK.js";
|
|
4
4
|
/**
|
|
5
5
|
* @license
|
|
6
6
|
* Copyright 2018 Google LLC. All Rights Reserved.
|
|
@@ -104,7 +104,7 @@ async function ge(e, t) {
|
|
|
104
104
|
const n = t.fetchFunc == null ? v().platform.fetch : t.fetchFunc, r = e.map((f) => n(f, t.requestInit, { isBinary: !0 })), s = (t.onProgress == null ? await Promise.all(r) : await Z(r, t.onProgress, 0, 0.5)).map((f) => f.arrayBuffer());
|
|
105
105
|
return t.onProgress == null ? await Promise.all(s) : await Z(s, t.onProgress, 0.5, 1);
|
|
106
106
|
}
|
|
107
|
-
function
|
|
107
|
+
function _e(e, t) {
|
|
108
108
|
var n;
|
|
109
109
|
const r = t.fetchFunc == null ? v().platform.fetch : t.fetchFunc;
|
|
110
110
|
let o = 0, i;
|
|
@@ -140,7 +140,7 @@ function Ae(e, t) {
|
|
|
140
140
|
* limitations under the License.
|
|
141
141
|
* =============================================================================
|
|
142
142
|
*/
|
|
143
|
-
const
|
|
143
|
+
const Ae = "application/octet-stream", Ne = "application/json";
|
|
144
144
|
class q {
|
|
145
145
|
constructor(t, n) {
|
|
146
146
|
if (this.DEFAULT_METHOD = "POST", n == null && (n = {}), this.weightPathPrefix = n.weightPathPrefix, this.weightUrlConverter = n.weightUrlConverter, n.fetchFunc != null ? (F(typeof n.fetchFunc == "function", () => "Must pass a function that matches the signature of `fetch` (see https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)"), this.fetch = n.fetchFunc) : this.fetch = v().platform.fetch, F(t != null && t.length > 0, () => "URL path for http must not be null, undefined or empty."), Array.isArray(t) && F(t.length === 2, () => `URL paths for http must have a length of 2, (actual length is ${t.length}).`), this.path = t, n.requestInit != null && n.requestInit.body != null)
|
|
@@ -158,7 +158,7 @@ class q {
|
|
|
158
158
|
}], o = ie(t, r);
|
|
159
159
|
if (n.body.append("model.json", new Blob([JSON.stringify(o)], { type: Ne }), "model.json"), t.weightData != null) {
|
|
160
160
|
const a = oe.join(t.weightData);
|
|
161
|
-
n.body.append("model.weights.bin", new Blob([a], { type:
|
|
161
|
+
n.body.append("model.weights.bin", new Blob([a], { type: Ae }), "model.weights.bin");
|
|
162
162
|
}
|
|
163
163
|
const i = await this.fetch(this.path, n);
|
|
164
164
|
if (i.ok)
|
|
@@ -199,7 +199,7 @@ class q {
|
|
|
199
199
|
return me(t, (n) => this.loadWeights(n));
|
|
200
200
|
}
|
|
201
201
|
async loadStream() {
|
|
202
|
-
const t = await this.loadModelJSON(), n = await this.getWeightUrls(t.weightsManifest), r = J(t.weightsManifest), o = () =>
|
|
202
|
+
const t = await this.loadModelJSON(), n = await this.getWeightUrls(t.weightsManifest), r = J(t.weightsManifest), o = () => _e(n, this.loadOptions);
|
|
203
203
|
return Object.assign(Object.assign({}, t), { weightSpecs: r, getWeightStream: o });
|
|
204
204
|
}
|
|
205
205
|
async getWeightUrls(t) {
|
|
@@ -1683,7 +1683,7 @@ function M(e, t) {
|
|
|
1683
1683
|
* limitations under the License.
|
|
1684
1684
|
* =============================================================================
|
|
1685
1685
|
*/
|
|
1686
|
-
const
|
|
1686
|
+
const A = {}, k = {
|
|
1687
1687
|
alpha: !1,
|
|
1688
1688
|
antialias: !1,
|
|
1689
1689
|
premultipliedAlpha: !1,
|
|
@@ -1693,18 +1693,18 @@ const _ = {}, k = {
|
|
|
1693
1693
|
failIfMajorPerformanceCaveat: !0
|
|
1694
1694
|
};
|
|
1695
1695
|
function Mt(e, t) {
|
|
1696
|
-
|
|
1696
|
+
A[e] = t;
|
|
1697
1697
|
}
|
|
1698
|
-
function
|
|
1699
|
-
if (!(e in
|
|
1698
|
+
function _(e, t) {
|
|
1699
|
+
if (!(e in A) || t != null) {
|
|
1700
1700
|
const r = vt(e, t);
|
|
1701
1701
|
if (r !== null)
|
|
1702
|
-
|
|
1702
|
+
A[e] = r;
|
|
1703
1703
|
else
|
|
1704
1704
|
return console.log("Could not get context for WebGL version", e), null;
|
|
1705
1705
|
}
|
|
1706
|
-
const n =
|
|
1707
|
-
return n == null || n.isContextLost() ? (delete
|
|
1706
|
+
const n = A[e];
|
|
1707
|
+
return n == null || n.isContextLost() ? (delete A[e], _(e)) : (n.disable(n.DEPTH_TEST), n.disable(n.STENCIL_TEST), n.disable(n.BLEND), n.disable(n.DITHER), n.disable(n.POLYGON_OFFSET_FILL), n.disable(n.SAMPLE_COVERAGE), n.enable(n.SCISSOR_TEST), n.enable(n.CULL_FACE), n.cullFace(n.BACK), A[e]);
|
|
1708
1708
|
}
|
|
1709
1709
|
function pt(e) {
|
|
1710
1710
|
if (!v().getBool("IS_SAFARI") && typeof OffscreenCanvas < "u" && e === 2)
|
|
@@ -1718,7 +1718,7 @@ function vt(e, t) {
|
|
|
1718
1718
|
throw new Error("Cannot get WebGL rendering context, WebGL is disabled.");
|
|
1719
1719
|
const n = t ?? pt(e);
|
|
1720
1720
|
return n.addEventListener("webglcontextlost", (r) => {
|
|
1721
|
-
r.preventDefault(), delete
|
|
1721
|
+
r.preventDefault(), delete A[e];
|
|
1722
1722
|
}, !1), v().getBool("SOFTWARE_WEBGL_ENABLED") && (k.failIfMajorPerformanceCaveat = !1), e === 1 ? (
|
|
1723
1723
|
// tslint:disable-next-line
|
|
1724
1724
|
n.getContext("webgl", k) || n.getContext("experimental-webgl", k)
|
|
@@ -1913,7 +1913,7 @@ function Qt(e, t, n, r, o, i, a) {
|
|
|
1913
1913
|
return s === -1 ? !1 : (m(e, () => e.bindBuffer(e.ARRAY_BUFFER, r)), m(e, () => e.vertexAttribPointer(s, o, e.FLOAT, !1, i, a)), m(e, () => e.enableVertexAttribArray(s)), !0);
|
|
1914
1914
|
}
|
|
1915
1915
|
function Ft(e, t, n) {
|
|
1916
|
-
|
|
1916
|
+
_t(e, n), m(e, () => e.activeTexture(e.TEXTURE0 + n)), m(e, () => e.bindTexture(e.TEXTURE_2D, t));
|
|
1917
1917
|
}
|
|
1918
1918
|
function en(e, t, n) {
|
|
1919
1919
|
return C(e, () => e.getUniformLocation(t, n), 'uniform "' + n + '" not present in program.');
|
|
@@ -1955,7 +1955,7 @@ function C(e, t, n) {
|
|
|
1955
1955
|
throw new Error(n);
|
|
1956
1956
|
return r;
|
|
1957
1957
|
}
|
|
1958
|
-
function
|
|
1958
|
+
function _t(e, t) {
|
|
1959
1959
|
const n = e.MAX_COMBINED_TEXTURE_IMAGE_UNITS - 1, r = t + e.TEXTURE0;
|
|
1960
1960
|
if (r < e.TEXTURE0 || r > n) {
|
|
1961
1961
|
const o = `[gl.TEXTURE0, gl.TEXTURE${n}]`;
|
|
@@ -2008,14 +2008,14 @@ function un(e, t) {
|
|
|
2008
2008
|
let W, X;
|
|
2009
2009
|
function ln(e) {
|
|
2010
2010
|
if (W == null) {
|
|
2011
|
-
const t =
|
|
2011
|
+
const t = _(e);
|
|
2012
2012
|
W = t.getParameter(t.MAX_TEXTURE_SIZE);
|
|
2013
2013
|
}
|
|
2014
2014
|
return W;
|
|
2015
2015
|
}
|
|
2016
2016
|
function fn(e) {
|
|
2017
2017
|
if (X == null) {
|
|
2018
|
-
const t =
|
|
2018
|
+
const t = _(e);
|
|
2019
2019
|
X = t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);
|
|
2020
2020
|
}
|
|
2021
2021
|
return Math.min(16, X);
|
|
@@ -2024,7 +2024,7 @@ function hn(e) {
|
|
|
2024
2024
|
if (e === 0)
|
|
2025
2025
|
return 0;
|
|
2026
2026
|
let t;
|
|
2027
|
-
const n =
|
|
2027
|
+
const n = _(e);
|
|
2028
2028
|
return g(n, "EXT_disjoint_timer_query_webgl2") && e === 2 ? t = 2 : g(n, "EXT_disjoint_timer_query") ? t = 1 : t = 0, t;
|
|
2029
2029
|
}
|
|
2030
2030
|
function g(e, t) {
|
|
@@ -2032,7 +2032,7 @@ function g(e, t) {
|
|
|
2032
2032
|
}
|
|
2033
2033
|
function dn(e) {
|
|
2034
2034
|
try {
|
|
2035
|
-
if (
|
|
2035
|
+
if (_(e) != null)
|
|
2036
2036
|
return !0;
|
|
2037
2037
|
} catch (t) {
|
|
2038
2038
|
return console.log("Error when getting WebGL context: ", t), !1;
|
|
@@ -2042,7 +2042,7 @@ function dn(e) {
|
|
|
2042
2042
|
function xn(e) {
|
|
2043
2043
|
if (e === 0)
|
|
2044
2044
|
return !1;
|
|
2045
|
-
const t =
|
|
2045
|
+
const t = _(e);
|
|
2046
2046
|
if (e === 1) {
|
|
2047
2047
|
if (!g(t, "OES_texture_float"))
|
|
2048
2048
|
return !1;
|
|
@@ -2053,7 +2053,7 @@ function xn(e) {
|
|
|
2053
2053
|
function pn(e) {
|
|
2054
2054
|
if (e === 0)
|
|
2055
2055
|
return !1;
|
|
2056
|
-
const t =
|
|
2056
|
+
const t = _(e);
|
|
2057
2057
|
if (e === 1) {
|
|
2058
2058
|
if (!g(t, "OES_texture_float") || !g(t, "WEBGL_color_buffer_float"))
|
|
2059
2059
|
return !1;
|
|
@@ -2063,7 +2063,7 @@ function pn(e) {
|
|
|
2063
2063
|
const r = "EXT_color_buffer_half_float";
|
|
2064
2064
|
if (g(t, r)) {
|
|
2065
2065
|
const o = t.getExtension(r);
|
|
2066
|
-
return
|
|
2066
|
+
return At(t, o);
|
|
2067
2067
|
}
|
|
2068
2068
|
return !1;
|
|
2069
2069
|
}
|
|
@@ -2077,7 +2077,7 @@ function G(e) {
|
|
|
2077
2077
|
const a = e.checkFramebufferStatus(e.FRAMEBUFFER) === e.FRAMEBUFFER_COMPLETE;
|
|
2078
2078
|
return e.bindTexture(e.TEXTURE_2D, null), e.bindFramebuffer(e.FRAMEBUFFER, null), e.deleteTexture(n), e.deleteFramebuffer(i), a;
|
|
2079
2079
|
}
|
|
2080
|
-
function
|
|
2080
|
+
function At(e, t) {
|
|
2081
2081
|
const n = de(e, t), r = e.createTexture();
|
|
2082
2082
|
e.bindTexture(e.TEXTURE_2D, r), e.texImage2D(e.TEXTURE_2D, 0, n.internalFormatHalfFloat, 1, 1, 0, n.textureFormatFloat, n.textureTypeHalfFloat, null);
|
|
2083
2083
|
const a = e.createFramebuffer();
|
|
@@ -2086,7 +2086,7 @@ function _t(e, t) {
|
|
|
2086
2086
|
return e.bindTexture(e.TEXTURE_2D, null), e.bindFramebuffer(e.FRAMEBUFFER, null), e.deleteTexture(r), e.deleteFramebuffer(a), s;
|
|
2087
2087
|
}
|
|
2088
2088
|
function vn(e) {
|
|
2089
|
-
return e !== 2 ? !1 :
|
|
2089
|
+
return e !== 2 ? !1 : _(e).fenceSync != null;
|
|
2090
2090
|
}
|
|
2091
2091
|
function mn(e, t) {
|
|
2092
2092
|
Array.isArray(e) || (e = [e]), e.forEach((n) => {
|
|
@@ -2314,7 +2314,7 @@ export {
|
|
|
2314
2314
|
mt as A,
|
|
2315
2315
|
kt as B,
|
|
2316
2316
|
Vt as C,
|
|
2317
|
-
|
|
2317
|
+
_ as D,
|
|
2318
2318
|
yt as E,
|
|
2319
2319
|
Xt as F,
|
|
2320
2320
|
g as G,
|