babylonjs-ktx2decoder 5.43.2 → 5.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -12,6 +12,56 @@ return /******/ (() => { // webpackBootstrap
|
|
|
12
12
|
/******/ "use strict";
|
|
13
13
|
/******/ var __webpack_modules__ = ({
|
|
14
14
|
|
|
15
|
+
/***/ "../../../dev/core/dist/Materials/Textures/ktx2decoderTypes.js":
|
|
16
|
+
/*!*********************************************************************!*\
|
|
17
|
+
!*** ../../../dev/core/dist/Materials/Textures/ktx2decoderTypes.js ***!
|
|
18
|
+
\*********************************************************************/
|
|
19
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
20
|
+
|
|
21
|
+
__webpack_require__.r(__webpack_exports__);
|
|
22
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
23
|
+
/* harmony export */ "EngineFormat": () => (/* binding */ EngineFormat),
|
|
24
|
+
/* harmony export */ "SourceTextureFormat": () => (/* binding */ SourceTextureFormat),
|
|
25
|
+
/* harmony export */ "TranscodeTarget": () => (/* binding */ TranscodeTarget)
|
|
26
|
+
/* harmony export */ });
|
|
27
|
+
var SourceTextureFormat;
|
|
28
|
+
(function (SourceTextureFormat) {
|
|
29
|
+
SourceTextureFormat[SourceTextureFormat["ETC1S"] = 0] = "ETC1S";
|
|
30
|
+
SourceTextureFormat[SourceTextureFormat["UASTC4x4"] = 1] = "UASTC4x4";
|
|
31
|
+
})(SourceTextureFormat || (SourceTextureFormat = {}));
|
|
32
|
+
var TranscodeTarget;
|
|
33
|
+
(function (TranscodeTarget) {
|
|
34
|
+
TranscodeTarget[TranscodeTarget["ASTC_4X4_RGBA"] = 0] = "ASTC_4X4_RGBA";
|
|
35
|
+
TranscodeTarget[TranscodeTarget["BC7_RGBA"] = 1] = "BC7_RGBA";
|
|
36
|
+
TranscodeTarget[TranscodeTarget["BC3_RGBA"] = 2] = "BC3_RGBA";
|
|
37
|
+
TranscodeTarget[TranscodeTarget["BC1_RGB"] = 3] = "BC1_RGB";
|
|
38
|
+
TranscodeTarget[TranscodeTarget["PVRTC1_4_RGBA"] = 4] = "PVRTC1_4_RGBA";
|
|
39
|
+
TranscodeTarget[TranscodeTarget["PVRTC1_4_RGB"] = 5] = "PVRTC1_4_RGB";
|
|
40
|
+
TranscodeTarget[TranscodeTarget["ETC2_RGBA"] = 6] = "ETC2_RGBA";
|
|
41
|
+
TranscodeTarget[TranscodeTarget["ETC1_RGB"] = 7] = "ETC1_RGB";
|
|
42
|
+
TranscodeTarget[TranscodeTarget["RGBA32"] = 8] = "RGBA32";
|
|
43
|
+
TranscodeTarget[TranscodeTarget["R8"] = 9] = "R8";
|
|
44
|
+
TranscodeTarget[TranscodeTarget["RG8"] = 10] = "RG8";
|
|
45
|
+
})(TranscodeTarget || (TranscodeTarget = {}));
|
|
46
|
+
var EngineFormat;
|
|
47
|
+
(function (EngineFormat) {
|
|
48
|
+
EngineFormat[EngineFormat["COMPRESSED_RGBA_BPTC_UNORM_EXT"] = 36492] = "COMPRESSED_RGBA_BPTC_UNORM_EXT";
|
|
49
|
+
EngineFormat[EngineFormat["COMPRESSED_RGBA_ASTC_4X4_KHR"] = 37808] = "COMPRESSED_RGBA_ASTC_4X4_KHR";
|
|
50
|
+
EngineFormat[EngineFormat["COMPRESSED_RGB_S3TC_DXT1_EXT"] = 33776] = "COMPRESSED_RGB_S3TC_DXT1_EXT";
|
|
51
|
+
EngineFormat[EngineFormat["COMPRESSED_RGBA_S3TC_DXT5_EXT"] = 33779] = "COMPRESSED_RGBA_S3TC_DXT5_EXT";
|
|
52
|
+
EngineFormat[EngineFormat["COMPRESSED_RGBA_PVRTC_4BPPV1_IMG"] = 35842] = "COMPRESSED_RGBA_PVRTC_4BPPV1_IMG";
|
|
53
|
+
EngineFormat[EngineFormat["COMPRESSED_RGB_PVRTC_4BPPV1_IMG"] = 35840] = "COMPRESSED_RGB_PVRTC_4BPPV1_IMG";
|
|
54
|
+
EngineFormat[EngineFormat["COMPRESSED_RGBA8_ETC2_EAC"] = 37496] = "COMPRESSED_RGBA8_ETC2_EAC";
|
|
55
|
+
EngineFormat[EngineFormat["COMPRESSED_RGB8_ETC2"] = 37492] = "COMPRESSED_RGB8_ETC2";
|
|
56
|
+
EngineFormat[EngineFormat["COMPRESSED_RGB_ETC1_WEBGL"] = 36196] = "COMPRESSED_RGB_ETC1_WEBGL";
|
|
57
|
+
EngineFormat[EngineFormat["RGBA8Format"] = 32856] = "RGBA8Format";
|
|
58
|
+
EngineFormat[EngineFormat["R8Format"] = 33321] = "R8Format";
|
|
59
|
+
EngineFormat[EngineFormat["RG8Format"] = 33323] = "RG8Format";
|
|
60
|
+
})(EngineFormat || (EngineFormat = {}));
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
/***/ }),
|
|
64
|
+
|
|
15
65
|
/***/ "../../../tools/ktx2Decoder/dist/Misc/dataReader.js":
|
|
16
66
|
/*!**********************************************************!*\
|
|
17
67
|
!*** ../../../tools/ktx2Decoder/dist/Misc/dataReader.js ***!
|
|
@@ -271,7 +321,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
271
321
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
272
322
|
/* harmony export */ "LiteTranscoder_UASTC_ASTC": () => (/* binding */ LiteTranscoder_UASTC_ASTC)
|
|
273
323
|
/* harmony export */ });
|
|
274
|
-
/* harmony import */ var
|
|
324
|
+
/* harmony import */ var core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core/Materials/Textures/ktx2decoderTypes */ "../../../dev/core/dist/Materials/Textures/ktx2decoderTypes.js");
|
|
275
325
|
/* harmony import */ var _liteTranscoder__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./liteTranscoder */ "../../../tools/ktx2Decoder/dist/Transcoders/liteTranscoder.js");
|
|
276
326
|
|
|
277
327
|
|
|
@@ -282,7 +332,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
282
332
|
class LiteTranscoder_UASTC_ASTC extends _liteTranscoder__WEBPACK_IMPORTED_MODULE_1__.LiteTranscoder {
|
|
283
333
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
284
334
|
static CanTranscode(src, dst, isInGammaSpace) {
|
|
285
|
-
return src ===
|
|
335
|
+
return src === core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.SourceTextureFormat.UASTC4x4 && dst === core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.TranscodeTarget.ASTC_4X4_RGBA;
|
|
286
336
|
}
|
|
287
337
|
getName() {
|
|
288
338
|
return LiteTranscoder_UASTC_ASTC.Name;
|
|
@@ -311,7 +361,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
311
361
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
312
362
|
/* harmony export */ "LiteTranscoder_UASTC_BC7": () => (/* binding */ LiteTranscoder_UASTC_BC7)
|
|
313
363
|
/* harmony export */ });
|
|
314
|
-
/* harmony import */ var
|
|
364
|
+
/* harmony import */ var core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core/Materials/Textures/ktx2decoderTypes */ "../../../dev/core/dist/Materials/Textures/ktx2decoderTypes.js");
|
|
315
365
|
/* harmony import */ var _liteTranscoder__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./liteTranscoder */ "../../../tools/ktx2Decoder/dist/Transcoders/liteTranscoder.js");
|
|
316
366
|
|
|
317
367
|
|
|
@@ -322,7 +372,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
322
372
|
class LiteTranscoder_UASTC_BC7 extends _liteTranscoder__WEBPACK_IMPORTED_MODULE_1__.LiteTranscoder {
|
|
323
373
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
324
374
|
static CanTranscode(src, dst, isInGammaSpace) {
|
|
325
|
-
return src ===
|
|
375
|
+
return src === core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.SourceTextureFormat.UASTC4x4 && dst === core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.TranscodeTarget.BC7_RGBA;
|
|
326
376
|
}
|
|
327
377
|
getName() {
|
|
328
378
|
return LiteTranscoder_UASTC_BC7.Name;
|
|
@@ -351,7 +401,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
351
401
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
352
402
|
/* harmony export */ "LiteTranscoder_UASTC_R8_UNORM": () => (/* binding */ LiteTranscoder_UASTC_R8_UNORM)
|
|
353
403
|
/* harmony export */ });
|
|
354
|
-
/* harmony import */ var
|
|
404
|
+
/* harmony import */ var core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core/Materials/Textures/ktx2decoderTypes */ "../../../dev/core/dist/Materials/Textures/ktx2decoderTypes.js");
|
|
355
405
|
/* harmony import */ var _liteTranscoder__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./liteTranscoder */ "../../../tools/ktx2Decoder/dist/Transcoders/liteTranscoder.js");
|
|
356
406
|
|
|
357
407
|
|
|
@@ -361,7 +411,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
361
411
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
362
412
|
class LiteTranscoder_UASTC_R8_UNORM extends _liteTranscoder__WEBPACK_IMPORTED_MODULE_1__.LiteTranscoder {
|
|
363
413
|
static CanTranscode(src, dst, isInGammaSpace) {
|
|
364
|
-
return src ===
|
|
414
|
+
return src === core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.SourceTextureFormat.UASTC4x4 && dst === core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.TranscodeTarget.R8;
|
|
365
415
|
}
|
|
366
416
|
getName() {
|
|
367
417
|
return LiteTranscoder_UASTC_R8_UNORM.Name;
|
|
@@ -398,7 +448,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
398
448
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
399
449
|
/* harmony export */ "LiteTranscoder_UASTC_RG8_UNORM": () => (/* binding */ LiteTranscoder_UASTC_RG8_UNORM)
|
|
400
450
|
/* harmony export */ });
|
|
401
|
-
/* harmony import */ var
|
|
451
|
+
/* harmony import */ var core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core/Materials/Textures/ktx2decoderTypes */ "../../../dev/core/dist/Materials/Textures/ktx2decoderTypes.js");
|
|
402
452
|
/* harmony import */ var _liteTranscoder__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./liteTranscoder */ "../../../tools/ktx2Decoder/dist/Transcoders/liteTranscoder.js");
|
|
403
453
|
|
|
404
454
|
|
|
@@ -408,7 +458,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
408
458
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
409
459
|
class LiteTranscoder_UASTC_RG8_UNORM extends _liteTranscoder__WEBPACK_IMPORTED_MODULE_1__.LiteTranscoder {
|
|
410
460
|
static CanTranscode(src, dst, isInGammaSpace) {
|
|
411
|
-
return src ===
|
|
461
|
+
return src === core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.SourceTextureFormat.UASTC4x4 && dst === core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.TranscodeTarget.RG8;
|
|
412
462
|
}
|
|
413
463
|
getName() {
|
|
414
464
|
return LiteTranscoder_UASTC_RG8_UNORM.Name;
|
|
@@ -445,7 +495,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
445
495
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
446
496
|
/* harmony export */ "LiteTranscoder_UASTC_RGBA_SRGB": () => (/* binding */ LiteTranscoder_UASTC_RGBA_SRGB)
|
|
447
497
|
/* harmony export */ });
|
|
448
|
-
/* harmony import */ var
|
|
498
|
+
/* harmony import */ var core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core/Materials/Textures/ktx2decoderTypes */ "../../../dev/core/dist/Materials/Textures/ktx2decoderTypes.js");
|
|
449
499
|
/* harmony import */ var _liteTranscoder__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./liteTranscoder */ "../../../tools/ktx2Decoder/dist/Transcoders/liteTranscoder.js");
|
|
450
500
|
|
|
451
501
|
|
|
@@ -455,7 +505,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
455
505
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
456
506
|
class LiteTranscoder_UASTC_RGBA_SRGB extends _liteTranscoder__WEBPACK_IMPORTED_MODULE_1__.LiteTranscoder {
|
|
457
507
|
static CanTranscode(src, dst, isInGammaSpace) {
|
|
458
|
-
return src ===
|
|
508
|
+
return src === core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.SourceTextureFormat.UASTC4x4 && dst === core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.TranscodeTarget.RGBA32 && isInGammaSpace;
|
|
459
509
|
}
|
|
460
510
|
getName() {
|
|
461
511
|
return LiteTranscoder_UASTC_RGBA_SRGB.Name;
|
|
@@ -492,7 +542,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
492
542
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
493
543
|
/* harmony export */ "LiteTranscoder_UASTC_RGBA_UNORM": () => (/* binding */ LiteTranscoder_UASTC_RGBA_UNORM)
|
|
494
544
|
/* harmony export */ });
|
|
495
|
-
/* harmony import */ var
|
|
545
|
+
/* harmony import */ var core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core/Materials/Textures/ktx2decoderTypes */ "../../../dev/core/dist/Materials/Textures/ktx2decoderTypes.js");
|
|
496
546
|
/* harmony import */ var _liteTranscoder__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./liteTranscoder */ "../../../tools/ktx2Decoder/dist/Transcoders/liteTranscoder.js");
|
|
497
547
|
|
|
498
548
|
|
|
@@ -502,7 +552,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
502
552
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
503
553
|
class LiteTranscoder_UASTC_RGBA_UNORM extends _liteTranscoder__WEBPACK_IMPORTED_MODULE_1__.LiteTranscoder {
|
|
504
554
|
static CanTranscode(src, dst, isInGammaSpace) {
|
|
505
|
-
return src ===
|
|
555
|
+
return src === core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.SourceTextureFormat.UASTC4x4 && dst === core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.TranscodeTarget.RGBA32 && !isInGammaSpace;
|
|
506
556
|
}
|
|
507
557
|
getName() {
|
|
508
558
|
return LiteTranscoder_UASTC_RGBA_UNORM.Name;
|
|
@@ -539,14 +589,16 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
539
589
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
540
590
|
/* harmony export */ "MSCTranscoder": () => (/* binding */ MSCTranscoder)
|
|
541
591
|
/* harmony export */ });
|
|
542
|
-
/* harmony import */ var
|
|
543
|
-
/* harmony import */ var
|
|
592
|
+
/* harmony import */ var core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core/Materials/Textures/ktx2decoderTypes */ "../../../dev/core/dist/Materials/Textures/ktx2decoderTypes.js");
|
|
593
|
+
/* harmony import */ var _transcoder__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../transcoder */ "../../../tools/ktx2Decoder/dist/transcoder.js");
|
|
594
|
+
/* harmony import */ var _wasmMemoryManager__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../wasmMemoryManager */ "../../../tools/ktx2Decoder/dist/wasmMemoryManager.js");
|
|
595
|
+
|
|
544
596
|
|
|
545
597
|
|
|
546
598
|
/**
|
|
547
599
|
* @internal
|
|
548
600
|
*/
|
|
549
|
-
class MSCTranscoder extends
|
|
601
|
+
class MSCTranscoder extends _transcoder__WEBPACK_IMPORTED_MODULE_1__.Transcoder {
|
|
550
602
|
getName() {
|
|
551
603
|
return MSCTranscoder.Name;
|
|
552
604
|
}
|
|
@@ -554,7 +606,7 @@ class MSCTranscoder extends _transcoder__WEBPACK_IMPORTED_MODULE_0__.Transcoder
|
|
|
554
606
|
if (this._mscBasisTranscoderPromise) {
|
|
555
607
|
return this._mscBasisTranscoderPromise;
|
|
556
608
|
}
|
|
557
|
-
this._mscBasisTranscoderPromise =
|
|
609
|
+
this._mscBasisTranscoderPromise = _wasmMemoryManager__WEBPACK_IMPORTED_MODULE_2__.WASMMemoryManager.LoadWASM(MSCTranscoder.WasmModuleURL).then((wasmBinary) => {
|
|
558
610
|
if (MSCTranscoder.UseFromWorkerThread) {
|
|
559
611
|
importScripts(MSCTranscoder.JSModuleURL);
|
|
560
612
|
}
|
|
@@ -601,14 +653,14 @@ class MSCTranscoder extends _transcoder__WEBPACK_IMPORTED_MODULE_0__.Transcoder
|
|
|
601
653
|
let result;
|
|
602
654
|
let textureData = null;
|
|
603
655
|
try {
|
|
604
|
-
transcoder = src ===
|
|
605
|
-
const texFormat = src ===
|
|
656
|
+
transcoder = src === core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.SourceTextureFormat.UASTC4x4 ? new basisModule.UastcImageTranscoder() : new basisModule.BasisLzEtc1sImageTranscoder();
|
|
657
|
+
const texFormat = src === core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.SourceTextureFormat.UASTC4x4 ? basisModule.TextureFormat.UASTC4x4 : basisModule.TextureFormat.ETC1S;
|
|
606
658
|
imageInfo = new basisModule.ImageInfo(texFormat, width, height, level);
|
|
607
|
-
const targetFormat = basisModule.TranscodeTarget[
|
|
659
|
+
const targetFormat = basisModule.TranscodeTarget[core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.TranscodeTarget[dst]]; // works because the labels of the sourceTextureFormat enum are the same as the property names used in TranscodeTarget!
|
|
608
660
|
if (!basisModule.isFormatSupported(targetFormat, texFormat)) {
|
|
609
|
-
throw new Error(`MSCTranscoder: Transcoding from "${
|
|
661
|
+
throw new Error(`MSCTranscoder: Transcoding from "${core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.SourceTextureFormat[src]}" to "${core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.TranscodeTarget[dst]}" not supported by current transcoder build.`);
|
|
610
662
|
}
|
|
611
|
-
if (src ===
|
|
663
|
+
if (src === core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.SourceTextureFormat.ETC1S) {
|
|
612
664
|
const sgd = ktx2Reader.supercompressionGlobalData;
|
|
613
665
|
transcoder.decodePalettes(sgd.endpointCount, sgd.endpointsData, sgd.selectorCount, sgd.selectorsData);
|
|
614
666
|
transcoder.decodeTables(sgd.tablesData);
|
|
@@ -679,9 +731,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
679
731
|
/* harmony export */ "Transcoder": () => (/* reexport safe */ _transcoder__WEBPACK_IMPORTED_MODULE_2__.Transcoder),
|
|
680
732
|
/* harmony export */ "TranscoderManager": () => (/* reexport safe */ _transcoderManager__WEBPACK_IMPORTED_MODULE_3__.TranscoderManager),
|
|
681
733
|
/* harmony export */ "WASMMemoryManager": () => (/* reexport safe */ _wasmMemoryManager__WEBPACK_IMPORTED_MODULE_4__.WASMMemoryManager),
|
|
682
|
-
/* harmony export */ "ZSTDDecoder": () => (/* reexport safe */ _zstddec__WEBPACK_IMPORTED_MODULE_5__.ZSTDDecoder)
|
|
683
|
-
/* harmony export */ "sourceTextureFormat": () => (/* reexport safe */ _transcoder__WEBPACK_IMPORTED_MODULE_2__.sourceTextureFormat),
|
|
684
|
-
/* harmony export */ "transcodeTarget": () => (/* reexport safe */ _transcoder__WEBPACK_IMPORTED_MODULE_2__.transcodeTarget)
|
|
734
|
+
/* harmony export */ "ZSTDDecoder": () => (/* reexport safe */ _zstddec__WEBPACK_IMPORTED_MODULE_5__.ZSTDDecoder)
|
|
685
735
|
/* harmony export */ });
|
|
686
736
|
/* harmony import */ var _ktx2Decoder__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ktx2Decoder */ "../../../tools/ktx2Decoder/dist/ktx2Decoder.js");
|
|
687
737
|
/* harmony import */ var _ktx2FileReader__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ktx2FileReader */ "../../../tools/ktx2Decoder/dist/ktx2FileReader.js");
|
|
@@ -714,16 +764,16 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
714
764
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
715
765
|
/* harmony export */ "KTX2Decoder": () => (/* binding */ KTX2Decoder)
|
|
716
766
|
/* harmony export */ });
|
|
717
|
-
/* harmony import */ var
|
|
718
|
-
/* harmony import */ var
|
|
719
|
-
/* harmony import */ var
|
|
720
|
-
/* harmony import */ var
|
|
721
|
-
/* harmony import */ var
|
|
722
|
-
/* harmony import */ var
|
|
723
|
-
/* harmony import */ var
|
|
724
|
-
/* harmony import */ var
|
|
725
|
-
/* harmony import */ var
|
|
726
|
-
/* harmony import */ var
|
|
767
|
+
/* harmony import */ var core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core/Materials/Textures/ktx2decoderTypes */ "../../../dev/core/dist/Materials/Textures/ktx2decoderTypes.js");
|
|
768
|
+
/* harmony import */ var _ktx2FileReader__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ktx2FileReader */ "../../../tools/ktx2Decoder/dist/ktx2FileReader.js");
|
|
769
|
+
/* harmony import */ var _transcoderManager__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./transcoderManager */ "../../../tools/ktx2Decoder/dist/transcoderManager.js");
|
|
770
|
+
/* harmony import */ var _Transcoders_liteTranscoder_UASTC_ASTC__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Transcoders/liteTranscoder_UASTC_ASTC */ "../../../tools/ktx2Decoder/dist/Transcoders/liteTranscoder_UASTC_ASTC.js");
|
|
771
|
+
/* harmony import */ var _Transcoders_liteTranscoder_UASTC_BC7__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Transcoders/liteTranscoder_UASTC_BC7 */ "../../../tools/ktx2Decoder/dist/Transcoders/liteTranscoder_UASTC_BC7.js");
|
|
772
|
+
/* harmony import */ var _Transcoders_liteTranscoder_UASTC_RGBA_UNORM__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Transcoders/liteTranscoder_UASTC_RGBA_UNORM */ "../../../tools/ktx2Decoder/dist/Transcoders/liteTranscoder_UASTC_RGBA_UNORM.js");
|
|
773
|
+
/* harmony import */ var _Transcoders_liteTranscoder_UASTC_RGBA_SRGB__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Transcoders/liteTranscoder_UASTC_RGBA_SRGB */ "../../../tools/ktx2Decoder/dist/Transcoders/liteTranscoder_UASTC_RGBA_SRGB.js");
|
|
774
|
+
/* harmony import */ var _Transcoders_liteTranscoder_UASTC_R8_UNORM__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Transcoders/liteTranscoder_UASTC_R8_UNORM */ "../../../tools/ktx2Decoder/dist/Transcoders/liteTranscoder_UASTC_R8_UNORM.js");
|
|
775
|
+
/* harmony import */ var _Transcoders_liteTranscoder_UASTC_RG8_UNORM__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./Transcoders/liteTranscoder_UASTC_RG8_UNORM */ "../../../tools/ktx2Decoder/dist/Transcoders/liteTranscoder_UASTC_RG8_UNORM.js");
|
|
776
|
+
/* harmony import */ var _Transcoders_mscTranscoder__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./Transcoders/mscTranscoder */ "../../../tools/ktx2Decoder/dist/Transcoders/mscTranscoder.js");
|
|
727
777
|
/* harmony import */ var _zstddec__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./zstddec */ "../../../tools/ktx2Decoder/dist/zstddec.js");
|
|
728
778
|
/* harmony import */ var _transcodeDecisionTree__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./transcodeDecisionTree */ "../../../tools/ktx2Decoder/dist/transcodeDecisionTree.js");
|
|
729
779
|
/**
|
|
@@ -756,11 +806,12 @@ const isPowerOfTwo = (value) => {
|
|
|
756
806
|
*/
|
|
757
807
|
class KTX2Decoder {
|
|
758
808
|
constructor() {
|
|
759
|
-
this._transcoderMgr = new
|
|
809
|
+
this._transcoderMgr = new _transcoderManager__WEBPACK_IMPORTED_MODULE_2__.TranscoderManager();
|
|
760
810
|
}
|
|
761
811
|
decode(data, caps, options) {
|
|
812
|
+
const finalOptions = { ...options, ...KTX2Decoder.DefaultDecoderOptions };
|
|
762
813
|
return Promise.resolve().then(() => {
|
|
763
|
-
const kfr = new
|
|
814
|
+
const kfr = new _ktx2FileReader__WEBPACK_IMPORTED_MODULE_1__.KTX2FileReader(data);
|
|
764
815
|
if (!kfr.isValid()) {
|
|
765
816
|
throw new Error("Invalid KT2 file: wrong signature");
|
|
766
817
|
}
|
|
@@ -770,10 +821,10 @@ class KTX2Decoder {
|
|
|
770
821
|
this._zstdDecoder = new _zstddec__WEBPACK_IMPORTED_MODULE_10__.ZSTDDecoder();
|
|
771
822
|
}
|
|
772
823
|
return this._zstdDecoder.init().then(() => {
|
|
773
|
-
return this._decodeData(kfr, caps,
|
|
824
|
+
return this._decodeData(kfr, caps, finalOptions);
|
|
774
825
|
});
|
|
775
826
|
}
|
|
776
|
-
return this._decodeData(kfr, caps,
|
|
827
|
+
return this._decodeData(kfr, caps, finalOptions);
|
|
777
828
|
});
|
|
778
829
|
}
|
|
779
830
|
_decodeData(kfr, caps, options) {
|
|
@@ -781,12 +832,15 @@ class KTX2Decoder {
|
|
|
781
832
|
const height = kfr.header.pixelHeight;
|
|
782
833
|
const srcTexFormat = kfr.textureFormat;
|
|
783
834
|
const decisionTree = new _transcodeDecisionTree__WEBPACK_IMPORTED_MODULE_11__.TranscodeDecisionTree(srcTexFormat, kfr.hasAlpha, isPowerOfTwo(width) && isPowerOfTwo(height), caps, options);
|
|
835
|
+
if (options?.transcodeFormatDecisionTree) {
|
|
836
|
+
decisionTree.parseTree(options?.transcodeFormatDecisionTree);
|
|
837
|
+
}
|
|
784
838
|
const transcodeFormat = decisionTree.transcodeFormat;
|
|
785
839
|
const engineFormat = decisionTree.engineFormat;
|
|
786
840
|
const roundToMultiple4 = decisionTree.roundToMultiple4;
|
|
787
841
|
const transcoder = this._transcoderMgr.findTranscoder(srcTexFormat, transcodeFormat, kfr.isInGammaSpace, options?.bypassTranscoders);
|
|
788
842
|
if (transcoder === null) {
|
|
789
|
-
throw new Error(`no transcoder found to transcode source texture format "${
|
|
843
|
+
throw new Error(`no transcoder found to transcode source texture format "${core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.SourceTextureFormat[srcTexFormat]}" to format "${core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.TranscodeTarget[transcodeFormat]}"`);
|
|
790
844
|
}
|
|
791
845
|
const mipmaps = [];
|
|
792
846
|
const dataPromises = [];
|
|
@@ -812,7 +866,7 @@ class KTX2Decoder {
|
|
|
812
866
|
let levelDataBuffer = kfr.data.buffer;
|
|
813
867
|
let levelDataOffset = kfr.levels[level].byteOffset + kfr.data.byteOffset;
|
|
814
868
|
let imageOffsetInLevel = 0;
|
|
815
|
-
if (kfr.header.supercompressionScheme ===
|
|
869
|
+
if (kfr.header.supercompressionScheme === _ktx2FileReader__WEBPACK_IMPORTED_MODULE_1__.SupercompressionScheme.ZStandard) {
|
|
816
870
|
levelDataBuffer = this._zstdDecoder.decode(new Uint8Array(levelDataBuffer, levelDataOffset, kfr.levels[level].byteLength), levelUncompressedByteLength);
|
|
817
871
|
levelDataOffset = 0;
|
|
818
872
|
}
|
|
@@ -823,7 +877,7 @@ class KTX2Decoder {
|
|
|
823
877
|
for (let imageIndex = 0; imageIndex < numImagesInLevel; imageIndex++) {
|
|
824
878
|
let encodedData;
|
|
825
879
|
let imageDesc = null;
|
|
826
|
-
if (kfr.header.supercompressionScheme ===
|
|
880
|
+
if (kfr.header.supercompressionScheme === _ktx2FileReader__WEBPACK_IMPORTED_MODULE_1__.SupercompressionScheme.BasisLZ) {
|
|
827
881
|
imageDesc = kfr.supercompressionGlobalData.imageDescs[firstImageDescIndex + imageIndex];
|
|
828
882
|
encodedData = new Uint8Array(levelDataBuffer, levelDataOffset + imageDesc.rgbSliceByteOffset, imageDesc.rgbSliceByteLength + imageDesc.alphaSliceByteLength);
|
|
829
883
|
}
|
|
@@ -856,14 +910,15 @@ class KTX2Decoder {
|
|
|
856
910
|
});
|
|
857
911
|
}
|
|
858
912
|
}
|
|
913
|
+
KTX2Decoder.DefaultDecoderOptions = {};
|
|
859
914
|
// Put in the order you want the transcoders to be used in priority
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
915
|
+
_transcoderManager__WEBPACK_IMPORTED_MODULE_2__.TranscoderManager.RegisterTranscoder(_Transcoders_liteTranscoder_UASTC_ASTC__WEBPACK_IMPORTED_MODULE_3__.LiteTranscoder_UASTC_ASTC);
|
|
916
|
+
_transcoderManager__WEBPACK_IMPORTED_MODULE_2__.TranscoderManager.RegisterTranscoder(_Transcoders_liteTranscoder_UASTC_BC7__WEBPACK_IMPORTED_MODULE_4__.LiteTranscoder_UASTC_BC7);
|
|
917
|
+
_transcoderManager__WEBPACK_IMPORTED_MODULE_2__.TranscoderManager.RegisterTranscoder(_Transcoders_liteTranscoder_UASTC_RGBA_UNORM__WEBPACK_IMPORTED_MODULE_5__.LiteTranscoder_UASTC_RGBA_UNORM);
|
|
918
|
+
_transcoderManager__WEBPACK_IMPORTED_MODULE_2__.TranscoderManager.RegisterTranscoder(_Transcoders_liteTranscoder_UASTC_RGBA_SRGB__WEBPACK_IMPORTED_MODULE_6__.LiteTranscoder_UASTC_RGBA_SRGB);
|
|
919
|
+
_transcoderManager__WEBPACK_IMPORTED_MODULE_2__.TranscoderManager.RegisterTranscoder(_Transcoders_liteTranscoder_UASTC_R8_UNORM__WEBPACK_IMPORTED_MODULE_7__.LiteTranscoder_UASTC_R8_UNORM);
|
|
920
|
+
_transcoderManager__WEBPACK_IMPORTED_MODULE_2__.TranscoderManager.RegisterTranscoder(_Transcoders_liteTranscoder_UASTC_RG8_UNORM__WEBPACK_IMPORTED_MODULE_8__.LiteTranscoder_UASTC_RG8_UNORM);
|
|
921
|
+
_transcoderManager__WEBPACK_IMPORTED_MODULE_2__.TranscoderManager.RegisterTranscoder(_Transcoders_mscTranscoder__WEBPACK_IMPORTED_MODULE_9__.MSCTranscoder); // catch all transcoder - will throw an error if the format can't be transcoded
|
|
867
922
|
|
|
868
923
|
|
|
869
924
|
/***/ }),
|
|
@@ -879,8 +934,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
879
934
|
/* harmony export */ "KTX2FileReader": () => (/* binding */ KTX2FileReader),
|
|
880
935
|
/* harmony export */ "SupercompressionScheme": () => (/* binding */ SupercompressionScheme)
|
|
881
936
|
/* harmony export */ });
|
|
882
|
-
/* harmony import */ var
|
|
883
|
-
/* harmony import */ var
|
|
937
|
+
/* harmony import */ var core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core/Materials/Textures/ktx2decoderTypes */ "../../../dev/core/dist/Materials/Textures/ktx2decoderTypes.js");
|
|
938
|
+
/* harmony import */ var _Misc_dataReader__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Misc/dataReader */ "../../../tools/ktx2Decoder/dist/Misc/dataReader.js");
|
|
884
939
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
885
940
|
|
|
886
941
|
|
|
@@ -923,7 +978,7 @@ class KTX2FileReader {
|
|
|
923
978
|
/**
|
|
924
979
|
* Get the header
|
|
925
980
|
*/
|
|
926
|
-
const hdrReader = new
|
|
981
|
+
const hdrReader = new _Misc_dataReader__WEBPACK_IMPORTED_MODULE_1__.DataReader(this._data, offsetInFile, 17 * 4);
|
|
927
982
|
const header = (this._header = {
|
|
928
983
|
vkFormat: hdrReader.readUint32(),
|
|
929
984
|
typeSize: hdrReader.readUint32(),
|
|
@@ -955,7 +1010,7 @@ class KTX2FileReader {
|
|
|
955
1010
|
* Get the levels
|
|
956
1011
|
*/
|
|
957
1012
|
let levelCount = Math.max(1, header.levelCount);
|
|
958
|
-
const levelReader = new
|
|
1013
|
+
const levelReader = new _Misc_dataReader__WEBPACK_IMPORTED_MODULE_1__.DataReader(this._data, offsetInFile, levelCount * 3 * (2 * 4));
|
|
959
1014
|
const levels = (this._levels = []);
|
|
960
1015
|
while (levelCount--) {
|
|
961
1016
|
levels.push({
|
|
@@ -968,7 +1023,7 @@ class KTX2FileReader {
|
|
|
968
1023
|
/**
|
|
969
1024
|
* Get the data format descriptor (DFD) blocks
|
|
970
1025
|
*/
|
|
971
|
-
const dfdReader = new
|
|
1026
|
+
const dfdReader = new _Misc_dataReader__WEBPACK_IMPORTED_MODULE_1__.DataReader(this._data, header.dfdByteOffset, header.dfdByteLength);
|
|
972
1027
|
const dfdBlock = (this._dfdBlock = {
|
|
973
1028
|
vendorId: dfdReader.skipBytes(4 /* skip totalSize */).readUint16(),
|
|
974
1029
|
descriptorType: dfdReader.readUint16(),
|
|
@@ -1022,7 +1077,7 @@ class KTX2FileReader {
|
|
|
1022
1077
|
*/
|
|
1023
1078
|
const sgd = (this._supercompressionGlobalData = {});
|
|
1024
1079
|
if (header.sgdByteLength > 0) {
|
|
1025
|
-
const sgdReader = new
|
|
1080
|
+
const sgdReader = new _Misc_dataReader__WEBPACK_IMPORTED_MODULE_1__.DataReader(this._data, header.sgdByteOffset, header.sgdByteLength);
|
|
1026
1081
|
sgd.endpointCount = sgdReader.readUint16();
|
|
1027
1082
|
sgd.selectorCount = sgdReader.readUint16();
|
|
1028
1083
|
sgd.endpointsByteLength = sgdReader.readUint32();
|
|
@@ -1058,15 +1113,15 @@ class KTX2FileReader {
|
|
|
1058
1113
|
return Math.max(this._header.layerCount, 1) * this._header.faceCount * layerPixelDepth;
|
|
1059
1114
|
}
|
|
1060
1115
|
get textureFormat() {
|
|
1061
|
-
return this._dfdBlock.colorModel === 166 /* UASTC */ ?
|
|
1116
|
+
return this._dfdBlock.colorModel === 166 /* UASTC */ ? core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.SourceTextureFormat.UASTC4x4 : core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.SourceTextureFormat.ETC1S;
|
|
1062
1117
|
}
|
|
1063
1118
|
get hasAlpha() {
|
|
1064
1119
|
const tformat = this.textureFormat;
|
|
1065
1120
|
switch (tformat) {
|
|
1066
|
-
case
|
|
1121
|
+
case core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.SourceTextureFormat.ETC1S:
|
|
1067
1122
|
return (this._dfdBlock.numSamples === 2 &&
|
|
1068
1123
|
(this._dfdBlock.samples[0].channelType === 15 /* AAA */ || this._dfdBlock.samples[1].channelType === 15 /* AAA */));
|
|
1069
|
-
case
|
|
1124
|
+
case core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.SourceTextureFormat.UASTC4x4:
|
|
1070
1125
|
return this._dfdBlock.samples[0].channelType === 3 /* RGBA */;
|
|
1071
1126
|
}
|
|
1072
1127
|
return false;
|
|
@@ -1124,9 +1179,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1124
1179
|
/* harmony export */ "Transcoder": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.Transcoder),
|
|
1125
1180
|
/* harmony export */ "TranscoderManager": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.TranscoderManager),
|
|
1126
1181
|
/* harmony export */ "WASMMemoryManager": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.WASMMemoryManager),
|
|
1127
|
-
/* harmony export */ "ZSTDDecoder": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.ZSTDDecoder)
|
|
1128
|
-
/* harmony export */ "sourceTextureFormat": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.sourceTextureFormat),
|
|
1129
|
-
/* harmony export */ "transcodeTarget": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.transcodeTarget)
|
|
1182
|
+
/* harmony export */ "ZSTDDecoder": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.ZSTDDecoder)
|
|
1130
1183
|
/* harmony export */ });
|
|
1131
1184
|
/* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../index */ "../../../tools/ktx2Decoder/dist/index.js");
|
|
1132
1185
|
/* eslint-disable import/no-internal-modules */
|
|
@@ -1150,27 +1203,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1150
1203
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1151
1204
|
/* harmony export */ "TranscodeDecisionTree": () => (/* binding */ TranscodeDecisionTree)
|
|
1152
1205
|
/* harmony export */ });
|
|
1153
|
-
/* harmony import */ var
|
|
1206
|
+
/* harmony import */ var core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core/Materials/Textures/ktx2decoderTypes */ "../../../dev/core/dist/Materials/Textures/ktx2decoderTypes.js");
|
|
1154
1207
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
1155
1208
|
|
|
1156
|
-
const COMPRESSED_RGBA_BPTC_UNORM_EXT = 0x8e8c;
|
|
1157
|
-
const COMPRESSED_RGBA_ASTC_4x4_KHR = 0x93b0;
|
|
1158
|
-
const COMPRESSED_RGB_S3TC_DXT1_EXT = 0x83f0;
|
|
1159
|
-
const COMPRESSED_RGBA_S3TC_DXT5_EXT = 0x83f3;
|
|
1160
|
-
const COMPRESSED_RGBA_PVRTC_4BPPV1_IMG = 0x8c02;
|
|
1161
|
-
const COMPRESSED_RGB_PVRTC_4BPPV1_IMG = 0x8c00;
|
|
1162
|
-
const COMPRESSED_RGBA8_ETC2_EAC = 0x9278;
|
|
1163
|
-
const COMPRESSED_RGB8_ETC2 = 0x9274;
|
|
1164
|
-
const COMPRESSED_RGB_ETC1_WEBGL = 0x8d64;
|
|
1165
|
-
const RGBA8Format = 0x8058;
|
|
1166
|
-
const R8Format = 0x8229;
|
|
1167
|
-
const RG8Format = 0x822b;
|
|
1168
1209
|
const DecisionTree = {
|
|
1169
1210
|
ETC1S: {
|
|
1170
1211
|
option: "forceRGBA",
|
|
1171
1212
|
yes: {
|
|
1172
|
-
transcodeFormat:
|
|
1173
|
-
engineFormat: RGBA8Format,
|
|
1213
|
+
transcodeFormat: core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.TranscodeTarget.RGBA32,
|
|
1214
|
+
engineFormat: core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.EngineFormat.RGBA8Format,
|
|
1174
1215
|
roundToMultiple4: false,
|
|
1175
1216
|
},
|
|
1176
1217
|
no: {
|
|
@@ -1178,38 +1219,38 @@ const DecisionTree = {
|
|
|
1178
1219
|
yes: {
|
|
1179
1220
|
alpha: true,
|
|
1180
1221
|
yes: {
|
|
1181
|
-
transcodeFormat:
|
|
1182
|
-
engineFormat: COMPRESSED_RGBA8_ETC2_EAC,
|
|
1222
|
+
transcodeFormat: core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.TranscodeTarget.ETC2_RGBA,
|
|
1223
|
+
engineFormat: core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.EngineFormat.COMPRESSED_RGBA8_ETC2_EAC,
|
|
1183
1224
|
},
|
|
1184
1225
|
no: {
|
|
1185
|
-
transcodeFormat:
|
|
1186
|
-
engineFormat: COMPRESSED_RGB8_ETC2,
|
|
1226
|
+
transcodeFormat: core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.TranscodeTarget.ETC1_RGB,
|
|
1227
|
+
engineFormat: core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.EngineFormat.COMPRESSED_RGB8_ETC2,
|
|
1187
1228
|
},
|
|
1188
1229
|
},
|
|
1189
1230
|
no: {
|
|
1190
1231
|
cap: "etc1",
|
|
1191
1232
|
alpha: false,
|
|
1192
1233
|
yes: {
|
|
1193
|
-
transcodeFormat:
|
|
1194
|
-
engineFormat: COMPRESSED_RGB_ETC1_WEBGL,
|
|
1234
|
+
transcodeFormat: core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.TranscodeTarget.ETC1_RGB,
|
|
1235
|
+
engineFormat: core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.EngineFormat.COMPRESSED_RGB_ETC1_WEBGL,
|
|
1195
1236
|
},
|
|
1196
1237
|
no: {
|
|
1197
1238
|
cap: "bptc",
|
|
1198
1239
|
yes: {
|
|
1199
|
-
transcodeFormat:
|
|
1200
|
-
engineFormat: COMPRESSED_RGBA_BPTC_UNORM_EXT,
|
|
1240
|
+
transcodeFormat: core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.TranscodeTarget.BC7_RGBA,
|
|
1241
|
+
engineFormat: core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.EngineFormat.COMPRESSED_RGBA_BPTC_UNORM_EXT,
|
|
1201
1242
|
},
|
|
1202
1243
|
no: {
|
|
1203
1244
|
cap: "s3tc",
|
|
1204
1245
|
yes: {
|
|
1205
1246
|
alpha: true,
|
|
1206
1247
|
yes: {
|
|
1207
|
-
transcodeFormat:
|
|
1208
|
-
engineFormat: COMPRESSED_RGBA_S3TC_DXT5_EXT,
|
|
1248
|
+
transcodeFormat: core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.TranscodeTarget.BC3_RGBA,
|
|
1249
|
+
engineFormat: core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.EngineFormat.COMPRESSED_RGBA_S3TC_DXT5_EXT,
|
|
1209
1250
|
},
|
|
1210
1251
|
no: {
|
|
1211
|
-
transcodeFormat:
|
|
1212
|
-
engineFormat: COMPRESSED_RGB_S3TC_DXT1_EXT,
|
|
1252
|
+
transcodeFormat: core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.TranscodeTarget.BC1_RGB,
|
|
1253
|
+
engineFormat: core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.EngineFormat.COMPRESSED_RGB_S3TC_DXT1_EXT,
|
|
1213
1254
|
},
|
|
1214
1255
|
},
|
|
1215
1256
|
no: {
|
|
@@ -1218,17 +1259,17 @@ const DecisionTree = {
|
|
|
1218
1259
|
yes: {
|
|
1219
1260
|
alpha: true,
|
|
1220
1261
|
yes: {
|
|
1221
|
-
transcodeFormat:
|
|
1222
|
-
engineFormat: COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,
|
|
1262
|
+
transcodeFormat: core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.TranscodeTarget.PVRTC1_4_RGBA,
|
|
1263
|
+
engineFormat: core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.EngineFormat.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,
|
|
1223
1264
|
},
|
|
1224
1265
|
no: {
|
|
1225
|
-
transcodeFormat:
|
|
1226
|
-
engineFormat: COMPRESSED_RGB_PVRTC_4BPPV1_IMG,
|
|
1266
|
+
transcodeFormat: core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.TranscodeTarget.PVRTC1_4_RGB,
|
|
1267
|
+
engineFormat: core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.EngineFormat.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,
|
|
1227
1268
|
},
|
|
1228
1269
|
},
|
|
1229
1270
|
no: {
|
|
1230
|
-
transcodeFormat:
|
|
1231
|
-
engineFormat: RGBA8Format,
|
|
1271
|
+
transcodeFormat: core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.TranscodeTarget.RGBA32,
|
|
1272
|
+
engineFormat: core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.EngineFormat.RGBA8Format,
|
|
1232
1273
|
roundToMultiple4: false,
|
|
1233
1274
|
},
|
|
1234
1275
|
},
|
|
@@ -1240,41 +1281,41 @@ const DecisionTree = {
|
|
|
1240
1281
|
UASTC: {
|
|
1241
1282
|
option: "forceRGBA",
|
|
1242
1283
|
yes: {
|
|
1243
|
-
transcodeFormat:
|
|
1244
|
-
engineFormat: RGBA8Format,
|
|
1284
|
+
transcodeFormat: core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.TranscodeTarget.RGBA32,
|
|
1285
|
+
engineFormat: core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.EngineFormat.RGBA8Format,
|
|
1245
1286
|
roundToMultiple4: false,
|
|
1246
1287
|
},
|
|
1247
1288
|
no: {
|
|
1248
1289
|
option: "forceR8",
|
|
1249
1290
|
yes: {
|
|
1250
|
-
transcodeFormat:
|
|
1251
|
-
engineFormat: R8Format,
|
|
1291
|
+
transcodeFormat: core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.TranscodeTarget.R8,
|
|
1292
|
+
engineFormat: core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.EngineFormat.R8Format,
|
|
1252
1293
|
roundToMultiple4: false,
|
|
1253
1294
|
},
|
|
1254
1295
|
no: {
|
|
1255
1296
|
option: "forceRG8",
|
|
1256
1297
|
yes: {
|
|
1257
|
-
transcodeFormat:
|
|
1258
|
-
engineFormat: RG8Format,
|
|
1298
|
+
transcodeFormat: core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.TranscodeTarget.RG8,
|
|
1299
|
+
engineFormat: core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.EngineFormat.RG8Format,
|
|
1259
1300
|
roundToMultiple4: false,
|
|
1260
1301
|
},
|
|
1261
1302
|
no: {
|
|
1262
1303
|
cap: "astc",
|
|
1263
1304
|
yes: {
|
|
1264
|
-
transcodeFormat:
|
|
1265
|
-
engineFormat:
|
|
1305
|
+
transcodeFormat: core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.TranscodeTarget.ASTC_4X4_RGBA,
|
|
1306
|
+
engineFormat: core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.EngineFormat.COMPRESSED_RGBA_ASTC_4X4_KHR,
|
|
1266
1307
|
},
|
|
1267
1308
|
no: {
|
|
1268
1309
|
cap: "bptc",
|
|
1269
1310
|
yes: {
|
|
1270
|
-
transcodeFormat:
|
|
1271
|
-
engineFormat: COMPRESSED_RGBA_BPTC_UNORM_EXT,
|
|
1311
|
+
transcodeFormat: core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.TranscodeTarget.BC7_RGBA,
|
|
1312
|
+
engineFormat: core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.EngineFormat.COMPRESSED_RGBA_BPTC_UNORM_EXT,
|
|
1272
1313
|
},
|
|
1273
1314
|
no: {
|
|
1274
1315
|
option: "useRGBAIfASTCBC7NotAvailableWhenUASTC",
|
|
1275
1316
|
yes: {
|
|
1276
|
-
transcodeFormat:
|
|
1277
|
-
engineFormat: RGBA8Format,
|
|
1317
|
+
transcodeFormat: core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.TranscodeTarget.RGBA32,
|
|
1318
|
+
engineFormat: core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.EngineFormat.RGBA8Format,
|
|
1278
1319
|
roundToMultiple4: false,
|
|
1279
1320
|
},
|
|
1280
1321
|
no: {
|
|
@@ -1282,31 +1323,31 @@ const DecisionTree = {
|
|
|
1282
1323
|
yes: {
|
|
1283
1324
|
alpha: true,
|
|
1284
1325
|
yes: {
|
|
1285
|
-
transcodeFormat:
|
|
1286
|
-
engineFormat: COMPRESSED_RGBA8_ETC2_EAC,
|
|
1326
|
+
transcodeFormat: core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.TranscodeTarget.ETC2_RGBA,
|
|
1327
|
+
engineFormat: core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.EngineFormat.COMPRESSED_RGBA8_ETC2_EAC,
|
|
1287
1328
|
},
|
|
1288
1329
|
no: {
|
|
1289
|
-
transcodeFormat:
|
|
1290
|
-
engineFormat: COMPRESSED_RGB8_ETC2,
|
|
1330
|
+
transcodeFormat: core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.TranscodeTarget.ETC1_RGB,
|
|
1331
|
+
engineFormat: core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.EngineFormat.COMPRESSED_RGB8_ETC2,
|
|
1291
1332
|
},
|
|
1292
1333
|
},
|
|
1293
1334
|
no: {
|
|
1294
1335
|
cap: "etc1",
|
|
1295
1336
|
yes: {
|
|
1296
|
-
transcodeFormat:
|
|
1297
|
-
engineFormat: COMPRESSED_RGB_ETC1_WEBGL,
|
|
1337
|
+
transcodeFormat: core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.TranscodeTarget.ETC1_RGB,
|
|
1338
|
+
engineFormat: core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.EngineFormat.COMPRESSED_RGB_ETC1_WEBGL,
|
|
1298
1339
|
},
|
|
1299
1340
|
no: {
|
|
1300
1341
|
cap: "s3tc",
|
|
1301
1342
|
yes: {
|
|
1302
1343
|
alpha: true,
|
|
1303
1344
|
yes: {
|
|
1304
|
-
transcodeFormat:
|
|
1305
|
-
engineFormat: COMPRESSED_RGBA_S3TC_DXT5_EXT,
|
|
1345
|
+
transcodeFormat: core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.TranscodeTarget.BC3_RGBA,
|
|
1346
|
+
engineFormat: core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.EngineFormat.COMPRESSED_RGBA_S3TC_DXT5_EXT,
|
|
1306
1347
|
},
|
|
1307
1348
|
no: {
|
|
1308
|
-
transcodeFormat:
|
|
1309
|
-
engineFormat: COMPRESSED_RGB_S3TC_DXT1_EXT,
|
|
1349
|
+
transcodeFormat: core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.TranscodeTarget.BC1_RGB,
|
|
1350
|
+
engineFormat: core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.EngineFormat.COMPRESSED_RGB_S3TC_DXT1_EXT,
|
|
1310
1351
|
},
|
|
1311
1352
|
},
|
|
1312
1353
|
no: {
|
|
@@ -1315,17 +1356,17 @@ const DecisionTree = {
|
|
|
1315
1356
|
yes: {
|
|
1316
1357
|
alpha: true,
|
|
1317
1358
|
yes: {
|
|
1318
|
-
transcodeFormat:
|
|
1319
|
-
engineFormat: COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,
|
|
1359
|
+
transcodeFormat: core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.TranscodeTarget.PVRTC1_4_RGBA,
|
|
1360
|
+
engineFormat: core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.EngineFormat.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,
|
|
1320
1361
|
},
|
|
1321
1362
|
no: {
|
|
1322
|
-
transcodeFormat:
|
|
1323
|
-
engineFormat: COMPRESSED_RGB_PVRTC_4BPPV1_IMG,
|
|
1363
|
+
transcodeFormat: core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.TranscodeTarget.PVRTC1_4_RGB,
|
|
1364
|
+
engineFormat: core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.EngineFormat.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,
|
|
1324
1365
|
},
|
|
1325
1366
|
},
|
|
1326
1367
|
no: {
|
|
1327
|
-
transcodeFormat:
|
|
1328
|
-
engineFormat: RGBA8Format,
|
|
1368
|
+
transcodeFormat: core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.TranscodeTarget.RGBA32,
|
|
1369
|
+
engineFormat: core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.EngineFormat.RGBA8Format,
|
|
1329
1370
|
roundToMultiple4: false,
|
|
1330
1371
|
},
|
|
1331
1372
|
},
|
|
@@ -1341,14 +1382,15 @@ const DecisionTree = {
|
|
|
1341
1382
|
};
|
|
1342
1383
|
class TranscodeDecisionTree {
|
|
1343
1384
|
constructor(textureFormat, hasAlpha, isPowerOfTwo, caps, options) {
|
|
1385
|
+
this._textureFormat = textureFormat;
|
|
1344
1386
|
this._hasAlpha = hasAlpha;
|
|
1345
1387
|
this._isPowerOfTwo = isPowerOfTwo;
|
|
1346
1388
|
this._caps = caps;
|
|
1347
1389
|
this._options = options ?? {};
|
|
1348
|
-
this.
|
|
1390
|
+
this.parseTree(DecisionTree);
|
|
1349
1391
|
}
|
|
1350
1392
|
static _IsLeafNode(node) {
|
|
1351
|
-
return node.
|
|
1393
|
+
return node.engineFormat !== undefined;
|
|
1352
1394
|
}
|
|
1353
1395
|
get transcodeFormat() {
|
|
1354
1396
|
return this._transcodeFormat;
|
|
@@ -1359,7 +1401,17 @@ class TranscodeDecisionTree {
|
|
|
1359
1401
|
get roundToMultiple4() {
|
|
1360
1402
|
return this._roundToMultiple4;
|
|
1361
1403
|
}
|
|
1404
|
+
parseTree(tree) {
|
|
1405
|
+
const node = this._textureFormat === core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.SourceTextureFormat.UASTC4x4 ? tree.UASTC : tree.ETC1S;
|
|
1406
|
+
if (node) {
|
|
1407
|
+
this._parseNode(node);
|
|
1408
|
+
}
|
|
1409
|
+
return node !== undefined;
|
|
1410
|
+
}
|
|
1362
1411
|
_parseNode(node) {
|
|
1412
|
+
if (!node) {
|
|
1413
|
+
return;
|
|
1414
|
+
}
|
|
1363
1415
|
if (TranscodeDecisionTree._IsLeafNode(node)) {
|
|
1364
1416
|
this._transcodeFormat = node.transcodeFormat;
|
|
1365
1417
|
this._engineFormat = node.engineFormat;
|
|
@@ -1368,10 +1420,10 @@ class TranscodeDecisionTree {
|
|
|
1368
1420
|
else {
|
|
1369
1421
|
let condition = true;
|
|
1370
1422
|
if (node.cap !== undefined) {
|
|
1371
|
-
condition = condition && this._caps[node.cap];
|
|
1423
|
+
condition = condition && !!this._caps[node.cap];
|
|
1372
1424
|
}
|
|
1373
1425
|
if (node.option !== undefined) {
|
|
1374
|
-
condition = condition && this._options[node.option];
|
|
1426
|
+
condition = condition && !!this._options[node.option];
|
|
1375
1427
|
}
|
|
1376
1428
|
if (node.alpha !== undefined) {
|
|
1377
1429
|
condition = condition && this._hasAlpha === node.alpha;
|
|
@@ -1379,6 +1431,14 @@ class TranscodeDecisionTree {
|
|
|
1379
1431
|
if (node.needsPowerOfTwo !== undefined) {
|
|
1380
1432
|
condition = condition && this._isPowerOfTwo === node.needsPowerOfTwo;
|
|
1381
1433
|
}
|
|
1434
|
+
if (node.transcodeFormat !== undefined) {
|
|
1435
|
+
if (Array.isArray(node.transcodeFormat)) {
|
|
1436
|
+
condition = condition && node.transcodeFormat.indexOf(this._transcodeFormat) !== -1;
|
|
1437
|
+
}
|
|
1438
|
+
else {
|
|
1439
|
+
condition = condition && node.transcodeFormat === this._transcodeFormat;
|
|
1440
|
+
}
|
|
1441
|
+
}
|
|
1382
1442
|
this._parseNode(condition ? node.yes : node.no);
|
|
1383
1443
|
}
|
|
1384
1444
|
}
|
|
@@ -1395,35 +1455,8 @@ class TranscodeDecisionTree {
|
|
|
1395
1455
|
|
|
1396
1456
|
__webpack_require__.r(__webpack_exports__);
|
|
1397
1457
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1398
|
-
/* harmony export */ "Transcoder": () => (/* binding */ Transcoder)
|
|
1399
|
-
/* harmony export */ "sourceTextureFormat": () => (/* binding */ sourceTextureFormat),
|
|
1400
|
-
/* harmony export */ "transcodeTarget": () => (/* binding */ transcodeTarget)
|
|
1458
|
+
/* harmony export */ "Transcoder": () => (/* binding */ Transcoder)
|
|
1401
1459
|
/* harmony export */ });
|
|
1402
|
-
/**
|
|
1403
|
-
* @internal
|
|
1404
|
-
*/
|
|
1405
|
-
var sourceTextureFormat;
|
|
1406
|
-
(function (sourceTextureFormat) {
|
|
1407
|
-
sourceTextureFormat[sourceTextureFormat["ETC1S"] = 0] = "ETC1S";
|
|
1408
|
-
sourceTextureFormat[sourceTextureFormat["UASTC4x4"] = 1] = "UASTC4x4";
|
|
1409
|
-
})(sourceTextureFormat || (sourceTextureFormat = {}));
|
|
1410
|
-
/**
|
|
1411
|
-
* @internal
|
|
1412
|
-
*/
|
|
1413
|
-
var transcodeTarget;
|
|
1414
|
-
(function (transcodeTarget) {
|
|
1415
|
-
transcodeTarget[transcodeTarget["ASTC_4x4_RGBA"] = 0] = "ASTC_4x4_RGBA";
|
|
1416
|
-
transcodeTarget[transcodeTarget["BC7_RGBA"] = 1] = "BC7_RGBA";
|
|
1417
|
-
transcodeTarget[transcodeTarget["BC3_RGBA"] = 2] = "BC3_RGBA";
|
|
1418
|
-
transcodeTarget[transcodeTarget["BC1_RGB"] = 3] = "BC1_RGB";
|
|
1419
|
-
transcodeTarget[transcodeTarget["PVRTC1_4_RGBA"] = 4] = "PVRTC1_4_RGBA";
|
|
1420
|
-
transcodeTarget[transcodeTarget["PVRTC1_4_RGB"] = 5] = "PVRTC1_4_RGB";
|
|
1421
|
-
transcodeTarget[transcodeTarget["ETC2_RGBA"] = 6] = "ETC2_RGBA";
|
|
1422
|
-
transcodeTarget[transcodeTarget["ETC1_RGB"] = 7] = "ETC1_RGB";
|
|
1423
|
-
transcodeTarget[transcodeTarget["RGBA32"] = 8] = "RGBA32";
|
|
1424
|
-
transcodeTarget[transcodeTarget["R8"] = 9] = "R8";
|
|
1425
|
-
transcodeTarget[transcodeTarget["RG8"] = 10] = "RG8";
|
|
1426
|
-
})(transcodeTarget || (transcodeTarget = {}));
|
|
1427
1460
|
/**
|
|
1428
1461
|
* @internal
|
|
1429
1462
|
*/
|
|
@@ -1458,7 +1491,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1458
1491
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1459
1492
|
/* harmony export */ "TranscoderManager": () => (/* binding */ TranscoderManager)
|
|
1460
1493
|
/* harmony export */ });
|
|
1461
|
-
/* harmony import */ var
|
|
1494
|
+
/* harmony import */ var core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core/Materials/Textures/ktx2decoderTypes */ "../../../dev/core/dist/Materials/Textures/ktx2decoderTypes.js");
|
|
1462
1495
|
/* harmony import */ var _wasmMemoryManager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./wasmMemoryManager */ "../../../tools/ktx2Decoder/dist/wasmMemoryManager.js");
|
|
1463
1496
|
|
|
1464
1497
|
|
|
@@ -1471,7 +1504,7 @@ class TranscoderManager {
|
|
|
1471
1504
|
}
|
|
1472
1505
|
findTranscoder(src, dst, isInGammaSpace, bypass) {
|
|
1473
1506
|
let transcoder = null;
|
|
1474
|
-
const key =
|
|
1507
|
+
const key = core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.SourceTextureFormat[src] + "_" + core_Materials_Textures_ktx2decoderTypes__WEBPACK_IMPORTED_MODULE_0__.TranscodeTarget[dst];
|
|
1475
1508
|
for (let i = 0; i < TranscoderManager._Transcoders.length; ++i) {
|
|
1476
1509
|
if (TranscoderManager._Transcoders[i].CanTranscode(src, dst, isInGammaSpace) && (!bypass || bypass.indexOf(TranscoderManager._Transcoders[i].Name) < 0)) {
|
|
1477
1510
|
transcoder = this._getExistingTranscoder(key, TranscoderManager._Transcoders[i].Name);
|