@loaders.gl/textures 4.4.0-alpha.15 → 4.4.0-alpha.17

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.
Files changed (74) hide show
  1. package/README.md +44 -0
  2. package/dist/basis-loader.d.ts +17 -8
  3. package/dist/basis-loader.d.ts.map +1 -1
  4. package/dist/basis-loader.js.map +1 -1
  5. package/dist/basis-worker-node.js +317 -188
  6. package/dist/basis-worker.js +252 -123
  7. package/dist/compressed-texture-worker.js +1035 -326
  8. package/dist/crunch-worker.js +141 -82
  9. package/dist/dist.dev.js +1220 -334
  10. package/dist/dist.min.js +1 -2
  11. package/dist/index.cjs +657 -317
  12. package/dist/index.cjs.map +4 -4
  13. package/dist/index.d.ts +2 -4
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +1 -3
  16. package/dist/index.js.map +1 -1
  17. package/dist/ktx2-basis-writer-worker-node.js +2 -2
  18. package/dist/ktx2-basis-writer-worker.js +2 -2
  19. package/dist/lib/gl-extensions.d.ts +164 -58
  20. package/dist/lib/gl-extensions.d.ts.map +1 -1
  21. package/dist/lib/gl-extensions.js +175 -66
  22. package/dist/lib/gl-extensions.js.map +1 -1
  23. package/dist/lib/parsers/parse-basis.d.ts +16 -1
  24. package/dist/lib/parsers/parse-basis.d.ts.map +1 -1
  25. package/dist/lib/parsers/parse-basis.js +216 -43
  26. package/dist/lib/parsers/parse-basis.js.map +1 -1
  27. package/dist/lib/parsers/parse-crunch.d.ts.map +1 -1
  28. package/dist/lib/parsers/parse-crunch.js +4 -4
  29. package/dist/lib/parsers/parse-crunch.js.map +1 -1
  30. package/dist/lib/parsers/parse-dds.d.ts.map +1 -1
  31. package/dist/lib/parsers/parse-dds.js +7 -7
  32. package/dist/lib/parsers/parse-dds.js.map +1 -1
  33. package/dist/lib/parsers/parse-ktx.d.ts.map +1 -1
  34. package/dist/lib/parsers/parse-ktx.js +7 -0
  35. package/dist/lib/parsers/parse-ktx.js.map +1 -1
  36. package/dist/lib/parsers/parse-pvr.d.ts.map +1 -1
  37. package/dist/lib/parsers/parse-pvr.js +28 -70
  38. package/dist/lib/parsers/parse-pvr.js.map +1 -1
  39. package/dist/lib/utils/detect-supported-texture-formats.d.ts +14 -0
  40. package/dist/lib/utils/detect-supported-texture-formats.d.ts.map +1 -0
  41. package/dist/lib/utils/detect-supported-texture-formats.js +197 -0
  42. package/dist/lib/utils/detect-supported-texture-formats.js.map +1 -0
  43. package/dist/lib/utils/extract-mipmap-images.d.ts +2 -2
  44. package/dist/lib/utils/extract-mipmap-images.d.ts.map +1 -1
  45. package/dist/lib/utils/extract-mipmap-images.js +12 -2
  46. package/dist/lib/utils/extract-mipmap-images.js.map +1 -1
  47. package/dist/lib/utils/ktx-format-helper.d.ts +2 -1
  48. package/dist/lib/utils/ktx-format-helper.d.ts.map +1 -1
  49. package/dist/lib/utils/ktx-format-helper.js +67 -109
  50. package/dist/lib/utils/ktx-format-helper.js.map +1 -1
  51. package/dist/lib/utils/texture-format-map.d.ts +3 -0
  52. package/dist/lib/utils/texture-format-map.d.ts.map +1 -0
  53. package/dist/lib/utils/texture-format-map.js +71 -0
  54. package/dist/lib/utils/texture-format-map.js.map +1 -0
  55. package/dist/lib/utils/version.js +1 -1
  56. package/dist/npy-worker.js +1 -1
  57. package/package.json +6 -6
  58. package/src/basis-loader.ts +21 -8
  59. package/src/index.ts +2 -4
  60. package/src/lib/gl-extensions.ts +186 -81
  61. package/src/lib/parsers/parse-basis.ts +274 -40
  62. package/src/lib/parsers/parse-crunch.ts +13 -6
  63. package/src/lib/parsers/parse-dds.ts +16 -9
  64. package/src/lib/parsers/parse-ktx.ts +12 -2
  65. package/src/lib/parsers/parse-pvr.ts +72 -72
  66. package/src/lib/utils/detect-supported-texture-formats.ts +210 -0
  67. package/src/lib/utils/extract-mipmap-images.ts +15 -4
  68. package/src/lib/utils/ktx-format-helper.ts +124 -111
  69. package/src/lib/utils/texture-format-map.ts +135 -0
  70. package/dist/lib/utils/texture-formats.d.ts +0 -8
  71. package/dist/lib/utils/texture-formats.d.ts.map +0 -1
  72. package/dist/lib/utils/texture-formats.js +0 -51
  73. package/dist/lib/utils/texture-formats.js.map +0 -1
  74. package/src/lib/utils/texture-formats.ts +0 -59
package/dist/dist.dev.js CHANGED
@@ -45,13 +45,6 @@ var __exports__ = (() => {
45
45
  }
46
46
  });
47
47
 
48
- // (disabled):../worker-utils/src/lib/process-utils/child-process-proxy
49
- var require_child_process_proxy = __commonJS({
50
- "(disabled):../worker-utils/src/lib/process-utils/child-process-proxy"() {
51
- "use strict";
52
- }
53
- });
54
-
55
48
  // bundle.ts
56
49
  var bundle_exports = {};
