r3f-performance 0.1.3 → 0.1.6
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/README.md +11 -6
- package/dist/components/PerfMonitor.d.ts +1 -1
- package/dist/components/PerfMonitor.d.ts.map +1 -1
- package/dist/components/Program.d.ts.map +1 -1
- package/dist/index.cjs +33 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +1141 -741
- package/package.json +28 -6
package/dist/index.mjs
CHANGED
|
@@ -1,55 +1,348 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var i=document.createElement("style");i.appendChild(document.createTextNode('._perfS_ans5i_1{position:fixed;z-index:9999;font-family:Roboto Mono,-apple-system,BlinkMacSystemFont,monospace;background-color:#000c;color:#fff;padding:6px 0 6px 6px;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-user-select:none;user-select:none;display:flex;flex-direction:column}._containerHeight_ans5i_16{min-height:110px}._topLeft_ans5i_21{top:0;left:0}._topRight_ans5i_22{top:0;right:0}._bottomLeft_ans5i_23{bottom:0;left:0}._bottomRight_ans5i_24{bottom:0;right:0}._minimal_ans5i_26{background-color:#242424d9}._perfIContainer_ans5i_30{display:flex;flex-wrap:wrap;gap:5px 10px}._perfIContainer_ans5i_30{display:flex;flex-wrap:wrap;gap:6px 12px;width:100%;padding-right:6px;box-sizing:border-box}._perfI_ans5i_30{display:flex;flex-direction:column;justify-content:center;align-items:flex-start;width:55px;height:auto;position:relative;margin-right:4px}._perfI_ans5i_30 small{font-size:12px;color:#e0e0e0;font-weight:500;padding-left:0;margin-bottom:2px;white-space:nowrap}._perfB_ans5i_69{position:relative;bottom:auto;right:auto;text-align:left;font-size:8px;font-weight:600;letter-spacing:.5px;text-transform:uppercase;color:#65c5bc;width:100%;opacity:.9}._toggleContainer_ans5i_83{display:flex;justify-content:flex-end;padding-right:4px}._toggle_ans5i_83{cursor:pointer;font-size:10px;background-color:#ffffff1a;color:#fff;padding:4px 8px;border-radius:2px;margin-left:4px;transition:all .2s}._toggle_ans5i_83:hover{background-color:#fff3;color:#fff}._activeTab_ans5i_105{background-color:#65c5bc4d;color:#fff}._containerScroll_ans5i_110{max-height:50vh;overflow-y:auto}._programGeo_ans5i_115{margin-bottom:2px;pointer-events:auto}._programHeader_ans5i_120{display:flex;align-items:center;justify-content:space-between;background-color:#ffffff0f;padding:6px 8px;border-radius:4px;cursor:pointer;transition:background-color .2s;min-height:24px;border:1px solid transparent}._programHeader_ans5i_120:hover{background-color:#ffffff1a;border-color:#ffffff1a}._programHeader_ans5i_120 *{cursor:pointer!important}._programHeader_ans5i_120 small{font-size:9px}._programHeader_ans5i_120>b{margin-right:4px;cursor:pointer}._headerLeft_ans5i_149{display:flex;align-items:center;flex:1;overflow:hidden}._programTitle_ans5i_156{font-weight:700;font-size:12px;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-right:10px}._toggleArrow_ans5i_166{font-size:10px;margin-right:8px;color:#888;width:12px;text-align:center;transition:transform .2s}._toggleVisible_ans5i_175{pointer-events:auto;justify-content:center;cursor:pointer;font-size:12px;background-color:#292b2d;width:auto;margin:0;color:#919191;text-align:center;display:inline-block;vertical-align:middle;padding:4px 6px}._toggleVisible_ans5i_175:hover{background-color:#1f1f1f}._toggleVisible_ans5i_175 svg{width:12px;height:12px;float:left}._programConsole_ans5i_200{font-weight:700;letter-spacing:.02em;background-color:#292b2d;color:#d3d3d3;overflow:hidden;text-overflow:ellipsis;cursor:pointer;display:block;font-size:11px;padding:5px;margin:4px auto;border:none;width:100%;text-align:center}._programsContainer_ans5i_218{margin-top:0}._headerRight_ans5i_222{display:flex;align-items:center;gap:6px}._metricBadge_ans5i_228{display:flex;align-items:center;background-color:#0000004d;padding:2px 6px;border-radius:3px;font-size:10px;color:#aaa;white-space:nowrap}._metricBadge_ans5i_228 b{color:#4fd1c5;margin-right:4px;font-weight:600;font-size:11px}._programsULHeader_ans5i_246{display:flex;position:relative;font-weight:700;color:#fff;line-height:14px;margin:4px 0}._programsULHeader_ans5i_246 svg{margin-right:4px;display:inline-block}._programsUL_ans5i_246{display:block;position:relative;padding-left:10px;margin:6px;list-style:none}._programsUL_ans5i_246 img{max-height:60px;max-width:100%;margin:6px auto;display:block}._programsUL_ans5i_246:after{content:"";position:absolute;left:0;top:0;width:1px;height:100%;background-color:gray;transform:translate(-50%);max-height:50vh;overflow-y:auto}._programsUL_ans5i_246 li{border-bottom:1px solid #313131;display:block;padding:4px;margin:0;line-height:1}._programsUL_ans5i_246 b{font-weight:700}._programsUL_ans5i_246 small{text-align:revert;letter-spacing:1px;font-size:10px;font-weight:500;margin-left:2px;color:#65c5bc}._programsGeoLi_ans5i_309{display:flex!important;height:auto!important}._programsGeoLi_ans5i_309 span{display:block;position:relative}._programsGeoLi_ans5i_309 b{padding-left:12px}._graph_ans5i_324{width:100%;height:66px;overflow:hidden;position:absolute;pointer-events:none;display:flex;top:0;left:0;justify-content:center;z-index:0}._graphpc_ans5i_336{text-align:center;font-weight:700;font-size:12px;line-height:12px;display:flex;justify-content:center;align-items:center;vertical-align:middle;color:#f1f1f1;padding:7px;width:100%;background-color:#242425cc;z-index:1;position:absolute;height:100%}._visibilityBtn_ans5i_354{display:flex;align-items:center;justify-content:center;width:20px;height:20px;border-radius:3px;margin-left:4px;color:#666;background:transparent;transition:all .2s}._visibilityBtn_ans5i_354:hover{background-color:#fff3;color:#fff}._visibilityBtn_ans5i_354._active_ans5i_105{color:#fff}')),document.head.appendChild(i)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { useThree as
|
|
5
|
-
import { createRoot as
|
|
6
|
-
import * as
|
|
7
|
-
import { MathUtils as
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const d = document.createElement("div"), f = v.current = Fe(d);
|
|
17
|
-
return s.appendChild(d), () => {
|
|
18
|
-
f.unmount(), v.current = null, s.removeChild(d);
|
|
2
|
+
import { jsx as p, jsxs as x, Fragment as q } from "react/jsx-runtime";
|
|
3
|
+
import z, { forwardRef as Ke, useRef as T, useLayoutEffect as pe, useMemo as J, useEffect as P, useState as B } from "react";
|
|
4
|
+
import { useThree as De, addEffect as Qe, addAfterEffect as Ye, addTail as Xe, Canvas as Je, useFrame as Ge } from "@react-three/fiber";
|
|
5
|
+
import { createRoot as Ze } from "react-dom/client";
|
|
6
|
+
import * as I from "three";
|
|
7
|
+
import { MathUtils as et } from "three";
|
|
8
|
+
const We = Ke(
|
|
9
|
+
({ portal: t, className: e, children: n, name: o, ...d }, f) => {
|
|
10
|
+
const h = De((a) => a.gl), u = T(null), g = T(null), r = (t == null ? void 0 : t.current) != null ? t.current : h.domElement.parentNode;
|
|
11
|
+
return pe(() => {
|
|
12
|
+
if (!u.current || !r) return;
|
|
13
|
+
const a = document.createElement("div"), i = g.current = Ze(a);
|
|
14
|
+
return r.appendChild(a), () => {
|
|
15
|
+
i.unmount(), g.current = null, r.removeChild(a);
|
|
19
16
|
};
|
|
20
|
-
}, [
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
/* @__PURE__ */
|
|
17
|
+
}, [r]), pe(() => {
|
|
18
|
+
const a = g.current;
|
|
19
|
+
a && a.render(
|
|
20
|
+
/* @__PURE__ */ p("div", { ref: f, className: e, children: n })
|
|
24
21
|
);
|
|
25
|
-
}), /* @__PURE__ */
|
|
22
|
+
}), /* @__PURE__ */ p("group", { name: o, ...d, ref: u });
|
|
26
23
|
}
|
|
27
24
|
);
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
25
|
+
We.displayName = "HtmlMinimal";
|
|
26
|
+
function Be(t) {
|
|
27
|
+
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
28
|
+
}
|
|
29
|
+
var ae = { exports: {} }, te = {}, Q = { exports: {} }, re = {};
|
|
30
|
+
/**
|
|
31
|
+
* @license React
|
|
32
|
+
* use-sync-external-store-shim.production.js
|
|
33
|
+
*
|
|
34
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
35
|
+
*
|
|
36
|
+
* This source code is licensed under the MIT license found in the
|
|
37
|
+
* LICENSE file in the root directory of this source tree.
|
|
38
|
+
*/
|
|
39
|
+
var he;
|
|
40
|
+
function tt() {
|
|
41
|
+
if (he) return re;
|
|
42
|
+
he = 1;
|
|
43
|
+
var t = z;
|
|
44
|
+
function e(i, m) {
|
|
45
|
+
return i === m && (i !== 0 || 1 / i === 1 / m) || i !== i && m !== m;
|
|
46
|
+
}
|
|
47
|
+
var n = typeof Object.is == "function" ? Object.is : e, o = t.useState, d = t.useEffect, f = t.useLayoutEffect, h = t.useDebugValue;
|
|
48
|
+
function u(i, m) {
|
|
49
|
+
var c = m(), s = o({ inst: { value: c, getSnapshot: m } }), y = s[0].inst, l = s[1];
|
|
50
|
+
return f(
|
|
51
|
+
function() {
|
|
52
|
+
y.value = c, y.getSnapshot = m, g(y) && l({ inst: y });
|
|
53
|
+
},
|
|
54
|
+
[i, c, m]
|
|
55
|
+
), d(
|
|
56
|
+
function() {
|
|
57
|
+
return g(y) && l({ inst: y }), i(function() {
|
|
58
|
+
g(y) && l({ inst: y });
|
|
59
|
+
});
|
|
60
|
+
},
|
|
61
|
+
[i]
|
|
62
|
+
), h(c), c;
|
|
63
|
+
}
|
|
64
|
+
function g(i) {
|
|
65
|
+
var m = i.getSnapshot;
|
|
66
|
+
i = i.value;
|
|
67
|
+
try {
|
|
68
|
+
var c = m();
|
|
69
|
+
return !n(i, c);
|
|
70
|
+
} catch {
|
|
71
|
+
return !0;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
function r(i, m) {
|
|
75
|
+
return m();
|
|
76
|
+
}
|
|
77
|
+
var a = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? r : u;
|
|
78
|
+
return re.useSyncExternalStore = t.useSyncExternalStore !== void 0 ? t.useSyncExternalStore : a, re;
|
|
79
|
+
}
|
|
80
|
+
var ne = {};
|
|
81
|
+
/**
|
|
82
|
+
* @license React
|
|
83
|
+
* use-sync-external-store-shim.development.js
|
|
84
|
+
*
|
|
85
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
86
|
+
*
|
|
87
|
+
* This source code is licensed under the MIT license found in the
|
|
88
|
+
* LICENSE file in the root directory of this source tree.
|
|
89
|
+
*/
|
|
90
|
+
var ge;
|
|
91
|
+
function rt() {
|
|
92
|
+
return ge || (ge = 1, process.env.NODE_ENV !== "production" && function() {
|
|
93
|
+
function t(c, s) {
|
|
94
|
+
return c === s && (c !== 0 || 1 / c === 1 / s) || c !== c && s !== s;
|
|
95
|
+
}
|
|
96
|
+
function e(c, s) {
|
|
97
|
+
a || d.startTransition === void 0 || (a = !0, console.error(
|
|
98
|
+
"You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
|
|
99
|
+
));
|
|
100
|
+
var y = s();
|
|
101
|
+
if (!i) {
|
|
102
|
+
var l = s();
|
|
103
|
+
f(y, l) || (console.error(
|
|
104
|
+
"The result of getSnapshot should be cached to avoid an infinite loop"
|
|
105
|
+
), i = !0);
|
|
106
|
+
}
|
|
107
|
+
l = h({
|
|
108
|
+
inst: { value: y, getSnapshot: s }
|
|
109
|
+
});
|
|
110
|
+
var E = l[0].inst, _ = l[1];
|
|
111
|
+
return g(
|
|
112
|
+
function() {
|
|
113
|
+
E.value = y, E.getSnapshot = s, n(E) && _({ inst: E });
|
|
114
|
+
},
|
|
115
|
+
[c, y, s]
|
|
116
|
+
), u(
|
|
117
|
+
function() {
|
|
118
|
+
return n(E) && _({ inst: E }), c(function() {
|
|
119
|
+
n(E) && _({ inst: E });
|
|
120
|
+
});
|
|
121
|
+
},
|
|
122
|
+
[c]
|
|
123
|
+
), r(y), y;
|
|
124
|
+
}
|
|
125
|
+
function n(c) {
|
|
126
|
+
var s = c.getSnapshot;
|
|
127
|
+
c = c.value;
|
|
128
|
+
try {
|
|
129
|
+
var y = s();
|
|
130
|
+
return !f(c, y);
|
|
131
|
+
} catch {
|
|
132
|
+
return !0;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
function o(c, s) {
|
|
136
|
+
return s();
|
|
137
|
+
}
|
|
138
|
+
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
139
|
+
var d = z, f = typeof Object.is == "function" ? Object.is : t, h = d.useState, u = d.useEffect, g = d.useLayoutEffect, r = d.useDebugValue, a = !1, i = !1, m = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? o : e;
|
|
140
|
+
ne.useSyncExternalStore = d.useSyncExternalStore !== void 0 ? d.useSyncExternalStore : m, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
141
|
+
}()), ne;
|
|
142
|
+
}
|
|
143
|
+
var ye;
|
|
144
|
+
function je() {
|
|
145
|
+
return ye || (ye = 1, process.env.NODE_ENV === "production" ? Q.exports = tt() : Q.exports = rt()), Q.exports;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* @license React
|
|
149
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
150
|
+
*
|
|
151
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
152
|
+
*
|
|
153
|
+
* This source code is licensed under the MIT license found in the
|
|
154
|
+
* LICENSE file in the root directory of this source tree.
|
|
155
|
+
*/
|
|
156
|
+
var ve;
|
|
157
|
+
function nt() {
|
|
158
|
+
if (ve) return te;
|
|
159
|
+
ve = 1;
|
|
160
|
+
var t = z, e = je();
|
|
161
|
+
function n(r, a) {
|
|
162
|
+
return r === a && (r !== 0 || 1 / r === 1 / a) || r !== r && a !== a;
|
|
163
|
+
}
|
|
164
|
+
var o = typeof Object.is == "function" ? Object.is : n, d = e.useSyncExternalStore, f = t.useRef, h = t.useEffect, u = t.useMemo, g = t.useDebugValue;
|
|
165
|
+
return te.useSyncExternalStoreWithSelector = function(r, a, i, m, c) {
|
|
166
|
+
var s = f(null);
|
|
167
|
+
if (s.current === null) {
|
|
168
|
+
var y = { hasValue: !1, value: null };
|
|
169
|
+
s.current = y;
|
|
170
|
+
} else y = s.current;
|
|
171
|
+
s = u(
|
|
172
|
+
function() {
|
|
173
|
+
function E(w) {
|
|
174
|
+
if (!_) {
|
|
175
|
+
if (_ = !0, b = w, w = m(w), c !== void 0 && y.hasValue) {
|
|
176
|
+
var L = y.value;
|
|
177
|
+
if (c(L, w))
|
|
178
|
+
return S = L;
|
|
179
|
+
}
|
|
180
|
+
return S = w;
|
|
181
|
+
}
|
|
182
|
+
if (L = S, o(b, w)) return L;
|
|
183
|
+
var O = m(w);
|
|
184
|
+
return c !== void 0 && c(L, O) ? (b = w, L) : (b = w, S = O);
|
|
185
|
+
}
|
|
186
|
+
var _ = !1, b, S, C = i === void 0 ? null : i;
|
|
187
|
+
return [
|
|
188
|
+
function() {
|
|
189
|
+
return E(a());
|
|
190
|
+
},
|
|
191
|
+
C === null ? void 0 : function() {
|
|
192
|
+
return E(C());
|
|
193
|
+
}
|
|
194
|
+
];
|
|
195
|
+
},
|
|
196
|
+
[a, i, m, c]
|
|
197
|
+
);
|
|
198
|
+
var l = d(r, s[0], s[1]);
|
|
199
|
+
return h(
|
|
200
|
+
function() {
|
|
201
|
+
y.hasValue = !0, y.value = l;
|
|
202
|
+
},
|
|
203
|
+
[l]
|
|
204
|
+
), g(l), l;
|
|
205
|
+
}, te;
|
|
206
|
+
}
|
|
207
|
+
var se = {};
|
|
208
|
+
/**
|
|
209
|
+
* @license React
|
|
210
|
+
* use-sync-external-store-shim/with-selector.development.js
|
|
211
|
+
*
|
|
212
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
213
|
+
*
|
|
214
|
+
* This source code is licensed under the MIT license found in the
|
|
215
|
+
* LICENSE file in the root directory of this source tree.
|
|
216
|
+
*/
|
|
217
|
+
var _e;
|
|
218
|
+
function st() {
|
|
219
|
+
return _e || (_e = 1, process.env.NODE_ENV !== "production" && function() {
|
|
220
|
+
function t(r, a) {
|
|
221
|
+
return r === a && (r !== 0 || 1 / r === 1 / a) || r !== r && a !== a;
|
|
222
|
+
}
|
|
223
|
+
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
224
|
+
var e = z, n = je(), o = typeof Object.is == "function" ? Object.is : t, d = n.useSyncExternalStore, f = e.useRef, h = e.useEffect, u = e.useMemo, g = e.useDebugValue;
|
|
225
|
+
se.useSyncExternalStoreWithSelector = function(r, a, i, m, c) {
|
|
226
|
+
var s = f(null);
|
|
227
|
+
if (s.current === null) {
|
|
228
|
+
var y = { hasValue: !1, value: null };
|
|
229
|
+
s.current = y;
|
|
230
|
+
} else y = s.current;
|
|
231
|
+
s = u(
|
|
232
|
+
function() {
|
|
233
|
+
function E(w) {
|
|
234
|
+
if (!_) {
|
|
235
|
+
if (_ = !0, b = w, w = m(w), c !== void 0 && y.hasValue) {
|
|
236
|
+
var L = y.value;
|
|
237
|
+
if (c(L, w))
|
|
238
|
+
return S = L;
|
|
239
|
+
}
|
|
240
|
+
return S = w;
|
|
241
|
+
}
|
|
242
|
+
if (L = S, o(b, w))
|
|
243
|
+
return L;
|
|
244
|
+
var O = m(w);
|
|
245
|
+
return c !== void 0 && c(L, O) ? (b = w, L) : (b = w, S = O);
|
|
246
|
+
}
|
|
247
|
+
var _ = !1, b, S, C = i === void 0 ? null : i;
|
|
248
|
+
return [
|
|
249
|
+
function() {
|
|
250
|
+
return E(a());
|
|
251
|
+
},
|
|
252
|
+
C === null ? void 0 : function() {
|
|
253
|
+
return E(C());
|
|
254
|
+
}
|
|
255
|
+
];
|
|
256
|
+
},
|
|
257
|
+
[a, i, m, c]
|
|
258
|
+
);
|
|
259
|
+
var l = d(r, s[0], s[1]);
|
|
260
|
+
return h(
|
|
261
|
+
function() {
|
|
262
|
+
y.hasValue = !0, y.value = l;
|
|
263
|
+
},
|
|
264
|
+
[l]
|
|
265
|
+
), g(l), l;
|
|
266
|
+
}, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
267
|
+
}()), se;
|
|
268
|
+
}
|
|
269
|
+
process.env.NODE_ENV === "production" ? ae.exports = nt() : ae.exports = st();
|
|
270
|
+
var it = ae.exports;
|
|
271
|
+
const at = /* @__PURE__ */ Be(it), Ee = (t) => {
|
|
272
|
+
let e;
|
|
273
|
+
const n = /* @__PURE__ */ new Set(), o = (r, a) => {
|
|
274
|
+
const i = typeof r == "function" ? r(e) : r;
|
|
275
|
+
if (!Object.is(i, e)) {
|
|
276
|
+
const m = e;
|
|
277
|
+
e = a ?? (typeof i != "object" || i === null) ? i : Object.assign({}, e, i), n.forEach((c) => c(e, m));
|
|
278
|
+
}
|
|
279
|
+
}, d = () => e, u = { setState: o, getState: d, getInitialState: () => g, subscribe: (r) => (n.add(r), () => n.delete(r)) }, g = e = t(o, d, u);
|
|
280
|
+
return u;
|
|
281
|
+
}, ot = (t) => t ? Ee(t) : Ee, { useSyncExternalStoreWithSelector: ct } = at, lt = (t) => t;
|
|
282
|
+
function ut(t, e = lt, n) {
|
|
283
|
+
const o = ct(
|
|
284
|
+
t.subscribe,
|
|
285
|
+
t.getState,
|
|
286
|
+
t.getInitialState,
|
|
287
|
+
e,
|
|
288
|
+
n
|
|
289
|
+
);
|
|
290
|
+
return z.useDebugValue(o), o;
|
|
291
|
+
}
|
|
292
|
+
const be = (t, e) => {
|
|
293
|
+
const n = ot(t), o = (d, f = e) => ut(n, d, f);
|
|
294
|
+
return Object.assign(o, n), o;
|
|
295
|
+
}, ft = (t, e) => t ? be(t, e) : be, xe = (t) => Symbol.iterator in t, Se = (t) => (
|
|
296
|
+
// HACK: avoid checking entries type
|
|
297
|
+
"entries" in t
|
|
298
|
+
), we = (t, e) => {
|
|
299
|
+
const n = t instanceof Map ? t : new Map(t.entries()), o = e instanceof Map ? e : new Map(e.entries());
|
|
300
|
+
if (n.size !== o.size)
|
|
301
|
+
return !1;
|
|
302
|
+
for (const [d, f] of n)
|
|
303
|
+
if (!o.has(d) || !Object.is(f, o.get(d)))
|
|
304
|
+
return !1;
|
|
305
|
+
return !0;
|
|
306
|
+
}, mt = (t, e) => {
|
|
307
|
+
const n = t[Symbol.iterator](), o = e[Symbol.iterator]();
|
|
308
|
+
let d = n.next(), f = o.next();
|
|
309
|
+
for (; !d.done && !f.done; ) {
|
|
310
|
+
if (!Object.is(d.value, f.value))
|
|
311
|
+
return !1;
|
|
312
|
+
d = n.next(), f = o.next();
|
|
313
|
+
}
|
|
314
|
+
return !!d.done && !!f.done;
|
|
315
|
+
};
|
|
316
|
+
function dt(t, e) {
|
|
317
|
+
return Object.is(t, e) ? !0 : typeof t != "object" || t === null || typeof e != "object" || e === null || Object.getPrototypeOf(t) !== Object.getPrototypeOf(e) ? !1 : xe(t) && xe(e) ? Se(t) && Se(e) ? we(t, e) : mt(t, e) : we(
|
|
318
|
+
{ entries: () => Object.entries(t) },
|
|
319
|
+
{ entries: () => Object.entries(e) }
|
|
320
|
+
);
|
|
321
|
+
}
|
|
322
|
+
const oe = ft((t, e) => {
|
|
323
|
+
function n() {
|
|
324
|
+
var y;
|
|
325
|
+
const { accumulated: o, startTime: d, infos: f, estimatedMemory: h } = e(), u = (y = e().log) == null ? void 0 : y.maxMemory, { totalFrames: g, log: r, gl: a, max: i } = o, m = {
|
|
326
|
+
calls: a.calls / g,
|
|
327
|
+
triangles: a.triangles / g,
|
|
328
|
+
points: a.points / g,
|
|
329
|
+
lines: a.lines / g
|
|
330
|
+
}, c = {
|
|
331
|
+
gpu: r.gpu / g,
|
|
332
|
+
cpu: r.cpu / g,
|
|
333
|
+
mem: r.mem / g,
|
|
334
|
+
fps: r.fps / g
|
|
42
335
|
};
|
|
43
336
|
return {
|
|
44
|
-
sessionTime: (window.performance.now() -
|
|
45
|
-
infos:
|
|
46
|
-
memory:
|
|
337
|
+
sessionTime: (window.performance.now() - d) / 1e3,
|
|
338
|
+
infos: f,
|
|
339
|
+
memory: h,
|
|
47
340
|
// Thêm memory vào report
|
|
48
|
-
log:
|
|
49
|
-
gl:
|
|
50
|
-
max:
|
|
51
|
-
maxMemory:
|
|
52
|
-
totalFrames:
|
|
341
|
+
log: c,
|
|
342
|
+
gl: m,
|
|
343
|
+
max: i,
|
|
344
|
+
maxMemory: u,
|
|
345
|
+
totalFrames: g
|
|
53
346
|
};
|
|
54
347
|
}
|
|
55
348
|
return {
|
|
@@ -114,16 +407,16 @@ const ee = Ue((r, e) => {
|
|
|
114
407
|
programs: /* @__PURE__ */ new Map(),
|
|
115
408
|
sceneLength: void 0,
|
|
116
409
|
tab: "infos",
|
|
117
|
-
getReport:
|
|
410
|
+
getReport: n
|
|
118
411
|
};
|
|
119
|
-
}),
|
|
120
|
-
Object.assign(
|
|
121
|
-
const { getState:
|
|
412
|
+
}), A = (t) => oe(t, dt);
|
|
413
|
+
Object.assign(A, oe);
|
|
414
|
+
const { getState: F, setState: M } = oe, R = {
|
|
122
415
|
value: 0,
|
|
123
416
|
fpsLimit: 60,
|
|
124
417
|
isOverLimit: 0
|
|
125
|
-
},
|
|
126
|
-
class
|
|
418
|
+
}, V = (t) => (t == null ? void 0 : t.reduce((e, n) => e + n, 0)) / t.length;
|
|
419
|
+
class pt {
|
|
127
420
|
constructor(e = {}) {
|
|
128
421
|
this.names = [""], this.finished = [], this.paused = !1, this.overClock = !1, this.queryHasResult = !1, this.queryCreated = !1, this.isWebGL2 = !0, this.memAccums = [], this.gpuAccums = [], this.activeAccums = [], this.logsAccums = {
|
|
129
422
|
mem: [],
|
|
@@ -138,7 +431,7 @@ class De {
|
|
|
138
431
|
}, this.t0 = 0, window.GLPerf = window.GLPerf || {}, Object.assign(this, e), this.fpsChart = new Array(this.chartLen).fill(0), this.gpuChart = new Array(this.chartLen).fill(0), this.cpuChart = new Array(this.chartLen).fill(0), this.memChart = new Array(this.chartLen).fill(0), this.now = () => window.performance && window.performance.now ? window.performance.now() : Date.now(), this.initGpu(), this.is120hz();
|
|
139
432
|
}
|
|
140
433
|
initGpu() {
|
|
141
|
-
this.uuid =
|
|
434
|
+
this.uuid = et.generateUUID(), this.gl && (this.isWebGL2 = !0, this.extension || (this.extension = this.gl.getExtension(
|
|
142
435
|
"EXT_disjoint_timer_query_webgl2"
|
|
143
436
|
)), this.extension === null && (this.isWebGL2 = !1));
|
|
144
437
|
}
|
|
@@ -147,10 +440,10 @@ class De {
|
|
|
147
440
|
*/
|
|
148
441
|
is120hz() {
|
|
149
442
|
let e = 0;
|
|
150
|
-
const
|
|
151
|
-
++e < 20 ? this.rafId = window.requestAnimationFrame(
|
|
443
|
+
const n = (o) => {
|
|
444
|
+
++e < 20 ? this.rafId = window.requestAnimationFrame(n) : (this.detected = Math.ceil(1e3 * e / (o - this.t0) / 70), window.cancelAnimationFrame(this.rafId)), this.t0 || (this.t0 = o);
|
|
152
445
|
};
|
|
153
|
-
this.rafId = window.requestAnimationFrame(
|
|
446
|
+
this.rafId = window.requestAnimationFrame(n);
|
|
154
447
|
}
|
|
155
448
|
/**
|
|
156
449
|
* Explicit UI add
|
|
@@ -160,8 +453,8 @@ class De {
|
|
|
160
453
|
this.names.indexOf(e) === -1 && (this.names.push(e), this.gpuAccums.push(0), this.activeAccums.push(!1));
|
|
161
454
|
}
|
|
162
455
|
nextFps(e) {
|
|
163
|
-
const
|
|
164
|
-
|
|
456
|
+
const n = 16.666666666666668, o = n - e.timeRemaining(), d = n * R.fpsLimit / 10 / o;
|
|
457
|
+
d < 0 || (R.value = d, R.isOverLimit < 25 ? R.isOverLimit++ : M({ overclockingFps: !0 }));
|
|
165
458
|
}
|
|
166
459
|
/**
|
|
167
460
|
* Increase frameID
|
|
@@ -169,49 +462,49 @@ class De {
|
|
|
169
462
|
*/
|
|
170
463
|
nextFrame(e) {
|
|
171
464
|
this.frameId++;
|
|
172
|
-
const
|
|
173
|
-
let
|
|
465
|
+
const n = e || this.now(), o = n - this.paramTime;
|
|
466
|
+
let d = 0;
|
|
174
467
|
if (this.frameId <= 1)
|
|
175
|
-
this.paramFrame = this.frameId, this.paramTime =
|
|
176
|
-
else if (
|
|
468
|
+
this.paramFrame = this.frameId, this.paramTime = n;
|
|
469
|
+
else if (n >= this.paramTime) {
|
|
177
470
|
this.maxMemory = window.performance.memory ? window.performance.memory.jsHeapSizeLimit / 1048576 : 0;
|
|
178
|
-
const
|
|
179
|
-
if (
|
|
471
|
+
const f = this.frameId - this.paramFrame, h = f * 1e3 / o, u = F().overclockingFps ? R.value : h;
|
|
472
|
+
if (d = this.isWebGL2 ? this.gpuAccums[0] : this.gpuAccums[0] / o, this.isWebGL2 ? this.gpuAccums[0] = 0 : Promise.all(this.finished).then(() => {
|
|
180
473
|
this.gpuAccums[0] = 0, this.finished = [];
|
|
181
474
|
}), this.currentMem = Math.round(
|
|
182
475
|
window.performance && window.performance.memory ? window.performance.memory.usedJSHeapSize / 1048576 : 0
|
|
183
476
|
), window.performance && this.startCpuProfiling) {
|
|
184
477
|
window.performance.mark("cpu-finished");
|
|
185
|
-
const
|
|
478
|
+
const g = performance.measure(
|
|
186
479
|
"cpu-duration",
|
|
187
480
|
"cpu-started",
|
|
188
481
|
"cpu-finished"
|
|
189
482
|
);
|
|
190
|
-
this.currentCpu = (
|
|
483
|
+
this.currentCpu = (g == null ? void 0 : g.duration) || 0, this.logsAccums.cpu.push(this.currentCpu), this.startCpuProfiling = !1;
|
|
191
484
|
}
|
|
192
|
-
this.logsAccums.mem.push(this.currentMem), this.logsAccums.fpsFixed.push(
|
|
193
|
-
cpu:
|
|
194
|
-
gpu:
|
|
195
|
-
mem:
|
|
196
|
-
fps:
|
|
197
|
-
duration: Math.round(
|
|
485
|
+
this.logsAccums.mem.push(this.currentMem), this.logsAccums.fpsFixed.push(h), this.logsAccums.fps.push(u), this.logsAccums.gpu.push(d), this.overClock && typeof window.requestIdleCallback < "u" && (R.isOverLimit > 0 && u > h ? R.isOverLimit-- : F().overclockingFps && M({ overclockingFps: !1 })), n >= this.paramTime + 1e3 / this.logsPerSecond && (this.paramLogger({
|
|
486
|
+
cpu: V(this.logsAccums.cpu),
|
|
487
|
+
gpu: V(this.logsAccums.gpu),
|
|
488
|
+
mem: V(this.logsAccums.mem),
|
|
489
|
+
fps: V(this.logsAccums.fps),
|
|
490
|
+
duration: Math.round(o),
|
|
198
491
|
maxMemory: this.maxMemory,
|
|
199
|
-
frameCount:
|
|
200
|
-
}), this.logsAccums.mem = [], this.logsAccums.fps = [], this.logsAccums.gpu = [], this.logsAccums.cpu = [], this.paramFrame = this.frameId, this.paramTime =
|
|
492
|
+
frameCount: f
|
|
493
|
+
}), this.logsAccums.mem = [], this.logsAccums.fps = [], this.logsAccums.gpu = [], this.logsAccums.cpu = [], this.paramFrame = this.frameId, this.paramTime = n), this.overClock && n - this.lastCalculateFixed >= 2 * 1e3 && (this.lastCalculateFixed = e, R.fpsLimit = Math.round(V(this.logsAccums.fpsFixed) / 10) * 100, M({ fpsLimit: R.fpsLimit / 10 }), this.logsAccums.fpsFixed = [], this.paramFrame = this.frameId, this.paramTime = n);
|
|
201
494
|
}
|
|
202
495
|
if (!this.detected || !this.chartFrame)
|
|
203
|
-
this.chartFrame = this.frameId, this.chartTime =
|
|
496
|
+
this.chartFrame = this.frameId, this.chartTime = n, this.circularId = 0;
|
|
204
497
|
else {
|
|
205
|
-
const
|
|
206
|
-
let
|
|
207
|
-
for (; --
|
|
208
|
-
const
|
|
209
|
-
this.fpsChart[this.circularId % this.chartLen] =
|
|
210
|
-
const
|
|
211
|
-
|
|
212
|
-
for (let
|
|
498
|
+
const f = n - this.chartTime;
|
|
499
|
+
let h = this.chartHz * f / 1e3;
|
|
500
|
+
for (; --h > 0 && this.detected; ) {
|
|
501
|
+
const g = (this.frameId - this.chartFrame) / f * 1e3, r = F().overclockingFps ? R.value : g;
|
|
502
|
+
this.fpsChart[this.circularId % this.chartLen] = r;
|
|
503
|
+
const a = 1e3 / this.currentMem, i = this.currentCpu, m = (this.isWebGL2 ? this.gpuAccums[1] * 2 : Math.round(this.gpuAccums[1] / o * 100)) + 4;
|
|
504
|
+
m > 0 && (this.gpuChart[this.circularId % this.chartLen] = m), i > 0 && (this.cpuChart[this.circularId % this.chartLen] = i), a > 0 && (this.memChart[this.circularId % this.chartLen] = a);
|
|
505
|
+
for (let c = 0; c < this.names.length; c++)
|
|
213
506
|
this.chartLogger({
|
|
214
|
-
i:
|
|
507
|
+
i: c,
|
|
215
508
|
data: {
|
|
216
509
|
fps: this.fpsChart,
|
|
217
510
|
gpu: this.gpuChart,
|
|
@@ -220,31 +513,31 @@ class De {
|
|
|
220
513
|
},
|
|
221
514
|
circularId: this.circularId
|
|
222
515
|
});
|
|
223
|
-
this.circularId++, this.chartFrame = this.frameId, this.chartTime =
|
|
516
|
+
this.circularId++, this.chartFrame = this.frameId, this.chartTime = n;
|
|
224
517
|
}
|
|
225
518
|
}
|
|
226
519
|
}
|
|
227
520
|
startGpu() {
|
|
228
|
-
const e = this.gl,
|
|
229
|
-
if (!(!e || !
|
|
230
|
-
let
|
|
521
|
+
const e = this.gl, n = this.extension;
|
|
522
|
+
if (!(!e || !n) && this.isWebGL2) {
|
|
523
|
+
let o = !1, d, f;
|
|
231
524
|
if (this.query) {
|
|
232
525
|
this.queryHasResult = !1;
|
|
233
|
-
let
|
|
234
|
-
if (
|
|
235
|
-
|
|
236
|
-
const
|
|
237
|
-
(
|
|
238
|
-
this.gpuAccums[
|
|
526
|
+
let h = this.query;
|
|
527
|
+
if (o = e.getQueryParameter(h, e.QUERY_RESULT_AVAILABLE), d = e.getParameter(n.GPU_DISJOINT_EXT), o && !d) {
|
|
528
|
+
f = e.getQueryParameter(this.query, e.QUERY_RESULT);
|
|
529
|
+
const u = f * 1e-6;
|
|
530
|
+
(o || d) && (e.deleteQuery(this.query), h = null), o && u > 0 && (d || this.activeAccums.forEach((g, r) => {
|
|
531
|
+
this.gpuAccums[r] = u;
|
|
239
532
|
}));
|
|
240
533
|
}
|
|
241
534
|
}
|
|
242
|
-
(
|
|
535
|
+
(o || !this.query) && (this.queryCreated = !0, this.query = e.createQuery(), e.beginQuery(n.TIME_ELAPSED_EXT, this.query));
|
|
243
536
|
}
|
|
244
537
|
}
|
|
245
538
|
endGpu() {
|
|
246
|
-
const e = this.extension,
|
|
247
|
-
this.isWebGL2 && this.queryCreated &&
|
|
539
|
+
const e = this.extension, n = this.gl;
|
|
540
|
+
this.isWebGL2 && this.queryCreated && n.getQuery(e.TIME_ELAPSED_EXT, n.CURRENT_QUERY) && n.endQuery(e.TIME_ELAPSED_EXT);
|
|
248
541
|
}
|
|
249
542
|
/**
|
|
250
543
|
* Begin named measurement
|
|
@@ -261,15 +554,15 @@ class De {
|
|
|
261
554
|
this.endGpu(), this.updateAccums(e);
|
|
262
555
|
}
|
|
263
556
|
updateAccums(e) {
|
|
264
|
-
let
|
|
265
|
-
|
|
266
|
-
const
|
|
267
|
-
this.activeAccums[
|
|
557
|
+
let n = this.names.indexOf(e);
|
|
558
|
+
n === -1 && (n = this.names.length, this.addUI(e));
|
|
559
|
+
const o = this.now();
|
|
560
|
+
this.activeAccums[n] = !this.activeAccums[n], this.t0 = o;
|
|
268
561
|
}
|
|
269
562
|
dispose() {
|
|
270
|
-
const e = this.gl,
|
|
563
|
+
const e = this.gl, n = this.extension;
|
|
271
564
|
try {
|
|
272
|
-
this.isWebGL2 && e &&
|
|
565
|
+
this.isWebGL2 && e && n && e.getQuery(n.TIME_ELAPSED_EXT, e.CURRENT_QUERY) && e.endQuery(n.TIME_ELAPSED_EXT);
|
|
273
566
|
} catch {
|
|
274
567
|
}
|
|
275
568
|
if (e && this.query) {
|
|
@@ -282,80 +575,187 @@ class De {
|
|
|
282
575
|
this.queryCreated = !1, this.queryHasResult = !1;
|
|
283
576
|
}
|
|
284
577
|
}
|
|
285
|
-
const
|
|
286
|
-
|
|
287
|
-
const { meshes:
|
|
288
|
-
if (!
|
|
578
|
+
const ht = (t) => {
|
|
579
|
+
t.forEach((e) => {
|
|
580
|
+
const { meshes: n } = e;
|
|
581
|
+
if (!n)
|
|
289
582
|
return;
|
|
290
|
-
const
|
|
583
|
+
const o = {
|
|
291
584
|
total: 0,
|
|
292
585
|
type: "Triangle",
|
|
293
586
|
data: []
|
|
294
587
|
};
|
|
295
|
-
Object.keys(
|
|
296
|
-
const
|
|
297
|
-
if (!
|
|
298
|
-
let
|
|
299
|
-
|
|
300
|
-
const
|
|
301
|
-
let
|
|
302
|
-
const
|
|
303
|
-
let
|
|
304
|
-
|
|
305
|
-
const
|
|
306
|
-
Math.max(0,
|
|
588
|
+
Object.keys(n).forEach((d) => {
|
|
589
|
+
const f = n[d], { geometry: h, material: u } = f, g = h.index, r = h.attributes.position;
|
|
590
|
+
if (!r) return;
|
|
591
|
+
let a = 1;
|
|
592
|
+
u.wireframe === !0 && (a = 0);
|
|
593
|
+
const i = g !== null ? g.count : r.count, m = h.drawRange.start * a, c = h.drawRange.count * a, s = m, y = Math.min(i, m + c) - 1;
|
|
594
|
+
let l = 1;
|
|
595
|
+
const E = f.count || 1;
|
|
596
|
+
let _ = "Triangle", b = 0;
|
|
597
|
+
f.isMesh ? u.wireframe === !0 ? (_ = "Line", l = l / 2) : (_ = "Triangle", l = l / 3) : f.isLine ? (_ = "Line", f.isLineSegments ? l = l / 2 : f.isLineLoop ? l = l : l = l - 1) : f.isPoints ? (_ = "Point", l = l) : f.isSprite && (_ = "Triangle", l = l / 3);
|
|
598
|
+
const S = Math.round(
|
|
599
|
+
Math.max(0, y - s + 1) * (l * E)
|
|
307
600
|
);
|
|
308
|
-
|
|
309
|
-
type:
|
|
310
|
-
count:
|
|
601
|
+
S > b && (b = S, o.type = _), o.total += S, o.data.push({ drawCount: S, type: _ }), f.userData.drawCount = {
|
|
602
|
+
type: _,
|
|
603
|
+
count: S
|
|
311
604
|
};
|
|
312
|
-
}), e.drawCounts =
|
|
605
|
+
}), e.drawCounts = o;
|
|
313
606
|
});
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
|
|
607
|
+
};
|
|
608
|
+
var Ve = { exports: {} };
|
|
609
|
+
(function(t) {
|
|
610
|
+
var e = Object.prototype.hasOwnProperty, n = "~";
|
|
611
|
+
function o() {
|
|
612
|
+
}
|
|
613
|
+
Object.create && (o.prototype = /* @__PURE__ */ Object.create(null), new o().__proto__ || (n = !1));
|
|
614
|
+
function d(g, r, a) {
|
|
615
|
+
this.fn = g, this.context = r, this.once = a || !1;
|
|
616
|
+
}
|
|
617
|
+
function f(g, r, a, i, m) {
|
|
618
|
+
if (typeof a != "function")
|
|
619
|
+
throw new TypeError("The listener must be a function");
|
|
620
|
+
var c = new d(a, i || g, m), s = n ? n + r : r;
|
|
621
|
+
return g._events[s] ? g._events[s].fn ? g._events[s] = [g._events[s], c] : g._events[s].push(c) : (g._events[s] = c, g._eventsCount++), g;
|
|
622
|
+
}
|
|
623
|
+
function h(g, r) {
|
|
624
|
+
--g._eventsCount === 0 ? g._events = new o() : delete g._events[r];
|
|
625
|
+
}
|
|
626
|
+
function u() {
|
|
627
|
+
this._events = new o(), this._eventsCount = 0;
|
|
628
|
+
}
|
|
629
|
+
u.prototype.eventNames = function() {
|
|
630
|
+
var r = [], a, i;
|
|
631
|
+
if (this._eventsCount === 0) return r;
|
|
632
|
+
for (i in a = this._events)
|
|
633
|
+
e.call(a, i) && r.push(n ? i.slice(1) : i);
|
|
634
|
+
return Object.getOwnPropertySymbols ? r.concat(Object.getOwnPropertySymbols(a)) : r;
|
|
635
|
+
}, u.prototype.listeners = function(r) {
|
|
636
|
+
var a = n ? n + r : r, i = this._events[a];
|
|
637
|
+
if (!i) return [];
|
|
638
|
+
if (i.fn) return [i.fn];
|
|
639
|
+
for (var m = 0, c = i.length, s = new Array(c); m < c; m++)
|
|
640
|
+
s[m] = i[m].fn;
|
|
641
|
+
return s;
|
|
642
|
+
}, u.prototype.listenerCount = function(r) {
|
|
643
|
+
var a = n ? n + r : r, i = this._events[a];
|
|
644
|
+
return i ? i.fn ? 1 : i.length : 0;
|
|
645
|
+
}, u.prototype.emit = function(r, a, i, m, c, s) {
|
|
646
|
+
var y = n ? n + r : r;
|
|
647
|
+
if (!this._events[y]) return !1;
|
|
648
|
+
var l = this._events[y], E = arguments.length, _, b;
|
|
649
|
+
if (l.fn) {
|
|
650
|
+
switch (l.once && this.removeListener(r, l.fn, void 0, !0), E) {
|
|
651
|
+
case 1:
|
|
652
|
+
return l.fn.call(l.context), !0;
|
|
653
|
+
case 2:
|
|
654
|
+
return l.fn.call(l.context, a), !0;
|
|
655
|
+
case 3:
|
|
656
|
+
return l.fn.call(l.context, a, i), !0;
|
|
657
|
+
case 4:
|
|
658
|
+
return l.fn.call(l.context, a, i, m), !0;
|
|
659
|
+
case 5:
|
|
660
|
+
return l.fn.call(l.context, a, i, m, c), !0;
|
|
661
|
+
case 6:
|
|
662
|
+
return l.fn.call(l.context, a, i, m, c, s), !0;
|
|
663
|
+
}
|
|
664
|
+
for (b = 1, _ = new Array(E - 1); b < E; b++)
|
|
665
|
+
_[b - 1] = arguments[b];
|
|
666
|
+
l.fn.apply(l.context, _);
|
|
667
|
+
} else {
|
|
668
|
+
var S = l.length, C;
|
|
669
|
+
for (b = 0; b < S; b++)
|
|
670
|
+
switch (l[b].once && this.removeListener(r, l[b].fn, void 0, !0), E) {
|
|
671
|
+
case 1:
|
|
672
|
+
l[b].fn.call(l[b].context);
|
|
673
|
+
break;
|
|
674
|
+
case 2:
|
|
675
|
+
l[b].fn.call(l[b].context, a);
|
|
676
|
+
break;
|
|
677
|
+
case 3:
|
|
678
|
+
l[b].fn.call(l[b].context, a, i);
|
|
679
|
+
break;
|
|
680
|
+
case 4:
|
|
681
|
+
l[b].fn.call(l[b].context, a, i, m);
|
|
682
|
+
break;
|
|
683
|
+
default:
|
|
684
|
+
if (!_) for (C = 1, _ = new Array(E - 1); C < E; C++)
|
|
685
|
+
_[C - 1] = arguments[C];
|
|
686
|
+
l[b].fn.apply(l[b].context, _);
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
return !0;
|
|
690
|
+
}, u.prototype.on = function(r, a, i) {
|
|
691
|
+
return f(this, r, a, i, !1);
|
|
692
|
+
}, u.prototype.once = function(r, a, i) {
|
|
693
|
+
return f(this, r, a, i, !0);
|
|
694
|
+
}, u.prototype.removeListener = function(r, a, i, m) {
|
|
695
|
+
var c = n ? n + r : r;
|
|
696
|
+
if (!this._events[c]) return this;
|
|
697
|
+
if (!a)
|
|
698
|
+
return h(this, c), this;
|
|
699
|
+
var s = this._events[c];
|
|
700
|
+
if (s.fn)
|
|
701
|
+
s.fn === a && (!m || s.once) && (!i || s.context === i) && h(this, c);
|
|
702
|
+
else {
|
|
703
|
+
for (var y = 0, l = [], E = s.length; y < E; y++)
|
|
704
|
+
(s[y].fn !== a || m && !s[y].once || i && s[y].context !== i) && l.push(s[y]);
|
|
705
|
+
l.length ? this._events[c] = l.length === 1 ? l[0] : l : h(this, c);
|
|
706
|
+
}
|
|
707
|
+
return this;
|
|
708
|
+
}, u.prototype.removeAllListeners = function(r) {
|
|
709
|
+
var a;
|
|
710
|
+
return r ? (a = n ? n + r : r, this._events[a] && h(this, a)) : (this._events = new o(), this._eventsCount = 0), this;
|
|
711
|
+
}, u.prototype.off = u.prototype.removeListener, u.prototype.addListener = u.prototype.on, u.prefixed = n, u.EventEmitter = u, t.exports = u;
|
|
712
|
+
})(Ve);
|
|
713
|
+
var gt = Ve.exports;
|
|
714
|
+
const yt = /* @__PURE__ */ Be(gt), ce = new yt();
|
|
715
|
+
function vt(t, e, n) {
|
|
716
|
+
return ce.on(t, e);
|
|
317
717
|
}
|
|
318
|
-
function
|
|
319
|
-
|
|
320
|
-
|
|
718
|
+
function _t(t, e, n) {
|
|
719
|
+
ce.removeListener(
|
|
720
|
+
t,
|
|
321
721
|
e,
|
|
322
|
-
(
|
|
323
|
-
|
|
722
|
+
(n == null ? void 0 : n.context) ?? null,
|
|
723
|
+
n == null ? void 0 : n.once
|
|
324
724
|
);
|
|
325
725
|
}
|
|
326
|
-
function
|
|
327
|
-
|
|
726
|
+
function Et(t, e) {
|
|
727
|
+
ce.emit(t, e);
|
|
328
728
|
}
|
|
329
|
-
function
|
|
330
|
-
let e = 0,
|
|
331
|
-
const
|
|
332
|
-
return
|
|
333
|
-
if (
|
|
334
|
-
const
|
|
335
|
-
if (
|
|
336
|
-
|
|
337
|
-
const
|
|
338
|
-
for (const
|
|
339
|
-
const
|
|
340
|
-
|
|
729
|
+
function bt(t) {
|
|
730
|
+
let e = 0, n = 0;
|
|
731
|
+
const o = /* @__PURE__ */ new Set(), d = /* @__PURE__ */ new Set();
|
|
732
|
+
return t.traverse((f) => {
|
|
733
|
+
if (f.isMesh) {
|
|
734
|
+
const h = f;
|
|
735
|
+
if (h.geometry && !o.has(h.geometry.uuid)) {
|
|
736
|
+
o.add(h.geometry.uuid);
|
|
737
|
+
const r = h.geometry.attributes;
|
|
738
|
+
for (const a in r) {
|
|
739
|
+
const i = r[a];
|
|
740
|
+
i.array && (n += i.array.byteLength);
|
|
341
741
|
}
|
|
342
|
-
|
|
742
|
+
h.geometry.index && h.geometry.index.array && (n += h.geometry.index.array.byteLength);
|
|
343
743
|
}
|
|
344
|
-
const
|
|
345
|
-
(Array.isArray(
|
|
346
|
-
if (
|
|
347
|
-
for (const
|
|
348
|
-
const
|
|
349
|
-
if (
|
|
350
|
-
const
|
|
351
|
-
if (!
|
|
352
|
-
if (
|
|
353
|
-
|
|
354
|
-
|
|
744
|
+
const u = h.material;
|
|
745
|
+
(Array.isArray(u) ? u : [u]).forEach((r) => {
|
|
746
|
+
if (r)
|
|
747
|
+
for (const a in r) {
|
|
748
|
+
const i = r[a];
|
|
749
|
+
if (i && i.isTexture) {
|
|
750
|
+
const m = i;
|
|
751
|
+
if (!d.has(m.uuid)) {
|
|
752
|
+
if (d.add(m.uuid), m.isCompressedTexture && m.mipmaps)
|
|
753
|
+
m.mipmaps.forEach((c) => {
|
|
754
|
+
c.data && (e += c.data.byteLength);
|
|
355
755
|
});
|
|
356
|
-
else if (
|
|
357
|
-
const
|
|
358
|
-
e +=
|
|
756
|
+
else if (m.image) {
|
|
757
|
+
const c = m.image, s = c.width || 0, y = c.height || 0, l = m.generateMipmaps ? 1.33 : 1;
|
|
758
|
+
e += s * y * 4 * l;
|
|
359
759
|
}
|
|
360
760
|
}
|
|
361
761
|
}
|
|
@@ -363,151 +763,151 @@ function qe(r) {
|
|
|
363
763
|
});
|
|
364
764
|
}
|
|
365
765
|
}), {
|
|
366
|
-
geometry:
|
|
766
|
+
geometry: n,
|
|
367
767
|
texture: e,
|
|
368
|
-
total:
|
|
768
|
+
total: n + e
|
|
369
769
|
};
|
|
370
770
|
}
|
|
371
|
-
const
|
|
372
|
-
|
|
373
|
-
),
|
|
374
|
-
|
|
375
|
-
muiPerf:
|
|
376
|
-
}),
|
|
377
|
-
const
|
|
378
|
-
return e[
|
|
379
|
-
},
|
|
380
|
-
overClock:
|
|
771
|
+
const Le = I.Object3D.prototype.updateMatrixWorld, Ce = I.Object3D.prototype.updateWorldMatrix, Oe = I.Object3D.prototype.updateMatrix, Ie = ["calls", "triangles", "points", "lines"], Me = ["gpu", "cpu", "mem", "fps"], xt = (t) => /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(
|
|
772
|
+
t
|
|
773
|
+
), Te = (t, e) => {
|
|
774
|
+
t.defines || (t.defines = {}), t.defines.muiPerf || (t.defines = Object.assign(t.defines || {}, {
|
|
775
|
+
muiPerf: t.uuid
|
|
776
|
+
}), t.needsUpdate = !0);
|
|
777
|
+
const n = t.uuid;
|
|
778
|
+
return e[n] || (e[n] = { meshes: {}, material: t }), t.needsUpdate = !1, n;
|
|
779
|
+
}, St = (t) => t === "muiPerf", wt = ({
|
|
780
|
+
overClock: t,
|
|
381
781
|
logsPerSecond: e,
|
|
382
|
-
chart:
|
|
383
|
-
deepAnalyze:
|
|
384
|
-
matrixUpdate:
|
|
782
|
+
chart: n,
|
|
783
|
+
deepAnalyze: o,
|
|
784
|
+
matrixUpdate: d
|
|
385
785
|
}) => {
|
|
386
|
-
const { gl:
|
|
387
|
-
M({ gl:
|
|
388
|
-
const
|
|
389
|
-
let
|
|
390
|
-
const
|
|
391
|
-
const
|
|
786
|
+
const { gl: f, scene: h } = De();
|
|
787
|
+
M({ gl: f, scene: h });
|
|
788
|
+
const u = 1e3;
|
|
789
|
+
let g = 0;
|
|
790
|
+
const r = J(() => {
|
|
791
|
+
const a = new pt({
|
|
392
792
|
trackGPU: !0,
|
|
393
|
-
overClock:
|
|
394
|
-
chartLen:
|
|
395
|
-
chartHz:
|
|
793
|
+
overClock: t,
|
|
794
|
+
chartLen: n ? n.length : 120,
|
|
795
|
+
chartHz: n ? n.hz : 60,
|
|
396
796
|
logsPerSecond: e || 10,
|
|
397
|
-
gl:
|
|
398
|
-
chartLogger: (
|
|
399
|
-
M({ chart:
|
|
797
|
+
gl: f.getContext(),
|
|
798
|
+
chartLogger: (l) => {
|
|
799
|
+
M({ chart: l });
|
|
400
800
|
},
|
|
401
|
-
paramLogger: (
|
|
402
|
-
var
|
|
403
|
-
const
|
|
404
|
-
maxMemory:
|
|
405
|
-
gpu:
|
|
406
|
-
cpu:
|
|
407
|
-
mem:
|
|
408
|
-
fps:
|
|
409
|
-
totalTime:
|
|
410
|
-
frameCount:
|
|
801
|
+
paramLogger: (l) => {
|
|
802
|
+
var C;
|
|
803
|
+
const E = {
|
|
804
|
+
maxMemory: l.maxMemory,
|
|
805
|
+
gpu: l.gpu,
|
|
806
|
+
cpu: l.cpu,
|
|
807
|
+
mem: l.mem,
|
|
808
|
+
fps: l.fps,
|
|
809
|
+
totalTime: l.duration,
|
|
810
|
+
frameCount: l.frameCount
|
|
411
811
|
};
|
|
412
|
-
M({ log:
|
|
413
|
-
const { accumulated:
|
|
414
|
-
|
|
415
|
-
for (let
|
|
416
|
-
const
|
|
417
|
-
|
|
812
|
+
M({ log: E });
|
|
813
|
+
const { accumulated: _ } = F(), b = f.info.render;
|
|
814
|
+
_.totalFrames++, _.gl.calls += b.calls, _.gl.triangles += b.triangles, _.gl.points += b.points, _.gl.lines += b.lines, _.log.gpu += l.gpu, _.log.cpu += l.cpu, _.log.mem += l.mem, _.log.fps += l.fps;
|
|
815
|
+
for (let w = 0; w < Ie.length; w++) {
|
|
816
|
+
const L = Ie[w], O = b[L];
|
|
817
|
+
O > _.max.gl[L] && (_.max.gl[L] = O);
|
|
418
818
|
}
|
|
419
|
-
for (let
|
|
420
|
-
const
|
|
421
|
-
|
|
819
|
+
for (let w = 0; w < Me.length; w++) {
|
|
820
|
+
const L = Me[w], O = l[L];
|
|
821
|
+
O > _.max.log[L] && (_.max.log[L] = O);
|
|
422
822
|
}
|
|
423
|
-
M({ accumulated:
|
|
424
|
-
const
|
|
425
|
-
calls:
|
|
426
|
-
triangles:
|
|
427
|
-
points:
|
|
428
|
-
lines:
|
|
429
|
-
geometries:
|
|
430
|
-
textures:
|
|
431
|
-
programs: ((
|
|
823
|
+
M({ accumulated: _ });
|
|
824
|
+
const S = {
|
|
825
|
+
calls: f.info.render.calls,
|
|
826
|
+
triangles: f.info.render.triangles,
|
|
827
|
+
points: f.info.render.points,
|
|
828
|
+
lines: f.info.render.lines,
|
|
829
|
+
geometries: f.info.memory.geometries,
|
|
830
|
+
textures: f.info.memory.textures,
|
|
831
|
+
programs: ((C = f.info.programs) == null ? void 0 : C.length) || 0
|
|
432
832
|
};
|
|
433
|
-
|
|
833
|
+
Et("log", [E, S]);
|
|
434
834
|
}
|
|
435
|
-
}),
|
|
436
|
-
let
|
|
437
|
-
const
|
|
438
|
-
return
|
|
835
|
+
}), i = f.getContext();
|
|
836
|
+
let m = null, c = null;
|
|
837
|
+
const s = i.getExtension("WEBGL_debug_renderer_info"), y = i.getParameter(i.VERSION);
|
|
838
|
+
return s && (m = i.getParameter(s.UNMASKED_RENDERER_WEBGL), c = i.getParameter(s.UNMASKED_VENDOR_WEBGL)), c || (c = "Unknown vendor"), m || (m = i.getParameter(i.RENDERER)), M({
|
|
439
839
|
startTime: window.performance.now(),
|
|
440
840
|
infos: {
|
|
441
|
-
version:
|
|
442
|
-
renderer:
|
|
443
|
-
vendor:
|
|
841
|
+
version: y,
|
|
842
|
+
renderer: m,
|
|
843
|
+
vendor: c
|
|
444
844
|
}
|
|
445
|
-
}),
|
|
446
|
-
}, [
|
|
447
|
-
return
|
|
448
|
-
|
|
449
|
-
}, [
|
|
450
|
-
if (!
|
|
451
|
-
|
|
452
|
-
return this.matrixWorldNeedsUpdate ||
|
|
453
|
-
},
|
|
454
|
-
return
|
|
455
|
-
},
|
|
456
|
-
return
|
|
845
|
+
}), a;
|
|
846
|
+
}, [t, n, e, f]);
|
|
847
|
+
return P(() => {
|
|
848
|
+
r && (r.overClock = t || !1, t === !1 && (M({ overclockingFps: !1 }), R.value = 0, R.isOverLimit = 0), r.chartHz = (n == null ? void 0 : n.hz) || 60, r.chartLen = (n == null ? void 0 : n.length) || 120);
|
|
849
|
+
}, [r, t, n == null ? void 0 : n.hz, n == null ? void 0 : n.length]), P(() => {
|
|
850
|
+
if (!f.info) return;
|
|
851
|
+
f.info.autoReset = !1, d && (I.Object3D.prototype.updateMatrixWorld = function(...m) {
|
|
852
|
+
return this.matrixWorldNeedsUpdate || m[0], Le.apply(this, m);
|
|
853
|
+
}, I.Object3D.prototype.updateWorldMatrix = function(...m) {
|
|
854
|
+
return Ce.apply(this, m);
|
|
855
|
+
}, I.Object3D.prototype.updateMatrix = function(...m) {
|
|
856
|
+
return Oe.apply(this, m);
|
|
457
857
|
});
|
|
458
|
-
const
|
|
459
|
-
|
|
460
|
-
}),
|
|
461
|
-
var
|
|
462
|
-
|
|
463
|
-
const
|
|
464
|
-
if (
|
|
465
|
-
|
|
466
|
-
const
|
|
858
|
+
const a = Qe(() => {
|
|
859
|
+
F().paused && M({ paused: !1 }), r == null || r.begin("profiler"), window.performance && (window.performance.mark("cpu-started"), r.startCpuProfiling = !0), f.info.reset();
|
|
860
|
+
}), i = Ye(() => {
|
|
861
|
+
var y, l;
|
|
862
|
+
r == null || r.end("profiler"), r && !r.paused && (r.nextFrame(window.performance.now()), t && typeof window.requestIdleCallback < "u" && (r.idleCbId = requestIdleCallback(r.nextFps)));
|
|
863
|
+
const m = window.performance.now();
|
|
864
|
+
if (m - g > u) {
|
|
865
|
+
g = m;
|
|
866
|
+
const E = bt(h), _ = r.currentMem || 0;
|
|
467
867
|
M({
|
|
468
868
|
estimatedMemory: {
|
|
469
|
-
vram:
|
|
869
|
+
vram: E.total / 1024 / 1024,
|
|
470
870
|
// Đổi ra MB
|
|
471
|
-
tex:
|
|
472
|
-
geo:
|
|
473
|
-
ram:
|
|
871
|
+
tex: E.texture / 1024 / 1024,
|
|
872
|
+
geo: E.geometry / 1024 / 1024,
|
|
873
|
+
ram: _
|
|
474
874
|
// Đã là MB
|
|
475
875
|
}
|
|
476
876
|
});
|
|
477
877
|
}
|
|
478
|
-
if (!
|
|
479
|
-
const
|
|
480
|
-
|
|
481
|
-
if (
|
|
482
|
-
if (!
|
|
483
|
-
let
|
|
484
|
-
const b = Array.isArray(
|
|
485
|
-
|
|
878
|
+
if (!o) return;
|
|
879
|
+
const c = {}, s = /* @__PURE__ */ new Map();
|
|
880
|
+
h.traverse((E) => {
|
|
881
|
+
if (E instanceof I.Mesh || E instanceof I.Points) {
|
|
882
|
+
if (!E.material) return;
|
|
883
|
+
let _ = E.material.uuid;
|
|
884
|
+
const b = Array.isArray(E.material) && E.material.length > 1;
|
|
885
|
+
_ = Te(b ? E.material[1] : E.material, c), c[_].meshes[E.uuid] = E;
|
|
486
886
|
}
|
|
487
|
-
}), (
|
|
488
|
-
const
|
|
489
|
-
if (
|
|
490
|
-
const { material:
|
|
491
|
-
|
|
492
|
-
program:
|
|
493
|
-
material:
|
|
494
|
-
meshes:
|
|
887
|
+
}), (l = (y = f == null ? void 0 : f.info) == null ? void 0 : y.programs) == null || l.forEach((E) => {
|
|
888
|
+
const _ = E.cacheKey.split(","), b = _[_.findIndex(St) + 1];
|
|
889
|
+
if (xt(b) && c[b]) {
|
|
890
|
+
const { material: S, meshes: C } = c[b];
|
|
891
|
+
s.set(b, {
|
|
892
|
+
program: E,
|
|
893
|
+
material: S,
|
|
894
|
+
meshes: C,
|
|
495
895
|
drawCounts: { total: 0, type: "triangle", data: [] },
|
|
496
896
|
expand: !1,
|
|
497
897
|
visible: !0
|
|
498
898
|
});
|
|
499
899
|
}
|
|
500
|
-
}),
|
|
501
|
-
programs:
|
|
502
|
-
triggerProgramsUpdate:
|
|
900
|
+
}), s.size !== F().programs.size && (ht(s), M({
|
|
901
|
+
programs: s,
|
|
902
|
+
triggerProgramsUpdate: F().triggerProgramsUpdate + 1
|
|
503
903
|
}));
|
|
504
904
|
});
|
|
505
905
|
return () => {
|
|
506
|
-
var
|
|
507
|
-
|
|
906
|
+
var m;
|
|
907
|
+
r && typeof window.cancelIdleCallback < "u" && window.cancelIdleCallback(r.idleCbId), (m = r == null ? void 0 : r.dispose) == null || m.call(r), d && (I.Object3D.prototype.updateMatrixWorld = Le, I.Object3D.prototype.updateWorldMatrix = Ce, I.Object3D.prototype.updateMatrix = Oe), a(), i();
|
|
508
908
|
};
|
|
509
|
-
}, [
|
|
510
|
-
const
|
|
909
|
+
}, [r, f, h, o, t, d]), P(() => {
|
|
910
|
+
const a = Xe(() => (r && (r.paused = !0, M({
|
|
511
911
|
paused: !0,
|
|
512
912
|
log: {
|
|
513
913
|
maxMemory: 0,
|
|
@@ -519,67 +919,67 @@ const ce = E.Object3D.prototype.updateMatrixWorld, le = E.Object3D.prototype.upd
|
|
|
519
919
|
frameCount: 0
|
|
520
920
|
}
|
|
521
921
|
})), !1));
|
|
522
|
-
return () =>
|
|
523
|
-
}, [
|
|
922
|
+
return () => a();
|
|
923
|
+
}, [r]), null;
|
|
524
924
|
};
|
|
525
|
-
function
|
|
526
|
-
const
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
}, [e]),
|
|
530
|
-
const
|
|
531
|
-
var
|
|
532
|
-
return (
|
|
533
|
-
},
|
|
534
|
-
return () =>
|
|
535
|
-
...
|
|
536
|
-
context:
|
|
925
|
+
function le(t, e, n = [], o) {
|
|
926
|
+
const d = T(e);
|
|
927
|
+
P(() => {
|
|
928
|
+
d.current = e;
|
|
929
|
+
}, [e]), P(() => {
|
|
930
|
+
const f = (u) => {
|
|
931
|
+
var g;
|
|
932
|
+
return (g = d.current) == null ? void 0 : g.call(d, u);
|
|
933
|
+
}, h = vt(t, f);
|
|
934
|
+
return () => _t(t, f, {
|
|
935
|
+
...o,
|
|
936
|
+
context: h
|
|
537
937
|
});
|
|
538
|
-
}, [
|
|
938
|
+
}, [t, o == null ? void 0 : o.once, ...n]);
|
|
539
939
|
}
|
|
540
|
-
function
|
|
940
|
+
function Lt(t) {
|
|
541
941
|
let e = 0;
|
|
542
|
-
for (const
|
|
543
|
-
const
|
|
544
|
-
e +=
|
|
942
|
+
for (const o in t.attributes) {
|
|
943
|
+
const d = t.getAttribute(o);
|
|
944
|
+
e += d.count * d.itemSize * d.array.BYTES_PER_ELEMENT;
|
|
545
945
|
}
|
|
546
|
-
const
|
|
547
|
-
return e +=
|
|
946
|
+
const n = t.getIndex();
|
|
947
|
+
return e += n ? n.count * n.itemSize * n.array.BYTES_PER_ELEMENT : 0, e;
|
|
548
948
|
}
|
|
549
|
-
const
|
|
550
|
-
perfS:
|
|
551
|
-
containerHeight:
|
|
552
|
-
topLeft:
|
|
553
|
-
topRight:
|
|
554
|
-
bottomLeft:
|
|
555
|
-
bottomRight:
|
|
556
|
-
minimal:
|
|
557
|
-
perfIContainer:
|
|
558
|
-
perfI:
|
|
559
|
-
perfB:
|
|
560
|
-
toggleContainer:
|
|
561
|
-
toggle:
|
|
562
|
-
activeTab:
|
|
563
|
-
containerScroll:
|
|
564
|
-
programGeo:
|
|
565
|
-
programHeader:
|
|
566
|
-
headerLeft:
|
|
567
|
-
programTitle:
|
|
568
|
-
toggleArrow:
|
|
569
|
-
programConsole:
|
|
570
|
-
programsContainer:
|
|
571
|
-
headerRight:
|
|
572
|
-
metricBadge:
|
|
573
|
-
programsULHeader:
|
|
574
|
-
programsUL:
|
|
575
|
-
programsGeoLi:
|
|
576
|
-
graph:
|
|
577
|
-
visibilityBtn:
|
|
578
|
-
active:
|
|
579
|
-
},
|
|
580
|
-
var
|
|
581
|
-
const
|
|
582
|
-
switch (
|
|
949
|
+
const Ct = "_perfS_ans5i_1", Ot = "_containerHeight_ans5i_16", It = "_topLeft_ans5i_21", Mt = "_topRight_ans5i_22", Tt = "_bottomLeft_ans5i_23", At = "_bottomRight_ans5i_24", Rt = "_minimal_ans5i_26", Nt = "_perfIContainer_ans5i_30", Ft = "_perfI_ans5i_30", Pt = "_perfB_ans5i_69", Ut = "_toggleContainer_ans5i_83", Dt = "_toggle_ans5i_83", Gt = "_activeTab_ans5i_105", Wt = "_containerScroll_ans5i_110", Bt = "_programGeo_ans5i_115", jt = "_programHeader_ans5i_120", Vt = "_headerLeft_ans5i_149", Ht = "_programTitle_ans5i_156", kt = "_toggleArrow_ans5i_166", qt = "_programConsole_ans5i_200", zt = "_programsContainer_ans5i_218", $t = "_headerRight_ans5i_222", Kt = "_metricBadge_ans5i_228", Qt = "_programsULHeader_ans5i_246", Yt = "_programsUL_ans5i_246", Xt = "_programsGeoLi_ans5i_309", Jt = "_graph_ans5i_324", Zt = "_visibilityBtn_ans5i_354", er = "_active_ans5i_105", v = {
|
|
950
|
+
perfS: Ct,
|
|
951
|
+
containerHeight: Ot,
|
|
952
|
+
topLeft: It,
|
|
953
|
+
topRight: Mt,
|
|
954
|
+
bottomLeft: Tt,
|
|
955
|
+
bottomRight: At,
|
|
956
|
+
minimal: Rt,
|
|
957
|
+
perfIContainer: Nt,
|
|
958
|
+
perfI: Ft,
|
|
959
|
+
perfB: Pt,
|
|
960
|
+
toggleContainer: Ut,
|
|
961
|
+
toggle: Dt,
|
|
962
|
+
activeTab: Gt,
|
|
963
|
+
containerScroll: Wt,
|
|
964
|
+
programGeo: Bt,
|
|
965
|
+
programHeader: jt,
|
|
966
|
+
headerLeft: Vt,
|
|
967
|
+
programTitle: Ht,
|
|
968
|
+
toggleArrow: kt,
|
|
969
|
+
programConsole: qt,
|
|
970
|
+
programsContainer: zt,
|
|
971
|
+
headerRight: $t,
|
|
972
|
+
metricBadge: Kt,
|
|
973
|
+
programsULHeader: Qt,
|
|
974
|
+
programsUL: Yt,
|
|
975
|
+
programsGeoLi: Xt,
|
|
976
|
+
graph: Jt,
|
|
977
|
+
visibilityBtn: Zt,
|
|
978
|
+
active: er
|
|
979
|
+
}, Ae = (t, e) => {
|
|
980
|
+
var d, f;
|
|
981
|
+
const n = (h) => {
|
|
982
|
+
switch (h) {
|
|
583
983
|
case 1e3:
|
|
584
984
|
return "RepeatWrapping";
|
|
585
985
|
case 1001:
|
|
@@ -589,8 +989,8 @@ const Qe = "_perfS_ans5i_1", Xe = "_containerHeight_ans5i_16", Ye = "_topLeft_an
|
|
|
589
989
|
default:
|
|
590
990
|
return "ClampToEdgeWrapping";
|
|
591
991
|
}
|
|
592
|
-
},
|
|
593
|
-
switch (
|
|
992
|
+
}, o = (h) => {
|
|
993
|
+
switch (h) {
|
|
594
994
|
case 3e3:
|
|
595
995
|
return "LinearEncoding";
|
|
596
996
|
case 3001:
|
|
@@ -612,30 +1012,30 @@ const Qe = "_perfS_ans5i_1", Xe = "_containerHeight_ans5i_16", Ye = "_topLeft_an
|
|
|
612
1012
|
}
|
|
613
1013
|
};
|
|
614
1014
|
return {
|
|
615
|
-
name:
|
|
616
|
-
url: (
|
|
617
|
-
encoding:
|
|
618
|
-
wrapT:
|
|
619
|
-
flipY: (
|
|
1015
|
+
name: t,
|
|
1016
|
+
url: (d = e == null ? void 0 : e.image) == null ? void 0 : d.currentSrc,
|
|
1017
|
+
encoding: o(e.encoding),
|
|
1018
|
+
wrapT: n(e.wrapT),
|
|
1019
|
+
flipY: (f = e.flipY) == null ? void 0 : f.toString()
|
|
620
1020
|
};
|
|
621
|
-
},
|
|
622
|
-
value:
|
|
1021
|
+
}, ie = ({
|
|
1022
|
+
value: t,
|
|
623
1023
|
label: e,
|
|
624
|
-
unit:
|
|
625
|
-
title:
|
|
626
|
-
}) =>
|
|
627
|
-
/* @__PURE__ */
|
|
1024
|
+
unit: n,
|
|
1025
|
+
title: o
|
|
1026
|
+
}) => t == null || t === 0 || t === "0" ? null : /* @__PURE__ */ x("div", { className: v.metricBadge, title: o, children: [
|
|
1027
|
+
/* @__PURE__ */ p("b", { children: t }),
|
|
628
1028
|
" ",
|
|
629
|
-
|
|
630
|
-
] }),
|
|
631
|
-
const
|
|
632
|
-
return
|
|
633
|
-
if (
|
|
634
|
-
const
|
|
635
|
-
let
|
|
636
|
-
const
|
|
637
|
-
|
|
638
|
-
if (!
|
|
1029
|
+
n || e
|
|
1030
|
+
] }), tr = ({ program: t, material: e, setTexNumber: n }) => {
|
|
1031
|
+
const o = A((h) => h.gl), [d, f] = B(null);
|
|
1032
|
+
return P(() => {
|
|
1033
|
+
if (o) {
|
|
1034
|
+
const h = t == null ? void 0 : t.getUniforms();
|
|
1035
|
+
let u = 0;
|
|
1036
|
+
const g = /* @__PURE__ */ new Map();
|
|
1037
|
+
h && h.seq && h.seq.forEach((r) => {
|
|
1038
|
+
if (!r.id.includes("uTroika") && ![
|
|
639
1039
|
"isOrthographic",
|
|
640
1040
|
"uvTransform",
|
|
641
1041
|
"lightProbe",
|
|
@@ -644,136 +1044,136 @@ const Qe = "_perfS_ans5i_1", Xe = "_containerHeight_ans5i_16", Ye = "_topLeft_an
|
|
|
644
1044
|
"normalMatrix",
|
|
645
1045
|
"modelMatrix",
|
|
646
1046
|
"modelViewMatrix"
|
|
647
|
-
].includes(
|
|
648
|
-
const
|
|
649
|
-
|
|
650
|
-
typeof
|
|
651
|
-
}),
|
|
1047
|
+
].includes(r.id)) {
|
|
1048
|
+
const a = [], i = { name: r.id };
|
|
1049
|
+
r.cache && (r.cache.forEach((m) => {
|
|
1050
|
+
typeof m < "u" && a.push(m.toString().substring(0, 4));
|
|
1051
|
+
}), i.value = a.join(), e[r.id] && e[r.id].image && (u++, i.value = Ae(r.id, e[r.id])), i.value || (i.value = "empty"), g.set(r.id, i));
|
|
652
1052
|
}
|
|
653
|
-
}), e.uniforms && Object.keys(e.uniforms).forEach((
|
|
654
|
-
const
|
|
655
|
-
if (
|
|
656
|
-
const { value:
|
|
657
|
-
if (
|
|
658
|
-
if (
|
|
659
|
-
|
|
1053
|
+
}), e.uniforms && Object.keys(e.uniforms).forEach((r) => {
|
|
1054
|
+
const a = e.uniforms[r];
|
|
1055
|
+
if (a.value) {
|
|
1056
|
+
const { value: i } = a, m = { name: r };
|
|
1057
|
+
if (r.includes("uTroika")) return;
|
|
1058
|
+
if (i.isTexture)
|
|
1059
|
+
u++, m.value = Ae(r, i);
|
|
660
1060
|
else {
|
|
661
|
-
let
|
|
1061
|
+
let c = JSON.stringify(i);
|
|
662
1062
|
try {
|
|
663
|
-
|
|
1063
|
+
c = JSON.stringify(i);
|
|
664
1064
|
} catch {
|
|
665
|
-
|
|
1065
|
+
c = i.toString();
|
|
666
1066
|
}
|
|
667
|
-
|
|
1067
|
+
m.value = c;
|
|
668
1068
|
}
|
|
669
|
-
|
|
1069
|
+
g.set(r, m);
|
|
670
1070
|
}
|
|
671
|
-
}),
|
|
1071
|
+
}), n(u), f(g);
|
|
672
1072
|
}
|
|
673
|
-
}, [
|
|
674
|
-
|
|
1073
|
+
}, [o, e, t, n]), /* @__PURE__ */ p("ul", { className: v.programsUL, children: d && Array.from(d.values()).map((h) => /* @__PURE__ */ p("span", { children: typeof h.value == "string" ? /* @__PURE__ */ p("li", { children: /* @__PURE__ */ x("span", { children: [
|
|
1074
|
+
h.name,
|
|
675
1075
|
" :",
|
|
676
1076
|
" ",
|
|
677
|
-
/* @__PURE__ */
|
|
678
|
-
|
|
679
|
-
|
|
1077
|
+
/* @__PURE__ */ x("b", { children: [
|
|
1078
|
+
h.value.substring(0, 30),
|
|
1079
|
+
h.value.length > 30 ? "..." : ""
|
|
680
1080
|
] })
|
|
681
|
-
] }) }) : /* @__PURE__ */
|
|
682
|
-
/* @__PURE__ */
|
|
683
|
-
|
|
1081
|
+
] }) }) : /* @__PURE__ */ x(q, { children: [
|
|
1082
|
+
/* @__PURE__ */ p("li", { children: /* @__PURE__ */ x("b", { children: [
|
|
1083
|
+
h.value.name,
|
|
684
1084
|
":"
|
|
685
1085
|
] }) }),
|
|
686
|
-
/* @__PURE__ */
|
|
687
|
-
Object.keys(
|
|
688
|
-
(
|
|
1086
|
+
/* @__PURE__ */ x("div", { children: [
|
|
1087
|
+
Object.keys(h.value).map(
|
|
1088
|
+
(u) => u !== "name" ? /* @__PURE__ */ p("div", { children: u === "url" ? /* @__PURE__ */ p(
|
|
689
1089
|
"a",
|
|
690
1090
|
{
|
|
691
|
-
href:
|
|
1091
|
+
href: h.value[u],
|
|
692
1092
|
target: "_blank",
|
|
693
1093
|
rel: "noreferrer",
|
|
694
|
-
children: /* @__PURE__ */
|
|
1094
|
+
children: /* @__PURE__ */ p("img", { src: h.value[u], alt: "texture" })
|
|
695
1095
|
}
|
|
696
|
-
) : /* @__PURE__ */
|
|
697
|
-
|
|
1096
|
+
) : /* @__PURE__ */ x("li", { children: [
|
|
1097
|
+
u,
|
|
698
1098
|
": ",
|
|
699
|
-
/* @__PURE__ */
|
|
700
|
-
] }) },
|
|
1099
|
+
/* @__PURE__ */ p("b", { children: h.value[u] })
|
|
1100
|
+
] }) }, u) : null
|
|
701
1101
|
),
|
|
702
|
-
/* @__PURE__ */
|
|
1102
|
+
/* @__PURE__ */ x(
|
|
703
1103
|
"button",
|
|
704
1104
|
{
|
|
705
|
-
className:
|
|
1105
|
+
className: v.programConsole,
|
|
706
1106
|
onClick: () => {
|
|
707
|
-
var
|
|
1107
|
+
var u;
|
|
708
1108
|
console.info(
|
|
709
|
-
e[
|
|
1109
|
+
e[h.value.name] || ((u = e == null ? void 0 : e.uniforms[h.value.name]) == null ? void 0 : u.value)
|
|
710
1110
|
);
|
|
711
1111
|
},
|
|
712
1112
|
children: [
|
|
713
1113
|
"console.info(",
|
|
714
|
-
|
|
1114
|
+
h.value.name,
|
|
715
1115
|
");"
|
|
716
1116
|
]
|
|
717
1117
|
}
|
|
718
1118
|
)
|
|
719
1119
|
] })
|
|
720
|
-
] }) },
|
|
721
|
-
},
|
|
722
|
-
const [e,
|
|
723
|
-
if (!
|
|
724
|
-
const
|
|
725
|
-
if (
|
|
726
|
-
const
|
|
727
|
-
return isFinite(
|
|
728
|
-
},
|
|
729
|
-
return /* @__PURE__ */
|
|
730
|
-
/* @__PURE__ */
|
|
1120
|
+
] }) }, h.name)) });
|
|
1121
|
+
}, rr = ({ el: t }) => {
|
|
1122
|
+
const [e, n] = B(t.visible), [o, d] = B(t.expand), [f, h] = B(0), { meshes: u, program: g, material: r } = t, a = A((s) => s.gl), i = () => {
|
|
1123
|
+
if (!a || !a.info || !a.info.render) return 0;
|
|
1124
|
+
const s = a.info.render.triangles + a.info.render.lines + a.info.render.points;
|
|
1125
|
+
if (s === 0) return 0;
|
|
1126
|
+
const y = Math.round(t.drawCounts.total / s * 100 * 10) / 10;
|
|
1127
|
+
return isFinite(y) && y || 0;
|
|
1128
|
+
}, m = Object.keys(u).length, c = i();
|
|
1129
|
+
return /* @__PURE__ */ x("div", { className: v.programGeo, children: [
|
|
1130
|
+
/* @__PURE__ */ x(
|
|
731
1131
|
"div",
|
|
732
1132
|
{
|
|
733
|
-
className:
|
|
1133
|
+
className: v.programHeader,
|
|
734
1134
|
onClick: () => {
|
|
735
|
-
Object.keys(
|
|
736
|
-
|
|
737
|
-
}),
|
|
1135
|
+
Object.keys(u).forEach((s) => {
|
|
1136
|
+
u[s].material.wireframe = !1;
|
|
1137
|
+
}), d(!o);
|
|
738
1138
|
},
|
|
739
1139
|
children: [
|
|
740
|
-
/* @__PURE__ */
|
|
741
|
-
/* @__PURE__ */
|
|
1140
|
+
/* @__PURE__ */ x("div", { className: v.headerLeft, children: [
|
|
1141
|
+
/* @__PURE__ */ p(
|
|
742
1142
|
"div",
|
|
743
1143
|
{
|
|
744
|
-
className:
|
|
1144
|
+
className: v.toggleArrow,
|
|
745
1145
|
style: {
|
|
746
|
-
transform:
|
|
1146
|
+
transform: o ? "rotate(90deg)" : "rotate(0deg)"
|
|
747
1147
|
},
|
|
748
1148
|
children: "▶"
|
|
749
1149
|
}
|
|
750
1150
|
),
|
|
751
|
-
|
|
1151
|
+
g && /* @__PURE__ */ p("span", { className: v.programTitle, children: g.name })
|
|
752
1152
|
] }),
|
|
753
|
-
/* @__PURE__ */
|
|
754
|
-
/* @__PURE__ */
|
|
755
|
-
|
|
1153
|
+
/* @__PURE__ */ x("div", { className: v.headerRight, children: [
|
|
1154
|
+
/* @__PURE__ */ p(
|
|
1155
|
+
ie,
|
|
756
1156
|
{
|
|
757
|
-
value:
|
|
758
|
-
unit:
|
|
1157
|
+
value: m,
|
|
1158
|
+
unit: m > 1 ? "users" : "user"
|
|
759
1159
|
}
|
|
760
1160
|
),
|
|
761
|
-
/* @__PURE__ */
|
|
762
|
-
|
|
1161
|
+
/* @__PURE__ */ p(ie, { value: f, unit: "tex" }),
|
|
1162
|
+
t.drawCounts.total > 0 && /* @__PURE__ */ x(
|
|
763
1163
|
"div",
|
|
764
1164
|
{
|
|
765
|
-
className:
|
|
766
|
-
title: `${
|
|
1165
|
+
className: v.metricBadge,
|
|
1166
|
+
title: `${c}% of total render`,
|
|
767
1167
|
children: [
|
|
768
|
-
/* @__PURE__ */
|
|
769
|
-
|
|
770
|
-
|
|
1168
|
+
/* @__PURE__ */ p("b", { children: t.drawCounts.total }),
|
|
1169
|
+
t.drawCounts.type === "Triangle" ? "tris" : t.drawCounts.type,
|
|
1170
|
+
t.visible && !t.material.wireframe && /* @__PURE__ */ x(
|
|
771
1171
|
"span",
|
|
772
1172
|
{
|
|
773
1173
|
style: { marginLeft: "4px", opacity: 0.6, fontSize: "9px" },
|
|
774
1174
|
children: [
|
|
775
1175
|
"(",
|
|
776
|
-
|
|
1176
|
+
c,
|
|
777
1177
|
"%)"
|
|
778
1178
|
]
|
|
779
1179
|
}
|
|
@@ -781,27 +1181,27 @@ const Qe = "_perfS_ans5i_1", Xe = "_containerHeight_ans5i_16", Ye = "_topLeft_an
|
|
|
781
1181
|
]
|
|
782
1182
|
}
|
|
783
1183
|
),
|
|
784
|
-
|
|
785
|
-
/* @__PURE__ */
|
|
1184
|
+
r.glslVersion === "300 es" && /* @__PURE__ */ p(ie, { value: "300", unit: "es" }),
|
|
1185
|
+
/* @__PURE__ */ p(
|
|
786
1186
|
"div",
|
|
787
1187
|
{
|
|
788
|
-
className: `${
|
|
1188
|
+
className: `${v.visibilityBtn} ${e ? v.active : ""}`,
|
|
789
1189
|
onPointerEnter: () => {
|
|
790
|
-
Object.keys(
|
|
791
|
-
(
|
|
1190
|
+
Object.keys(u).forEach(
|
|
1191
|
+
(s) => u[s].material.wireframe = !0
|
|
792
1192
|
);
|
|
793
1193
|
},
|
|
794
1194
|
onPointerLeave: () => {
|
|
795
|
-
Object.keys(
|
|
796
|
-
(
|
|
1195
|
+
Object.keys(u).forEach(
|
|
1196
|
+
(s) => u[s].material.wireframe = !1
|
|
797
1197
|
);
|
|
798
1198
|
},
|
|
799
|
-
onClick: (
|
|
800
|
-
|
|
801
|
-
const
|
|
802
|
-
Object.keys(
|
|
803
|
-
|
|
804
|
-
}),
|
|
1199
|
+
onClick: (s) => {
|
|
1200
|
+
s.stopPropagation();
|
|
1201
|
+
const y = !e;
|
|
1202
|
+
Object.keys(u).forEach((l) => {
|
|
1203
|
+
u[l] && (u[l].visible = y);
|
|
1204
|
+
}), n(y);
|
|
805
1205
|
},
|
|
806
1206
|
children: e ? "👁" : "×"
|
|
807
1207
|
}
|
|
@@ -810,19 +1210,19 @@ const Qe = "_perfS_ans5i_1", Xe = "_containerHeight_ans5i_16", Ye = "_topLeft_an
|
|
|
810
1210
|
]
|
|
811
1211
|
}
|
|
812
1212
|
),
|
|
813
|
-
/* @__PURE__ */
|
|
814
|
-
/* @__PURE__ */
|
|
815
|
-
/* @__PURE__ */
|
|
816
|
-
|
|
1213
|
+
/* @__PURE__ */ x("div", { style: { display: o ? "block" : "none" }, children: [
|
|
1214
|
+
/* @__PURE__ */ p("div", { className: v.programsULHeader, style: { marginTop: "4px" }, children: "Uniforms" }),
|
|
1215
|
+
/* @__PURE__ */ p(
|
|
1216
|
+
tr,
|
|
817
1217
|
{
|
|
818
|
-
program:
|
|
819
|
-
material:
|
|
820
|
-
setTexNumber:
|
|
1218
|
+
program: g,
|
|
1219
|
+
material: r,
|
|
1220
|
+
setTexNumber: h
|
|
821
1221
|
}
|
|
822
1222
|
),
|
|
823
|
-
/* @__PURE__ */
|
|
824
|
-
/* @__PURE__ */
|
|
825
|
-
(
|
|
1223
|
+
/* @__PURE__ */ p("div", { className: v.programsULHeader, children: "Geometries" }),
|
|
1224
|
+
/* @__PURE__ */ p("ul", { className: v.programsUL, children: u && Object.keys(u).map(
|
|
1225
|
+
(s) => u[s] && u[s].geometry && /* @__PURE__ */ p("li", { className: v.programsGeoLi, children: /* @__PURE__ */ x(
|
|
826
1226
|
"div",
|
|
827
1227
|
{
|
|
828
1228
|
style: {
|
|
@@ -832,8 +1232,8 @@ const Qe = "_perfS_ans5i_1", Xe = "_containerHeight_ans5i_16", Ye = "_topLeft_an
|
|
|
832
1232
|
alignItems: "center"
|
|
833
1233
|
},
|
|
834
1234
|
children: [
|
|
835
|
-
/* @__PURE__ */
|
|
836
|
-
|
|
1235
|
+
/* @__PURE__ */ p("span", { children: u[s].geometry.type }),
|
|
1236
|
+
u[s].userData && u[s].userData.drawCount && /* @__PURE__ */ x(
|
|
837
1237
|
"span",
|
|
838
1238
|
{
|
|
839
1239
|
style: {
|
|
@@ -843,16 +1243,16 @@ const Qe = "_perfS_ans5i_1", Xe = "_containerHeight_ans5i_16", Ye = "_topLeft_an
|
|
|
843
1243
|
gap: "6px"
|
|
844
1244
|
},
|
|
845
1245
|
children: [
|
|
846
|
-
/* @__PURE__ */
|
|
847
|
-
/* @__PURE__ */
|
|
1246
|
+
/* @__PURE__ */ x("span", { children: [
|
|
1247
|
+
/* @__PURE__ */ p("b", { children: u[s].userData.drawCount.count }),
|
|
848
1248
|
" ",
|
|
849
|
-
|
|
1249
|
+
u[s].userData.drawCount.type,
|
|
850
1250
|
"s"
|
|
851
1251
|
] }),
|
|
852
|
-
/* @__PURE__ */
|
|
853
|
-
/* @__PURE__ */
|
|
854
|
-
/* @__PURE__ */
|
|
855
|
-
|
|
1252
|
+
/* @__PURE__ */ p("span", { style: { opacity: 0.3 }, children: "|" }),
|
|
1253
|
+
/* @__PURE__ */ x("span", { children: [
|
|
1254
|
+
/* @__PURE__ */ p("b", { children: Math.round(
|
|
1255
|
+
Lt(u[s].geometry) / 1024 * 100
|
|
856
1256
|
) / 100 }),
|
|
857
1257
|
" ",
|
|
858
1258
|
"KB"
|
|
@@ -862,85 +1262,85 @@ const Qe = "_perfS_ans5i_1", Xe = "_containerHeight_ans5i_16", Ye = "_topLeft_an
|
|
|
862
1262
|
)
|
|
863
1263
|
]
|
|
864
1264
|
}
|
|
865
|
-
) },
|
|
1265
|
+
) }, s)
|
|
866
1266
|
) }),
|
|
867
|
-
/* @__PURE__ */
|
|
1267
|
+
/* @__PURE__ */ x(
|
|
868
1268
|
"button",
|
|
869
1269
|
{
|
|
870
|
-
className:
|
|
871
|
-
onClick: () => console.info(
|
|
1270
|
+
className: v.programConsole,
|
|
1271
|
+
onClick: () => console.info(r),
|
|
872
1272
|
children: [
|
|
873
1273
|
"Log Material (",
|
|
874
|
-
|
|
1274
|
+
r.type,
|
|
875
1275
|
")"
|
|
876
1276
|
]
|
|
877
1277
|
}
|
|
878
1278
|
)
|
|
879
1279
|
] })
|
|
880
1280
|
] });
|
|
881
|
-
},
|
|
882
|
-
|
|
883
|
-
const
|
|
884
|
-
return /* @__PURE__ */
|
|
1281
|
+
}, nr = () => {
|
|
1282
|
+
A((e) => e.triggerProgramsUpdate);
|
|
1283
|
+
const t = A((e) => e.programs);
|
|
1284
|
+
return /* @__PURE__ */ p(
|
|
885
1285
|
"div",
|
|
886
1286
|
{
|
|
887
|
-
className:
|
|
1287
|
+
className: v.programsContainer,
|
|
888
1288
|
onWheel: (e) => e.stopPropagation(),
|
|
889
|
-
children:
|
|
1289
|
+
children: t && Array.from(t.values()).map((e) => e ? /* @__PURE__ */ p(rr, { el: e }, e.material.uuid) : null)
|
|
890
1290
|
}
|
|
891
1291
|
);
|
|
892
|
-
},
|
|
893
|
-
minimal:
|
|
1292
|
+
}, sr = ({
|
|
1293
|
+
minimal: t,
|
|
894
1294
|
chart: e = { length: 120, hz: 60 }
|
|
895
1295
|
}) => {
|
|
896
|
-
const
|
|
1296
|
+
const n = J(() => ({
|
|
897
1297
|
fps: new Float32Array(e.length * 3),
|
|
898
1298
|
cpu: new Float32Array(e.length * 3),
|
|
899
1299
|
gpu: new Float32Array(e.length * 3)
|
|
900
|
-
}), [e]),
|
|
901
|
-
let
|
|
902
|
-
const { width:
|
|
903
|
-
if (!
|
|
1300
|
+
}), [e]), o = T(null), d = T(null), f = T(null), h = T(null), u = J(() => new I.Vector3(0, 0, 0), []), g = (r, a = 1, i, m) => {
|
|
1301
|
+
let c = 0;
|
|
1302
|
+
const { width: s, height: y } = m, l = F().chart.data[r];
|
|
1303
|
+
if (!l || l.length === 0)
|
|
904
1304
|
return;
|
|
905
|
-
const
|
|
906
|
-
for (let
|
|
907
|
-
const
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
Math.min(100,
|
|
1305
|
+
const E = t ? 2 : 6, _ = t ? 12 : 50, b = l.length;
|
|
1306
|
+
for (let S = 0; S < b; S++) {
|
|
1307
|
+
const C = (F().chart.circularId + S + 1) % b;
|
|
1308
|
+
l[C] !== void 0 && (l[C] > c && (c = l[C] * a), u.set(
|
|
1309
|
+
E + S / (b - 1) * (s - E * 2) - s / 2,
|
|
1310
|
+
Math.min(100, l[C]) * a / 100 * (y - E * 2 - _) - y / 2,
|
|
911
1311
|
0
|
|
912
|
-
),
|
|
1312
|
+
), u.toArray(i.attributes.position.array, S * 3));
|
|
913
1313
|
}
|
|
914
|
-
|
|
1314
|
+
i.attributes.position.needsUpdate = !0;
|
|
915
1315
|
};
|
|
916
|
-
return
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
),
|
|
920
|
-
}), /* @__PURE__ */
|
|
921
|
-
/* @__PURE__ */
|
|
1316
|
+
return Ge(function({ viewport: a }) {
|
|
1317
|
+
g("fps", 1, o.current, a), d.current && d.current.color.set(
|
|
1318
|
+
F().overclockingFps ? N.overClock : N.fps
|
|
1319
|
+
), g("gpu", 5, f.current, a), g("cpu", 5, h.current, a);
|
|
1320
|
+
}), /* @__PURE__ */ x(q, { children: [
|
|
1321
|
+
/* @__PURE__ */ x(
|
|
922
1322
|
"line",
|
|
923
1323
|
{
|
|
924
|
-
onUpdate: (
|
|
925
|
-
|
|
1324
|
+
onUpdate: (r) => {
|
|
1325
|
+
r.updateMatrix(), r.matrixWorld.copy(r.matrix);
|
|
926
1326
|
},
|
|
927
1327
|
children: [
|
|
928
|
-
/* @__PURE__ */
|
|
1328
|
+
/* @__PURE__ */ p("bufferGeometry", { ref: o, children: /* @__PURE__ */ p(
|
|
929
1329
|
"bufferAttribute",
|
|
930
1330
|
{
|
|
931
1331
|
attach: "attributes-position",
|
|
932
1332
|
count: e.length,
|
|
933
|
-
args: [
|
|
934
|
-
array:
|
|
1333
|
+
args: [n.fps, 3],
|
|
1334
|
+
array: n.fps,
|
|
935
1335
|
itemSize: 3,
|
|
936
|
-
usage:
|
|
1336
|
+
usage: I.DynamicDrawUsage,
|
|
937
1337
|
needsUpdate: !0
|
|
938
1338
|
}
|
|
939
1339
|
) }),
|
|
940
|
-
/* @__PURE__ */
|
|
1340
|
+
/* @__PURE__ */ p(
|
|
941
1341
|
"lineBasicMaterial",
|
|
942
1342
|
{
|
|
943
|
-
ref:
|
|
1343
|
+
ref: d,
|
|
944
1344
|
color: N.fps,
|
|
945
1345
|
transparent: !0,
|
|
946
1346
|
opacity: 0.5
|
|
@@ -949,87 +1349,87 @@ const Qe = "_perfS_ans5i_1", Xe = "_containerHeight_ans5i_16", Ye = "_topLeft_an
|
|
|
949
1349
|
]
|
|
950
1350
|
}
|
|
951
1351
|
),
|
|
952
|
-
/* @__PURE__ */
|
|
1352
|
+
/* @__PURE__ */ x(
|
|
953
1353
|
"line",
|
|
954
1354
|
{
|
|
955
|
-
onUpdate: (
|
|
956
|
-
|
|
1355
|
+
onUpdate: (r) => {
|
|
1356
|
+
r.updateMatrix(), r.matrixWorld.copy(r.matrix);
|
|
957
1357
|
},
|
|
958
1358
|
children: [
|
|
959
|
-
/* @__PURE__ */
|
|
1359
|
+
/* @__PURE__ */ p("bufferGeometry", { ref: f, children: /* @__PURE__ */ p(
|
|
960
1360
|
"bufferAttribute",
|
|
961
1361
|
{
|
|
962
1362
|
attach: "attributes-position",
|
|
963
1363
|
count: e.length,
|
|
964
|
-
array:
|
|
965
|
-
args: [
|
|
1364
|
+
array: n.gpu,
|
|
1365
|
+
args: [n.gpu, 3],
|
|
966
1366
|
itemSize: 3,
|
|
967
|
-
usage:
|
|
1367
|
+
usage: I.DynamicDrawUsage,
|
|
968
1368
|
needsUpdate: !0
|
|
969
1369
|
}
|
|
970
1370
|
) }),
|
|
971
|
-
/* @__PURE__ */
|
|
1371
|
+
/* @__PURE__ */ p("lineBasicMaterial", { color: N.gpu, transparent: !0, opacity: 0.5 })
|
|
972
1372
|
]
|
|
973
1373
|
}
|
|
974
1374
|
),
|
|
975
|
-
/* @__PURE__ */
|
|
1375
|
+
/* @__PURE__ */ x(
|
|
976
1376
|
"line",
|
|
977
1377
|
{
|
|
978
|
-
onUpdate: (
|
|
979
|
-
|
|
1378
|
+
onUpdate: (r) => {
|
|
1379
|
+
r.updateMatrix(), r.matrixWorld.copy(r.matrix);
|
|
980
1380
|
},
|
|
981
1381
|
children: [
|
|
982
|
-
/* @__PURE__ */
|
|
1382
|
+
/* @__PURE__ */ p("bufferGeometry", { ref: h, children: /* @__PURE__ */ p(
|
|
983
1383
|
"bufferAttribute",
|
|
984
1384
|
{
|
|
985
1385
|
attach: "attributes-position",
|
|
986
1386
|
count: e.length,
|
|
987
|
-
array:
|
|
988
|
-
args: [
|
|
1387
|
+
array: n.cpu,
|
|
1388
|
+
args: [n.cpu, 3],
|
|
989
1389
|
itemSize: 3,
|
|
990
|
-
usage:
|
|
1390
|
+
usage: I.DynamicDrawUsage,
|
|
991
1391
|
needsUpdate: !0
|
|
992
1392
|
}
|
|
993
1393
|
) }),
|
|
994
|
-
/* @__PURE__ */
|
|
1394
|
+
/* @__PURE__ */ p("lineBasicMaterial", { color: N.cpu, transparent: !0, opacity: 0.5 })
|
|
995
1395
|
]
|
|
996
1396
|
}
|
|
997
1397
|
)
|
|
998
1398
|
] });
|
|
999
|
-
},
|
|
1000
|
-
chart:
|
|
1399
|
+
}, ir = ({
|
|
1400
|
+
chart: t,
|
|
1001
1401
|
showGraph: e = !0,
|
|
1002
|
-
antialias:
|
|
1003
|
-
minimal:
|
|
1402
|
+
antialias: n = !0,
|
|
1403
|
+
minimal: o
|
|
1004
1404
|
}) => {
|
|
1005
|
-
const
|
|
1006
|
-
return /* @__PURE__ */
|
|
1405
|
+
const d = T(void 0), f = A((h) => h.paused);
|
|
1406
|
+
return /* @__PURE__ */ p(
|
|
1007
1407
|
"div",
|
|
1008
1408
|
{
|
|
1009
|
-
className:
|
|
1409
|
+
className: v.graph,
|
|
1010
1410
|
style: {
|
|
1011
1411
|
display: "flex",
|
|
1012
1412
|
marginTop: 6,
|
|
1013
1413
|
position: "absolute",
|
|
1014
1414
|
width: "100%",
|
|
1015
|
-
height: `${
|
|
1415
|
+
height: `${o ? 37 : e ? 100 : 60}px`
|
|
1016
1416
|
},
|
|
1017
|
-
children: /* @__PURE__ */
|
|
1018
|
-
|
|
1417
|
+
children: /* @__PURE__ */ p(
|
|
1418
|
+
Je,
|
|
1019
1419
|
{
|
|
1020
|
-
ref:
|
|
1420
|
+
ref: d,
|
|
1021
1421
|
orthographic: !0,
|
|
1022
1422
|
camera: { rotation: [0, 0, 0] },
|
|
1023
|
-
dpr:
|
|
1423
|
+
dpr: n ? [1, 2] : 1,
|
|
1024
1424
|
gl: {
|
|
1025
1425
|
antialias: !0,
|
|
1026
1426
|
alpha: !0,
|
|
1027
1427
|
stencil: !1,
|
|
1028
1428
|
depth: !1
|
|
1029
1429
|
},
|
|
1030
|
-
onCreated: ({ scene:
|
|
1031
|
-
|
|
1032
|
-
|
|
1430
|
+
onCreated: ({ scene: h }) => {
|
|
1431
|
+
h.traverse((u) => {
|
|
1432
|
+
u.matrixWorldAutoUpdate = !1, u.matrixAutoUpdate = !1;
|
|
1033
1433
|
});
|
|
1034
1434
|
},
|
|
1035
1435
|
flat: !0,
|
|
@@ -1039,116 +1439,116 @@ const Qe = "_perfS_ans5i_1", Xe = "_containerHeight_ans5i_16", Ye = "_topLeft_an
|
|
|
1039
1439
|
pointerEvents: "none",
|
|
1040
1440
|
background: "transparent !important",
|
|
1041
1441
|
width: "100%",
|
|
1042
|
-
height: `${
|
|
1442
|
+
height: `${o ? 37 : e ? 100 : 60}px`
|
|
1043
1443
|
},
|
|
1044
|
-
children:
|
|
1045
|
-
/* @__PURE__ */
|
|
1046
|
-
e && /* @__PURE__ */
|
|
1444
|
+
children: f ? null : /* @__PURE__ */ x(q, { children: [
|
|
1445
|
+
/* @__PURE__ */ p(ar, {}),
|
|
1446
|
+
e && /* @__PURE__ */ p(sr, { minimal: o, chart: t })
|
|
1047
1447
|
] })
|
|
1048
1448
|
}
|
|
1049
1449
|
)
|
|
1050
1450
|
}
|
|
1051
1451
|
);
|
|
1052
|
-
},
|
|
1053
|
-
|
|
1054
|
-
}, 1 / 0), null),
|
|
1452
|
+
}, ar = () => (Ge(function({ gl: e, scene: n, camera: o }) {
|
|
1453
|
+
o.updateMatrix(), o.matrixWorld.copy(o.matrix), o.matrixWorldInverse.copy(o.matrixWorld).invert(), e.render(n, o);
|
|
1454
|
+
}, 1 / 0), null), Re = {
|
|
1055
1455
|
fps: { fg: "#00ffff", bg: "#000022" },
|
|
1056
1456
|
// Chỉnh màu nền đậm hơn chút
|
|
1057
1457
|
cpu: { fg: "#00ff00", bg: "#002200" },
|
|
1058
1458
|
gpu: { fg: "#ff0080", bg: "#220011" }
|
|
1059
|
-
},
|
|
1459
|
+
}, G = [
|
|
1060
1460
|
{ key: "fps", label: "FPS", maxVal: 120 },
|
|
1061
1461
|
{ key: "cpu", label: "CPU", maxVal: 40 },
|
|
1062
1462
|
{ key: "gpu", label: "GPU", maxVal: 40 }
|
|
1063
|
-
], W = 48,
|
|
1064
|
-
function
|
|
1065
|
-
show:
|
|
1463
|
+
], W = 48, He = 15, Y = 2, k = He, H = W - k - 2, X = 6, or = 15, Ne = 1e3 / or;
|
|
1464
|
+
function cr({
|
|
1465
|
+
show: t = !0,
|
|
1066
1466
|
opacity: e = 1,
|
|
1067
1467
|
// Tăng opacity lên 1 để bớt trong suốt
|
|
1068
|
-
className:
|
|
1069
|
-
style:
|
|
1468
|
+
className: n,
|
|
1469
|
+
style: o
|
|
1070
1470
|
}) {
|
|
1071
|
-
const
|
|
1471
|
+
const d = A((c) => c.paused), f = T(null), h = T(null), [u, g] = B(300), r = J(
|
|
1072
1472
|
() => Math.max(1, Math.round(window.devicePixelRatio || 1)),
|
|
1073
1473
|
[]
|
|
1074
1474
|
);
|
|
1075
|
-
|
|
1076
|
-
if (!
|
|
1077
|
-
const
|
|
1078
|
-
for (const
|
|
1079
|
-
|
|
1475
|
+
P(() => {
|
|
1476
|
+
if (!h.current) return;
|
|
1477
|
+
const c = new ResizeObserver((s) => {
|
|
1478
|
+
for (const y of s)
|
|
1479
|
+
g(y.contentRect.width);
|
|
1080
1480
|
});
|
|
1081
|
-
return
|
|
1481
|
+
return c.observe(h.current), () => c.disconnect();
|
|
1082
1482
|
}, []);
|
|
1083
|
-
const
|
|
1084
|
-
return
|
|
1085
|
-
const
|
|
1086
|
-
if (!
|
|
1087
|
-
|
|
1088
|
-
const
|
|
1089
|
-
if (
|
|
1090
|
-
|
|
1091
|
-
for (let
|
|
1092
|
-
const { key:
|
|
1093
|
-
|
|
1483
|
+
const a = (G.length - 1) * X, i = Math.max(0, (u - a) / G.length), m = Math.max(0, i - Y);
|
|
1484
|
+
return P(() => {
|
|
1485
|
+
const c = f.current;
|
|
1486
|
+
if (!c) return;
|
|
1487
|
+
c.width = u * r, c.height = W * r, c.style.width = "100%", c.style.height = `${W}px`;
|
|
1488
|
+
const s = c.getContext("2d");
|
|
1489
|
+
if (s) {
|
|
1490
|
+
s.setTransform(1, 0, 0, 1, 0, 0), s.scale(r, r), s.imageSmoothingEnabled = !1, s.font = "bold 9px Roboto Mono, monospace", s.textBaseline = "top", s.clearRect(0, 0, u, W);
|
|
1491
|
+
for (let y = 0; y < G.length; y++) {
|
|
1492
|
+
const { key: l } = G[y], E = y * (i + X), { bg: _ } = Re[l];
|
|
1493
|
+
s.fillStyle = _, s.globalAlpha = e, s.fillRect(E, 0, i, W), s.globalAlpha = 1;
|
|
1094
1494
|
}
|
|
1095
1495
|
}
|
|
1096
|
-
}, [
|
|
1097
|
-
if (!
|
|
1098
|
-
const
|
|
1099
|
-
if (!
|
|
1100
|
-
const
|
|
1101
|
-
if (!
|
|
1102
|
-
let
|
|
1103
|
-
const
|
|
1496
|
+
}, [r, u, i, e]), P(() => {
|
|
1497
|
+
if (!t) return;
|
|
1498
|
+
const c = f.current;
|
|
1499
|
+
if (!c) return;
|
|
1500
|
+
const s = c.getContext("2d");
|
|
1501
|
+
if (!s) return;
|
|
1502
|
+
let y = 0, l = 0;
|
|
1503
|
+
const E = {
|
|
1104
1504
|
fps: { min: 1 / 0, max: 0 },
|
|
1105
1505
|
cpu: { min: 1 / 0, max: 0 },
|
|
1106
1506
|
gpu: { min: 1 / 0, max: 0 }
|
|
1107
1507
|
};
|
|
1108
|
-
function
|
|
1109
|
-
if (!
|
|
1110
|
-
const
|
|
1111
|
-
if (
|
|
1112
|
-
|
|
1113
|
-
const
|
|
1114
|
-
for (let
|
|
1115
|
-
const { key:
|
|
1116
|
-
let
|
|
1117
|
-
if (
|
|
1118
|
-
const
|
|
1119
|
-
|
|
1508
|
+
function _(b) {
|
|
1509
|
+
if (!c || !s || (y = requestAnimationFrame(_), d)) return;
|
|
1510
|
+
const S = b - l;
|
|
1511
|
+
if (S < Ne) return;
|
|
1512
|
+
l = b - S % Ne;
|
|
1513
|
+
const C = F(), w = C.chart.circularId;
|
|
1514
|
+
for (let L = 0; L < G.length; L++) {
|
|
1515
|
+
const { key: O, label: ke, maxVal: ue } = G[L], j = L * (i + X), { fg: fe, bg: me } = Re[O], $ = C.chart.data[O], Z = ($ == null ? void 0 : $.length) || 0;
|
|
1516
|
+
let K = 0;
|
|
1517
|
+
if (Z > 0) {
|
|
1518
|
+
const $e = (w - 1 + Z) % Z;
|
|
1519
|
+
K = $[$e] ?? 0;
|
|
1120
1520
|
}
|
|
1121
|
-
const
|
|
1122
|
-
|
|
1123
|
-
const
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
(
|
|
1127
|
-
|
|
1128
|
-
(
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1521
|
+
const D = E[O];
|
|
1522
|
+
D.min = Math.min(D.min, K), D.max = Math.max(D.max, K), s.fillStyle = me, s.globalAlpha = 1, s.fillRect(j, 0, i, He), s.fillStyle = fe;
|
|
1523
|
+
const qe = `${ke} (${Math.round(D.min)}-${Math.round(D.max)})`;
|
|
1524
|
+
s.fillText(qe, j + 3, 2), m > 1 && s.drawImage(
|
|
1525
|
+
c,
|
|
1526
|
+
(j + Y + 1) * r,
|
|
1527
|
+
k * r,
|
|
1528
|
+
(m - 1) * r,
|
|
1529
|
+
H * r,
|
|
1530
|
+
j + Y,
|
|
1531
|
+
k,
|
|
1532
|
+
m - 1,
|
|
1533
|
+
H
|
|
1134
1534
|
);
|
|
1135
|
-
const
|
|
1136
|
-
|
|
1137
|
-
const
|
|
1138
|
-
|
|
1535
|
+
const de = j + Y + m - 1;
|
|
1536
|
+
s.fillStyle = me, s.globalAlpha = 1, s.fillRect(de, k, 1, H), s.fillStyle = fe, s.globalAlpha = 1;
|
|
1537
|
+
const ze = Math.min(K, ue) / ue, ee = Math.round(ze * H);
|
|
1538
|
+
ee > 0 && s.fillRect(de, k + H - ee, 1, ee);
|
|
1139
1539
|
}
|
|
1140
1540
|
}
|
|
1141
|
-
return
|
|
1142
|
-
}, [
|
|
1541
|
+
return y = requestAnimationFrame(_), () => cancelAnimationFrame(y);
|
|
1542
|
+
}, [d, t, r, i, m]), t ? /* @__PURE__ */ p(
|
|
1143
1543
|
"div",
|
|
1144
1544
|
{
|
|
1145
|
-
ref:
|
|
1146
|
-
className:
|
|
1147
|
-
style: { width: "100%", ...
|
|
1148
|
-
children: /* @__PURE__ */
|
|
1545
|
+
ref: h,
|
|
1546
|
+
className: n,
|
|
1547
|
+
style: { width: "100%", ...o, marginTop: X },
|
|
1548
|
+
children: /* @__PURE__ */ p(
|
|
1149
1549
|
"canvas",
|
|
1150
1550
|
{
|
|
1151
|
-
ref:
|
|
1551
|
+
ref: f,
|
|
1152
1552
|
style: {
|
|
1153
1553
|
display: "block",
|
|
1154
1554
|
pointerEvents: "none",
|
|
@@ -1172,208 +1572,208 @@ const N = {
|
|
|
1172
1572
|
// 255,208,0
|
|
1173
1573
|
vram: "#FF8C00"
|
|
1174
1574
|
// 255,140,0
|
|
1175
|
-
},
|
|
1176
|
-
metric:
|
|
1575
|
+
}, Fe = ({
|
|
1576
|
+
metric: t,
|
|
1177
1577
|
decimal: e = 0,
|
|
1178
|
-
suffix:
|
|
1578
|
+
suffix: n = ""
|
|
1179
1579
|
}) => {
|
|
1180
|
-
const
|
|
1181
|
-
return
|
|
1182
|
-
const [
|
|
1183
|
-
if (
|
|
1184
|
-
const
|
|
1185
|
-
|
|
1580
|
+
const o = T(null);
|
|
1581
|
+
return le("log", (d) => {
|
|
1582
|
+
const [f] = d;
|
|
1583
|
+
if (f && o.current) {
|
|
1584
|
+
const h = f[t];
|
|
1585
|
+
o.current.innerText = (typeof h == "number" ? h.toFixed(e) : "0") + n;
|
|
1186
1586
|
}
|
|
1187
|
-
}), /* @__PURE__ */
|
|
1587
|
+
}), /* @__PURE__ */ x("span", { ref: o, children: [
|
|
1188
1588
|
"0",
|
|
1189
|
-
|
|
1589
|
+
n
|
|
1190
1590
|
] });
|
|
1191
|
-
},
|
|
1192
|
-
metric:
|
|
1591
|
+
}, U = ({
|
|
1592
|
+
metric: t,
|
|
1193
1593
|
suffix: e = ""
|
|
1194
1594
|
}) => {
|
|
1195
|
-
const
|
|
1196
|
-
return
|
|
1197
|
-
const [,
|
|
1198
|
-
if (
|
|
1199
|
-
let
|
|
1200
|
-
|
|
1595
|
+
const n = T(null);
|
|
1596
|
+
return le("log", (o) => {
|
|
1597
|
+
const [, d] = o;
|
|
1598
|
+
if (d && n.current) {
|
|
1599
|
+
let f = d[t];
|
|
1600
|
+
t === "calls" && f === 1 && (f = "--"), n.current.innerText = f + e;
|
|
1201
1601
|
}
|
|
1202
|
-
}), /* @__PURE__ */
|
|
1602
|
+
}), /* @__PURE__ */ x("span", { ref: n, children: [
|
|
1203
1603
|
"0",
|
|
1204
1604
|
e
|
|
1205
1605
|
] });
|
|
1206
|
-
},
|
|
1207
|
-
const e =
|
|
1208
|
-
return /* @__PURE__ */
|
|
1606
|
+
}, Pe = ({ type: t }) => {
|
|
1607
|
+
const e = A((n) => n.estimatedMemory[t]);
|
|
1608
|
+
return /* @__PURE__ */ x("span", { children: [
|
|
1209
1609
|
e.toFixed(0),
|
|
1210
1610
|
" MB"
|
|
1211
1611
|
] });
|
|
1212
|
-
},
|
|
1213
|
-
const
|
|
1214
|
-
|
|
1215
|
-
const [
|
|
1216
|
-
|
|
1612
|
+
}, lr = () => {
|
|
1613
|
+
const t = A((d) => d.overclockingFps), e = A((d) => d.fpsLimit), n = T(null);
|
|
1614
|
+
le("log", (d) => {
|
|
1615
|
+
const [f] = d;
|
|
1616
|
+
f && n.current && (n.current.innerText = Math.round(f.fps).toString());
|
|
1217
1617
|
});
|
|
1218
|
-
const
|
|
1219
|
-
return /* @__PURE__ */
|
|
1220
|
-
/* @__PURE__ */
|
|
1618
|
+
const o = t ? N.overClock : N.fps;
|
|
1619
|
+
return /* @__PURE__ */ x("div", { className: v.perfI, children: [
|
|
1620
|
+
/* @__PURE__ */ x("span", { className: v.perfB, style: { color: o }, children: [
|
|
1221
1621
|
"FPS ",
|
|
1222
|
-
|
|
1622
|
+
t ? ` ${e}🚀` : ""
|
|
1223
1623
|
] }),
|
|
1224
|
-
/* @__PURE__ */
|
|
1624
|
+
/* @__PURE__ */ p("small", { className: v.perfSmallI, ref: n, children: "0" })
|
|
1225
1625
|
] });
|
|
1226
|
-
},
|
|
1227
|
-
/* @__PURE__ */
|
|
1228
|
-
/* @__PURE__ */
|
|
1229
|
-
/* @__PURE__ */
|
|
1230
|
-
/* @__PURE__ */
|
|
1626
|
+
}, ur = ({ showGraph: t, minimal: e }) => A((o) => o.gl) ? /* @__PURE__ */ x("div", { className: v.perfIContainer, children: [
|
|
1627
|
+
/* @__PURE__ */ p(lr, { showGraph: t }),
|
|
1628
|
+
/* @__PURE__ */ x("div", { className: v.perfI, children: [
|
|
1629
|
+
/* @__PURE__ */ p("span", { className: v.perfB, style: { color: N.cpu }, children: "CPU" }),
|
|
1630
|
+
/* @__PURE__ */ p("small", { className: v.perfSmallI, children: /* @__PURE__ */ p(Fe, { metric: "cpu", decimal: 2, suffix: " ms" }) })
|
|
1231
1631
|
] }),
|
|
1232
|
-
/* @__PURE__ */
|
|
1233
|
-
/* @__PURE__ */
|
|
1234
|
-
/* @__PURE__ */
|
|
1632
|
+
/* @__PURE__ */ x("div", { className: v.perfI, children: [
|
|
1633
|
+
/* @__PURE__ */ p("span", { className: v.perfB, style: { color: N.gpu }, children: "GPU" }),
|
|
1634
|
+
/* @__PURE__ */ p("small", { className: v.perfSmallI, children: /* @__PURE__ */ p(Fe, { metric: "gpu", decimal: 2, suffix: " ms" }) })
|
|
1235
1635
|
] }),
|
|
1236
|
-
/* @__PURE__ */
|
|
1237
|
-
/* @__PURE__ */
|
|
1238
|
-
/* @__PURE__ */
|
|
1636
|
+
/* @__PURE__ */ x("div", { className: v.perfI, children: [
|
|
1637
|
+
/* @__PURE__ */ p("span", { className: v.perfB, style: { color: N.memory }, children: "MEMORY" }),
|
|
1638
|
+
/* @__PURE__ */ p("small", { className: v.perfSmallI, children: /* @__PURE__ */ p(Pe, { type: "ram" }) })
|
|
1239
1639
|
] }),
|
|
1240
|
-
/* @__PURE__ */
|
|
1241
|
-
/* @__PURE__ */
|
|
1242
|
-
/* @__PURE__ */
|
|
1640
|
+
/* @__PURE__ */ x("div", { className: v.perfI, children: [
|
|
1641
|
+
/* @__PURE__ */ p("span", { className: v.perfB, style: { color: N.vram }, children: "VRAM" }),
|
|
1642
|
+
/* @__PURE__ */ p("small", { className: v.perfSmallI, children: /* @__PURE__ */ p(Pe, { type: "vram" }) })
|
|
1243
1643
|
] }),
|
|
1244
|
-
!e && /* @__PURE__ */
|
|
1245
|
-
/* @__PURE__ */
|
|
1246
|
-
/* @__PURE__ */
|
|
1644
|
+
!e && /* @__PURE__ */ x("div", { className: v.perfI, children: [
|
|
1645
|
+
/* @__PURE__ */ p("span", { className: v.perfB, children: "Calls" }),
|
|
1646
|
+
/* @__PURE__ */ p("small", { className: v.perfSmallI, children: /* @__PURE__ */ p(U, { metric: "calls" }) })
|
|
1247
1647
|
] })
|
|
1248
|
-
] }) : null,
|
|
1249
|
-
/* @__PURE__ */
|
|
1250
|
-
/* @__PURE__ */
|
|
1251
|
-
/* @__PURE__ */
|
|
1648
|
+
] }) : null, fr = ({ matrixUpdate: t }) => /* @__PURE__ */ x("div", { className: v.perfIContainer, children: [
|
|
1649
|
+
/* @__PURE__ */ x("div", { className: v.perfI, children: [
|
|
1650
|
+
/* @__PURE__ */ p("span", { className: v.perfB, children: "Geometries" }),
|
|
1651
|
+
/* @__PURE__ */ p("small", { className: v.perfSmallI, children: /* @__PURE__ */ p(U, { metric: "geometries" }) })
|
|
1252
1652
|
] }),
|
|
1253
|
-
/* @__PURE__ */
|
|
1254
|
-
/* @__PURE__ */
|
|
1255
|
-
/* @__PURE__ */
|
|
1653
|
+
/* @__PURE__ */ x("div", { className: v.perfI, children: [
|
|
1654
|
+
/* @__PURE__ */ p("span", { className: v.perfB, children: "Textures" }),
|
|
1655
|
+
/* @__PURE__ */ p("small", { className: v.perfSmallI, children: /* @__PURE__ */ p(U, { metric: "textures" }) })
|
|
1256
1656
|
] }),
|
|
1257
|
-
/* @__PURE__ */
|
|
1258
|
-
/* @__PURE__ */
|
|
1259
|
-
/* @__PURE__ */
|
|
1657
|
+
/* @__PURE__ */ x("div", { className: v.perfI, children: [
|
|
1658
|
+
/* @__PURE__ */ p("span", { className: v.perfB, children: "Shaders" }),
|
|
1659
|
+
/* @__PURE__ */ p("small", { className: v.perfSmallI, children: /* @__PURE__ */ p(U, { metric: "programs" }) })
|
|
1260
1660
|
] }),
|
|
1261
|
-
/* @__PURE__ */
|
|
1262
|
-
/* @__PURE__ */
|
|
1263
|
-
/* @__PURE__ */
|
|
1661
|
+
/* @__PURE__ */ x("div", { className: v.perfI, children: [
|
|
1662
|
+
/* @__PURE__ */ p("span", { className: v.perfB, children: "Triangles" }),
|
|
1663
|
+
/* @__PURE__ */ p("small", { className: v.perfSmallI, children: /* @__PURE__ */ p(U, { metric: "triangles" }) })
|
|
1264
1664
|
] }),
|
|
1265
|
-
/* @__PURE__ */
|
|
1266
|
-
/* @__PURE__ */
|
|
1267
|
-
/* @__PURE__ */
|
|
1665
|
+
/* @__PURE__ */ x("div", { className: v.perfI, children: [
|
|
1666
|
+
/* @__PURE__ */ p("span", { className: v.perfB, children: "Lines" }),
|
|
1667
|
+
/* @__PURE__ */ p("small", { className: v.perfSmallI, children: /* @__PURE__ */ p(U, { metric: "lines" }) })
|
|
1268
1668
|
] }),
|
|
1269
|
-
/* @__PURE__ */
|
|
1270
|
-
/* @__PURE__ */
|
|
1271
|
-
/* @__PURE__ */
|
|
1669
|
+
/* @__PURE__ */ x("div", { className: v.perfI, children: [
|
|
1670
|
+
/* @__PURE__ */ p("span", { className: v.perfB, children: "Points" }),
|
|
1671
|
+
/* @__PURE__ */ p("small", { className: v.perfSmallI, children: /* @__PURE__ */ p(U, { metric: "points" }) })
|
|
1272
1672
|
] }),
|
|
1273
|
-
|
|
1274
|
-
/* @__PURE__ */
|
|
1275
|
-
/* @__PURE__ */
|
|
1673
|
+
t && /* @__PURE__ */ x("div", { className: v.perfI, children: [
|
|
1674
|
+
/* @__PURE__ */ p("span", { className: v.perfB, children: "Matrices" }),
|
|
1675
|
+
/* @__PURE__ */ p("small", { className: v.perfSmallI, children: t })
|
|
1276
1676
|
] })
|
|
1277
|
-
] }),
|
|
1278
|
-
const
|
|
1279
|
-
return /* @__PURE__ */
|
|
1677
|
+
] }), Ue = ({ tab: t, title: e, set: n }) => {
|
|
1678
|
+
const o = A((d) => d.tab);
|
|
1679
|
+
return /* @__PURE__ */ p(
|
|
1280
1680
|
"div",
|
|
1281
1681
|
{
|
|
1282
|
-
className: `${
|
|
1682
|
+
className: `${v.toggle} ${o === t ? v.activeTab : ""}`,
|
|
1283
1683
|
onClick: () => {
|
|
1284
|
-
|
|
1684
|
+
n(!0), M({ tab: t });
|
|
1285
1685
|
},
|
|
1286
1686
|
children: e
|
|
1287
1687
|
}
|
|
1288
1688
|
);
|
|
1289
|
-
},
|
|
1290
|
-
openByDefault:
|
|
1689
|
+
}, mr = ({
|
|
1690
|
+
openByDefault: t,
|
|
1291
1691
|
showGraph: e,
|
|
1292
|
-
deepAnalyze:
|
|
1293
|
-
matrixUpdate:
|
|
1294
|
-
graphType:
|
|
1295
|
-
perfContainerRef:
|
|
1296
|
-
antialias:
|
|
1297
|
-
chart:
|
|
1298
|
-
minimal:
|
|
1692
|
+
deepAnalyze: n,
|
|
1693
|
+
matrixUpdate: o,
|
|
1694
|
+
graphType: d,
|
|
1695
|
+
perfContainerRef: f,
|
|
1696
|
+
antialias: h,
|
|
1697
|
+
chart: u,
|
|
1698
|
+
minimal: g
|
|
1299
1699
|
}) => {
|
|
1300
|
-
const [
|
|
1301
|
-
return /* @__PURE__ */
|
|
1302
|
-
/* @__PURE__ */
|
|
1303
|
-
/* @__PURE__ */
|
|
1304
|
-
e && (
|
|
1305
|
-
|
|
1700
|
+
const [r, a] = B(t || !1), i = A((m) => m.tab);
|
|
1701
|
+
return /* @__PURE__ */ x(q, { children: [
|
|
1702
|
+
/* @__PURE__ */ x("div", { style: { display: r ? "block" : "none", marginTop: "4px" }, children: [
|
|
1703
|
+
/* @__PURE__ */ p(fr, { matrixUpdate: o }),
|
|
1704
|
+
e && (d === "bar" ? /* @__PURE__ */ p(cr, {}) : /* @__PURE__ */ p(
|
|
1705
|
+
ir,
|
|
1306
1706
|
{
|
|
1307
|
-
perfContainerRef:
|
|
1308
|
-
chart:
|
|
1707
|
+
perfContainerRef: f,
|
|
1708
|
+
chart: u,
|
|
1309
1709
|
showGraph: e,
|
|
1310
|
-
antialias:
|
|
1311
|
-
minimal:
|
|
1312
|
-
matrixUpdate:
|
|
1710
|
+
antialias: h,
|
|
1711
|
+
minimal: g,
|
|
1712
|
+
matrixUpdate: o
|
|
1313
1713
|
}
|
|
1314
1714
|
)),
|
|
1315
|
-
|
|
1715
|
+
r && /* @__PURE__ */ p("div", { className: v.containerScroll, children: i === "programs" && /* @__PURE__ */ p(nr, {}) })
|
|
1316
1716
|
] }),
|
|
1317
|
-
|
|
1717
|
+
t && !n ? null : /* @__PURE__ */ x(
|
|
1318
1718
|
"div",
|
|
1319
1719
|
{
|
|
1320
|
-
className:
|
|
1321
|
-
style:
|
|
1720
|
+
className: v.toggleContainer,
|
|
1721
|
+
style: r && e && d === "line" ? { marginTop: 50 } : { marginTop: 6 },
|
|
1322
1722
|
children: [
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
/* @__PURE__ */
|
|
1723
|
+
n && /* @__PURE__ */ p(Ue, { tab: "programs", title: "Programs", set: a }),
|
|
1724
|
+
n && /* @__PURE__ */ p(Ue, { tab: "infos", title: "Infos", set: a }),
|
|
1725
|
+
/* @__PURE__ */ p("div", { className: v.toggle, onClick: () => a(!r), children: r ? "Minimize" : "More" })
|
|
1326
1726
|
]
|
|
1327
1727
|
}
|
|
1328
1728
|
)
|
|
1329
1729
|
] });
|
|
1330
|
-
},
|
|
1331
|
-
showGraph:
|
|
1730
|
+
}, vr = ({
|
|
1731
|
+
showGraph: t = !0,
|
|
1332
1732
|
openByDefault: e = !0,
|
|
1333
|
-
className:
|
|
1334
|
-
overClock:
|
|
1335
|
-
graphType:
|
|
1336
|
-
style:
|
|
1337
|
-
position:
|
|
1338
|
-
chart:
|
|
1339
|
-
logsPerSecond:
|
|
1340
|
-
deepAnalyze:
|
|
1341
|
-
antialias:
|
|
1342
|
-
matrixUpdate:
|
|
1343
|
-
minimal:
|
|
1733
|
+
className: n,
|
|
1734
|
+
overClock: o = !1,
|
|
1735
|
+
graphType: d = "bar",
|
|
1736
|
+
style: f,
|
|
1737
|
+
position: h = "top-right",
|
|
1738
|
+
chart: u,
|
|
1739
|
+
logsPerSecond: g,
|
|
1740
|
+
deepAnalyze: r = !1,
|
|
1741
|
+
antialias: a = !0,
|
|
1742
|
+
matrixUpdate: i,
|
|
1743
|
+
minimal: m
|
|
1344
1744
|
}) => {
|
|
1345
|
-
const
|
|
1346
|
-
return /* @__PURE__ */
|
|
1347
|
-
/* @__PURE__ */
|
|
1348
|
-
|
|
1745
|
+
const c = T(null), s = h === "top-left" ? v.topLeft : h === "bottom-left" ? v.bottomLeft : h === "bottom-right" ? v.bottomRight : v.topRight, y = t && d === "line" && !r;
|
|
1746
|
+
return /* @__PURE__ */ x(q, { children: [
|
|
1747
|
+
/* @__PURE__ */ p(
|
|
1748
|
+
wt,
|
|
1349
1749
|
{
|
|
1350
|
-
logsPerSecond:
|
|
1351
|
-
chart:
|
|
1352
|
-
overClock:
|
|
1353
|
-
deepAnalyze:
|
|
1354
|
-
matrixUpdate:
|
|
1750
|
+
logsPerSecond: g,
|
|
1751
|
+
chart: u,
|
|
1752
|
+
overClock: o,
|
|
1753
|
+
deepAnalyze: r,
|
|
1754
|
+
matrixUpdate: i
|
|
1355
1755
|
}
|
|
1356
1756
|
),
|
|
1357
|
-
/* @__PURE__ */
|
|
1757
|
+
/* @__PURE__ */ p(We, { name: "r3f-perf", children: /* @__PURE__ */ x(
|
|
1358
1758
|
"div",
|
|
1359
1759
|
{
|
|
1360
|
-
className: `${
|
|
1361
|
-
style:
|
|
1362
|
-
ref:
|
|
1760
|
+
className: `${v.perfS} ${s} ${m ? v.minimal : ""} ${n || ""} ${y ? v.containerHeight : ""}`,
|
|
1761
|
+
style: f,
|
|
1762
|
+
ref: c,
|
|
1363
1763
|
children: [
|
|
1364
|
-
/* @__PURE__ */
|
|
1365
|
-
!
|
|
1366
|
-
|
|
1764
|
+
/* @__PURE__ */ p(ur, { showGraph: t, minimal: m }),
|
|
1765
|
+
!m && /* @__PURE__ */ p(
|
|
1766
|
+
mr,
|
|
1367
1767
|
{
|
|
1368
|
-
showGraph:
|
|
1369
|
-
deepAnalyze:
|
|
1370
|
-
matrixUpdate:
|
|
1768
|
+
showGraph: t,
|
|
1769
|
+
deepAnalyze: r,
|
|
1770
|
+
matrixUpdate: i,
|
|
1371
1771
|
openByDefault: e,
|
|
1372
|
-
graphType:
|
|
1373
|
-
perfContainerRef:
|
|
1374
|
-
antialias:
|
|
1375
|
-
chart:
|
|
1376
|
-
minimal:
|
|
1772
|
+
graphType: d,
|
|
1773
|
+
perfContainerRef: c,
|
|
1774
|
+
antialias: a,
|
|
1775
|
+
chart: u,
|
|
1776
|
+
minimal: m
|
|
1377
1777
|
}
|
|
1378
1778
|
)
|
|
1379
1779
|
]
|
|
@@ -1382,5 +1782,5 @@ const N = {
|
|
|
1382
1782
|
] });
|
|
1383
1783
|
};
|
|
1384
1784
|
export {
|
|
1385
|
-
|
|
1785
|
+
vr as PerfMonitor
|
|
1386
1786
|
};
|