57
50
  __export(bundle_exports, {
@@ -64,16 +57,82 @@ var __exports__ = (() => {
64
57
  CompressedTextureWriter: () => CompressedTextureWriter,
65
58
  CrunchLoader: () => CrunchLoader,
66
59
  CrunchWorkerLoader: () => CrunchLoader,
60
+ GL_COMPRESSED_R11_EAC: () => GL_COMPRESSED_R11_EAC,
61
+ GL_COMPRESSED_RED_GREEN_RGTC2_EXT: () => GL_COMPRESSED_RED_GREEN_RGTC2_EXT,
62
+ GL_COMPRESSED_RED_RGTC1_EXT: () => GL_COMPRESSED_RED_RGTC1_EXT,
63
+ GL_COMPRESSED_RG11_EAC: () => GL_COMPRESSED_RG11_EAC,
64
+ GL_COMPRESSED_RGB8_ETC2: () => GL_COMPRESSED_RGB8_ETC2,
65
+ GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2: () => GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,
66
+ GL_COMPRESSED_RGBA8_ETC2_EAC: () => GL_COMPRESSED_RGBA8_ETC2_EAC,
67
+ GL_COMPRESSED_RGBA_ASTC_10x10_KHR: () => GL_COMPRESSED_RGBA_ASTC_10x10_KHR,
68
+ GL_COMPRESSED_RGBA_ASTC_10x5_KHR: () => GL_COMPRESSED_RGBA_ASTC_10x5_KHR,
69
+ GL_COMPRESSED_RGBA_ASTC_10x6_KHR: () => GL_COMPRESSED_RGBA_ASTC_10x6_KHR,
70
+ GL_COMPRESSED_RGBA_ASTC_10x8_KHR: () => GL_COMPRESSED_RGBA_ASTC_10x8_KHR,
71
+ GL_COMPRESSED_RGBA_ASTC_12x10_KHR: () => GL_COMPRESSED_RGBA_ASTC_12x10_KHR,
72
+ GL_COMPRESSED_RGBA_ASTC_12x12_KHR: () => GL_COMPRESSED_RGBA_ASTC_12x12_KHR,
73
+ GL_COMPRESSED_RGBA_ASTC_4x4_KHR: () => GL_COMPRESSED_RGBA_ASTC_4x4_KHR,
74
+ GL_COMPRESSED_RGBA_ASTC_5x4_KHR: () => GL_COMPRESSED_RGBA_ASTC_5x4_KHR,
75
+ GL_COMPRESSED_RGBA_ASTC_5x5_KHR: () => GL_COMPRESSED_RGBA_ASTC_5x5_KHR,
76
+ GL_COMPRESSED_RGBA_ASTC_6x5_KHR: () => GL_COMPRESSED_RGBA_ASTC_6x5_KHR,
77
+ GL_COMPRESSED_RGBA_ASTC_6x6_KHR: () => GL_COMPRESSED_RGBA_ASTC_6x6_KHR,
78
+ GL_COMPRESSED_RGBA_ASTC_8x5_KHR: () => GL_COMPRESSED_RGBA_ASTC_8x5_KHR,
79
+ GL_COMPRESSED_RGBA_ASTC_8x6_KHR: () => GL_COMPRESSED_RGBA_ASTC_8x6_KHR,
80
+ GL_COMPRESSED_RGBA_ASTC_8x8_KHR: () => GL_COMPRESSED_RGBA_ASTC_8x8_KHR,
81
+ GL_COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL: () => GL_COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL,
82
+ GL_COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL: () => GL_COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL,
83
+ GL_COMPRESSED_RGBA_BPTC_UNORM_EXT: () => GL_COMPRESSED_RGBA_BPTC_UNORM_EXT,
84
+ GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG: () => GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,
85
+ GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG: () => GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,
86
+ GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: () => GL_COMPRESSED_RGBA_S3TC_DXT1_EXT,
87
+ GL_COMPRESSED_RGBA_S3TC_DXT3_EXT: () => GL_COMPRESSED_RGBA_S3TC_DXT3_EXT,
88
+ GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: () => GL_COMPRESSED_RGBA_S3TC_DXT5_EXT,
89
+ GL_COMPRESSED_RGB_ATC_WEBGL: () => GL_COMPRESSED_RGB_ATC_WEBGL,
90
+ GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT: () => GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,
91
+ GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT: () => GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,
92
+ GL_COMPRESSED_RGB_ETC1_WEBGL: () => GL_COMPRESSED_RGB_ETC1_WEBGL,
93
+ GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG: () => GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG,
94
+ GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG: () => GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG,
95
+ GL_COMPRESSED_RGB_S3TC_DXT1_EXT: () => GL_COMPRESSED_RGB_S3TC_DXT1_EXT,
96
+ GL_COMPRESSED_SIGNED_R11_EAC: () => GL_COMPRESSED_SIGNED_R11_EAC,
97
+ GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT: () => GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT,
98
+ GL_COMPRESSED_SIGNED_RED_RGTC1_EXT: () => GL_COMPRESSED_SIGNED_RED_RGTC1_EXT,
99
+ GL_COMPRESSED_SIGNED_RG11_EAC: () => GL_COMPRESSED_SIGNED_RG11_EAC,
100
+ GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR: () => GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,
101
+ GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR: () => GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,
102
+ GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR: () => GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,
103
+ GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR: () => GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,
104
+ GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR: () => GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,
105
+ GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR: () => GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR,
106
+ GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR: () => GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,
107
+ GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR: () => GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR,
108
+ GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR: () => GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,
109
+ GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR: () => GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,
110
+ GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR: () => GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,
111
+ GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR: () => GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,
112
+ GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR: () => GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,
113
+ GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR: () => GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,
114
+ GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC: () => GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,
115
+ GL_COMPRESSED_SRGB8_ETC2: () => GL_COMPRESSED_SRGB8_ETC2,
116
+ GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2: () => GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,
117
+ GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT: () => GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT,
118
+ GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: () => GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,
119
+ GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: () => GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,
120
+ GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: () => GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,
121
+ GL_COMPRESSED_SRGB_S3TC_DXT1_EXT: () => GL_COMPRESSED_SRGB_S3TC_DXT1_EXT,
67
122
  GL_EXTENSIONS_CONSTANTS: () => GL_EXTENSIONS_CONSTANTS,
123
+ GL_RGB: () => GL_RGB,
124
+ GL_RGB565: () => GL_RGB565,
125
+ GL_RGB5_A1: () => GL_RGB5_A1,
126
+ GL_RGBA: () => GL_RGBA,
127
+ GL_RGBA4: () => GL_RGBA4,
128
+ GL_RGBA8: () => GL_RGBA8,
68
129
  KTX2BasisWriter: () => KTX2BasisWriter,
69
130
  KTX2BasisWriterWorker: () => KTX2BasisWriterWorker,
70
131
  NPYLoader: () => NPYLoader,
71
132
  NPYWorkerLoader: () => NPYWorkerLoader,
72
- getSupportedGPUTextureFormats: () => getSupportedGPUTextureFormats,
73
133
  loadImageTexture: () => loadImageTexture,
74
134
  loadImageTextureArray: () => loadImageTextureArray,
75
- loadImageTextureCube: () => loadImageTextureCube,
76
- selectSupportedBasisFormat: () => selectSupportedBasisFormat
135
+ loadImageTextureCube: () => loadImageTextureCube
77
136
  });
78
137
  __reExport(bundle_exports, __toESM(require_core(), 1));
79
138
 
@@ -105,6 +164,541 @@ var __exports__ = (() => {
105
164
  var matches = typeof process !== "undefined" && process.version && /v([0-9]*)/.exec(process.version);
106
165
  var nodeVersion = matches && parseFloat(matches[1]) || 0;
107
166
 
167
+ // ../../node_modules/@probe.gl/env/dist/lib/globals.js
168
+ var window_2 = globalThis;
169
+ var document_2 = globalThis.document || {};
170
+ var process_ = globalThis.process || {};
171
+ var console_ = globalThis.console;
172
+ var navigator_ = globalThis.navigator || {};
173
+
174
+ // ../../node_modules/@probe.gl/env/dist/lib/is-electron.js
175
+ function isElectron(mockUserAgent) {
176
+ if (typeof window !== "undefined" && window.process?.type === "renderer") {
177
+ return true;
178
+ }
179
+ if (typeof process !== "undefined" && Boolean(process.versions?.["electron"])) {
180
+ return true;
181
+ }
182
+ const realUserAgent = typeof navigator !== "undefined" && navigator.userAgent;
183
+ const userAgent = mockUserAgent || realUserAgent;
184
+ return Boolean(userAgent && userAgent.indexOf("Electron") >= 0);
185
+ }
186
+
187
+ // ../../node_modules/@probe.gl/env/dist/lib/is-browser.js
188
+ function isBrowser2() {
189
+ const isNode = (
190
+ // @ts-expect-error
191
+ typeof process === "object" && String(process) === "[object process]" && !process?.browser
192
+ );
193
+ return !isNode || isElectron();
194
+ }
195
+
196
+ // ../../node_modules/@probe.gl/env/dist/index.js
197
+ var VERSION2 = true ? "4.1.1" : "untranspiled source";
198
+
199
+ // ../../node_modules/@probe.gl/log/dist/utils/assert.js
200
+ function assert2(condition, message) {
201
+ if (!condition) {
202
+ throw new Error(message || "Assertion failed");
203
+ }
204
+ }
205
+
206
+ // ../../node_modules/@probe.gl/log/dist/loggers/log-utils.js
207
+ function normalizeLogLevel(logLevel) {
208
+ if (!logLevel) {
209
+ return 0;
210
+ }
211
+ let resolvedLevel;
212
+ switch (typeof logLevel) {
213
+ case "number":
214
+ resolvedLevel = logLevel;
215
+ break;
216
+ case "object":
217
+ resolvedLevel = logLevel.logLevel || logLevel.priority || 0;
218
+ break;
219
+ default:
220
+ return 0;
221
+ }
222
+ assert2(Number.isFinite(resolvedLevel) && resolvedLevel >= 0);
223
+ return resolvedLevel;
224
+ }
225
+ function normalizeArguments(opts) {
226
+ const { logLevel, message } = opts;
227
+ opts.logLevel = normalizeLogLevel(logLevel);
228
+ const args = opts.args ? Array.from(opts.args) : [];
229
+ while (args.length && args.shift() !== message) {
230
+ }
231
+ switch (typeof logLevel) {
232
+ case "string":
233
+ case "function":
234
+ if (message !== void 0) {
235
+ args.unshift(message);
236
+ }
237
+ opts.message = logLevel;
238
+ break;
239
+ case "object":
240
+ Object.assign(opts, logLevel);
241
+ break;
242
+ default:
243
+ }
244
+ if (typeof opts.message === "function") {
245
+ opts.message = opts.message();
246
+ }
247
+ const messageType = typeof opts.message;
248
+ assert2(messageType === "string" || messageType === "object");
249
+ return Object.assign(opts, { args }, opts.opts);
250
+ }
251
+
252
+ // ../../node_modules/@probe.gl/log/dist/loggers/base-log.js
253
+ var noop = () => {
254
+ };
255
+ var BaseLog = class {
256
+ constructor({ level = 0 } = {}) {
257
+ this.userData = {};
258
+ this._onceCache = /* @__PURE__ */ new Set();
259
+ this._level = level;
260
+ }
261
+ set level(newLevel) {
262
+ this.setLevel(newLevel);
263
+ }
264
+ get level() {
265
+ return this.getLevel();
266
+ }
267
+ setLevel(level) {
268
+ this._level = level;
269
+ return this;
270
+ }
271
+ getLevel() {
272
+ return this._level;
273
+ }
274
+ // Unconditional logging
275
+ warn(message, ...args) {
276
+ return this._log("warn", 0, message, args, { once: true });
277
+ }
278
+ error(message, ...args) {
279
+ return this._log("error", 0, message, args);
280
+ }
281
+ // Conditional logging
282
+ log(logLevel, message, ...args) {
283
+ return this._log("log", logLevel, message, args);
284
+ }
285
+ info(logLevel, message, ...args) {
286
+ return this._log("info", logLevel, message, args);
287
+ }
288
+ once(logLevel, message, ...args) {
289
+ return this._log("once", logLevel, message, args, { once: true });
290
+ }
291
+ _log(type, logLevel, message, args, options = {}) {
292
+ const normalized = normalizeArguments({
293
+ logLevel,
294
+ message,
295
+ args: this._buildArgs(logLevel, message, args),
296
+ opts: options
297
+ });
298
+ return this._createLogFunction(type, normalized, options);
299
+ }
300
+ _buildArgs(logLevel, message, args) {
301
+ return [logLevel, message, ...args];
302
+ }
303
+ _createLogFunction(type, normalized, options) {
304
+ if (!this._shouldLog(normalized.logLevel)) {
305
+ return noop;
306
+ }
307
+ const tag = this._getOnceTag(options.tag ?? normalized.tag ?? normalized.message);
308
+ if ((options.once || normalized.once) && tag !== void 0) {
309
+ if (this._onceCache.has(tag)) {
310
+ return noop;
311
+ }
312
+ this._onceCache.add(tag);
313
+ }
314
+ return this._emit(type, normalized);
315
+ }
316
+ _shouldLog(logLevel) {
317
+ return this.getLevel() >= normalizeLogLevel(logLevel);
318
+ }
319
+ _getOnceTag(tag) {
320
+ if (tag === void 0) {
321
+ return void 0;
322
+ }
323
+ try {
324
+ return typeof tag === "string" ? tag : String(tag);
325
+ } catch {
326
+ return void 0;
327
+ }
328
+ }
329
+ };
330
+
331
+ // ../../node_modules/@probe.gl/log/dist/utils/local-storage.js
332
+ function getStorage(type) {
333
+ try {
334
+ const storage = window[type];
335
+ const x = "__storage_test__";
336
+ storage.setItem(x, x);
337
+ storage.removeItem(x);
338
+ return storage;
339
+ } catch (e) {
340
+ return null;
341
+ }
342
+ }
343
+ var LocalStorage = class {
344
+ constructor(id, defaultConfig, type = "sessionStorage") {
345
+ this.storage = getStorage(type);
346
+ this.id = id;
347
+ this.config = defaultConfig;
348
+ this._loadConfiguration();
349
+ }
350
+ getConfiguration() {
351
+ return this.config;
352
+ }
353
+ setConfiguration(configuration) {
354
+ Object.assign(this.config, configuration);
355
+ if (this.storage) {
356
+ const serialized = JSON.stringify(this.config);
357
+ this.storage.setItem(this.id, serialized);
358
+ }
359
+ }
360
+ // Get config from persistent store, if available
361
+ _loadConfiguration() {
362
+ let configuration = {};
363
+ if (this.storage) {
364
+ const serializedConfiguration = this.storage.getItem(this.id);
365
+ configuration = serializedConfiguration ? JSON.parse(serializedConfiguration) : {};
366
+ }
367
+ Object.assign(this.config, configuration);
368
+ return this;
369
+ }
370
+ };
371
+
372
+ // ../../node_modules/@probe.gl/log/dist/utils/formatters.js
373
+ function formatTime(ms) {
374
+ let formatted;
375
+ if (ms < 10) {
376
+ formatted = `${ms.toFixed(2)}ms`;
377
+ } else if (ms < 100) {
378
+ formatted = `${ms.toFixed(1)}ms`;
379
+ } else if (ms < 1e3) {
380
+ formatted = `${ms.toFixed(0)}ms`;
381
+ } else {
382
+ formatted = `${(ms / 1e3).toFixed(2)}s`;
383
+ }
384
+ return formatted;
385
+ }
386
+ function leftPad(string, length = 8) {
387
+ const padLength = Math.max(length - string.length, 0);
388
+ return `${" ".repeat(padLength)}${string}`;
389
+ }
390
+
391
+ // ../../node_modules/@probe.gl/log/dist/utils/color.js
392
+ var COLOR;
393
+ (function(COLOR2) {
394
+ COLOR2[COLOR2["BLACK"] = 30] = "BLACK";
395
+ COLOR2[COLOR2["RED"] = 31] = "RED";
396
+ COLOR2[COLOR2["GREEN"] = 32] = "GREEN";
397
+ COLOR2[COLOR2["YELLOW"] = 33] = "YELLOW";
398
+ COLOR2[COLOR2["BLUE"] = 34] = "BLUE";
399
+ COLOR2[COLOR2["MAGENTA"] = 35] = "MAGENTA";
400
+ COLOR2[COLOR2["CYAN"] = 36] = "CYAN";
401
+ COLOR2[COLOR2["WHITE"] = 37] = "WHITE";
402
+ COLOR2[COLOR2["BRIGHT_BLACK"] = 90] = "BRIGHT_BLACK";
403
+ COLOR2[COLOR2["BRIGHT_RED"] = 91] = "BRIGHT_RED";
404
+ COLOR2[COLOR2["BRIGHT_GREEN"] = 92] = "BRIGHT_GREEN";
405
+ COLOR2[COLOR2["BRIGHT_YELLOW"] = 93] = "BRIGHT_YELLOW";
406
+ COLOR2[COLOR2["BRIGHT_BLUE"] = 94] = "BRIGHT_BLUE";
407
+ COLOR2[COLOR2["BRIGHT_MAGENTA"] = 95] = "BRIGHT_MAGENTA";
408
+ COLOR2[COLOR2["BRIGHT_CYAN"] = 96] = "BRIGHT_CYAN";
409
+ COLOR2[COLOR2["BRIGHT_WHITE"] = 97] = "BRIGHT_WHITE";
410
+ })(COLOR || (COLOR = {}));
411
+ var BACKGROUND_INCREMENT = 10;
412
+ function getColor(color) {
413
+ if (typeof color !== "string") {
414
+ return color;
415
+ }
416
+ color = color.toUpperCase();
417
+ return COLOR[color] || COLOR.WHITE;
418
+ }
419
+ function addColor(string, color, background) {
420
+ if (!isBrowser2 && typeof string === "string") {
421
+ if (color) {
422
+ const colorCode = getColor(color);
423
+ string = `\x1B[${colorCode}m${string}\x1B[39m`;
424
+ }
425
+ if (background) {
426
+ const colorCode = getColor(background);
427
+ string = `\x1B[${colorCode + BACKGROUND_INCREMENT}m${string}\x1B[49m`;
428
+ }
429
+ }
430
+ return string;
431
+ }
432
+
433
+ // ../../node_modules/@probe.gl/log/dist/utils/autobind.js
434
+ function autobind(obj, predefined = ["constructor"]) {
435
+ const proto = Object.getPrototypeOf(obj);
436
+ const propNames = Object.getOwnPropertyNames(proto);
437
+ const object = obj;
438
+ for (const key of propNames) {
439
+ const value = object[key];
440
+ if (typeof value === "function") {
441
+ if (!predefined.find((name) => key === name)) {
442
+ object[key] = value.bind(obj);
443
+ }
444
+ }
445
+ }
446
+ }
447
+
448
+ // ../../node_modules/@probe.gl/log/dist/utils/hi-res-timestamp.js
449
+ function getHiResTimestamp() {
450
+ let timestamp;
451
+ if (isBrowser2() && window_2.performance) {
452
+ timestamp = window_2?.performance?.now?.();
453
+ } else if ("hrtime" in process_) {
454
+ const timeParts = process_?.hrtime?.();
455
+ timestamp = timeParts[0] * 1e3 + timeParts[1] / 1e6;
456
+ } else {
457
+ timestamp = Date.now();
458
+ }
459
+ return timestamp;
460
+ }
461
+
462
+ // ../../node_modules/@probe.gl/log/dist/loggers/probe-log.js
463
+ var originalConsole = {
464
+ debug: isBrowser2() ? console.debug || console.log : console.log,
465
+ log: console.log,
466
+ info: console.info,
467
+ warn: console.warn,
468
+ error: console.error
469
+ };
470
+ var DEFAULT_LOG_CONFIGURATION = {
471
+ enabled: true,
472
+ level: 0
473
+ };
474
+ var ProbeLog = class extends BaseLog {
475
+ constructor({ id } = { id: "" }) {
476
+ super({ level: 0 });
477
+ this.VERSION = VERSION2;
478
+ this._startTs = getHiResTimestamp();
479
+ this._deltaTs = getHiResTimestamp();
480
+ this.userData = {};
481
+ this.LOG_THROTTLE_TIMEOUT = 0;
482
+ this.id = id;
483
+ this.userData = {};
484
+ this._storage = new LocalStorage(`__probe-${this.id}__`, { [this.id]: DEFAULT_LOG_CONFIGURATION });
485
+ this.timeStamp(`${this.id} started`);
486
+ autobind(this);
487
+ Object.seal(this);
488
+ }
489
+ isEnabled() {
490
+ return this._getConfiguration().enabled;
491
+ }
492
+ getLevel() {
493
+ return this._getConfiguration().level;
494
+ }
495
+ /** @return milliseconds, with fractions */
496
+ getTotal() {
497
+ return Number((getHiResTimestamp() - this._startTs).toPrecision(10));
498
+ }
499
+ /** @return milliseconds, with fractions */
500
+ getDelta() {
501
+ return Number((getHiResTimestamp() - this._deltaTs).toPrecision(10));
502
+ }
503
+ /** @deprecated use logLevel */
504
+ set priority(newPriority) {
505
+ this.level = newPriority;
506
+ }
507
+ /** @deprecated use logLevel */
508
+ get priority() {
509
+ return this.level;
510
+ }
511
+ /** @deprecated use logLevel */
512
+ getPriority() {
513
+ return this.level;
514
+ }
515
+ // Configure
516
+ enable(enabled = true) {
517
+ this._updateConfiguration({ enabled });
518
+ return this;
519
+ }
520
+ setLevel(level) {
521
+ this._updateConfiguration({ level });
522
+ return this;
523
+ }
524
+ /** return the current status of the setting */
525
+ get(setting) {
526
+ return this._getConfiguration()[setting];
527
+ }
528
+ // update the status of the setting
529
+ set(setting, value) {
530
+ this._updateConfiguration({ [setting]: value });
531
+ }
532
+ /** Logs the current settings as a table */
533
+ settings() {
534
+ if (console.table) {
535
+ console.table(this._storage.config);
536
+ } else {
537
+ console.log(this._storage.config);
538
+ }
539
+ }
540
+ // Unconditional logging
541
+ assert(condition, message) {
542
+ if (!condition) {
543
+ throw new Error(message || "Assertion failed");
544
+ }
545
+ }
546
+ warn(message, ...args) {
547
+ return this._log("warn", 0, message, args, {
548
+ method: originalConsole.warn,
549
+ once: true
550
+ });
551
+ }
552
+ error(message, ...args) {
553
+ return this._log("error", 0, message, args, {
554
+ method: originalConsole.error
555
+ });
556
+ }
557
+ /** Print a deprecation warning */
558
+ deprecated(oldUsage, newUsage) {
559
+ return this.warn(`\`${oldUsage}\` is deprecated and will be removed in a later version. Use \`${newUsage}\` instead`);
560
+ }
561
+ /** Print a removal warning */
562
+ removed(oldUsage, newUsage) {
563
+ return this.error(`\`${oldUsage}\` has been removed. Use \`${newUsage}\` instead`);
564
+ }
565
+ probe(logLevel, message, ...args) {
566
+ return this._log("log", logLevel, message, args, {
567
+ method: originalConsole.log,
568
+ time: true,
569
+ once: true
570
+ });
571
+ }
572
+ log(logLevel, message, ...args) {
573
+ return this._log("log", logLevel, message, args, {
574
+ method: originalConsole.debug
575
+ });
576
+ }
577
+ info(logLevel, message, ...args) {
578
+ return this._log("info", logLevel, message, args, { method: console.info });
579
+ }
580
+ once(logLevel, message, ...args) {
581
+ return this._log("once", logLevel, message, args, {
582
+ method: originalConsole.debug || originalConsole.info,
583
+ once: true
584
+ });
585
+ }
586
+ /** Logs an object as a table */
587
+ table(logLevel, table, columns) {
588
+ if (table) {
589
+ return this._log("table", logLevel, table, columns && [columns] || [], {
590
+ method: console.table || noop,
591
+ tag: getTableHeader(table)
592
+ });
593
+ }
594
+ return noop;
595
+ }
596
+ time(logLevel, message) {
597
+ return this._log("time", logLevel, message, [], {
598
+ method: console.time ? console.time : console.info
599
+ });
600
+ }
601
+ timeEnd(logLevel, message) {
602
+ return this._log("time", logLevel, message, [], {
603
+ method: console.timeEnd ? console.timeEnd : console.info
604
+ });
605
+ }
606
+ timeStamp(logLevel, message) {
607
+ return this._log("time", logLevel, message, [], {
608
+ method: console.timeStamp || noop
609
+ });
610
+ }
611
+ group(logLevel, message, opts = { collapsed: false }) {
612
+ const method = (opts.collapsed ? console.groupCollapsed : console.group) || console.info;
613
+ return this._log("group", logLevel, message, [], { method });
614
+ }
615
+ groupCollapsed(logLevel, message, opts = {}) {
616
+ return this.group(logLevel, message, Object.assign({}, opts, { collapsed: true }));
617
+ }
618
+ groupEnd(logLevel) {
619
+ return this._log("groupEnd", logLevel, "", [], {
620
+ method: console.groupEnd || noop
621
+ });
622
+ }
623
+ // EXPERIMENTAL
624
+ withGroup(logLevel, message, func) {
625
+ this.group(logLevel, message)();
626
+ try {
627
+ func();
628
+ } finally {
629
+ this.groupEnd(logLevel)();
630
+ }
631
+ }
632
+ trace() {
633
+ if (console.trace) {
634
+ console.trace();
635
+ }
636
+ }
637
+ _shouldLog(logLevel) {
638
+ return this.isEnabled() && super._shouldLog(logLevel);
639
+ }
640
+ _emit(_type, normalized) {
641
+ const method = normalized.method;
642
+ assert2(method);
643
+ normalized.total = this.getTotal();
644
+ normalized.delta = this.getDelta();
645
+ this._deltaTs = getHiResTimestamp();
646
+ const message = decorateMessage(this.id, normalized.message, normalized);
647
+ return method.bind(console, message, ...normalized.args);
648
+ }
649
+ _getConfiguration() {
650
+ if (!this._storage.config[this.id]) {
651
+ this._updateConfiguration(DEFAULT_LOG_CONFIGURATION);
652
+ }
653
+ return this._storage.config[this.id];
654
+ }
655
+ _updateConfiguration(configuration) {
656
+ const currentConfiguration = this._storage.config[this.id] || {
657
+ ...DEFAULT_LOG_CONFIGURATION
658
+ };
659
+ this._storage.setConfiguration({
660
+ [this.id]: { ...currentConfiguration, ...configuration }
661
+ });
662
+ }
663
+ };
664
+ ProbeLog.VERSION = VERSION2;
665
+ function decorateMessage(id, message, opts) {
666
+ if (typeof message === "string") {
667
+ const time = opts.time ? leftPad(formatTime(opts.total)) : "";
668
+ message = opts.time ? `${id}: ${time} ${message}` : `${id}: ${message}`;
669
+ message = addColor(message, opts.color, opts.background);
670
+ }
671
+ return message;
672
+ }
673
+ function getTableHeader(table) {
674
+ for (const key in table) {
675
+ for (const title in table[key]) {
676
+ return title || "untitled";
677
+ }
678
+ }
679
+ return "empty";
680
+ }
681
+
682
+ // ../../node_modules/@probe.gl/log/dist/init.js
683
+ globalThis.probe = {};
684
+
685
+ // ../../node_modules/@probe.gl/log/dist/index.js
686
+ var dist_default = new ProbeLog({ id: "@probe.gl/log" });
687
+
688
+ // ../loader-utils/src/lib/log-utils/log.ts
689
+ var VERSION3 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
690
+ var version = VERSION3[0] >= "0" && VERSION3[0] <= "9" ? `v${VERSION3}` : "";
691
+ function createLog() {
692
+ const log2 = new ProbeLog({ id: "loaders.gl" });
693
+ globalThis.loaders ||= {};
694
+ globalThis.loaders.log = log2;
695
+ globalThis.loaders.version = version;
696
+ globalThis.probe ||= {};
697
+ globalThis.probe.loaders = log2;
698
+ return log2;
699
+ }
700
+ var log = createLog();
701
+
108
702
  // ../loader-utils/src/lib/module-utils/js-module-utils.ts
109
703
  function registerJSModules(modules) {
110
704
  globalThis.loaders ||= {};
@@ -136,10 +730,10 @@ var __exports__ = (() => {
136
730
  }
137
731
  return globalThis._loadersgl_.version;
138
732
  }
139
- var VERSION2 = getVersion();
733
+ var VERSION4 = getVersion();
140
734
 
141
735
  // ../worker-utils/src/lib/env-utils/assert.ts
142
- function assert2(condition, message) {
736
+ function assert3(condition, message) {
143
737
  if (!condition) {
144
738
  throw new Error(message || "loaders.gl assertion failed.");
145
739
  }
@@ -153,10 +747,10 @@ var __exports__ = (() => {
153
747
  document: typeof document !== "undefined" && document
154
748
  };
155
749
  var self_2 = globals2.self || globals2.window || globals2.global || {};
156
- var window_2 = globals2.window || globals2.self || globals2.global || {};
157
- var global_2 = globals2.global || globals2.self || globals2.window || {};
158
- var document_2 = globals2.document || {};
159
- var isBrowser2 = (
750
+ var window_3 = globals2.window || globals2.self || globals2.global || {};
751
+ var global_3 = globals2.global || globals2.self || globals2.window || {};
752
+ var document_3 = globals2.document || {};
753
+ var isBrowser3 = (
160
754
  // @ts-ignore process.browser
161
755
  typeof process !== "object" || String(process) !== "[object process]" || process.browser
162
756
  );
@@ -187,12 +781,12 @@ var __exports__ = (() => {
187
781
  if (modules[libraryName]) {
188
782
  return modules[libraryName];
189
783
  }
190
- if (!isBrowser2) {
784
+ if (!isBrowser3) {
191
785
  return `modules/${moduleName}/dist/libs/${libraryName}`;
192
786
  }
193
787
  if (options.CDN) {
194
- assert2(options.CDN.startsWith("http"));
195
- return `${options.CDN}/${moduleName}@${VERSION2}/dist/libs/${libraryName}`;
788
+ assert3(options.CDN.startsWith("http"));
789
+ return `${options.CDN}/${moduleName}@${VERSION4}/dist/libs/${libraryName}`;
196
790
  }
197
791
  if (isWorker) {
198
792
  return `../src/libs/${libraryName}`;
@@ -203,7 +797,7 @@ var __exports__ = (() => {
203
797
  if (libraryUrl.endsWith("wasm")) {
204
798
  return await loadAsArrayBuffer(libraryUrl);
205
799
  }
206
- if (!isBrowser2) {
800
+ if (!isBrowser3) {
207
801
  const { requireFromFile } = globalThis.loaders || {};
208
802
  try {
209
803
  const result = await requireFromFile?.(libraryUrl);
@@ -229,7 +823,7 @@ var __exports__ = (() => {
229
823
  return loadLibraryFromString(scriptSource, libraryUrl);
230
824
  }
231
825
  function loadLibraryFromString(scriptSource, id) {
232
- if (!isBrowser2) {
826
+ if (!isBrowser3) {
233
827
  const { requireFromString } = globalThis.loaders || {};
234
828
  return requireFromString?.(scriptSource, id);
235
829
  }
@@ -249,7 +843,7 @@ var __exports__ = (() => {
249
843
  }
250
844
  async function loadAsArrayBuffer(url) {
251
845
  const { readFileAsArrayBuffer } = globalThis.loaders || {};
252
- if (isBrowser2 || !readFileAsArrayBuffer || url.startsWith("http")) {
846
+ if (isBrowser3 || !readFileAsArrayBuffer || url.startsWith("http")) {
253
847
  const response = await fetch(url);
254
848
  return await response.arrayBuffer();
255
849
  }
@@ -264,7 +858,7 @@ var __exports__ = (() => {
264
858
  }
265
859
  async function loadAsText(url) {
266
860
  const { readFileAsText } = globalThis.loaders || {};
267
- if (isBrowser2 || !readFileAsText || url.startsWith("http")) {
861
+ if (isBrowser3 || !readFileAsText || url.startsWith("http")) {
268
862
  const response = await fetch(url);
269
863
  return await response.text();
270
864
  }
@@ -278,8 +872,21 @@ var __exports__ = (() => {
278
872
  }
279
873
  }
280
874
 
281
- // ../worker-utils/src/index.ts
282
- var import_child_process_proxy = __toESM(require_child_process_proxy(), 1);
875
+ // ../worker-utils/src/lib/process-utils/child-process-proxy.browser.ts
876
+ var ChildProcessProxy = class {
877
+ constructor() {
878
+ throw new Error("ChildProcessProxy is not available in browser environments");
879
+ }
880
+ async start(props) {
881
+ return await Promise.resolve({});
882
+ }
883
+ async stop() {
884
+ return await Promise.resolve();
885
+ }
886
+ async exit() {
887
+ return await Promise.resolve();
888
+ }
889
+ };
283
890
 
284
891
  // ../loader-utils/src/lib/path-utils/file-aliases.ts
285
892
  var pathPrefix = "";
@@ -375,104 +982,269 @@ var __exports__ = (() => {
375
982
  }
376
983
 
377
984
  // src/lib/gl-extensions.ts
985
+ var GL_RGB = 6407;
986
+ var GL_RGBA = 6408;
987
+ var GL_RGBA4 = 32854;
988
+ var GL_RGB5_A1 = 32855;
989
+ var GL_RGBA8 = 32856;
990
+ var GL_RGB565 = 36194;
991
+ var GL_COMPRESSED_RGB_S3TC_DXT1_EXT = 33776;
992
+ var GL_COMPRESSED_RGBA_S3TC_DXT1_EXT = 33777;
993
+ var GL_COMPRESSED_RGBA_S3TC_DXT3_EXT = 33778;
994
+ var GL_COMPRESSED_RGBA_S3TC_DXT5_EXT = 33779;
995
+ var GL_COMPRESSED_R11_EAC = 37488;
996
+ var GL_COMPRESSED_SIGNED_R11_EAC = 37489;
997
+ var GL_COMPRESSED_RG11_EAC = 37490;
998
+ var GL_COMPRESSED_SIGNED_RG11_EAC = 37491;
999
+ var GL_COMPRESSED_RGB8_ETC2 = 37492;
1000
+ var GL_COMPRESSED_RGBA8_ETC2_EAC = 37493;
1001
+ var GL_COMPRESSED_SRGB8_ETC2 = 37494;
1002
+ var GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 37495;
1003
+ var GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 37496;
1004
+ var GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 37497;
1005
+ var GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG = 35840;
1006
+ var GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG = 35841;
1007
+ var GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG = 35842;
1008
+ var GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG = 35843;
1009
+ var GL_COMPRESSED_RGB_ETC1_WEBGL = 36196;
1010
+ var GL_COMPRESSED_RGB_ATC_WEBGL = 35986;
1011
+ var GL_COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL = 35987;
1012
+ var GL_COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL = 34798;
1013
+ var GL_COMPRESSED_RGBA_ASTC_4x4_KHR = 37808;
1014
+ var GL_COMPRESSED_RGBA_ASTC_5x4_KHR = 37809;
1015
+ var GL_COMPRESSED_RGBA_ASTC_5x5_KHR = 37810;
1016
+ var GL_COMPRESSED_RGBA_ASTC_6x5_KHR = 37811;
1017
+ var GL_COMPRESSED_RGBA_ASTC_6x6_KHR = 37812;
1018
+ var GL_COMPRESSED_RGBA_ASTC_8x5_KHR = 37813;
1019
+ var GL_COMPRESSED_RGBA_ASTC_8x6_KHR = 37814;
1020
+ var GL_COMPRESSED_RGBA_ASTC_8x8_KHR = 37815;
1021
+ var GL_COMPRESSED_RGBA_ASTC_10x5_KHR = 37816;
1022
+ var GL_COMPRESSED_RGBA_ASTC_10x6_KHR = 37817;
1023
+ var GL_COMPRESSED_RGBA_ASTC_10x8_KHR = 37818;
1024
+ var GL_COMPRESSED_RGBA_ASTC_10x10_KHR = 37819;
1025
+ var GL_COMPRESSED_RGBA_ASTC_12x10_KHR = 37820;
1026
+ var GL_COMPRESSED_RGBA_ASTC_12x12_KHR = 37821;
1027
+ var GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR = 37840;
1028
+ var GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR = 37841;
1029
+ var GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR = 37842;
1030
+ var GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR = 37843;
1031
+ var GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR = 37844;
1032
+ var GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR = 37845;
1033
+ var GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR = 37846;
1034
+ var GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR = 37847;
1035
+ var GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR = 37848;
1036
+ var GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR = 37849;
1037
+ var GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR = 37850;
1038
+ var GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR = 37851;
1039
+ var GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR = 37852;
1040
+ var GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR = 37853;
1041
+ var GL_COMPRESSED_RED_RGTC1_EXT = 36283;
1042
+ var GL_COMPRESSED_SIGNED_RED_RGTC1_EXT = 36284;
1043
+ var GL_COMPRESSED_RED_GREEN_RGTC2_EXT = 36285;
1044
+ var GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT = 36286;
1045
+ var GL_COMPRESSED_RGBA_BPTC_UNORM_EXT = 36492;
1046
+ var GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT = 36493;
1047
+ var GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT = 36494;
1048
+ var GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT = 36495;
1049
+ var GL_COMPRESSED_SRGB_S3TC_DXT1_EXT = 35916;
1050
+ var GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT = 35917;
1051
+ var GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT = 35918;
1052
+ var GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT = 35919;
378
1053
  var GL_EXTENSIONS_CONSTANTS = {
379
- // WEBGL_compressed_texture_s3tc
380
- COMPRESSED_RGB_S3TC_DXT1_EXT: 33776,
381
- COMPRESSED_RGBA_S3TC_DXT1_EXT: 33777,
382
- COMPRESSED_RGBA_S3TC_DXT3_EXT: 33778,
383
- COMPRESSED_RGBA_S3TC_DXT5_EXT: 33779,
384
- // WEBGL_compressed_texture_es3
385
- COMPRESSED_R11_EAC: 37488,
386
- COMPRESSED_SIGNED_R11_EAC: 37489,
387
- COMPRESSED_RG11_EAC: 37490,
388
- COMPRESSED_SIGNED_RG11_EAC: 37491,
389
- COMPRESSED_RGB8_ETC2: 37492,
390
- COMPRESSED_RGBA8_ETC2_EAC: 37493,
391
- COMPRESSED_SRGB8_ETC2: 37494,
392
- COMPRESSED_SRGB8_ALPHA8_ETC2_EAC: 37495,
393
- COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2: 37496,
394
- COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2: 37497,
395
- // WEBGL_compressed_texture_pvrtc
396
- COMPRESSED_RGB_PVRTC_4BPPV1_IMG: 35840,
397
- COMPRESSED_RGBA_PVRTC_4BPPV1_IMG: 35842,
398
- COMPRESSED_RGB_PVRTC_2BPPV1_IMG: 35841,
399
- COMPRESSED_RGBA_PVRTC_2BPPV1_IMG: 35843,
400
- // WEBGL_compressed_texture_etc1
401
- COMPRESSED_RGB_ETC1_WEBGL: 36196,
402
- // WEBGL_compressed_texture_atc
403
- COMPRESSED_RGB_ATC_WEBGL: 35986,
404
- COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL: 35987,
405
- COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL: 34798,
406
- // WEBGL_compressed_texture_astc
407
- COMPRESSED_RGBA_ASTC_4X4_KHR: 37808,
408
- COMPRESSED_RGBA_ASTC_5X4_KHR: 37809,
409
- COMPRESSED_RGBA_ASTC_5X5_KHR: 37810,
410
- COMPRESSED_RGBA_ASTC_6X5_KHR: 37811,
411
- COMPRESSED_RGBA_ASTC_6X6_KHR: 37812,
412
- COMPRESSED_RGBA_ASTC_8X5_KHR: 37813,
413
- COMPRESSED_RGBA_ASTC_8X6_KHR: 37814,
414
- COMPRESSED_RGBA_ASTC_8X8_KHR: 37815,
415
- COMPRESSED_RGBA_ASTC_10X5_KHR: 37816,
416
- COMPRESSED_RGBA_ASTC_10X6_KHR: 37817,
417
- COMPRESSED_RGBA_ASTC_10X8_KHR: 37818,
418
- COMPRESSED_RGBA_ASTC_10X10_KHR: 37819,
419
- COMPRESSED_RGBA_ASTC_12X10_KHR: 37820,
420
- COMPRESSED_RGBA_ASTC_12X12_KHR: 37821,
421
- COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR: 37840,
422
- COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR: 37841,
423
- COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR: 37842,
424
- COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR: 37843,
425
- COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR: 37844,
426
- COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR: 37845,
427
- COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR: 37846,
428
- COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR: 37847,
429
- COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR: 37848,
430
- COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR: 37849,
431
- COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR: 37850,
432
- COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR: 37851,
433
- COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR: 37852,
434
- COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR: 37853,
435
- // EXT_texture_compression_rgtc
436
- COMPRESSED_RED_RGTC1_EXT: 36283,
437
- COMPRESSED_SIGNED_RED_RGTC1_EXT: 36284,
438
- COMPRESSED_RED_GREEN_RGTC2_EXT: 36285,
439
- COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT: 36286,
440
- // WEBGL_compressed_texture_s3tc_srgb
441
- COMPRESSED_SRGB_S3TC_DXT1_EXT: 35916,
442
- COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: 35917,
443
- COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: 35918,
444
- COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: 35919
1054
+ RGB: GL_RGB,
1055
+ RGBA: GL_RGBA,
1056
+ RGBA4: GL_RGBA4,
1057
+ RGB5_A1: GL_RGB5_A1,
1058
+ RGBA8: GL_RGBA8,
1059
+ RGB565: GL_RGB565,
1060
+ COMPRESSED_RGB_S3TC_DXT1_EXT: GL_COMPRESSED_RGB_S3TC_DXT1_EXT,
1061
+ COMPRESSED_RGBA_S3TC_DXT1_EXT: GL_COMPRESSED_RGBA_S3TC_DXT1_EXT,
1062
+ COMPRESSED_RGBA_S3TC_DXT3_EXT: GL_COMPRESSED_RGBA_S3TC_DXT3_EXT,
1063
+ COMPRESSED_RGBA_S3TC_DXT5_EXT: GL_COMPRESSED_RGBA_S3TC_DXT5_EXT,
1064
+ COMPRESSED_R11_EAC: GL_COMPRESSED_R11_EAC,
1065
+ COMPRESSED_SIGNED_R11_EAC: GL_COMPRESSED_SIGNED_R11_EAC,
1066
+ COMPRESSED_RG11_EAC: GL_COMPRESSED_RG11_EAC,
1067
+ COMPRESSED_SIGNED_RG11_EAC: GL_COMPRESSED_SIGNED_RG11_EAC,
1068
+ COMPRESSED_RGB8_ETC2: GL_COMPRESSED_RGB8_ETC2,
1069
+ COMPRESSED_RGBA8_ETC2_EAC: GL_COMPRESSED_RGBA8_ETC2_EAC,
1070
+ COMPRESSED_SRGB8_ETC2: GL_COMPRESSED_SRGB8_ETC2,
1071
+ COMPRESSED_SRGB8_ALPHA8_ETC2_EAC: GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,
1072
+ COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2: GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,
1073
+ COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2: GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,
1074
+ COMPRESSED_RGB_PVRTC_4BPPV1_IMG: GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG,
1075
+ COMPRESSED_RGB_PVRTC_2BPPV1_IMG: GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG,
1076
+ COMPRESSED_RGBA_PVRTC_4BPPV1_IMG: GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,
1077
+ COMPRESSED_RGBA_PVRTC_2BPPV1_IMG: GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,
1078
+ COMPRESSED_RGB_ETC1_WEBGL: GL_COMPRESSED_RGB_ETC1_WEBGL,
1079
+ COMPRESSED_RGB_ATC_WEBGL: GL_COMPRESSED_RGB_ATC_WEBGL,
1080
+ COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL: GL_COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL,
1081
+ COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL: GL_COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL,
1082
+ COMPRESSED_RGBA_ASTC_4x4_KHR: GL_COMPRESSED_RGBA_ASTC_4x4_KHR,
1083
+ COMPRESSED_RGBA_ASTC_5x4_KHR: GL_COMPRESSED_RGBA_ASTC_5x4_KHR,
1084
+ COMPRESSED_RGBA_ASTC_5x5_KHR: GL_COMPRESSED_RGBA_ASTC_5x5_KHR,
1085
+ COMPRESSED_RGBA_ASTC_6x5_KHR: GL_COMPRESSED_RGBA_ASTC_6x5_KHR,
1086
+ COMPRESSED_RGBA_ASTC_6x6_KHR: GL_COMPRESSED_RGBA_ASTC_6x6_KHR,
1087
+ COMPRESSED_RGBA_ASTC_8x5_KHR: GL_COMPRESSED_RGBA_ASTC_8x5_KHR,
1088
+ COMPRESSED_RGBA_ASTC_8x6_KHR: GL_COMPRESSED_RGBA_ASTC_8x6_KHR,
1089
+ COMPRESSED_RGBA_ASTC_8x8_KHR: GL_COMPRESSED_RGBA_ASTC_8x8_KHR,
1090
+ COMPRESSED_RGBA_ASTC_10x5_KHR: GL_COMPRESSED_RGBA_ASTC_10x5_KHR,
1091
+ COMPRESSED_RGBA_ASTC_10x6_KHR: GL_COMPRESSED_RGBA_ASTC_10x6_KHR,
1092
+ COMPRESSED_RGBA_ASTC_10x8_KHR: GL_COMPRESSED_RGBA_ASTC_10x8_KHR,
1093
+ COMPRESSED_RGBA_ASTC_10x10_KHR: GL_COMPRESSED_RGBA_ASTC_10x10_KHR,
1094
+ COMPRESSED_RGBA_ASTC_12x10_KHR: GL_COMPRESSED_RGBA_ASTC_12x10_KHR,
1095
+ COMPRESSED_RGBA_ASTC_12x12_KHR: GL_COMPRESSED_RGBA_ASTC_12x12_KHR,
1096
+ COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,
1097
+ COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR,
1098
+ COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,
1099
+ COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,
1100
+ COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,
1101
+ COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,
1102
+ COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,
1103
+ COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,
1104
+ COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,
1105
+ COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,
1106
+ COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,
1107
+ COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,
1108
+ COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,
1109
+ COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR,
1110
+ COMPRESSED_RED_RGTC1_EXT: GL_COMPRESSED_RED_RGTC1_EXT,
1111
+ COMPRESSED_SIGNED_RED_RGTC1_EXT: GL_COMPRESSED_SIGNED_RED_RGTC1_EXT,
1112
+ COMPRESSED_RED_GREEN_RGTC2_EXT: GL_COMPRESSED_RED_GREEN_RGTC2_EXT,
1113
+ COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT: GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT,
1114
+ COMPRESSED_RGBA_BPTC_UNORM_EXT: GL_COMPRESSED_RGBA_BPTC_UNORM_EXT,
1115
+ COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT: GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT,
1116
+ COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT: GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,
1117
+ COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT: GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,
1118
+ COMPRESSED_SRGB_S3TC_DXT1_EXT: GL_COMPRESSED_SRGB_S3TC_DXT1_EXT,
1119
+ COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,
1120
+ COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,
1121
+ COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,
1122
+ // Deprecated legacy aliases with non-standard ASTC casing.
1123
+ COMPRESSED_RGBA_ASTC_4X4_KHR: GL_COMPRESSED_RGBA_ASTC_4x4_KHR,
1124
+ COMPRESSED_RGBA_ASTC_5X4_KHR: GL_COMPRESSED_RGBA_ASTC_5x4_KHR,
1125
+ COMPRESSED_RGBA_ASTC_5X5_KHR: GL_COMPRESSED_RGBA_ASTC_5x5_KHR,
1126
+ COMPRESSED_RGBA_ASTC_6X5_KHR: GL_COMPRESSED_RGBA_ASTC_6x5_KHR,
1127
+ COMPRESSED_RGBA_ASTC_6X6_KHR: GL_COMPRESSED_RGBA_ASTC_6x6_KHR,
1128
+ COMPRESSED_RGBA_ASTC_8X5_KHR: GL_COMPRESSED_RGBA_ASTC_8x5_KHR,
1129
+ COMPRESSED_RGBA_ASTC_8X6_KHR: GL_COMPRESSED_RGBA_ASTC_8x6_KHR,
1130
+ COMPRESSED_RGBA_ASTC_8X8_KHR: GL_COMPRESSED_RGBA_ASTC_8x8_KHR,
1131
+ COMPRESSED_RGBA_ASTC_10X5_KHR: GL_COMPRESSED_RGBA_ASTC_10x5_KHR,
1132
+ COMPRESSED_RGBA_ASTC_10X6_KHR: GL_COMPRESSED_RGBA_ASTC_10x6_KHR,
1133
+ COMPRESSED_RGBA_ASTC_10X8_KHR: GL_COMPRESSED_RGBA_ASTC_10x8_KHR,
1134
+ COMPRESSED_RGBA_ASTC_10X10_KHR: GL_COMPRESSED_RGBA_ASTC_10x10_KHR,
1135
+ COMPRESSED_RGBA_ASTC_12X10_KHR: GL_COMPRESSED_RGBA_ASTC_12x10_KHR,
1136
+ COMPRESSED_RGBA_ASTC_12X12_KHR: GL_COMPRESSED_RGBA_ASTC_12x12_KHR,
1137
+ COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,
1138
+ COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR,
1139
+ COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,
1140
+ COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,
1141
+ COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,
1142
+ COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,
1143
+ COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,
1144
+ COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,
1145
+ COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,
1146
+ COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,
1147
+ COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,
1148
+ COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,
1149
+ COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,
1150
+ COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR
445
1151
  };
446
1152
 
447
- // src/lib/utils/texture-formats.ts
1153
+ // src/lib/utils/detect-supported-texture-formats.ts
448
1154
  var BROWSER_PREFIXES = ["", "WEBKIT_", "MOZ_"];
449
- var WEBGL_EXTENSIONS = {
1155
+ var WEBGL_TEXTURE_FORMATS = {
450
1156
  /* eslint-disable camelcase */
451
- WEBGL_compressed_texture_s3tc: "dxt",
452
- WEBGL_compressed_texture_s3tc_srgb: "dxt-srgb",
453
- WEBGL_compressed_texture_etc1: "etc1",
454
- WEBGL_compressed_texture_etc: "etc2",
455
- WEBGL_compressed_texture_pvrtc: "pvrtc",
456
- WEBGL_compressed_texture_atc: "atc",
457
- WEBGL_compressed_texture_astc: "astc",
458
- EXT_texture_compression_rgtc: "rgtc"
1157
+ WEBGL_compressed_texture_s3tc: [
1158
+ "bc1-rgb-unorm-webgl",
1159
+ "bc1-rgba-unorm",
1160
+ "bc2-rgba-unorm",
1161
+ "bc3-rgba-unorm"
1162
+ ],
1163
+ WEBGL_compressed_texture_s3tc_srgb: [
1164
+ "bc1-rgb-unorm-srgb-webgl",
1165
+ "bc1-rgba-unorm-srgb",
1166
+ "bc2-rgba-unorm-srgb",
1167
+ "bc3-rgba-unorm-srgb"
1168
+ ],
1169
+ EXT_texture_compression_rgtc: ["bc4-r-unorm", "bc4-r-snorm", "bc5-rg-unorm", "bc5-rg-snorm"],
1170
+ EXT_texture_compression_bptc: [
1171
+ "bc6h-rgb-ufloat",
1172
+ "bc6h-rgb-float",
1173
+ "bc7-rgba-unorm",
1174
+ "bc7-rgba-unorm-srgb"
1175
+ ],
1176
+ WEBGL_compressed_texture_etc1: ["etc1-rbg-unorm-webgl"],
1177
+ WEBGL_compressed_texture_etc: [
1178
+ "etc2-rgb8unorm",
1179
+ "etc2-rgb8unorm-srgb",
1180
+ "etc2-rgb8a1unorm",
1181
+ "etc2-rgb8a1unorm-srgb",
1182
+ "etc2-rgba8unorm",
1183
+ "etc2-rgba8unorm-srgb",
1184
+ "eac-r11unorm",
1185
+ "eac-r11snorm",
1186
+ "eac-rg11unorm",
1187
+ "eac-rg11snorm"
1188
+ ],
1189
+ WEBGL_compressed_texture_pvrtc: [
1190
+ "pvrtc-rgb4unorm-webgl",
1191
+ "pvrtc-rgba4unorm-webgl",
1192
+ "pvrtc-rbg2unorm-webgl",
1193
+ "pvrtc-rgba2unorm-webgl"
1194
+ ],
1195
+ WEBGL_compressed_texture_atc: [
1196
+ "atc-rgb-unorm-webgl",
1197
+ "atc-rgba-unorm-webgl",
1198
+ "atc-rgbai-unorm-webgl"
1199
+ ],
1200
+ WEBGL_compressed_texture_astc: [
1201
+ "astc-4x4-unorm",
1202
+ "astc-4x4-unorm-srgb",
1203
+ "astc-5x4-unorm",
1204
+ "astc-5x4-unorm-srgb",
1205
+ "astc-5x5-unorm",
1206
+ "astc-5x5-unorm-srgb",
1207
+ "astc-6x5-unorm",
1208
+ "astc-6x5-unorm-srgb",
1209
+ "astc-6x6-unorm",
1210
+ "astc-6x6-unorm-srgb",
1211
+ "astc-8x5-unorm",
1212
+ "astc-8x5-unorm-srgb",
1213
+ "astc-8x6-unorm",
1214
+ "astc-8x6-unorm-srgb",
1215
+ "astc-8x8-unorm",
1216
+ "astc-8x8-unorm-srgb",
1217
+ "astc-10x5-unorm",
1218
+ "astc-10x5-unorm-srgb",
1219
+ "astc-10x6-unorm",
1220
+ "astc-10x6-unorm-srgb",
1221
+ "astc-10x8-unorm",
1222
+ "astc-10x8-unorm-srgb",
1223
+ "astc-10x10-unorm",
1224
+ "astc-10x10-unorm-srgb",
1225
+ "astc-12x10-unorm",
1226
+ "astc-12x10-unorm-srgb",
1227
+ "astc-12x12-unorm",
1228
+ "astc-12x12-unorm-srgb"
1229
+ ]
459
1230
  /* eslint-enable camelcase */
460
1231
  };
461
- var formats = null;
462
- function getSupportedGPUTextureFormats(gl) {
463
- if (!formats) {
1232
+ var textureFormats = null;
1233
+ function detectSupportedTextureFormats(gl) {
1234
+ if (!textureFormats) {
464
1235
  gl = gl || getWebGLContext() || void 0;
465
- formats = /* @__PURE__ */ new Set();
1236
+ textureFormats = /* @__PURE__ */ new Set();
466
1237
  for (const prefix of BROWSER_PREFIXES) {
467
- for (const extension in WEBGL_EXTENSIONS) {
1238
+ for (const extension in WEBGL_TEXTURE_FORMATS) {
468
1239
  if (gl && gl.getExtension(`${prefix}${extension}`)) {
469
- const gpuTextureFormat = WEBGL_EXTENSIONS[extension];
470
- formats.add(gpuTextureFormat);
1240
+ for (const textureFormat of WEBGL_TEXTURE_FORMATS[extension]) {
1241
+ textureFormats.add(textureFormat);
1242
+ }
471
1243
  }
472
1244
  }
473
1245
  }
474
1246
  }
475
- return formats;
1247
+ return textureFormats;
476
1248
  }
477
1249
  function getWebGLContext() {
478
1250
  try {
@@ -732,23 +1504,100 @@ var __exports__ = (() => {
732
1504
  return container;
733
1505
  }
734
1506
 
1507
+ // src/lib/utils/texture-format-map.ts
1508
+ var WEBGL_TO_TEXTURE_FORMAT = {
1509
+ [GL_COMPRESSED_RGB_S3TC_DXT1_EXT]: "bc1-rgb-unorm-webgl",
1510
+ [GL_COMPRESSED_SRGB_S3TC_DXT1_EXT]: "bc1-rgb-unorm-srgb-webgl",
1511
+ [GL_COMPRESSED_RGBA_S3TC_DXT1_EXT]: "bc1-rgba-unorm",
1512
+ [GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT]: "bc1-rgba-unorm-srgb",
1513
+ [GL_COMPRESSED_RGBA_S3TC_DXT3_EXT]: "bc2-rgba-unorm",
1514
+ [GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT]: "bc2-rgba-unorm-srgb",
1515
+ [GL_COMPRESSED_RGBA_S3TC_DXT5_EXT]: "bc3-rgba-unorm",
1516
+ [GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT]: "bc3-rgba-unorm-srgb",
1517
+ [GL_COMPRESSED_RED_RGTC1_EXT]: "bc4-r-unorm",
1518
+ [GL_COMPRESSED_SIGNED_RED_RGTC1_EXT]: "bc4-r-snorm",
1519
+ [GL_COMPRESSED_RED_GREEN_RGTC2_EXT]: "bc5-rg-unorm",
1520
+ [GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT]: "bc5-rg-snorm",
1521
+ [GL_COMPRESSED_RGB8_ETC2]: "etc2-rgb8unorm",
1522
+ [GL_COMPRESSED_SRGB8_ETC2]: "etc2-rgb8unorm-srgb",
1523
+ [GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2]: "etc2-rgb8a1unorm",
1524
+ [GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2]: "etc2-rgb8a1unorm-srgb",
1525
+ [GL_COMPRESSED_RGBA8_ETC2_EAC]: "etc2-rgba8unorm",
1526
+ [GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC]: "etc2-rgba8unorm-srgb",
1527
+ [GL_COMPRESSED_R11_EAC]: "eac-r11unorm",
1528
+ [GL_COMPRESSED_SIGNED_R11_EAC]: "eac-r11snorm",
1529
+ [GL_COMPRESSED_RG11_EAC]: "eac-rg11unorm",
1530
+ [GL_COMPRESSED_SIGNED_RG11_EAC]: "eac-rg11snorm",
1531
+ [GL_COMPRESSED_RGBA_ASTC_4x4_KHR]: "astc-4x4-unorm",
1532
+ [GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR]: "astc-4x4-unorm-srgb",
1533
+ [GL_COMPRESSED_RGBA_ASTC_5x4_KHR]: "astc-5x4-unorm",
1534
+ [GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR]: "astc-5x4-unorm-srgb",
1535
+ [GL_COMPRESSED_RGBA_ASTC_5x5_KHR]: "astc-5x5-unorm",
1536
+ [GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR]: "astc-5x5-unorm-srgb",
1537
+ [GL_COMPRESSED_RGBA_ASTC_6x5_KHR]: "astc-6x5-unorm",
1538
+ [GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR]: "astc-6x5-unorm-srgb",
1539
+ [GL_COMPRESSED_RGBA_ASTC_6x6_KHR]: "astc-6x6-unorm",
1540
+ [GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR]: "astc-6x6-unorm-srgb",
1541
+ [GL_COMPRESSED_RGBA_ASTC_8x5_KHR]: "astc-8x5-unorm",
1542
+ [GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR]: "astc-8x5-unorm-srgb",
1543
+ [GL_COMPRESSED_RGBA_ASTC_8x6_KHR]: "astc-8x6-unorm",
1544
+ [GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR]: "astc-8x6-unorm-srgb",
1545
+ [GL_COMPRESSED_RGBA_ASTC_8x8_KHR]: "astc-8x8-unorm",
1546
+ [GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR]: "astc-8x8-unorm-srgb",
1547
+ [GL_COMPRESSED_RGBA_ASTC_10x5_KHR]: "astc-10x5-unorm",
1548
+ [GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR]: "astc-10x5-unorm-srgb",
1549
+ [GL_COMPRESSED_RGBA_ASTC_10x6_KHR]: "astc-10x6-unorm",
1550
+ [GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR]: "astc-10x6-unorm-srgb",
1551
+ [GL_COMPRESSED_RGBA_ASTC_10x8_KHR]: "astc-10x8-unorm",
1552
+ [GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR]: "astc-10x8-unorm-srgb",
1553
+ [GL_COMPRESSED_RGBA_ASTC_10x10_KHR]: "astc-10x10-unorm",
1554
+ [GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR]: "astc-10x10-unorm-srgb",
1555
+ [GL_COMPRESSED_RGBA_ASTC_12x10_KHR]: "astc-12x10-unorm",
1556
+ [GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR]: "astc-12x10-unorm-srgb",
1557
+ [GL_COMPRESSED_RGBA_ASTC_12x12_KHR]: "astc-12x12-unorm",
1558
+ [GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR]: "astc-12x12-unorm-srgb",
1559
+ [GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG]: "pvrtc-rgb4unorm-webgl",
1560
+ [GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG]: "pvrtc-rgba4unorm-webgl",
1561
+ [GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG]: "pvrtc-rbg2unorm-webgl",
1562
+ [GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG]: "pvrtc-rgba2unorm-webgl",
1563
+ [GL_COMPRESSED_RGB_ETC1_WEBGL]: "etc1-rbg-unorm-webgl",
1564
+ [GL_COMPRESSED_RGB_ATC_WEBGL]: "atc-rgb-unorm-webgl",
1565
+ [GL_COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL]: "atc-rgba-unorm-webgl",
1566
+ [GL_COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL]: "atc-rgbai-unorm-webgl"
1567
+ };
1568
+ function getTextureFormatFromWebGLFormat(format) {
1569
+ if (format === void 0) {
1570
+ return void 0;
1571
+ }
1572
+ return WEBGL_TO_TEXTURE_FORMAT[format];
1573
+ }
1574
+
735
1575
  // src/lib/utils/extract-mipmap-images.ts
736
1576
  function extractMipmapImages(data, options) {
737
1577
  const images = new Array(options.mipMapLevels);
1578
+ const format = options.internalFormat;
1579
+ const textureFormat = format === void 0 ? void 0 : getTextureFormatFromWebGLFormat(format);
738
1580
  let levelWidth = options.width;
739
1581
  let levelHeight = options.height;
740
1582
  let offset = 0;
741
1583
  for (let i = 0; i < options.mipMapLevels; ++i) {
742
1584
  const levelSize = getLevelSize(options, levelWidth, levelHeight, data, i);
743
1585
  const levelData = getLevelData(data, i, offset, levelSize);
744
- images[i] = {
1586
+ const image = {
1587
+ shape: "texture-level",
745
1588
  compressed: true,
746
- format: options.internalFormat,
747
1589
  data: levelData,
748
1590
  width: levelWidth,
749
1591
  height: levelHeight,
750
1592
  levelSize
751
1593
  };
1594
+ if (format !== void 0) {
1595
+ image.format = format;
1596
+ }
1597
+ if (textureFormat) {
1598
+ image.textureFormat = textureFormat;
1599
+ }
1600
+ images[i] = image;
752
1601
  levelWidth = Math.max(1, levelWidth >> 1);
753
1602
  levelHeight = Math.max(1, levelHeight >> 1);
754
1603
  offset += levelSize;
@@ -770,114 +1619,72 @@ var __exports__ = (() => {
770
1619
 
771
1620
  // src/lib/utils/ktx-format-helper.ts
772
1621
  var VULKAN_TO_WEBGL_FORMAT_MAP = {
773
- 131: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGB_S3TC_DXT1_EXT,
774
- 132: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB_S3TC_DXT1_EXT,
775
- 133: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_S3TC_DXT1_EXT,
776
- 134: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,
777
- 135: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_S3TC_DXT3_EXT,
778
- 136: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,
779
- 137: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_S3TC_DXT5_EXT,
780
- 138: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,
781
- 139: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RED_RGTC1_EXT,
782
- 140: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SIGNED_RED_RGTC1_EXT,
783
- 141: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RED_GREEN_RGTC2_EXT,
784
- 142: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT,
785
- 147: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGB8_ETC2,
786
- 148: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ETC2,
787
- 149: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,
788
- 150: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,
789
- 151: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA8_ETC2_EAC,
790
- 152: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,
791
- 153: GL_EXTENSIONS_CONSTANTS.COMPRESSED_R11_EAC,
792
- 154: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SIGNED_R11_EAC,
793
- 155: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RG11_EAC,
794
- 156: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SIGNED_RG11_EAC,
795
- // @ts-ignore
796
- 157: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_4x4_KHR,
797
- // @ts-ignore
798
- 158: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,
799
- // @ts-ignore
800
- 159: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_5x4_KHR,
801
- // @ts-ignore
802
- 160: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR,
803
- // @ts-ignore
804
- 161: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_5x5_KHR,
805
- // @ts-ignore
806
- 162: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,
807
- // @ts-ignore
808
- 163: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_6x5_KHR,
809
- // @ts-ignore
810
- 164: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,
811
- // @ts-ignore
812
- 165: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_6x6_KHR,
813
- // @ts-ignore
814
- 166: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,
815
- // @ts-ignore
816
- 167: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_8x5_KHR,
817
- // @ts-ignore
818
- 168: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,
819
- // @ts-ignore
820
- 169: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_8x6_KHR,
821
- // @ts-ignore
822
- 170: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,
823
- // @ts-ignore
824
- 171: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_8x8_KHR,
825
- // @ts-ignore
826
- 172: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,
827
- // @ts-ignore
828
- 173: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_10x5_KHR,
829
- // @ts-ignore
830
- 174: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,
831
- // @ts-ignore
832
- 175: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_10x6_KHR,
833
- // @ts-ignore
834
- 176: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,
835
- // @ts-ignore
836
- 177: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_10x8_KHR,
837
- // @ts-ignore
838
- 178: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,
839
- // @ts-ignore
840
- 179: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_10x10_KHR,
841
- // @ts-ignore
842
- 180: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,
843
- // @ts-ignore
844
- 181: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_12x10_KHR,
845
- // @ts-ignore
846
- 182: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,
847
- // @ts-ignore
848
- 183: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_12x12_KHR,
849
- // @ts-ignore
850
- 184: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR,
851
- 1000054e3: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,
852
- 1000054001: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,
853
- // @ts-ignore
854
- 1000066e3: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_4x4_KHR,
855
- // @ts-ignore
856
- 1000066001: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_5x4_KHR,
857
- // @ts-ignore
858
- 1000066002: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_5x5_KHR,
859
- // @ts-ignore
860
- 1000066003: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_6x5_KHR,
861
- // @ts-ignore
862
- 1000066004: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_6x6_KHR,
863
- // @ts-ignore
864
- 1000066005: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_8x5_KHR,
865
- // @ts-ignore
866
- 1000066006: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_8x6_KHR,
867
- // @ts-ignore
868
- 1000066007: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_8x8_KHR,
869
- // @ts-ignore
870
- 1000066008: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_10x5_KHR,
871
- // @ts-ignore
872
- 1000066009: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_10x6_KHR,
873
- // @ts-ignore
874
- 1000066010: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_10x8_KHR,
875
- // @ts-ignore
876
- 1000066011: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_10x10_KHR,
877
- // @ts-ignore
878
- 1000066012: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_12x10_KHR,
879
- // @ts-ignore
880
- 1000066013: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_12x12_KHR
1622
+ 131: GL_COMPRESSED_RGB_S3TC_DXT1_EXT,
1623
+ 132: GL_COMPRESSED_SRGB_S3TC_DXT1_EXT,
1624
+ 133: GL_COMPRESSED_RGBA_S3TC_DXT1_EXT,
1625
+ 134: GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,
1626
+ 135: GL_COMPRESSED_RGBA_S3TC_DXT3_EXT,
1627
+ 136: GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,
1628
+ 137: GL_COMPRESSED_RGBA_S3TC_DXT5_EXT,
1629
+ 138: GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,
1630
+ 139: GL_COMPRESSED_RED_RGTC1_EXT,
1631
+ 140: GL_COMPRESSED_SIGNED_RED_RGTC1_EXT,
1632
+ 141: GL_COMPRESSED_RED_GREEN_RGTC2_EXT,
1633
+ 142: GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT,
1634
+ 147: GL_COMPRESSED_RGB8_ETC2,
1635
+ 148: GL_COMPRESSED_SRGB8_ETC2,
1636
+ 149: GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,
1637
+ 150: GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,
1638
+ 151: GL_COMPRESSED_RGBA8_ETC2_EAC,
1639
+ 152: GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,
1640
+ 153: GL_COMPRESSED_R11_EAC,
1641
+ 154: GL_COMPRESSED_SIGNED_R11_EAC,
1642
+ 155: GL_COMPRESSED_RG11_EAC,
1643
+ 156: GL_COMPRESSED_SIGNED_RG11_EAC,
1644
+ 157: GL_COMPRESSED_RGBA_ASTC_4x4_KHR,
1645
+ 158: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,
1646
+ 159: GL_COMPRESSED_RGBA_ASTC_5x4_KHR,
1647
+ 160: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR,
1648
+ 161: GL_COMPRESSED_RGBA_ASTC_5x5_KHR,
1649
+ 162: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,
1650
+ 163: GL_COMPRESSED_RGBA_ASTC_6x5_KHR,
1651
+ 164: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,
1652
+ 165: GL_COMPRESSED_RGBA_ASTC_6x6_KHR,
1653
+ 166: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,
1654
+ 167: GL_COMPRESSED_RGBA_ASTC_8x5_KHR,
1655
+ 168: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,
1656
+ 169: GL_COMPRESSED_RGBA_ASTC_8x6_KHR,
1657
+ 170: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,
1658
+ 171: GL_COMPRESSED_RGBA_ASTC_8x8_KHR,
1659
+ 172: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,
1660
+ 173: GL_COMPRESSED_RGBA_ASTC_10x5_KHR,
1661
+ 174: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,
1662
+ 175: GL_COMPRESSED_RGBA_ASTC_10x6_KHR,
1663
+ 176: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,
1664
+ 177: GL_COMPRESSED_RGBA_ASTC_10x8_KHR,
1665
+ 178: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,
1666
+ 179: GL_COMPRESSED_RGBA_ASTC_10x10_KHR,
1667
+ 180: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,
1668
+ 181: GL_COMPRESSED_RGBA_ASTC_12x10_KHR,
1669
+ 182: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,
1670
+ 183: GL_COMPRESSED_RGBA_ASTC_12x12_KHR,
1671
+ 184: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR,
1672
+ 1000054e3: GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,
1673
+ 1000054001: GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,
1674
+ 1000066e3: GL_COMPRESSED_RGBA_ASTC_4x4_KHR,
1675
+ 1000066001: GL_COMPRESSED_RGBA_ASTC_5x4_KHR,
1676
+ 1000066002: GL_COMPRESSED_RGBA_ASTC_5x5_KHR,
1677
+ 1000066003: GL_COMPRESSED_RGBA_ASTC_6x5_KHR,
1678
+ 1000066004: GL_COMPRESSED_RGBA_ASTC_6x6_KHR,
1679
+ 1000066005: GL_COMPRESSED_RGBA_ASTC_8x5_KHR,
1680
+ 1000066006: GL_COMPRESSED_RGBA_ASTC_8x6_KHR,
1681
+ 1000066007: GL_COMPRESSED_RGBA_ASTC_8x8_KHR,
1682
+ 1000066008: GL_COMPRESSED_RGBA_ASTC_10x5_KHR,
1683
+ 1000066009: GL_COMPRESSED_RGBA_ASTC_10x6_KHR,
1684
+ 1000066010: GL_COMPRESSED_RGBA_ASTC_10x8_KHR,
1685
+ 1000066011: GL_COMPRESSED_RGBA_ASTC_10x10_KHR,
1686
+ 1000066012: GL_COMPRESSED_RGBA_ASTC_12x10_KHR,
1687
+ 1000066013: GL_COMPRESSED_RGBA_ASTC_12x12_KHR
881
1688
  };
882
1689
  function mapVkFormatToWebGL(vkFormat) {
883
1690
  return VULKAN_TO_WEBGL_FORMAT_MAP[vkFormat];
@@ -922,6 +1729,11 @@ var __exports__ = (() => {
922
1729
  const width = ktx.pixelWidth;
923
1730
  const height = ktx.pixelHeight;
924
1731
  const internalFormat = mapVkFormatToWebGL(ktx.vkFormat);
1732
+ if (internalFormat === void 0) {
1733
+ log.warn(
1734
+ `KTX2 container vkFormat ${ktx.vkFormat} does not map to a known WebGL format; returning texture levels without format metadata.`
1735
+ )();
1736
+ }
925
1737
  return extractMipmapImages(ktx.levels, {
926
1738
  mipMapLevels,
927
1739
  width,
@@ -932,49 +1744,113 @@ var __exports__ = (() => {
932
1744
  }
933
1745
 
934
1746
  // src/lib/parsers/parse-basis.ts
935
- var OutputFormat = {
1747
+ var BASIS_FORMAT_TO_OUTPUT_OPTIONS = {
936
1748
  etc1: {
937
1749
  basisFormat: 0,
938
1750
  compressed: true,
939
- format: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGB_ETC1_WEBGL
1751
+ format: GL_COMPRESSED_RGB_ETC1_WEBGL,
1752
+ textureFormat: "etc1-rbg-unorm-webgl"
1753
+ },
1754
+ etc2: {
1755
+ basisFormat: 1,
1756
+ compressed: true,
1757
+ format: GL_COMPRESSED_RGBA8_ETC2_EAC,
1758
+ textureFormat: "etc2-rgba8unorm"
940
1759
  },
941
- etc2: { basisFormat: 1, compressed: true },
942
1760
  bc1: {
943
1761
  basisFormat: 2,
944
1762
  compressed: true,
945
- format: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGB_S3TC_DXT1_EXT
1763
+ format: GL_COMPRESSED_RGB_S3TC_DXT1_EXT,
1764
+ textureFormat: "bc1-rgb-unorm-webgl"
946
1765
  },
947
1766
  bc3: {
948
1767
  basisFormat: 3,
949
1768
  compressed: true,
950
- format: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_S3TC_DXT5_EXT
1769
+ format: GL_COMPRESSED_RGBA_S3TC_DXT5_EXT,
1770
+ textureFormat: "bc3-rgba-unorm"
1771
+ },
1772
+ bc4: {
1773
+ basisFormat: 4,
1774
+ compressed: true,
1775
+ format: GL_COMPRESSED_RED_RGTC1_EXT,
1776
+ textureFormat: "bc4-r-unorm"
1777
+ },
1778
+ bc5: {
1779
+ basisFormat: 5,
1780
+ compressed: true,
1781
+ format: GL_COMPRESSED_RED_GREEN_RGTC2_EXT,
1782
+ textureFormat: "bc5-rg-unorm"
1783
+ },
1784
+ "bc7-m6-opaque-only": {
1785
+ basisFormat: 6,
1786
+ compressed: true,
1787
+ format: GL_COMPRESSED_RGBA_BPTC_UNORM_EXT,
1788
+ textureFormat: "bc7-rgba-unorm"
1789
+ },
1790
+ "bc7-m5": {
1791
+ basisFormat: 7,
1792
+ compressed: true,
1793
+ format: GL_COMPRESSED_RGBA_BPTC_UNORM_EXT,
1794
+ textureFormat: "bc7-rgba-unorm"
951
1795
  },
952
- bc4: { basisFormat: 4, compressed: true },
953
- bc5: { basisFormat: 5, compressed: true },
954
- "bc7-m6-opaque-only": { basisFormat: 6, compressed: true },
955
- "bc7-m5": { basisFormat: 7, compressed: true },
956
1796
  "pvrtc1-4-rgb": {
957
1797
  basisFormat: 8,
958
1798
  compressed: true,
959
- format: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGB_PVRTC_4BPPV1_IMG
1799
+ format: GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG,
1800
+ textureFormat: "pvrtc-rgb4unorm-webgl"
960
1801
  },
961
1802
  "pvrtc1-4-rgba": {
962
1803
  basisFormat: 9,
963
1804
  compressed: true,
964
- format: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG
1805
+ format: GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,
1806
+ textureFormat: "pvrtc-rgba4unorm-webgl"
965
1807
  },
966
1808
  "astc-4x4": {
967
1809
  basisFormat: 10,
968
1810
  compressed: true,
969
- format: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_4X4_KHR
1811
+ format: GL_COMPRESSED_RGBA_ASTC_4x4_KHR,
1812
+ textureFormat: "astc-4x4-unorm"
1813
+ },
1814
+ "atc-rgb": {
1815
+ basisFormat: 11,
1816
+ compressed: true,
1817
+ format: GL_COMPRESSED_RGB_ATC_WEBGL,
1818
+ textureFormat: "atc-rgb-unorm-webgl"
1819
+ },
1820
+ "atc-rgba-interpolated-alpha": {
1821
+ basisFormat: 12,
1822
+ compressed: true,
1823
+ format: GL_COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL,
1824
+ textureFormat: "atc-rgbai-unorm-webgl"
1825
+ },
1826
+ rgba32: {
1827
+ basisFormat: 13,
1828
+ compressed: false,
1829
+ format: GL_RGBA8,
1830
+ textureFormat: "rgba8unorm"
1831
+ },
1832
+ rgb565: {
1833
+ basisFormat: 14,
1834
+ compressed: false,
1835
+ format: GL_RGB565,
1836
+ textureFormat: "rgb565unorm-webgl"
1837
+ },
1838
+ bgr565: {
1839
+ basisFormat: 15,
1840
+ compressed: false,
1841
+ format: GL_RGB565,
1842
+ textureFormat: "rgb565unorm-webgl"
970
1843
  },
971
- "atc-rgb": { basisFormat: 11, compressed: true },
972
- "atc-rgba-interpolated-alpha": { basisFormat: 12, compressed: true },
973
- rgba32: { basisFormat: 13, compressed: false },
974
- rgb565: { basisFormat: 14, compressed: false },
975
- bgr565: { basisFormat: 15, compressed: false },
976
- rgba4444: { basisFormat: 16, compressed: false }
1844
+ rgba4444: {
1845
+ basisFormat: 16,
1846
+ compressed: false,
1847
+ format: GL_RGBA4,
1848
+ textureFormat: "rgba4unorm-webgl"
1849
+ }
977
1850
  };
1851
+ var BASIS_FORMATS = Object.freeze(
1852
+ Object.keys(BASIS_FORMAT_TO_OUTPUT_OPTIONS)
1853
+ );
978
1854
  async function parseBasis(data, options = {}) {
979
1855
  if (!options.basis?.containerFormat || options.basis.containerFormat === "auto") {
980
1856
  if (isKTX(data)) {
@@ -1028,7 +1904,7 @@ var __exports__ = (() => {
1028
1904
  const hasAlpha = basisFile.getHasAlpha(
1029
1905
  /* imageIndex, levelIndex */
1030
1906
  );
1031
- const { compressed, format, basisFormat } = getBasisOptions(options, hasAlpha);
1907
+ const { compressed, format, basisFormat, textureFormat } = getBasisOptions(options, hasAlpha);
1032
1908
  const decodedSize = basisFile.getImageTranscodedSizeInBytes(imageIndex, levelIndex, basisFormat);
1033
1909
  const decodedData = new Uint8Array(decodedSize);
1034
1910
  if (!basisFile.transcodeImage(decodedData, imageIndex, levelIndex, basisFormat, 0, 0)) {
@@ -1036,11 +1912,13 @@ var __exports__ = (() => {
1036
1912
  }
1037
1913
  return {
1038
1914
  // standard loaders.gl image category payload
1915
+ shape: "texture-level",
1039
1916
  width,
1040
1917
  height,
1041
1918
  data: decodedData,
1042
1919
  compressed,
1043
- format,
1920
+ ...format !== void 0 ? { format } : {},
1921
+ ...textureFormat !== void 0 ? { textureFormat } : {},
1044
1922
  // Additional fields
1045
1923
  // Add levelSize field.
1046
1924
  hasAlpha
@@ -1065,7 +1943,7 @@ var __exports__ = (() => {
1065
1943
  }
1066
1944
  function transcodeKTX2Image(ktx2File, levelIndex, options) {
1067
1945
  const { alphaFlag, height, width } = ktx2File.getImageLevelInfo(levelIndex, 0, 0);
1068
- const { compressed, format, basisFormat } = getBasisOptions(options, alphaFlag);
1946
+ const { compressed, format, basisFormat, textureFormat } = getBasisOptions(options, alphaFlag);
1069
1947
  const decodedSize = ktx2File.getImageTranscodedSizeInBytes(
1070
1948
  levelIndex,
1071
1949
  0,
@@ -1088,48 +1966,98 @@ var __exports__ = (() => {
1088
1966
  }
1089
1967
  return {
1090
1968
  // standard loaders.gl image category payload
1969
+ shape: "texture-level",
1091
1970
  width,
1092
1971
  height,
1093
1972
  data: decodedData,
1094
1973
  compressed,
1974
+ ...format !== void 0 ? { format } : {},
1975
+ ...textureFormat !== void 0 ? { textureFormat } : {},
1095
1976
  // Additional fields
1096
1977
  levelSize: decodedSize,
1097
- hasAlpha: alphaFlag,
1098
- format
1978
+ hasAlpha: alphaFlag
1099
1979
  };
1100
1980
  }
1101
1981
  function getBasisOptions(options, hasAlpha) {
1102
- let format = options.basis?.format;
1982
+ let format = options.basis?.format || "auto";
1103
1983
  if (format === "auto") {
1104
- format = selectSupportedBasisFormat();
1984
+ format = options.basis?.supportedTextureFormats ? selectSupportedBasisFormat(options.basis.supportedTextureFormats) : selectSupportedBasisFormat();
1105
1985
  }
1106
1986
  if (typeof format === "object") {
1107
1987
  format = hasAlpha ? format.alpha : format.noAlpha;
1108
1988
  }
1109
- format = format.toLowerCase();
1110
- return OutputFormat[format];
1989
+ const normalizedFormat = format.toLowerCase();
1990
+ const basisOutputOptions = BASIS_FORMAT_TO_OUTPUT_OPTIONS[normalizedFormat];
1991
+ if (!basisOutputOptions) {
1992
+ throw new Error(`Unknown Basis format ${format}`);
1993
+ }
1994
+ return basisOutputOptions;
1111
1995
  }
1112
- function selectSupportedBasisFormat() {
1113
- const supportedFormats = getSupportedGPUTextureFormats();
1114
- if (supportedFormats.has("astc")) {
1996
+ function selectSupportedBasisFormat(supportedTextureFormats = detectSupportedTextureFormats()) {
1997
+ const textureFormats2 = new Set(supportedTextureFormats);
1998
+ if (hasSupportedTextureFormat(textureFormats2, ["astc-4x4-unorm", "astc-4x4-unorm-srgb"])) {
1115
1999
  return "astc-4x4";
1116
- } else if (supportedFormats.has("dxt")) {
2000
+ } else if (hasSupportedTextureFormat(textureFormats2, ["bc7-rgba-unorm", "bc7-rgba-unorm-srgb"])) {
2001
+ return {
2002
+ alpha: "bc7-m5",
2003
+ noAlpha: "bc7-m6-opaque-only"
2004
+ };
2005
+ } else if (hasSupportedTextureFormat(textureFormats2, [
2006
+ "bc1-rgb-unorm-webgl",
2007
+ "bc1-rgb-unorm-srgb-webgl",
2008
+ "bc1-rgba-unorm",
2009
+ "bc1-rgba-unorm-srgb",
2010
+ "bc2-rgba-unorm",
2011
+ "bc2-rgba-unorm-srgb",
2012
+ "bc3-rgba-unorm",
2013
+ "bc3-rgba-unorm-srgb"
2014
+ ])) {
1117
2015
  return {
1118
2016
  alpha: "bc3",
1119
2017
  noAlpha: "bc1"
1120
2018
  };
1121
- } else if (supportedFormats.has("pvrtc")) {
2019
+ } else if (hasSupportedTextureFormat(textureFormats2, [
2020
+ "pvrtc-rgb4unorm-webgl",
2021
+ "pvrtc-rgba4unorm-webgl",
2022
+ "pvrtc-rbg2unorm-webgl",
2023
+ "pvrtc-rgba2unorm-webgl"
2024
+ ])) {
1122
2025
  return {
1123
2026
  alpha: "pvrtc1-4-rgba",
1124
2027
  noAlpha: "pvrtc1-4-rgb"
1125
2028
  };
1126
- } else if (supportedFormats.has("etc1")) {
1127
- return "etc1";
1128
- } else if (supportedFormats.has("etc2")) {
2029
+ } else if (hasSupportedTextureFormat(textureFormats2, [
2030
+ "etc2-rgb8unorm",
2031
+ "etc2-rgb8unorm-srgb",
2032
+ "etc2-rgb8a1unorm",
2033
+ "etc2-rgb8a1unorm-srgb",
2034
+ "etc2-rgba8unorm",
2035
+ "etc2-rgba8unorm-srgb",
2036
+ "eac-r11unorm",
2037
+ "eac-r11snorm",
2038
+ "eac-rg11unorm",
2039
+ "eac-rg11snorm"
2040
+ ])) {
1129
2041
  return "etc2";
2042
+ } else if (textureFormats2.has("etc1-rbg-unorm-webgl")) {
2043
+ return "etc1";
2044
+ } else if (hasSupportedTextureFormat(textureFormats2, [
2045
+ "atc-rgb-unorm-webgl",
2046
+ "atc-rgba-unorm-webgl",
2047
+ "atc-rgbai-unorm-webgl"
2048
+ ])) {
2049
+ return {
2050
+ alpha: "atc-rgba-interpolated-alpha",
2051
+ noAlpha: "atc-rgb"
2052
+ };
1130
2053
  }
1131
2054
  return "rgb565";
1132
2055
  }
2056
+ function hasSupportedTextureFormat(supportedTextureFormats, candidateTextureFormats) {
2057
+ return candidateTextureFormats.some(
2058
+ (textureFormat) => supportedTextureFormats.has(textureFormat)
2059
+ );
2060
+ }
1133
2061
 
1134
2062
  // src/basis-loader.ts
1135
2063
  var BasisWorkerLoader = {
@@ -1174,12 +2102,12 @@ var __exports__ = (() => {
1174
2102
  DDPF_FOURCC: 4
1175
2103
  };
1176
2104
  var DDS_PIXEL_FORMATS = {
1177
- DXT1: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGB_S3TC_DXT1_EXT,
1178
- DXT3: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_S3TC_DXT3_EXT,
1179
- DXT5: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_S3TC_DXT5_EXT,
1180
- "ATC ": GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGB_ATC_WEBGL,
1181
- ATCA: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL,
1182
- ATCI: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL
2105
+ DXT1: GL_COMPRESSED_RGB_S3TC_DXT1_EXT,
2106
+ DXT3: GL_COMPRESSED_RGBA_S3TC_DXT3_EXT,
2107
+ DXT5: GL_COMPRESSED_RGBA_S3TC_DXT5_EXT,
2108
+ "ATC ": GL_COMPRESSED_RGB_ATC_WEBGL,
2109
+ ATCA: GL_COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL,
2110
+ ATCI: GL_COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL
1183
2111
  };
1184
2112
  var getATCLevelSize = getDxt1LevelSize;
1185
2113
  var getATCALevelSize = getDxtXLevelSize;
@@ -1254,75 +2182,33 @@ var __exports__ = (() => {
1254
2182
  METADATA_SIZE_INDEX: 12
1255
2183
  };
1256
2184
  var PVR_PIXEL_FORMATS = {
1257
- 0: [GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGB_PVRTC_2BPPV1_IMG],
1258
- 1: [GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG],
1259
- 2: [GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGB_PVRTC_4BPPV1_IMG],
1260
- 3: [GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG],
1261
- 6: [GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGB_ETC1_WEBGL],
1262
- 7: [GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGB_S3TC_DXT1_EXT],
1263
- 9: [GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_S3TC_DXT3_EXT],
1264
- 11: [GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_S3TC_DXT5_EXT],
1265
- 22: [GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGB8_ETC2],
1266
- 23: [GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA8_ETC2_EAC],
1267
- 24: [GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2],
1268
- 25: [GL_EXTENSIONS_CONSTANTS.COMPRESSED_R11_EAC],
1269
- 26: [GL_EXTENSIONS_CONSTANTS.COMPRESSED_RG11_EAC],
1270
- 27: [
1271
- GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_4X4_KHR,
1272
- GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR
1273
- ],
1274
- 28: [
1275
- GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_5X4_KHR,
1276
- GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR
1277
- ],
1278
- 29: [
1279
- GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_5X5_KHR,
1280
- GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR
1281
- ],
1282
- 30: [
1283
- GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_6X5_KHR,
1284
- GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR
1285
- ],
1286
- 31: [
1287
- GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_6X6_KHR,
1288
- GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR
1289
- ],
1290
- 32: [
1291
- GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_8X5_KHR,
1292
- GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR
1293
- ],
1294
- 33: [
1295
- GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_8X6_KHR,
1296
- GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR
1297
- ],
1298
- 34: [
1299
- GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_8X8_KHR,
1300
- GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR
1301
- ],
1302
- 35: [
1303
- GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_10X5_KHR,
1304
- GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR
1305
- ],
1306
- 36: [
1307
- GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_10X6_KHR,
1308
- GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR
1309
- ],
1310
- 37: [
1311
- GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_10X8_KHR,
1312
- GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR
1313
- ],
1314
- 38: [
1315
- GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_10X10_KHR,
1316
- GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR
1317
- ],
1318
- 39: [
1319
- GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_12X10_KHR,
1320
- GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR
1321
- ],
1322
- 40: [
1323
- GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_12X12_KHR,
1324
- GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR
1325
- ]
2185
+ 0: [GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG],
2186
+ 1: [GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG],
2187
+ 2: [GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG],
2188
+ 3: [GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG],
2189
+ 6: [GL_COMPRESSED_RGB_ETC1_WEBGL],
2190
+ 7: [GL_COMPRESSED_RGB_S3TC_DXT1_EXT],
2191
+ 9: [GL_COMPRESSED_RGBA_S3TC_DXT3_EXT],
2192
+ 11: [GL_COMPRESSED_RGBA_S3TC_DXT5_EXT],
2193
+ 22: [GL_COMPRESSED_RGB8_ETC2],
2194
+ 23: [GL_COMPRESSED_RGBA8_ETC2_EAC],
2195
+ 24: [GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2],
2196
+ 25: [GL_COMPRESSED_R11_EAC],
2197
+ 26: [GL_COMPRESSED_RG11_EAC],
2198
+ 27: [GL_COMPRESSED_RGBA_ASTC_4x4_KHR, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR],
2199
+ 28: [GL_COMPRESSED_RGBA_ASTC_5x4_KHR, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR],
2200
+ 29: [GL_COMPRESSED_RGBA_ASTC_5x5_KHR, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR],
2201
+ 30: [GL_COMPRESSED_RGBA_ASTC_6x5_KHR, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR],
2202
+ 31: [GL_COMPRESSED_RGBA_ASTC_6x6_KHR, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR],
2203
+ 32: [GL_COMPRESSED_RGBA_ASTC_8x5_KHR, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR],
2204
+ 33: [GL_COMPRESSED_RGBA_ASTC_8x6_KHR, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR],
2205
+ 34: [GL_COMPRESSED_RGBA_ASTC_8x8_KHR, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR],
2206
+ 35: [GL_COMPRESSED_RGBA_ASTC_10x5_KHR, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR],
2207
+ 36: [GL_COMPRESSED_RGBA_ASTC_10x6_KHR, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR],
2208
+ 37: [GL_COMPRESSED_RGBA_ASTC_10x8_KHR, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR],
2209
+ 38: [GL_COMPRESSED_RGBA_ASTC_10x10_KHR, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR],
2210
+ 39: [GL_COMPRESSED_RGBA_ASTC_12x10_KHR, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR],
2211
+ 40: [GL_COMPRESSED_RGBA_ASTC_12x12_KHR, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR]
1326
2212
  };
1327
2213
  var PVR_SIZE_FUNCTIONS = {
1328
2214
  0: pvrtc2bppSize,
@@ -1355,8 +2241,8 @@ var __exports__ = (() => {
1355
2241
  };
1356
2242
  function isPVR(data) {
1357
2243
  const header = new Uint32Array(data, 0, PVR_CONSTANTS.HEADER_LENGTH);
1358
- const version = header[PVR_CONSTANTS.MAGIC_NUMBER_INDEX];
1359
- return version === PVR_CONSTANTS.MAGIC_NUMBER || version === PVR_CONSTANTS.MAGIC_NUMBER_EXTRA;
2244
+ const version2 = header[PVR_CONSTANTS.MAGIC_NUMBER_INDEX];
2245
+ return version2 === PVR_CONSTANTS.MAGIC_NUMBER || version2 === PVR_CONSTANTS.MAGIC_NUMBER_EXTRA;
1360
2246
  }
1361
2247
  function parsePVR(data) {
1362
2248
  const header = new Uint32Array(data, 0, PVR_CONSTANTS.HEADER_LENGTH);
@@ -1624,7 +2510,7 @@ var __exports__ = (() => {
1624
2510
  "--output",
1625
2511
  outputUrl
1626
2512
  ];
1627
- const childProcess = new import_child_process_proxy.default();
2513
+ const childProcess = new ChildProcessProxy();
1628
2514
  await childProcess.start({
1629
2515
  command: "npx",
1630
2516
  arguments: args,
@@ -1709,7 +2595,7 @@ var __exports__ = (() => {
1709
2595
  };
1710
2596
 
1711
2597
  // ../images/src/lib/utils/version.ts
1712
- var VERSION3 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
2598
+ var VERSION5 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
1713
2599
 
1714
2600
  // ../images/src/lib/category-api/image-type.ts
1715
2601
  var parseImageNode = globalThis.loaders?.parseImageNode;
@@ -2114,7 +3000,7 @@ var __exports__ = (() => {
2114
3000
  id: "image",
2115
3001
  module: "images",
2116
3002
  name: "Images",
2117
- version: VERSION3,
3003
+ version: VERSION5,
2118
3004
  mimeTypes: MIME_TYPES,
2119
3005
  extensions: EXTENSIONS,
2120
3006
  parse: parseImage,