babylonjs-ktx2decoder 5.0.0-beta.8-snapshot
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.
|
@@ -0,0 +1,1648 @@
|
|
|
1
|
+
(function webpackUniversalModuleDefinition(root, factory) {
|
|
2
|
+
if(typeof exports === 'object' && typeof module === 'object')
|
|
3
|
+
module.exports = factory();
|
|
4
|
+
else if(typeof define === 'function' && define.amd)
|
|
5
|
+
define("babylonjs-ktx2decoder", [], factory);
|
|
6
|
+
else if(typeof exports === 'object')
|
|
7
|
+
exports["babylonjs-ktx2decoder"] = factory();
|
|
8
|
+
else
|
|
9
|
+
root["KTX2DECODER"] = factory();
|
|
10
|
+
})((typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : this), function() {
|
|
11
|
+
return /******/ (() => { // webpackBootstrap
|
|
12
|
+
/******/ "use strict";
|
|
13
|
+
/******/ var __webpack_modules__ = ({
|
|
14
|
+
|
|
15
|
+
/***/ "../../../tools/ktx2Decoder/dist/Misc/dataReader.js":
|
|
16
|
+
/*!**********************************************************!*\
|
|
17
|
+
!*** ../../../tools/ktx2Decoder/dist/Misc/dataReader.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 */ "DataReader": () => (/* binding */ DataReader)
|
|
24
|
+
/* harmony export */ });
|
|
25
|
+
/**
|
|
26
|
+
* Utility class for reading from a data buffer
|
|
27
|
+
*/
|
|
28
|
+
class DataReader {
|
|
29
|
+
/**
|
|
30
|
+
* Constructor
|
|
31
|
+
* @param buffer The buffer to set
|
|
32
|
+
* @param byteOffset The starting offset in the buffer
|
|
33
|
+
* @param byteLength The byte length of the buffer
|
|
34
|
+
*/
|
|
35
|
+
constructor(buffer, byteOffset, byteLength) {
|
|
36
|
+
if (buffer.buffer) {
|
|
37
|
+
this._dataView = new DataView(buffer.buffer, buffer.byteOffset + (byteOffset !== null && byteOffset !== void 0 ? byteOffset : 0), byteLength !== null && byteLength !== void 0 ? byteLength : buffer.byteLength);
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
this._dataView = new DataView(buffer, byteOffset !== null && byteOffset !== void 0 ? byteOffset : 0, byteLength !== null && byteLength !== void 0 ? byteLength : buffer.byteLength);
|
|
41
|
+
}
|
|
42
|
+
this._dataByteOffset = 0;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* The current byte offset from the beginning of the data buffer.
|
|
46
|
+
*/
|
|
47
|
+
get byteOffset() {
|
|
48
|
+
return this._dataByteOffset;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Read a unsigned 8-bit integer from the currently loaded data range.
|
|
52
|
+
* @returns The 8-bit integer read
|
|
53
|
+
*/
|
|
54
|
+
readUint8() {
|
|
55
|
+
const value = this._dataView.getUint8(this._dataByteOffset);
|
|
56
|
+
this._dataByteOffset += 1;
|
|
57
|
+
return value;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Read a signed 8-bit integer from the currently loaded data range.
|
|
61
|
+
* @returns The 8-bit integer read
|
|
62
|
+
*/
|
|
63
|
+
readInt8() {
|
|
64
|
+
const value = this._dataView.getInt8(this._dataByteOffset);
|
|
65
|
+
this._dataByteOffset += 1;
|
|
66
|
+
return value;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Read a unsigned 16-bit integer from the currently loaded data range.
|
|
70
|
+
* @returns The 16-bit integer read
|
|
71
|
+
*/
|
|
72
|
+
readUint16() {
|
|
73
|
+
const value = this._dataView.getUint16(this._dataByteOffset, true);
|
|
74
|
+
this._dataByteOffset += 2;
|
|
75
|
+
return value;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Read a signed 16-bit integer from the currently loaded data range.
|
|
79
|
+
* @returns The 16-bit integer read
|
|
80
|
+
*/
|
|
81
|
+
readInt16() {
|
|
82
|
+
const value = this._dataView.getInt16(this._dataByteOffset, true);
|
|
83
|
+
this._dataByteOffset += 2;
|
|
84
|
+
return value;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Read a unsigned 32-bit integer from the currently loaded data range.
|
|
88
|
+
* @returns The 32-bit integer read
|
|
89
|
+
*/
|
|
90
|
+
readUint32() {
|
|
91
|
+
const value = this._dataView.getUint32(this._dataByteOffset, true);
|
|
92
|
+
this._dataByteOffset += 4;
|
|
93
|
+
return value;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Read a signed 32-bit integer from the currently loaded data range.
|
|
97
|
+
* @returns The 32-bit integer read
|
|
98
|
+
*/
|
|
99
|
+
readInt32() {
|
|
100
|
+
const value = this._dataView.getInt32(this._dataByteOffset, true);
|
|
101
|
+
this._dataByteOffset += 4;
|
|
102
|
+
return value;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Read a unsigned 32-bit integer from the currently loaded data range.
|
|
106
|
+
* @returns The 32-bit integer read
|
|
107
|
+
*/
|
|
108
|
+
readUint64() {
|
|
109
|
+
// split 64-bit number into two 32-bit (4-byte) parts
|
|
110
|
+
const left = this._dataView.getUint32(this._dataByteOffset, true);
|
|
111
|
+
const right = this._dataView.getUint32(this._dataByteOffset + 4, true);
|
|
112
|
+
// combine the two 32-bit values
|
|
113
|
+
const combined = true ? left + (2 ** 32 * right) : 0;
|
|
114
|
+
/*if (!Number.isSafeInteger(combined)) {
|
|
115
|
+
console.warn('DataReader: ' + combined + ' exceeds MAX_SAFE_INTEGER. Precision may be lost.');
|
|
116
|
+
}*/
|
|
117
|
+
this._dataByteOffset += 8;
|
|
118
|
+
return combined;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Read a byte array from the currently loaded data range.
|
|
122
|
+
* @param byteLength The byte length to read
|
|
123
|
+
* @returns The byte array read
|
|
124
|
+
*/
|
|
125
|
+
readUint8Array(byteLength) {
|
|
126
|
+
const value = new Uint8Array(this._dataView.buffer, this._dataView.byteOffset + this._dataByteOffset, byteLength);
|
|
127
|
+
this._dataByteOffset += byteLength;
|
|
128
|
+
return value;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Skips the given byte length the currently loaded data range.
|
|
132
|
+
* @param byteLength The byte length to skip
|
|
133
|
+
* @returns This instance
|
|
134
|
+
*/
|
|
135
|
+
skipBytes(byteLength) {
|
|
136
|
+
this._dataByteOffset += byteLength;
|
|
137
|
+
return this;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
/***/ }),
|
|
143
|
+
|
|
144
|
+
/***/ "../../../tools/ktx2Decoder/dist/Misc/index.js":
|
|
145
|
+
/*!*****************************************************!*\
|
|
146
|
+
!*** ../../../tools/ktx2Decoder/dist/Misc/index.js ***!
|
|
147
|
+
\*****************************************************/
|
|
148
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
149
|
+
|
|
150
|
+
__webpack_require__.r(__webpack_exports__);
|
|
151
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
152
|
+
/* harmony export */ "DataReader": () => (/* reexport safe */ _dataReader__WEBPACK_IMPORTED_MODULE_0__.DataReader)
|
|
153
|
+
/* harmony export */ });
|
|
154
|
+
/* harmony import */ var _dataReader__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dataReader */ "../../../tools/ktx2Decoder/dist/Misc/dataReader.js");
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
/***/ }),
|
|
159
|
+
|
|
160
|
+
/***/ "../../../tools/ktx2Decoder/dist/Transcoders/index.js":
|
|
161
|
+
/*!************************************************************!*\
|
|
162
|
+
!*** ../../../tools/ktx2Decoder/dist/Transcoders/index.js ***!
|
|
163
|
+
\************************************************************/
|
|
164
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
165
|
+
|
|
166
|
+
__webpack_require__.r(__webpack_exports__);
|
|
167
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
168
|
+
/* harmony export */ "LiteTranscoder": () => (/* reexport safe */ _liteTranscoder__WEBPACK_IMPORTED_MODULE_0__.LiteTranscoder),
|
|
169
|
+
/* harmony export */ "LiteTranscoder_UASTC_ASTC": () => (/* reexport safe */ _liteTranscoder_UASTC_ASTC__WEBPACK_IMPORTED_MODULE_1__.LiteTranscoder_UASTC_ASTC),
|
|
170
|
+
/* harmony export */ "LiteTranscoder_UASTC_BC7": () => (/* reexport safe */ _liteTranscoder_UASTC_BC7__WEBPACK_IMPORTED_MODULE_2__.LiteTranscoder_UASTC_BC7),
|
|
171
|
+
/* harmony export */ "LiteTranscoder_UASTC_RGBA_UNORM": () => (/* reexport safe */ _liteTranscoder_UASTC_RGBA_UNORM__WEBPACK_IMPORTED_MODULE_3__.LiteTranscoder_UASTC_RGBA_UNORM),
|
|
172
|
+
/* harmony export */ "LiteTranscoder_UASTC_RGBA_SRGB": () => (/* reexport safe */ _liteTranscoder_UASTC_RGBA_SRGB__WEBPACK_IMPORTED_MODULE_4__.LiteTranscoder_UASTC_RGBA_SRGB),
|
|
173
|
+
/* harmony export */ "MSCTranscoder": () => (/* reexport safe */ _mscTranscoder__WEBPACK_IMPORTED_MODULE_5__.MSCTranscoder)
|
|
174
|
+
/* harmony export */ });
|
|
175
|
+
/* harmony import */ var _liteTranscoder__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./liteTranscoder */ "../../../tools/ktx2Decoder/dist/Transcoders/liteTranscoder.js");
|
|
176
|
+
/* harmony import */ var _liteTranscoder_UASTC_ASTC__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./liteTranscoder_UASTC_ASTC */ "../../../tools/ktx2Decoder/dist/Transcoders/liteTranscoder_UASTC_ASTC.js");
|
|
177
|
+
/* harmony import */ var _liteTranscoder_UASTC_BC7__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./liteTranscoder_UASTC_BC7 */ "../../../tools/ktx2Decoder/dist/Transcoders/liteTranscoder_UASTC_BC7.js");
|
|
178
|
+
/* harmony import */ var _liteTranscoder_UASTC_RGBA_UNORM__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./liteTranscoder_UASTC_RGBA_UNORM */ "../../../tools/ktx2Decoder/dist/Transcoders/liteTranscoder_UASTC_RGBA_UNORM.js");
|
|
179
|
+
/* harmony import */ var _liteTranscoder_UASTC_RGBA_SRGB__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./liteTranscoder_UASTC_RGBA_SRGB */ "../../../tools/ktx2Decoder/dist/Transcoders/liteTranscoder_UASTC_RGBA_SRGB.js");
|
|
180
|
+
/* harmony import */ var _mscTranscoder__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./mscTranscoder */ "../../../tools/ktx2Decoder/dist/Transcoders/mscTranscoder.js");
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
/***/ }),
|
|
190
|
+
|
|
191
|
+
/***/ "../../../tools/ktx2Decoder/dist/Transcoders/liteTranscoder.js":
|
|
192
|
+
/*!*********************************************************************!*\
|
|
193
|
+
!*** ../../../tools/ktx2Decoder/dist/Transcoders/liteTranscoder.js ***!
|
|
194
|
+
\*********************************************************************/
|
|
195
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
196
|
+
|
|
197
|
+
__webpack_require__.r(__webpack_exports__);
|
|
198
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
199
|
+
/* harmony export */ "LiteTranscoder": () => (/* binding */ LiteTranscoder)
|
|
200
|
+
/* harmony export */ });
|
|
201
|
+
/* harmony import */ var _transcoder__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../transcoder */ "../../../tools/ktx2Decoder/dist/transcoder.js");
|
|
202
|
+
/* harmony import */ var _wasmMemoryManager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../wasmMemoryManager */ "../../../tools/ktx2Decoder/dist/wasmMemoryManager.js");
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* @hidden
|
|
207
|
+
*/
|
|
208
|
+
class LiteTranscoder extends _transcoder__WEBPACK_IMPORTED_MODULE_0__.Transcoder {
|
|
209
|
+
_loadModule() {
|
|
210
|
+
if (this._modulePromise) {
|
|
211
|
+
return this._modulePromise;
|
|
212
|
+
}
|
|
213
|
+
this._modulePromise = _wasmMemoryManager__WEBPACK_IMPORTED_MODULE_1__.WASMMemoryManager.LoadWASM(this._modulePath).then((wasmBinary) => {
|
|
214
|
+
return new Promise((resolve) => {
|
|
215
|
+
WebAssembly.instantiate(wasmBinary, { env: { memory: this._memoryManager.wasmMemory } }).then((moduleWrapper) => {
|
|
216
|
+
resolve({ module: moduleWrapper.instance.exports });
|
|
217
|
+
});
|
|
218
|
+
});
|
|
219
|
+
});
|
|
220
|
+
return this._modulePromise;
|
|
221
|
+
}
|
|
222
|
+
get memoryManager() {
|
|
223
|
+
return this._memoryManager;
|
|
224
|
+
}
|
|
225
|
+
setModulePath(modulePath) {
|
|
226
|
+
this._modulePath = modulePath;
|
|
227
|
+
}
|
|
228
|
+
initialize() {
|
|
229
|
+
this._transcodeInPlace = true;
|
|
230
|
+
}
|
|
231
|
+
needMemoryManager() {
|
|
232
|
+
return true;
|
|
233
|
+
}
|
|
234
|
+
setMemoryManager(memoryMgr) {
|
|
235
|
+
this._memoryManager = memoryMgr;
|
|
236
|
+
}
|
|
237
|
+
transcode(src, dst, level, width, height, uncompressedByteLength, ktx2Reader, imageDesc, encodedData) {
|
|
238
|
+
return this._loadModule().then((moduleWrapper) => {
|
|
239
|
+
const transcoder = moduleWrapper.module;
|
|
240
|
+
const [textureView, uncompressedTextureView, nBlocks] = this._prepareTranscoding(width, height, uncompressedByteLength, encodedData);
|
|
241
|
+
return transcoder.transcode(nBlocks) === 0 ? (this._transcodeInPlace ? textureView.slice() : uncompressedTextureView.slice()) : null;
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
_prepareTranscoding(width, height, uncompressedByteLength, encodedData, forceRGBA = false) {
|
|
245
|
+
const nBlocks = ((width + 3) >> 2) * ((height + 3) >> 2);
|
|
246
|
+
if (forceRGBA) {
|
|
247
|
+
uncompressedByteLength = width * ((height + 3) >> 2) * 4 * 4;
|
|
248
|
+
}
|
|
249
|
+
const texMemoryPages = ((nBlocks * 16 + 65535 + (this._transcodeInPlace ? 0 : uncompressedByteLength)) >> 16) + 1;
|
|
250
|
+
const textureView = this.memoryManager.getMemoryView(texMemoryPages, 65536, nBlocks * 16);
|
|
251
|
+
const uncompressedTextureView = this._transcodeInPlace ? null : new Uint8Array(this._memoryManager.wasmMemory.buffer, 65536 + nBlocks * 16, forceRGBA ? width * height * 4 : uncompressedByteLength);
|
|
252
|
+
textureView.set(encodedData);
|
|
253
|
+
return [textureView, uncompressedTextureView, nBlocks];
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
/***/ }),
|
|
259
|
+
|
|
260
|
+
/***/ "../../../tools/ktx2Decoder/dist/Transcoders/liteTranscoder_UASTC_ASTC.js":
|
|
261
|
+
/*!********************************************************************************!*\
|
|
262
|
+
!*** ../../../tools/ktx2Decoder/dist/Transcoders/liteTranscoder_UASTC_ASTC.js ***!
|
|
263
|
+
\********************************************************************************/
|
|
264
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
265
|
+
|
|
266
|
+
__webpack_require__.r(__webpack_exports__);
|
|
267
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
268
|
+
/* harmony export */ "LiteTranscoder_UASTC_ASTC": () => (/* binding */ LiteTranscoder_UASTC_ASTC)
|
|
269
|
+
/* harmony export */ });
|
|
270
|
+
/* harmony import */ var _transcoder__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../transcoder */ "../../../tools/ktx2Decoder/dist/transcoder.js");
|
|
271
|
+
/* harmony import */ var _liteTranscoder__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./liteTranscoder */ "../../../tools/ktx2Decoder/dist/Transcoders/liteTranscoder.js");
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* @hidden
|
|
276
|
+
*/
|
|
277
|
+
class LiteTranscoder_UASTC_ASTC extends _liteTranscoder__WEBPACK_IMPORTED_MODULE_1__.LiteTranscoder {
|
|
278
|
+
static CanTranscode(src, dst, isInGammaSpace) {
|
|
279
|
+
return src === _transcoder__WEBPACK_IMPORTED_MODULE_0__.sourceTextureFormat.UASTC4x4 && dst === _transcoder__WEBPACK_IMPORTED_MODULE_0__.transcodeTarget.ASTC_4x4_RGBA;
|
|
280
|
+
}
|
|
281
|
+
getName() {
|
|
282
|
+
return LiteTranscoder_UASTC_ASTC.Name;
|
|
283
|
+
}
|
|
284
|
+
initialize() {
|
|
285
|
+
super.initialize();
|
|
286
|
+
this.setModulePath(LiteTranscoder_UASTC_ASTC.WasmModuleURL);
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* URL to use when loading the wasm module for the transcoder
|
|
291
|
+
*/
|
|
292
|
+
LiteTranscoder_UASTC_ASTC.WasmModuleURL = "https://preview.babylonjs.com/ktx2Transcoders/uastc_astc.wasm";
|
|
293
|
+
LiteTranscoder_UASTC_ASTC.Name = "UniversalTranscoder_UASTC_ASTC";
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
/***/ }),
|
|
297
|
+
|
|
298
|
+
/***/ "../../../tools/ktx2Decoder/dist/Transcoders/liteTranscoder_UASTC_BC7.js":
|
|
299
|
+
/*!*******************************************************************************!*\
|
|
300
|
+
!*** ../../../tools/ktx2Decoder/dist/Transcoders/liteTranscoder_UASTC_BC7.js ***!
|
|
301
|
+
\*******************************************************************************/
|
|
302
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
303
|
+
|
|
304
|
+
__webpack_require__.r(__webpack_exports__);
|
|
305
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
306
|
+
/* harmony export */ "LiteTranscoder_UASTC_BC7": () => (/* binding */ LiteTranscoder_UASTC_BC7)
|
|
307
|
+
/* harmony export */ });
|
|
308
|
+
/* harmony import */ var _transcoder__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../transcoder */ "../../../tools/ktx2Decoder/dist/transcoder.js");
|
|
309
|
+
/* harmony import */ var _liteTranscoder__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./liteTranscoder */ "../../../tools/ktx2Decoder/dist/Transcoders/liteTranscoder.js");
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* @hidden
|
|
314
|
+
*/
|
|
315
|
+
class LiteTranscoder_UASTC_BC7 extends _liteTranscoder__WEBPACK_IMPORTED_MODULE_1__.LiteTranscoder {
|
|
316
|
+
static CanTranscode(src, dst, isInGammaSpace) {
|
|
317
|
+
return src === _transcoder__WEBPACK_IMPORTED_MODULE_0__.sourceTextureFormat.UASTC4x4 && dst === _transcoder__WEBPACK_IMPORTED_MODULE_0__.transcodeTarget.BC7_RGBA;
|
|
318
|
+
}
|
|
319
|
+
getName() {
|
|
320
|
+
return LiteTranscoder_UASTC_BC7.Name;
|
|
321
|
+
}
|
|
322
|
+
initialize() {
|
|
323
|
+
super.initialize();
|
|
324
|
+
this.setModulePath(LiteTranscoder_UASTC_BC7.WasmModuleURL);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* URL to use when loading the wasm module for the transcoder
|
|
329
|
+
*/
|
|
330
|
+
LiteTranscoder_UASTC_BC7.WasmModuleURL = "https://preview.babylonjs.com/ktx2Transcoders/uastc_bc7.wasm";
|
|
331
|
+
LiteTranscoder_UASTC_BC7.Name = "UniversalTranscoder_UASTC_BC7";
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
/***/ }),
|
|
335
|
+
|
|
336
|
+
/***/ "../../../tools/ktx2Decoder/dist/Transcoders/liteTranscoder_UASTC_RGBA_SRGB.js":
|
|
337
|
+
/*!*************************************************************************************!*\
|
|
338
|
+
!*** ../../../tools/ktx2Decoder/dist/Transcoders/liteTranscoder_UASTC_RGBA_SRGB.js ***!
|
|
339
|
+
\*************************************************************************************/
|
|
340
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
341
|
+
|
|
342
|
+
__webpack_require__.r(__webpack_exports__);
|
|
343
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
344
|
+
/* harmony export */ "LiteTranscoder_UASTC_RGBA_SRGB": () => (/* binding */ LiteTranscoder_UASTC_RGBA_SRGB)
|
|
345
|
+
/* harmony export */ });
|
|
346
|
+
/* harmony import */ var _transcoder__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../transcoder */ "../../../tools/ktx2Decoder/dist/transcoder.js");
|
|
347
|
+
/* harmony import */ var _liteTranscoder__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./liteTranscoder */ "../../../tools/ktx2Decoder/dist/Transcoders/liteTranscoder.js");
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* @hidden
|
|
352
|
+
*/
|
|
353
|
+
class LiteTranscoder_UASTC_RGBA_SRGB extends _liteTranscoder__WEBPACK_IMPORTED_MODULE_1__.LiteTranscoder {
|
|
354
|
+
static CanTranscode(src, dst, isInGammaSpace) {
|
|
355
|
+
return src === _transcoder__WEBPACK_IMPORTED_MODULE_0__.sourceTextureFormat.UASTC4x4 && dst === _transcoder__WEBPACK_IMPORTED_MODULE_0__.transcodeTarget.RGBA32 && isInGammaSpace;
|
|
356
|
+
}
|
|
357
|
+
getName() {
|
|
358
|
+
return LiteTranscoder_UASTC_RGBA_SRGB.Name;
|
|
359
|
+
}
|
|
360
|
+
initialize() {
|
|
361
|
+
super.initialize();
|
|
362
|
+
this._transcodeInPlace = false;
|
|
363
|
+
this.setModulePath(LiteTranscoder_UASTC_RGBA_SRGB.WasmModuleURL);
|
|
364
|
+
}
|
|
365
|
+
transcode(src, dst, level, width, height, uncompressedByteLength, ktx2Reader, imageDesc, encodedData) {
|
|
366
|
+
return this._loadModule().then((moduleWrapper) => {
|
|
367
|
+
const transcoder = moduleWrapper.module;
|
|
368
|
+
const [, uncompressedTextureView,] = this._prepareTranscoding(width, height, uncompressedByteLength, encodedData, true);
|
|
369
|
+
return transcoder.decodeRGBA32(width, height) === 0 ? uncompressedTextureView.slice() : null;
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
/**
|
|
374
|
+
* URL to use when loading the wasm module for the transcoder (srgb)
|
|
375
|
+
*/
|
|
376
|
+
LiteTranscoder_UASTC_RGBA_SRGB.WasmModuleURL = "https://preview.babylonjs.com/ktx2Transcoders/uastc_rgba32_srgb.wasm";
|
|
377
|
+
LiteTranscoder_UASTC_RGBA_SRGB.Name = "UniversalTranscoder_UASTC_RGBA_SRGB";
|
|
378
|
+
|
|
379
|
+
|
|
380
|
+
/***/ }),
|
|
381
|
+
|
|
382
|
+
/***/ "../../../tools/ktx2Decoder/dist/Transcoders/liteTranscoder_UASTC_RGBA_UNORM.js":
|
|
383
|
+
/*!**************************************************************************************!*\
|
|
384
|
+
!*** ../../../tools/ktx2Decoder/dist/Transcoders/liteTranscoder_UASTC_RGBA_UNORM.js ***!
|
|
385
|
+
\**************************************************************************************/
|
|
386
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
387
|
+
|
|
388
|
+
__webpack_require__.r(__webpack_exports__);
|
|
389
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
390
|
+
/* harmony export */ "LiteTranscoder_UASTC_RGBA_UNORM": () => (/* binding */ LiteTranscoder_UASTC_RGBA_UNORM)
|
|
391
|
+
/* harmony export */ });
|
|
392
|
+
/* harmony import */ var _transcoder__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../transcoder */ "../../../tools/ktx2Decoder/dist/transcoder.js");
|
|
393
|
+
/* harmony import */ var _liteTranscoder__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./liteTranscoder */ "../../../tools/ktx2Decoder/dist/Transcoders/liteTranscoder.js");
|
|
394
|
+
|
|
395
|
+
|
|
396
|
+
/**
|
|
397
|
+
* @hidden
|
|
398
|
+
*/
|
|
399
|
+
class LiteTranscoder_UASTC_RGBA_UNORM extends _liteTranscoder__WEBPACK_IMPORTED_MODULE_1__.LiteTranscoder {
|
|
400
|
+
static CanTranscode(src, dst, isInGammaSpace) {
|
|
401
|
+
return src === _transcoder__WEBPACK_IMPORTED_MODULE_0__.sourceTextureFormat.UASTC4x4 && dst === _transcoder__WEBPACK_IMPORTED_MODULE_0__.transcodeTarget.RGBA32 && !isInGammaSpace;
|
|
402
|
+
}
|
|
403
|
+
getName() {
|
|
404
|
+
return LiteTranscoder_UASTC_RGBA_UNORM.Name;
|
|
405
|
+
}
|
|
406
|
+
initialize() {
|
|
407
|
+
super.initialize();
|
|
408
|
+
this._transcodeInPlace = false;
|
|
409
|
+
this.setModulePath(LiteTranscoder_UASTC_RGBA_UNORM.WasmModuleURL);
|
|
410
|
+
}
|
|
411
|
+
transcode(src, dst, level, width, height, uncompressedByteLength, ktx2Reader, imageDesc, encodedData) {
|
|
412
|
+
return this._loadModule().then((moduleWrapper) => {
|
|
413
|
+
const transcoder = moduleWrapper.module;
|
|
414
|
+
const [, uncompressedTextureView,] = this._prepareTranscoding(width, height, uncompressedByteLength, encodedData, true);
|
|
415
|
+
return transcoder.decodeRGBA32(width, height) === 0 ? uncompressedTextureView.slice() : null;
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
/**
|
|
420
|
+
* URL to use when loading the wasm module for the transcoder (unorm)
|
|
421
|
+
*/
|
|
422
|
+
LiteTranscoder_UASTC_RGBA_UNORM.WasmModuleURL = "https://preview.babylonjs.com/ktx2Transcoders/uastc_rgba32_unorm.wasm";
|
|
423
|
+
LiteTranscoder_UASTC_RGBA_UNORM.Name = "UniversalTranscoder_UASTC_RGBA_UNORM";
|
|
424
|
+
|
|
425
|
+
|
|
426
|
+
/***/ }),
|
|
427
|
+
|
|
428
|
+
/***/ "../../../tools/ktx2Decoder/dist/Transcoders/mscTranscoder.js":
|
|
429
|
+
/*!********************************************************************!*\
|
|
430
|
+
!*** ../../../tools/ktx2Decoder/dist/Transcoders/mscTranscoder.js ***!
|
|
431
|
+
\********************************************************************/
|
|
432
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
433
|
+
|
|
434
|
+
__webpack_require__.r(__webpack_exports__);
|
|
435
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
436
|
+
/* harmony export */ "MSCTranscoder": () => (/* binding */ MSCTranscoder)
|
|
437
|
+
/* harmony export */ });
|
|
438
|
+
/* harmony import */ var _transcoder__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../transcoder */ "../../../tools/ktx2Decoder/dist/transcoder.js");
|
|
439
|
+
/* harmony import */ var _wasmMemoryManager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../wasmMemoryManager */ "../../../tools/ktx2Decoder/dist/wasmMemoryManager.js");
|
|
440
|
+
|
|
441
|
+
|
|
442
|
+
/**
|
|
443
|
+
* @hidden
|
|
444
|
+
*/
|
|
445
|
+
class MSCTranscoder extends _transcoder__WEBPACK_IMPORTED_MODULE_0__.Transcoder {
|
|
446
|
+
getName() {
|
|
447
|
+
return MSCTranscoder.Name;
|
|
448
|
+
}
|
|
449
|
+
_getMSCBasisTranscoder() {
|
|
450
|
+
if (this._mscBasisTranscoderPromise) {
|
|
451
|
+
return this._mscBasisTranscoderPromise;
|
|
452
|
+
}
|
|
453
|
+
this._mscBasisTranscoderPromise = _wasmMemoryManager__WEBPACK_IMPORTED_MODULE_1__.WASMMemoryManager.LoadWASM(MSCTranscoder.WasmModuleURL).then((wasmBinary) => {
|
|
454
|
+
if (MSCTranscoder.UseFromWorkerThread) {
|
|
455
|
+
importScripts(MSCTranscoder.JSModuleURL);
|
|
456
|
+
}
|
|
457
|
+
// Worker Number = 0 and MSC_TRANSCODER has not been loaded yet.
|
|
458
|
+
else if (typeof (MSC_TRANSCODER) === "undefined") {
|
|
459
|
+
return new Promise((resolve, reject) => {
|
|
460
|
+
const head = document.getElementsByTagName("head")[0];
|
|
461
|
+
const script = document.createElement("script");
|
|
462
|
+
script.setAttribute("type", "text/javascript");
|
|
463
|
+
script.setAttribute("src", MSCTranscoder.JSModuleURL);
|
|
464
|
+
script.onload = () => {
|
|
465
|
+
MSC_TRANSCODER({ wasmBinary }).then((basisModule) => {
|
|
466
|
+
basisModule.initTranscoders();
|
|
467
|
+
this._mscBasisModule = basisModule;
|
|
468
|
+
resolve();
|
|
469
|
+
});
|
|
470
|
+
};
|
|
471
|
+
script.onerror = () => {
|
|
472
|
+
reject("Can not load MSC_TRANSCODER script.");
|
|
473
|
+
};
|
|
474
|
+
head.appendChild(script);
|
|
475
|
+
});
|
|
476
|
+
}
|
|
477
|
+
return new Promise((resolve) => {
|
|
478
|
+
MSC_TRANSCODER({ wasmBinary }).then((basisModule) => {
|
|
479
|
+
basisModule.initTranscoders();
|
|
480
|
+
this._mscBasisModule = basisModule;
|
|
481
|
+
resolve();
|
|
482
|
+
});
|
|
483
|
+
});
|
|
484
|
+
});
|
|
485
|
+
return this._mscBasisTranscoderPromise;
|
|
486
|
+
}
|
|
487
|
+
static CanTranscode(src, dst, isInGammaSpace) {
|
|
488
|
+
return true;
|
|
489
|
+
}
|
|
490
|
+
transcode(src, dst, level, width, height, uncompressedByteLength, ktx2Reader, imageDesc, encodedData) {
|
|
491
|
+
const isVideo = false;
|
|
492
|
+
return this._getMSCBasisTranscoder().then(() => {
|
|
493
|
+
const basisModule = this._mscBasisModule;
|
|
494
|
+
let transcoder;
|
|
495
|
+
let imageInfo;
|
|
496
|
+
let result;
|
|
497
|
+
let textureData = null;
|
|
498
|
+
try {
|
|
499
|
+
transcoder = src === _transcoder__WEBPACK_IMPORTED_MODULE_0__.sourceTextureFormat.UASTC4x4 ? new basisModule.UastcImageTranscoder() : new basisModule.BasisLzEtc1sImageTranscoder();
|
|
500
|
+
const texFormat = src === _transcoder__WEBPACK_IMPORTED_MODULE_0__.sourceTextureFormat.UASTC4x4 ? basisModule.TextureFormat.UASTC4x4 : basisModule.TextureFormat.ETC1S;
|
|
501
|
+
imageInfo = new basisModule.ImageInfo(texFormat, width, height, level);
|
|
502
|
+
const targetFormat = basisModule.TranscodeTarget[_transcoder__WEBPACK_IMPORTED_MODULE_0__.transcodeTarget[dst]]; // works because the labels of the sourceTextureFormat enum are the same as the property names used in TranscodeTarget!
|
|
503
|
+
if (!basisModule.isFormatSupported(targetFormat, texFormat)) {
|
|
504
|
+
throw new Error(`MSCTranscoder: Transcoding from "${_transcoder__WEBPACK_IMPORTED_MODULE_0__.sourceTextureFormat[src]}" to "${_transcoder__WEBPACK_IMPORTED_MODULE_0__.transcodeTarget[dst]}" not supported by current transcoder build.`);
|
|
505
|
+
}
|
|
506
|
+
if (src === _transcoder__WEBPACK_IMPORTED_MODULE_0__.sourceTextureFormat.ETC1S) {
|
|
507
|
+
const sgd = ktx2Reader.supercompressionGlobalData;
|
|
508
|
+
transcoder.decodePalettes(sgd.endpointCount, sgd.endpointsData, sgd.selectorCount, sgd.selectorsData);
|
|
509
|
+
transcoder.decodeTables(sgd.tablesData);
|
|
510
|
+
imageInfo.flags = imageDesc.imageFlags;
|
|
511
|
+
imageInfo.rgbByteOffset = 0;
|
|
512
|
+
imageInfo.rgbByteLength = imageDesc.rgbSliceByteLength;
|
|
513
|
+
imageInfo.alphaByteOffset = imageDesc.alphaSliceByteOffset > 0 ? imageDesc.rgbSliceByteLength : 0;
|
|
514
|
+
imageInfo.alphaByteLength = imageDesc.alphaSliceByteLength;
|
|
515
|
+
result = transcoder.transcodeImage(targetFormat, encodedData, imageInfo, 0, isVideo);
|
|
516
|
+
}
|
|
517
|
+
else {
|
|
518
|
+
imageInfo.flags = 0;
|
|
519
|
+
imageInfo.rgbByteOffset = 0;
|
|
520
|
+
imageInfo.rgbByteLength = uncompressedByteLength;
|
|
521
|
+
imageInfo.alphaByteOffset = 0;
|
|
522
|
+
imageInfo.alphaByteLength = 0;
|
|
523
|
+
result = transcoder.transcodeImage(targetFormat, encodedData, imageInfo, 0, ktx2Reader.hasAlpha, isVideo);
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
finally {
|
|
527
|
+
if (transcoder) {
|
|
528
|
+
transcoder.delete();
|
|
529
|
+
}
|
|
530
|
+
if (imageInfo) {
|
|
531
|
+
imageInfo.delete();
|
|
532
|
+
}
|
|
533
|
+
if (result && result.transcodedImage) {
|
|
534
|
+
textureData = result.transcodedImage.get_typed_memory_view().slice();
|
|
535
|
+
result.transcodedImage.delete();
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
return textureData;
|
|
539
|
+
});
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
/**
|
|
543
|
+
* URL to use when loading the MSC transcoder
|
|
544
|
+
*/
|
|
545
|
+
MSCTranscoder.JSModuleURL = "https://preview.babylonjs.com/ktx2Transcoders/msc_basis_transcoder.js";
|
|
546
|
+
/**
|
|
547
|
+
* URL to use when loading the wasm module for the transcoder
|
|
548
|
+
*/
|
|
549
|
+
MSCTranscoder.WasmModuleURL = "https://preview.babylonjs.com/ktx2Transcoders/msc_basis_transcoder.wasm";
|
|
550
|
+
MSCTranscoder.UseFromWorkerThread = true;
|
|
551
|
+
MSCTranscoder.Name = "MSCTranscoder";
|
|
552
|
+
|
|
553
|
+
|
|
554
|
+
/***/ }),
|
|
555
|
+
|
|
556
|
+
/***/ "../../../tools/ktx2Decoder/dist/index.js":
|
|
557
|
+
/*!************************************************!*\
|
|
558
|
+
!*** ../../../tools/ktx2Decoder/dist/index.js ***!
|
|
559
|
+
\************************************************/
|
|
560
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
561
|
+
|
|
562
|
+
__webpack_require__.r(__webpack_exports__);
|
|
563
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
564
|
+
/* harmony export */ "KTX2Decoder": () => (/* reexport safe */ _ktx2Decoder__WEBPACK_IMPORTED_MODULE_0__.KTX2Decoder),
|
|
565
|
+
/* harmony export */ "KTX2FileReader": () => (/* reexport safe */ _ktx2FileReader__WEBPACK_IMPORTED_MODULE_1__.KTX2FileReader),
|
|
566
|
+
/* harmony export */ "SupercompressionScheme": () => (/* reexport safe */ _ktx2FileReader__WEBPACK_IMPORTED_MODULE_1__.SupercompressionScheme),
|
|
567
|
+
/* harmony export */ "Transcoder": () => (/* reexport safe */ _transcoder__WEBPACK_IMPORTED_MODULE_2__.Transcoder),
|
|
568
|
+
/* harmony export */ "sourceTextureFormat": () => (/* reexport safe */ _transcoder__WEBPACK_IMPORTED_MODULE_2__.sourceTextureFormat),
|
|
569
|
+
/* harmony export */ "transcodeTarget": () => (/* reexport safe */ _transcoder__WEBPACK_IMPORTED_MODULE_2__.transcodeTarget),
|
|
570
|
+
/* harmony export */ "TranscoderManager": () => (/* reexport safe */ _transcoderManager__WEBPACK_IMPORTED_MODULE_3__.TranscoderManager),
|
|
571
|
+
/* harmony export */ "WASMMemoryManager": () => (/* reexport safe */ _wasmMemoryManager__WEBPACK_IMPORTED_MODULE_4__.WASMMemoryManager),
|
|
572
|
+
/* harmony export */ "ZSTDDecoder": () => (/* reexport safe */ _zstddec__WEBPACK_IMPORTED_MODULE_5__.ZSTDDecoder),
|
|
573
|
+
/* harmony export */ "DataReader": () => (/* reexport safe */ _Misc_index__WEBPACK_IMPORTED_MODULE_6__.DataReader),
|
|
574
|
+
/* harmony export */ "LiteTranscoder": () => (/* reexport safe */ _Transcoders_index__WEBPACK_IMPORTED_MODULE_7__.LiteTranscoder),
|
|
575
|
+
/* harmony export */ "LiteTranscoder_UASTC_ASTC": () => (/* reexport safe */ _Transcoders_index__WEBPACK_IMPORTED_MODULE_7__.LiteTranscoder_UASTC_ASTC),
|
|
576
|
+
/* harmony export */ "LiteTranscoder_UASTC_BC7": () => (/* reexport safe */ _Transcoders_index__WEBPACK_IMPORTED_MODULE_7__.LiteTranscoder_UASTC_BC7),
|
|
577
|
+
/* harmony export */ "LiteTranscoder_UASTC_RGBA_SRGB": () => (/* reexport safe */ _Transcoders_index__WEBPACK_IMPORTED_MODULE_7__.LiteTranscoder_UASTC_RGBA_SRGB),
|
|
578
|
+
/* harmony export */ "LiteTranscoder_UASTC_RGBA_UNORM": () => (/* reexport safe */ _Transcoders_index__WEBPACK_IMPORTED_MODULE_7__.LiteTranscoder_UASTC_RGBA_UNORM),
|
|
579
|
+
/* harmony export */ "MSCTranscoder": () => (/* reexport safe */ _Transcoders_index__WEBPACK_IMPORTED_MODULE_7__.MSCTranscoder)
|
|
580
|
+
/* harmony export */ });
|
|
581
|
+
/* harmony import */ var _ktx2Decoder__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ktx2Decoder */ "../../../tools/ktx2Decoder/dist/ktx2Decoder.js");
|
|
582
|
+
/* harmony import */ var _ktx2FileReader__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ktx2FileReader */ "../../../tools/ktx2Decoder/dist/ktx2FileReader.js");
|
|
583
|
+
/* harmony import */ var _transcoder__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./transcoder */ "../../../tools/ktx2Decoder/dist/transcoder.js");
|
|
584
|
+
/* harmony import */ var _transcoderManager__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./transcoderManager */ "../../../tools/ktx2Decoder/dist/transcoderManager.js");
|
|
585
|
+
/* harmony import */ var _wasmMemoryManager__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./wasmMemoryManager */ "../../../tools/ktx2Decoder/dist/wasmMemoryManager.js");
|
|
586
|
+
/* harmony import */ var _zstddec__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./zstddec */ "../../../tools/ktx2Decoder/dist/zstddec.js");
|
|
587
|
+
/* harmony import */ var _Misc_index__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Misc/index */ "../../../tools/ktx2Decoder/dist/Misc/index.js");
|
|
588
|
+
/* harmony import */ var _Transcoders_index__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Transcoders/index */ "../../../tools/ktx2Decoder/dist/Transcoders/index.js");
|
|
589
|
+
|
|
590
|
+
|
|
591
|
+
|
|
592
|
+
|
|
593
|
+
|
|
594
|
+
|
|
595
|
+
|
|
596
|
+
|
|
597
|
+
|
|
598
|
+
|
|
599
|
+
/***/ }),
|
|
600
|
+
|
|
601
|
+
/***/ "../../../tools/ktx2Decoder/dist/ktx2Decoder.js":
|
|
602
|
+
/*!******************************************************!*\
|
|
603
|
+
!*** ../../../tools/ktx2Decoder/dist/ktx2Decoder.js ***!
|
|
604
|
+
\******************************************************/
|
|
605
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
606
|
+
|
|
607
|
+
__webpack_require__.r(__webpack_exports__);
|
|
608
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
609
|
+
/* harmony export */ "KTX2Decoder": () => (/* binding */ KTX2Decoder)
|
|
610
|
+
/* harmony export */ });
|
|
611
|
+
/* harmony import */ var _ktx2FileReader__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ktx2FileReader */ "../../../tools/ktx2Decoder/dist/ktx2FileReader.js");
|
|
612
|
+
/* harmony import */ var _transcoderManager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./transcoderManager */ "../../../tools/ktx2Decoder/dist/transcoderManager.js");
|
|
613
|
+
/* harmony import */ var _Transcoders_liteTranscoder_UASTC_ASTC__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Transcoders/liteTranscoder_UASTC_ASTC */ "../../../tools/ktx2Decoder/dist/Transcoders/liteTranscoder_UASTC_ASTC.js");
|
|
614
|
+
/* harmony import */ var _Transcoders_liteTranscoder_UASTC_BC7__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Transcoders/liteTranscoder_UASTC_BC7 */ "../../../tools/ktx2Decoder/dist/Transcoders/liteTranscoder_UASTC_BC7.js");
|
|
615
|
+
/* harmony import */ var _Transcoders_liteTranscoder_UASTC_RGBA_UNORM__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Transcoders/liteTranscoder_UASTC_RGBA_UNORM */ "../../../tools/ktx2Decoder/dist/Transcoders/liteTranscoder_UASTC_RGBA_UNORM.js");
|
|
616
|
+
/* harmony import */ var _Transcoders_liteTranscoder_UASTC_RGBA_SRGB__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Transcoders/liteTranscoder_UASTC_RGBA_SRGB */ "../../../tools/ktx2Decoder/dist/Transcoders/liteTranscoder_UASTC_RGBA_SRGB.js");
|
|
617
|
+
/* harmony import */ var _Transcoders_mscTranscoder__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Transcoders/mscTranscoder */ "../../../tools/ktx2Decoder/dist/Transcoders/mscTranscoder.js");
|
|
618
|
+
/* harmony import */ var _transcoder__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./transcoder */ "../../../tools/ktx2Decoder/dist/transcoder.js");
|
|
619
|
+
/* harmony import */ var _zstddec__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./zstddec */ "../../../tools/ktx2Decoder/dist/zstddec.js");
|
|
620
|
+
/* harmony import */ var _transcodeDecisionTree__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./transcodeDecisionTree */ "../../../tools/ktx2Decoder/dist/transcodeDecisionTree.js");
|
|
621
|
+
/**
|
|
622
|
+
* Resources used for the implementation:
|
|
623
|
+
* - 3js KTX2 loader: https://github.com/mrdoob/three.js/blob/dfb5c23ce126ec845e4aa240599915fef5375797/examples/jsm/loaders/KTX2Loader.js
|
|
624
|
+
* - Universal Texture Transcoders: https://github.com/KhronosGroup/Universal-Texture-Transcoders
|
|
625
|
+
* - KTX2 specification: http://github.khronos.org/KTX-Specification/
|
|
626
|
+
* - KTX2 binaries to convert files: https://github.com/KhronosGroup/KTX-Software/releases
|
|
627
|
+
* - KTX specification: https://www.khronos.org/registry/DataFormat/specs/1.3/dataformat.1.3.html
|
|
628
|
+
* - KTX-Software: https://github.com/KhronosGroup/KTX-Software
|
|
629
|
+
*/
|
|
630
|
+
|
|
631
|
+
|
|
632
|
+
|
|
633
|
+
|
|
634
|
+
|
|
635
|
+
|
|
636
|
+
|
|
637
|
+
|
|
638
|
+
|
|
639
|
+
|
|
640
|
+
const isPowerOfTwo = (value) => {
|
|
641
|
+
return (value & (value - 1)) === 0 && value !== 0;
|
|
642
|
+
};
|
|
643
|
+
/**
|
|
644
|
+
* Class for decoding KTX2 files
|
|
645
|
+
*
|
|
646
|
+
*/
|
|
647
|
+
class KTX2Decoder {
|
|
648
|
+
constructor() {
|
|
649
|
+
this._transcoderMgr = new _transcoderManager__WEBPACK_IMPORTED_MODULE_1__.TranscoderManager();
|
|
650
|
+
}
|
|
651
|
+
decode(data, caps, options) {
|
|
652
|
+
return Promise.resolve().then(() => {
|
|
653
|
+
const kfr = new _ktx2FileReader__WEBPACK_IMPORTED_MODULE_0__.KTX2FileReader(data);
|
|
654
|
+
if (!kfr.isValid()) {
|
|
655
|
+
throw new Error("Invalid KT2 file: wrong signature");
|
|
656
|
+
}
|
|
657
|
+
kfr.parse();
|
|
658
|
+
if (kfr.needZSTDDecoder) {
|
|
659
|
+
if (!this._zstdDecoder) {
|
|
660
|
+
this._zstdDecoder = new _zstddec__WEBPACK_IMPORTED_MODULE_8__.ZSTDDecoder();
|
|
661
|
+
}
|
|
662
|
+
return this._zstdDecoder.init().then(() => {
|
|
663
|
+
return this._decodeData(kfr, caps, options);
|
|
664
|
+
});
|
|
665
|
+
}
|
|
666
|
+
return this._decodeData(kfr, caps, options);
|
|
667
|
+
});
|
|
668
|
+
}
|
|
669
|
+
_decodeData(kfr, caps, options) {
|
|
670
|
+
const width = kfr.header.pixelWidth;
|
|
671
|
+
const height = kfr.header.pixelHeight;
|
|
672
|
+
const srcTexFormat = kfr.textureFormat;
|
|
673
|
+
const decisionTree = new _transcodeDecisionTree__WEBPACK_IMPORTED_MODULE_9__.TranscodeDecisionTree(srcTexFormat, kfr.hasAlpha, isPowerOfTwo(width) && isPowerOfTwo(height), caps, options);
|
|
674
|
+
const transcodeFormat = decisionTree.transcodeFormat;
|
|
675
|
+
const engineFormat = decisionTree.engineFormat;
|
|
676
|
+
const roundToMultiple4 = decisionTree.roundToMultiple4;
|
|
677
|
+
const transcoder = this._transcoderMgr.findTranscoder(srcTexFormat, transcodeFormat, kfr.isInGammaSpace, options === null || options === void 0 ? void 0 : options.bypassTranscoders);
|
|
678
|
+
if (transcoder === null) {
|
|
679
|
+
throw new Error(`no transcoder found to transcode source texture format "${_transcoder__WEBPACK_IMPORTED_MODULE_7__.sourceTextureFormat[srcTexFormat]}" to format "${_transcoder__WEBPACK_IMPORTED_MODULE_7__.transcodeTarget[transcodeFormat]}"`);
|
|
680
|
+
}
|
|
681
|
+
const mipmaps = [];
|
|
682
|
+
const dataPromises = [];
|
|
683
|
+
const decodedData = {
|
|
684
|
+
width: 0,
|
|
685
|
+
height: 0,
|
|
686
|
+
transcodedFormat: engineFormat,
|
|
687
|
+
mipmaps,
|
|
688
|
+
isInGammaSpace: kfr.isInGammaSpace,
|
|
689
|
+
hasAlpha: kfr.hasAlpha,
|
|
690
|
+
transcoderName: transcoder.getName(),
|
|
691
|
+
};
|
|
692
|
+
let firstImageDescIndex = 0;
|
|
693
|
+
for (let level = 0; level < kfr.header.levelCount; level++) {
|
|
694
|
+
if (level > 0) {
|
|
695
|
+
firstImageDescIndex += Math.max(kfr.header.layerCount, 1) * kfr.header.faceCount * Math.max(kfr.header.pixelDepth >> (level - 1), 1);
|
|
696
|
+
}
|
|
697
|
+
const levelWidth = Math.floor(width / (1 << level)) || 1;
|
|
698
|
+
const levelHeight = Math.floor(height / (1 << level)) || 1;
|
|
699
|
+
const numImagesInLevel = kfr.header.faceCount; // note that cubemap are not supported yet (see KTX2FileReader), so faceCount == 1
|
|
700
|
+
const levelImageByteLength = ((levelWidth + 3) >> 2) * ((levelHeight + 3) >> 2) * kfr.dfdBlock.bytesPlane[0];
|
|
701
|
+
const levelUncompressedByteLength = kfr.levels[level].uncompressedByteLength;
|
|
702
|
+
let levelDataBuffer = kfr.data.buffer;
|
|
703
|
+
let levelDataOffset = kfr.levels[level].byteOffset + kfr.data.byteOffset;
|
|
704
|
+
let imageOffsetInLevel = 0;
|
|
705
|
+
if (kfr.header.supercompressionScheme === _ktx2FileReader__WEBPACK_IMPORTED_MODULE_0__.SupercompressionScheme.ZStandard) {
|
|
706
|
+
levelDataBuffer = this._zstdDecoder.decode(new Uint8Array(levelDataBuffer, levelDataOffset, kfr.levels[level].byteLength), levelUncompressedByteLength);
|
|
707
|
+
levelDataOffset = 0;
|
|
708
|
+
}
|
|
709
|
+
if (level === 0) {
|
|
710
|
+
decodedData.width = roundToMultiple4 ? (levelWidth + 3) & ~3 : levelWidth;
|
|
711
|
+
decodedData.height = roundToMultiple4 ? (levelHeight + 3) & ~3 : levelHeight;
|
|
712
|
+
}
|
|
713
|
+
for (let imageIndex = 0; imageIndex < numImagesInLevel; imageIndex++) {
|
|
714
|
+
let encodedData;
|
|
715
|
+
let imageDesc = null;
|
|
716
|
+
if (kfr.header.supercompressionScheme === _ktx2FileReader__WEBPACK_IMPORTED_MODULE_0__.SupercompressionScheme.BasisLZ) {
|
|
717
|
+
imageDesc = kfr.supercompressionGlobalData.imageDescs[firstImageDescIndex + imageIndex];
|
|
718
|
+
encodedData = new Uint8Array(levelDataBuffer, levelDataOffset + imageDesc.rgbSliceByteOffset, imageDesc.rgbSliceByteLength + imageDesc.alphaSliceByteLength);
|
|
719
|
+
}
|
|
720
|
+
else {
|
|
721
|
+
encodedData = new Uint8Array(levelDataBuffer, levelDataOffset + imageOffsetInLevel, levelImageByteLength);
|
|
722
|
+
imageOffsetInLevel += levelImageByteLength;
|
|
723
|
+
}
|
|
724
|
+
const mipmap = {
|
|
725
|
+
data: null,
|
|
726
|
+
width: levelWidth,
|
|
727
|
+
height: levelHeight,
|
|
728
|
+
};
|
|
729
|
+
const transcodedData = transcoder
|
|
730
|
+
.transcode(srcTexFormat, transcodeFormat, level, levelWidth, levelHeight, levelUncompressedByteLength, kfr, imageDesc, encodedData)
|
|
731
|
+
.then((data) => {
|
|
732
|
+
mipmap.data = data;
|
|
733
|
+
return data;
|
|
734
|
+
})
|
|
735
|
+
.catch((reason) => {
|
|
736
|
+
var _a;
|
|
737
|
+
decodedData.errors = (_a = decodedData.errors) !== null && _a !== void 0 ? _a : "";
|
|
738
|
+
decodedData.errors += reason + "\n" + reason.stack + "\n";
|
|
739
|
+
return null;
|
|
740
|
+
});
|
|
741
|
+
dataPromises.push(transcodedData);
|
|
742
|
+
mipmaps.push(mipmap);
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
return Promise.all(dataPromises).then(() => {
|
|
746
|
+
return decodedData;
|
|
747
|
+
});
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
// Put in the order you want the transcoders to be used in priority
|
|
751
|
+
_transcoderManager__WEBPACK_IMPORTED_MODULE_1__.TranscoderManager.RegisterTranscoder(_Transcoders_liteTranscoder_UASTC_ASTC__WEBPACK_IMPORTED_MODULE_2__.LiteTranscoder_UASTC_ASTC);
|
|
752
|
+
_transcoderManager__WEBPACK_IMPORTED_MODULE_1__.TranscoderManager.RegisterTranscoder(_Transcoders_liteTranscoder_UASTC_BC7__WEBPACK_IMPORTED_MODULE_3__.LiteTranscoder_UASTC_BC7);
|
|
753
|
+
_transcoderManager__WEBPACK_IMPORTED_MODULE_1__.TranscoderManager.RegisterTranscoder(_Transcoders_liteTranscoder_UASTC_RGBA_UNORM__WEBPACK_IMPORTED_MODULE_4__.LiteTranscoder_UASTC_RGBA_UNORM);
|
|
754
|
+
_transcoderManager__WEBPACK_IMPORTED_MODULE_1__.TranscoderManager.RegisterTranscoder(_Transcoders_liteTranscoder_UASTC_RGBA_SRGB__WEBPACK_IMPORTED_MODULE_5__.LiteTranscoder_UASTC_RGBA_SRGB);
|
|
755
|
+
_transcoderManager__WEBPACK_IMPORTED_MODULE_1__.TranscoderManager.RegisterTranscoder(_Transcoders_mscTranscoder__WEBPACK_IMPORTED_MODULE_6__.MSCTranscoder); // catch all transcoder - will throw an error if the format can't be transcoded
|
|
756
|
+
|
|
757
|
+
|
|
758
|
+
/***/ }),
|
|
759
|
+
|
|
760
|
+
/***/ "../../../tools/ktx2Decoder/dist/ktx2FileReader.js":
|
|
761
|
+
/*!*********************************************************!*\
|
|
762
|
+
!*** ../../../tools/ktx2Decoder/dist/ktx2FileReader.js ***!
|
|
763
|
+
\*********************************************************/
|
|
764
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
765
|
+
|
|
766
|
+
__webpack_require__.r(__webpack_exports__);
|
|
767
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
768
|
+
/* harmony export */ "SupercompressionScheme": () => (/* binding */ SupercompressionScheme),
|
|
769
|
+
/* harmony export */ "KTX2FileReader": () => (/* binding */ KTX2FileReader)
|
|
770
|
+
/* harmony export */ });
|
|
771
|
+
/* harmony import */ var _Misc_dataReader__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Misc/dataReader */ "../../../tools/ktx2Decoder/dist/Misc/dataReader.js");
|
|
772
|
+
/* harmony import */ var _transcoder__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./transcoder */ "../../../tools/ktx2Decoder/dist/transcoder.js");
|
|
773
|
+
|
|
774
|
+
|
|
775
|
+
/** @hidden */
|
|
776
|
+
var SupercompressionScheme;
|
|
777
|
+
(function (SupercompressionScheme) {
|
|
778
|
+
SupercompressionScheme[SupercompressionScheme["None"] = 0] = "None";
|
|
779
|
+
SupercompressionScheme[SupercompressionScheme["BasisLZ"] = 1] = "BasisLZ";
|
|
780
|
+
SupercompressionScheme[SupercompressionScheme["ZStandard"] = 2] = "ZStandard";
|
|
781
|
+
SupercompressionScheme[SupercompressionScheme["ZLib"] = 3] = "ZLib";
|
|
782
|
+
})(SupercompressionScheme || (SupercompressionScheme = {}));
|
|
783
|
+
class KTX2FileReader {
|
|
784
|
+
/**
|
|
785
|
+
* Will throw an exception if the file can't be parsed
|
|
786
|
+
*/
|
|
787
|
+
constructor(data) {
|
|
788
|
+
this._data = data;
|
|
789
|
+
}
|
|
790
|
+
get data() {
|
|
791
|
+
return this._data;
|
|
792
|
+
}
|
|
793
|
+
get header() {
|
|
794
|
+
return this._header;
|
|
795
|
+
}
|
|
796
|
+
get levels() {
|
|
797
|
+
return this._levels;
|
|
798
|
+
}
|
|
799
|
+
get dfdBlock() {
|
|
800
|
+
return this._dfdBlock;
|
|
801
|
+
}
|
|
802
|
+
get supercompressionGlobalData() {
|
|
803
|
+
return this._supercompressionGlobalData;
|
|
804
|
+
}
|
|
805
|
+
isValid() {
|
|
806
|
+
return KTX2FileReader.IsValid(this._data);
|
|
807
|
+
}
|
|
808
|
+
parse() {
|
|
809
|
+
let offsetInFile = 12; // skip the header
|
|
810
|
+
/**
|
|
811
|
+
* Get the header
|
|
812
|
+
*/
|
|
813
|
+
const hdrReader = new _Misc_dataReader__WEBPACK_IMPORTED_MODULE_0__.DataReader(this._data, offsetInFile, 17 * 4);
|
|
814
|
+
const header = this._header = {
|
|
815
|
+
vkFormat: hdrReader.readUint32(),
|
|
816
|
+
typeSize: hdrReader.readUint32(),
|
|
817
|
+
pixelWidth: hdrReader.readUint32(),
|
|
818
|
+
pixelHeight: hdrReader.readUint32(),
|
|
819
|
+
pixelDepth: hdrReader.readUint32(),
|
|
820
|
+
layerCount: hdrReader.readUint32(),
|
|
821
|
+
faceCount: hdrReader.readUint32(),
|
|
822
|
+
levelCount: hdrReader.readUint32(),
|
|
823
|
+
supercompressionScheme: hdrReader.readUint32(),
|
|
824
|
+
dfdByteOffset: hdrReader.readUint32(),
|
|
825
|
+
dfdByteLength: hdrReader.readUint32(),
|
|
826
|
+
kvdByteOffset: hdrReader.readUint32(),
|
|
827
|
+
kvdByteLength: hdrReader.readUint32(),
|
|
828
|
+
sgdByteOffset: hdrReader.readUint64(),
|
|
829
|
+
sgdByteLength: hdrReader.readUint64(),
|
|
830
|
+
};
|
|
831
|
+
if (header.pixelDepth > 0) {
|
|
832
|
+
throw new Error(`Failed to parse KTX2 file - Only 2D textures are currently supported.`);
|
|
833
|
+
}
|
|
834
|
+
if (header.layerCount > 1) {
|
|
835
|
+
throw new Error(`Failed to parse KTX2 file - Array textures are not currently supported.`);
|
|
836
|
+
}
|
|
837
|
+
if (header.faceCount > 1) {
|
|
838
|
+
throw new Error(`Failed to parse KTX2 file - Cube textures are not currently supported.`);
|
|
839
|
+
}
|
|
840
|
+
offsetInFile += hdrReader.byteOffset;
|
|
841
|
+
/**
|
|
842
|
+
* Get the levels
|
|
843
|
+
*/
|
|
844
|
+
let levelCount = Math.max(1, header.levelCount);
|
|
845
|
+
const levelReader = new _Misc_dataReader__WEBPACK_IMPORTED_MODULE_0__.DataReader(this._data, offsetInFile, levelCount * 3 * (2 * 4));
|
|
846
|
+
const levels = this._levels = [];
|
|
847
|
+
while (levelCount--) {
|
|
848
|
+
levels.push({
|
|
849
|
+
byteOffset: levelReader.readUint64(),
|
|
850
|
+
byteLength: levelReader.readUint64(),
|
|
851
|
+
uncompressedByteLength: levelReader.readUint64(),
|
|
852
|
+
});
|
|
853
|
+
}
|
|
854
|
+
offsetInFile += levelReader.byteOffset;
|
|
855
|
+
/**
|
|
856
|
+
* Get the data format descriptor (DFD) blocks
|
|
857
|
+
*/
|
|
858
|
+
const dfdReader = new _Misc_dataReader__WEBPACK_IMPORTED_MODULE_0__.DataReader(this._data, header.dfdByteOffset, header.dfdByteLength);
|
|
859
|
+
const dfdBlock = this._dfdBlock = {
|
|
860
|
+
vendorId: dfdReader.skipBytes(4 /* skip totalSize */).readUint16(),
|
|
861
|
+
descriptorType: dfdReader.readUint16(),
|
|
862
|
+
versionNumber: dfdReader.readUint16(),
|
|
863
|
+
descriptorBlockSize: dfdReader.readUint16(),
|
|
864
|
+
colorModel: dfdReader.readUint8(),
|
|
865
|
+
colorPrimaries: dfdReader.readUint8(),
|
|
866
|
+
transferFunction: dfdReader.readUint8(),
|
|
867
|
+
flags: dfdReader.readUint8(),
|
|
868
|
+
texelBlockDimension: {
|
|
869
|
+
x: dfdReader.readUint8() + 1,
|
|
870
|
+
y: dfdReader.readUint8() + 1,
|
|
871
|
+
z: dfdReader.readUint8() + 1,
|
|
872
|
+
w: dfdReader.readUint8() + 1,
|
|
873
|
+
},
|
|
874
|
+
bytesPlane: [
|
|
875
|
+
dfdReader.readUint8(),
|
|
876
|
+
dfdReader.readUint8(),
|
|
877
|
+
dfdReader.readUint8(),
|
|
878
|
+
dfdReader.readUint8(),
|
|
879
|
+
dfdReader.readUint8(),
|
|
880
|
+
dfdReader.readUint8(),
|
|
881
|
+
dfdReader.readUint8(),
|
|
882
|
+
dfdReader.readUint8(), /* bytesPlane7 */
|
|
883
|
+
],
|
|
884
|
+
numSamples: 0,
|
|
885
|
+
samples: new Array(),
|
|
886
|
+
};
|
|
887
|
+
dfdBlock.numSamples = (dfdBlock.descriptorBlockSize - 24) / 16;
|
|
888
|
+
for (let i = 0; i < dfdBlock.numSamples; i++) {
|
|
889
|
+
const sample = {
|
|
890
|
+
bitOffset: dfdReader.readUint16(),
|
|
891
|
+
bitLength: dfdReader.readUint8() + 1,
|
|
892
|
+
channelType: dfdReader.readUint8(),
|
|
893
|
+
channelFlags: 0,
|
|
894
|
+
samplePosition: [
|
|
895
|
+
dfdReader.readUint8(),
|
|
896
|
+
dfdReader.readUint8(),
|
|
897
|
+
dfdReader.readUint8(),
|
|
898
|
+
dfdReader.readUint8(), /* samplePosition3 */
|
|
899
|
+
],
|
|
900
|
+
sampleLower: dfdReader.readUint32(),
|
|
901
|
+
sampleUpper: dfdReader.readUint32(),
|
|
902
|
+
};
|
|
903
|
+
sample.channelFlags = (sample.channelType & 0xF0) >> 4;
|
|
904
|
+
sample.channelType = sample.channelType & 0x0F;
|
|
905
|
+
dfdBlock.samples.push(sample);
|
|
906
|
+
}
|
|
907
|
+
/**
|
|
908
|
+
* Get the Supercompression Global Data (sgd)
|
|
909
|
+
*/
|
|
910
|
+
const sgd = this._supercompressionGlobalData = {};
|
|
911
|
+
if (header.sgdByteLength > 0) {
|
|
912
|
+
const sgdReader = new _Misc_dataReader__WEBPACK_IMPORTED_MODULE_0__.DataReader(this._data, header.sgdByteOffset, header.sgdByteLength);
|
|
913
|
+
sgd.endpointCount = sgdReader.readUint16();
|
|
914
|
+
sgd.selectorCount = sgdReader.readUint16();
|
|
915
|
+
sgd.endpointsByteLength = sgdReader.readUint32();
|
|
916
|
+
sgd.selectorsByteLength = sgdReader.readUint32();
|
|
917
|
+
sgd.tablesByteLength = sgdReader.readUint32();
|
|
918
|
+
sgd.extendedByteLength = sgdReader.readUint32();
|
|
919
|
+
sgd.imageDescs = [];
|
|
920
|
+
const imageCount = this._getImageCount();
|
|
921
|
+
for (let i = 0; i < imageCount; i++) {
|
|
922
|
+
sgd.imageDescs.push({
|
|
923
|
+
imageFlags: sgdReader.readUint32(),
|
|
924
|
+
rgbSliceByteOffset: sgdReader.readUint32(),
|
|
925
|
+
rgbSliceByteLength: sgdReader.readUint32(),
|
|
926
|
+
alphaSliceByteOffset: sgdReader.readUint32(),
|
|
927
|
+
alphaSliceByteLength: sgdReader.readUint32(),
|
|
928
|
+
});
|
|
929
|
+
}
|
|
930
|
+
const endpointsByteOffset = header.sgdByteOffset + sgdReader.byteOffset;
|
|
931
|
+
const selectorsByteOffset = endpointsByteOffset + sgd.endpointsByteLength;
|
|
932
|
+
const tablesByteOffset = selectorsByteOffset + sgd.selectorsByteLength;
|
|
933
|
+
const extendedByteOffset = tablesByteOffset + sgd.tablesByteLength;
|
|
934
|
+
sgd.endpointsData = new Uint8Array(this._data.buffer, this._data.byteOffset + endpointsByteOffset, sgd.endpointsByteLength);
|
|
935
|
+
sgd.selectorsData = new Uint8Array(this._data.buffer, this._data.byteOffset + selectorsByteOffset, sgd.selectorsByteLength);
|
|
936
|
+
sgd.tablesData = new Uint8Array(this._data.buffer, this._data.byteOffset + tablesByteOffset, sgd.tablesByteLength);
|
|
937
|
+
sgd.extendedData = new Uint8Array(this._data.buffer, this._data.byteOffset + extendedByteOffset, sgd.extendedByteLength);
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
_getImageCount() {
|
|
941
|
+
let layerPixelDepth = Math.max(this._header.pixelDepth, 1);
|
|
942
|
+
for (let i = 1; i < this._header.levelCount; i++) {
|
|
943
|
+
layerPixelDepth += Math.max(this._header.pixelDepth >> i, 1);
|
|
944
|
+
}
|
|
945
|
+
return Math.max(this._header.layerCount, 1) * this._header.faceCount * layerPixelDepth;
|
|
946
|
+
}
|
|
947
|
+
get textureFormat() {
|
|
948
|
+
return this._dfdBlock.colorModel === 166 /* UASTC */ ? _transcoder__WEBPACK_IMPORTED_MODULE_1__.sourceTextureFormat.UASTC4x4 : _transcoder__WEBPACK_IMPORTED_MODULE_1__.sourceTextureFormat.ETC1S;
|
|
949
|
+
}
|
|
950
|
+
get hasAlpha() {
|
|
951
|
+
const tformat = this.textureFormat;
|
|
952
|
+
switch (tformat) {
|
|
953
|
+
case _transcoder__WEBPACK_IMPORTED_MODULE_1__.sourceTextureFormat.ETC1S:
|
|
954
|
+
return this._dfdBlock.numSamples === 2 && (this._dfdBlock.samples[0].channelType === 15 /* AAA */ || this._dfdBlock.samples[1].channelType === 15 /* AAA */);
|
|
955
|
+
case _transcoder__WEBPACK_IMPORTED_MODULE_1__.sourceTextureFormat.UASTC4x4:
|
|
956
|
+
return this._dfdBlock.samples[0].channelType === 3 /* RGBA */;
|
|
957
|
+
}
|
|
958
|
+
return false;
|
|
959
|
+
}
|
|
960
|
+
get needZSTDDecoder() {
|
|
961
|
+
return this._header.supercompressionScheme === SupercompressionScheme.ZStandard;
|
|
962
|
+
}
|
|
963
|
+
get isInGammaSpace() {
|
|
964
|
+
return this._dfdBlock.transferFunction === 2 /* sRGB */;
|
|
965
|
+
}
|
|
966
|
+
static IsValid(data) {
|
|
967
|
+
if (data.byteLength >= 12) {
|
|
968
|
+
// '«', 'K', 'T', 'X', ' ', '2', '0', '»', '\r', '\n', '\x1A', '\n'
|
|
969
|
+
const identifier = new Uint8Array(data.buffer, data.byteOffset, 12);
|
|
970
|
+
if (identifier[0] === 0xAB && identifier[1] === 0x4B && identifier[2] === 0x54 && identifier[3] === 0x58 && identifier[4] === 0x20 && identifier[5] === 0x32 &&
|
|
971
|
+
identifier[6] === 0x30 && identifier[7] === 0xBB && identifier[8] === 0x0D && identifier[9] === 0x0A && identifier[10] === 0x1A && identifier[11] === 0x0A) {
|
|
972
|
+
return true;
|
|
973
|
+
}
|
|
974
|
+
}
|
|
975
|
+
return false;
|
|
976
|
+
}
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
|
|
980
|
+
/***/ }),
|
|
981
|
+
|
|
982
|
+
/***/ "../../../tools/ktx2Decoder/dist/legacy/legacy.js":
|
|
983
|
+
/*!********************************************************!*\
|
|
984
|
+
!*** ../../../tools/ktx2Decoder/dist/legacy/legacy.js ***!
|
|
985
|
+
\********************************************************/
|
|
986
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
987
|
+
|
|
988
|
+
__webpack_require__.r(__webpack_exports__);
|
|
989
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
990
|
+
/* harmony export */ "DataReader": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.DataReader),
|
|
991
|
+
/* harmony export */ "KTX2Decoder": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.KTX2Decoder),
|
|
992
|
+
/* harmony export */ "KTX2FileReader": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.KTX2FileReader),
|
|
993
|
+
/* harmony export */ "LiteTranscoder": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.LiteTranscoder),
|
|
994
|
+
/* harmony export */ "LiteTranscoder_UASTC_ASTC": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.LiteTranscoder_UASTC_ASTC),
|
|
995
|
+
/* harmony export */ "LiteTranscoder_UASTC_BC7": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.LiteTranscoder_UASTC_BC7),
|
|
996
|
+
/* harmony export */ "LiteTranscoder_UASTC_RGBA_SRGB": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.LiteTranscoder_UASTC_RGBA_SRGB),
|
|
997
|
+
/* harmony export */ "LiteTranscoder_UASTC_RGBA_UNORM": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.LiteTranscoder_UASTC_RGBA_UNORM),
|
|
998
|
+
/* harmony export */ "MSCTranscoder": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.MSCTranscoder),
|
|
999
|
+
/* harmony export */ "SupercompressionScheme": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.SupercompressionScheme),
|
|
1000
|
+
/* harmony export */ "Transcoder": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.Transcoder),
|
|
1001
|
+
/* harmony export */ "TranscoderManager": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.TranscoderManager),
|
|
1002
|
+
/* harmony export */ "WASMMemoryManager": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.WASMMemoryManager),
|
|
1003
|
+
/* harmony export */ "ZSTDDecoder": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.ZSTDDecoder),
|
|
1004
|
+
/* harmony export */ "sourceTextureFormat": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.sourceTextureFormat),
|
|
1005
|
+
/* harmony export */ "transcodeTarget": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.transcodeTarget)
|
|
1006
|
+
/* harmony export */ });
|
|
1007
|
+
/* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../index */ "../../../tools/ktx2Decoder/dist/index.js");
|
|
1008
|
+
|
|
1009
|
+
const globalObject = (typeof __webpack_require__.g !== 'undefined') ? __webpack_require__.g : ((typeof window !== 'undefined') ? window : undefined);
|
|
1010
|
+
if (typeof globalObject !== "undefined") {
|
|
1011
|
+
globalObject.KTX2DECODER = _index__WEBPACK_IMPORTED_MODULE_0__.KTX2Decoder;
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
|
|
1015
|
+
|
|
1016
|
+
/***/ }),
|
|
1017
|
+
|
|
1018
|
+
/***/ "../../../tools/ktx2Decoder/dist/transcodeDecisionTree.js":
|
|
1019
|
+
/*!****************************************************************!*\
|
|
1020
|
+
!*** ../../../tools/ktx2Decoder/dist/transcodeDecisionTree.js ***!
|
|
1021
|
+
\****************************************************************/
|
|
1022
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1023
|
+
|
|
1024
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1025
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1026
|
+
/* harmony export */ "TranscodeDecisionTree": () => (/* binding */ TranscodeDecisionTree)
|
|
1027
|
+
/* harmony export */ });
|
|
1028
|
+
/* harmony import */ var _transcoder__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./transcoder */ "../../../tools/ktx2Decoder/dist/transcoder.js");
|
|
1029
|
+
|
|
1030
|
+
const COMPRESSED_RGBA_BPTC_UNORM_EXT = 0x8E8C;
|
|
1031
|
+
const COMPRESSED_RGBA_ASTC_4x4_KHR = 0x93B0;
|
|
1032
|
+
const COMPRESSED_RGB_S3TC_DXT1_EXT = 0x83F0;
|
|
1033
|
+
const COMPRESSED_RGBA_S3TC_DXT5_EXT = 0x83F3;
|
|
1034
|
+
const COMPRESSED_RGBA_PVRTC_4BPPV1_IMG = 0x8C02;
|
|
1035
|
+
const COMPRESSED_RGB_PVRTC_4BPPV1_IMG = 0x8C00;
|
|
1036
|
+
const COMPRESSED_RGBA8_ETC2_EAC = 0x9278;
|
|
1037
|
+
const COMPRESSED_RGB8_ETC2 = 0x9274;
|
|
1038
|
+
const COMPRESSED_RGB_ETC1_WEBGL = 0x8D64;
|
|
1039
|
+
const RGBA8Format = 0x8058;
|
|
1040
|
+
const DecisionTree = {
|
|
1041
|
+
ETC1S: {
|
|
1042
|
+
option: "forceRGBA",
|
|
1043
|
+
yes: {
|
|
1044
|
+
transcodeFormat: _transcoder__WEBPACK_IMPORTED_MODULE_0__.transcodeTarget.RGBA32,
|
|
1045
|
+
engineFormat: RGBA8Format,
|
|
1046
|
+
roundToMultiple4: false,
|
|
1047
|
+
},
|
|
1048
|
+
no: {
|
|
1049
|
+
cap: "etc2",
|
|
1050
|
+
yes: {
|
|
1051
|
+
alpha: true,
|
|
1052
|
+
yes: {
|
|
1053
|
+
transcodeFormat: _transcoder__WEBPACK_IMPORTED_MODULE_0__.transcodeTarget.ETC2_RGBA,
|
|
1054
|
+
engineFormat: COMPRESSED_RGBA8_ETC2_EAC,
|
|
1055
|
+
},
|
|
1056
|
+
no: {
|
|
1057
|
+
transcodeFormat: _transcoder__WEBPACK_IMPORTED_MODULE_0__.transcodeTarget.ETC1_RGB,
|
|
1058
|
+
engineFormat: COMPRESSED_RGB8_ETC2,
|
|
1059
|
+
},
|
|
1060
|
+
},
|
|
1061
|
+
no: {
|
|
1062
|
+
cap: "etc1",
|
|
1063
|
+
alpha: false,
|
|
1064
|
+
yes: {
|
|
1065
|
+
transcodeFormat: _transcoder__WEBPACK_IMPORTED_MODULE_0__.transcodeTarget.ETC1_RGB,
|
|
1066
|
+
engineFormat: COMPRESSED_RGB_ETC1_WEBGL,
|
|
1067
|
+
},
|
|
1068
|
+
no: {
|
|
1069
|
+
cap: "bptc",
|
|
1070
|
+
yes: {
|
|
1071
|
+
transcodeFormat: _transcoder__WEBPACK_IMPORTED_MODULE_0__.transcodeTarget.BC7_RGBA,
|
|
1072
|
+
engineFormat: COMPRESSED_RGBA_BPTC_UNORM_EXT,
|
|
1073
|
+
},
|
|
1074
|
+
no: {
|
|
1075
|
+
cap: "s3tc",
|
|
1076
|
+
yes: {
|
|
1077
|
+
alpha: true,
|
|
1078
|
+
yes: {
|
|
1079
|
+
transcodeFormat: _transcoder__WEBPACK_IMPORTED_MODULE_0__.transcodeTarget.BC3_RGBA,
|
|
1080
|
+
engineFormat: COMPRESSED_RGBA_S3TC_DXT5_EXT,
|
|
1081
|
+
},
|
|
1082
|
+
no: {
|
|
1083
|
+
transcodeFormat: _transcoder__WEBPACK_IMPORTED_MODULE_0__.transcodeTarget.BC1_RGB,
|
|
1084
|
+
engineFormat: COMPRESSED_RGB_S3TC_DXT1_EXT,
|
|
1085
|
+
},
|
|
1086
|
+
},
|
|
1087
|
+
no: {
|
|
1088
|
+
cap: "pvrtc",
|
|
1089
|
+
needsPowerOfTwo: true,
|
|
1090
|
+
yes: {
|
|
1091
|
+
alpha: true,
|
|
1092
|
+
yes: {
|
|
1093
|
+
transcodeFormat: _transcoder__WEBPACK_IMPORTED_MODULE_0__.transcodeTarget.PVRTC1_4_RGBA,
|
|
1094
|
+
engineFormat: COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,
|
|
1095
|
+
},
|
|
1096
|
+
no: {
|
|
1097
|
+
transcodeFormat: _transcoder__WEBPACK_IMPORTED_MODULE_0__.transcodeTarget.PVRTC1_4_RGB,
|
|
1098
|
+
engineFormat: COMPRESSED_RGB_PVRTC_4BPPV1_IMG,
|
|
1099
|
+
},
|
|
1100
|
+
},
|
|
1101
|
+
no: {
|
|
1102
|
+
transcodeFormat: _transcoder__WEBPACK_IMPORTED_MODULE_0__.transcodeTarget.RGBA32,
|
|
1103
|
+
engineFormat: RGBA8Format,
|
|
1104
|
+
roundToMultiple4: false,
|
|
1105
|
+
},
|
|
1106
|
+
},
|
|
1107
|
+
},
|
|
1108
|
+
},
|
|
1109
|
+
},
|
|
1110
|
+
},
|
|
1111
|
+
},
|
|
1112
|
+
UASTC: {
|
|
1113
|
+
option: "forceRGBA",
|
|
1114
|
+
yes: {
|
|
1115
|
+
transcodeFormat: _transcoder__WEBPACK_IMPORTED_MODULE_0__.transcodeTarget.RGBA32,
|
|
1116
|
+
engineFormat: RGBA8Format,
|
|
1117
|
+
roundToMultiple4: false,
|
|
1118
|
+
},
|
|
1119
|
+
no: {
|
|
1120
|
+
cap: "astc",
|
|
1121
|
+
yes: {
|
|
1122
|
+
transcodeFormat: _transcoder__WEBPACK_IMPORTED_MODULE_0__.transcodeTarget.ASTC_4x4_RGBA,
|
|
1123
|
+
engineFormat: COMPRESSED_RGBA_ASTC_4x4_KHR,
|
|
1124
|
+
},
|
|
1125
|
+
no: {
|
|
1126
|
+
cap: "bptc",
|
|
1127
|
+
yes: {
|
|
1128
|
+
transcodeFormat: _transcoder__WEBPACK_IMPORTED_MODULE_0__.transcodeTarget.BC7_RGBA,
|
|
1129
|
+
engineFormat: COMPRESSED_RGBA_BPTC_UNORM_EXT,
|
|
1130
|
+
},
|
|
1131
|
+
no: {
|
|
1132
|
+
option: "useRGBAIfASTCBC7NotAvailableWhenUASTC",
|
|
1133
|
+
yes: {
|
|
1134
|
+
transcodeFormat: _transcoder__WEBPACK_IMPORTED_MODULE_0__.transcodeTarget.RGBA32,
|
|
1135
|
+
engineFormat: RGBA8Format,
|
|
1136
|
+
roundToMultiple4: false,
|
|
1137
|
+
},
|
|
1138
|
+
no: {
|
|
1139
|
+
cap: "etc2",
|
|
1140
|
+
yes: {
|
|
1141
|
+
alpha: true,
|
|
1142
|
+
yes: {
|
|
1143
|
+
transcodeFormat: _transcoder__WEBPACK_IMPORTED_MODULE_0__.transcodeTarget.ETC2_RGBA,
|
|
1144
|
+
engineFormat: COMPRESSED_RGBA8_ETC2_EAC,
|
|
1145
|
+
},
|
|
1146
|
+
no: {
|
|
1147
|
+
transcodeFormat: _transcoder__WEBPACK_IMPORTED_MODULE_0__.transcodeTarget.ETC1_RGB,
|
|
1148
|
+
engineFormat: COMPRESSED_RGB8_ETC2,
|
|
1149
|
+
},
|
|
1150
|
+
},
|
|
1151
|
+
no: {
|
|
1152
|
+
cap: "etc1",
|
|
1153
|
+
yes: {
|
|
1154
|
+
transcodeFormat: _transcoder__WEBPACK_IMPORTED_MODULE_0__.transcodeTarget.ETC1_RGB,
|
|
1155
|
+
engineFormat: COMPRESSED_RGB_ETC1_WEBGL,
|
|
1156
|
+
},
|
|
1157
|
+
no: {
|
|
1158
|
+
cap: "s3tc",
|
|
1159
|
+
yes: {
|
|
1160
|
+
alpha: true,
|
|
1161
|
+
yes: {
|
|
1162
|
+
transcodeFormat: _transcoder__WEBPACK_IMPORTED_MODULE_0__.transcodeTarget.BC3_RGBA,
|
|
1163
|
+
engineFormat: COMPRESSED_RGBA_S3TC_DXT5_EXT,
|
|
1164
|
+
},
|
|
1165
|
+
no: {
|
|
1166
|
+
transcodeFormat: _transcoder__WEBPACK_IMPORTED_MODULE_0__.transcodeTarget.BC1_RGB,
|
|
1167
|
+
engineFormat: COMPRESSED_RGB_S3TC_DXT1_EXT,
|
|
1168
|
+
},
|
|
1169
|
+
},
|
|
1170
|
+
no: {
|
|
1171
|
+
cap: "pvrtc",
|
|
1172
|
+
needsPowerOfTwo: true,
|
|
1173
|
+
yes: {
|
|
1174
|
+
alpha: true,
|
|
1175
|
+
yes: {
|
|
1176
|
+
transcodeFormat: _transcoder__WEBPACK_IMPORTED_MODULE_0__.transcodeTarget.PVRTC1_4_RGBA,
|
|
1177
|
+
engineFormat: COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,
|
|
1178
|
+
},
|
|
1179
|
+
no: {
|
|
1180
|
+
transcodeFormat: _transcoder__WEBPACK_IMPORTED_MODULE_0__.transcodeTarget.PVRTC1_4_RGB,
|
|
1181
|
+
engineFormat: COMPRESSED_RGB_PVRTC_4BPPV1_IMG,
|
|
1182
|
+
},
|
|
1183
|
+
},
|
|
1184
|
+
no: {
|
|
1185
|
+
transcodeFormat: _transcoder__WEBPACK_IMPORTED_MODULE_0__.transcodeTarget.RGBA32,
|
|
1186
|
+
engineFormat: RGBA8Format,
|
|
1187
|
+
roundToMultiple4: false,
|
|
1188
|
+
},
|
|
1189
|
+
},
|
|
1190
|
+
},
|
|
1191
|
+
},
|
|
1192
|
+
},
|
|
1193
|
+
},
|
|
1194
|
+
},
|
|
1195
|
+
},
|
|
1196
|
+
},
|
|
1197
|
+
};
|
|
1198
|
+
class TranscodeDecisionTree {
|
|
1199
|
+
constructor(textureFormat, hasAlpha, isPowerOfTwo, caps, options) {
|
|
1200
|
+
this._hasAlpha = hasAlpha;
|
|
1201
|
+
this._isPowerOfTwo = isPowerOfTwo;
|
|
1202
|
+
this._caps = caps;
|
|
1203
|
+
this._options = options !== null && options !== void 0 ? options : {};
|
|
1204
|
+
this._parseNode(textureFormat === _transcoder__WEBPACK_IMPORTED_MODULE_0__.sourceTextureFormat.UASTC4x4 ? DecisionTree.UASTC : DecisionTree.ETC1S);
|
|
1205
|
+
}
|
|
1206
|
+
static _IsLeafNode(node) {
|
|
1207
|
+
return node.transcodeFormat !== undefined;
|
|
1208
|
+
}
|
|
1209
|
+
get transcodeFormat() {
|
|
1210
|
+
return this._transcodeFormat;
|
|
1211
|
+
}
|
|
1212
|
+
get engineFormat() {
|
|
1213
|
+
return this._engineFormat;
|
|
1214
|
+
}
|
|
1215
|
+
get roundToMultiple4() {
|
|
1216
|
+
return this._roundToMultiple4;
|
|
1217
|
+
}
|
|
1218
|
+
_parseNode(node) {
|
|
1219
|
+
var _a;
|
|
1220
|
+
if (TranscodeDecisionTree._IsLeafNode(node)) {
|
|
1221
|
+
this._transcodeFormat = node.transcodeFormat;
|
|
1222
|
+
this._engineFormat = node.engineFormat;
|
|
1223
|
+
this._roundToMultiple4 = (_a = node.roundToMultiple4) !== null && _a !== void 0 ? _a : true;
|
|
1224
|
+
}
|
|
1225
|
+
else {
|
|
1226
|
+
let condition = true;
|
|
1227
|
+
if (node.cap !== undefined) {
|
|
1228
|
+
condition = condition && this._caps[node.cap];
|
|
1229
|
+
}
|
|
1230
|
+
if (node.option !== undefined) {
|
|
1231
|
+
condition = condition && this._options[node.option];
|
|
1232
|
+
}
|
|
1233
|
+
if (node.alpha !== undefined) {
|
|
1234
|
+
condition = condition && this._hasAlpha === node.alpha;
|
|
1235
|
+
}
|
|
1236
|
+
if (node.needsPowerOfTwo !== undefined) {
|
|
1237
|
+
condition = condition && this._isPowerOfTwo === node.needsPowerOfTwo;
|
|
1238
|
+
}
|
|
1239
|
+
this._parseNode(condition ? node.yes : node.no);
|
|
1240
|
+
}
|
|
1241
|
+
}
|
|
1242
|
+
}
|
|
1243
|
+
|
|
1244
|
+
|
|
1245
|
+
/***/ }),
|
|
1246
|
+
|
|
1247
|
+
/***/ "../../../tools/ktx2Decoder/dist/transcoder.js":
|
|
1248
|
+
/*!*****************************************************!*\
|
|
1249
|
+
!*** ../../../tools/ktx2Decoder/dist/transcoder.js ***!
|
|
1250
|
+
\*****************************************************/
|
|
1251
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1252
|
+
|
|
1253
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1254
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1255
|
+
/* harmony export */ "sourceTextureFormat": () => (/* binding */ sourceTextureFormat),
|
|
1256
|
+
/* harmony export */ "transcodeTarget": () => (/* binding */ transcodeTarget),
|
|
1257
|
+
/* harmony export */ "Transcoder": () => (/* binding */ Transcoder)
|
|
1258
|
+
/* harmony export */ });
|
|
1259
|
+
/**
|
|
1260
|
+
* @hidden
|
|
1261
|
+
*/
|
|
1262
|
+
var sourceTextureFormat;
|
|
1263
|
+
(function (sourceTextureFormat) {
|
|
1264
|
+
sourceTextureFormat[sourceTextureFormat["ETC1S"] = 0] = "ETC1S";
|
|
1265
|
+
sourceTextureFormat[sourceTextureFormat["UASTC4x4"] = 1] = "UASTC4x4";
|
|
1266
|
+
})(sourceTextureFormat || (sourceTextureFormat = {}));
|
|
1267
|
+
/**
|
|
1268
|
+
* @hidden
|
|
1269
|
+
*/
|
|
1270
|
+
var transcodeTarget;
|
|
1271
|
+
(function (transcodeTarget) {
|
|
1272
|
+
transcodeTarget[transcodeTarget["ASTC_4x4_RGBA"] = 0] = "ASTC_4x4_RGBA";
|
|
1273
|
+
transcodeTarget[transcodeTarget["BC7_RGBA"] = 1] = "BC7_RGBA";
|
|
1274
|
+
transcodeTarget[transcodeTarget["BC3_RGBA"] = 2] = "BC3_RGBA";
|
|
1275
|
+
transcodeTarget[transcodeTarget["BC1_RGB"] = 3] = "BC1_RGB";
|
|
1276
|
+
transcodeTarget[transcodeTarget["PVRTC1_4_RGBA"] = 4] = "PVRTC1_4_RGBA";
|
|
1277
|
+
transcodeTarget[transcodeTarget["PVRTC1_4_RGB"] = 5] = "PVRTC1_4_RGB";
|
|
1278
|
+
transcodeTarget[transcodeTarget["ETC2_RGBA"] = 6] = "ETC2_RGBA";
|
|
1279
|
+
transcodeTarget[transcodeTarget["ETC1_RGB"] = 7] = "ETC1_RGB";
|
|
1280
|
+
transcodeTarget[transcodeTarget["RGBA32"] = 8] = "RGBA32";
|
|
1281
|
+
})(transcodeTarget || (transcodeTarget = {}));
|
|
1282
|
+
/**
|
|
1283
|
+
* @hidden
|
|
1284
|
+
*/
|
|
1285
|
+
class Transcoder {
|
|
1286
|
+
static CanTranscode(src, dst, isInGammaSpace) {
|
|
1287
|
+
return false;
|
|
1288
|
+
}
|
|
1289
|
+
getName() {
|
|
1290
|
+
return Transcoder.Name;
|
|
1291
|
+
}
|
|
1292
|
+
initialize() {
|
|
1293
|
+
}
|
|
1294
|
+
needMemoryManager() {
|
|
1295
|
+
return false;
|
|
1296
|
+
}
|
|
1297
|
+
setMemoryManager(memoryMgr) {
|
|
1298
|
+
}
|
|
1299
|
+
transcode(src, dst, level, width, height, uncompressedByteLength, ktx2Reader, imageDesc, encodedData) {
|
|
1300
|
+
return Promise.resolve(null);
|
|
1301
|
+
}
|
|
1302
|
+
}
|
|
1303
|
+
Transcoder.Name = "Transcoder";
|
|
1304
|
+
|
|
1305
|
+
|
|
1306
|
+
/***/ }),
|
|
1307
|
+
|
|
1308
|
+
/***/ "../../../tools/ktx2Decoder/dist/transcoderManager.js":
|
|
1309
|
+
/*!************************************************************!*\
|
|
1310
|
+
!*** ../../../tools/ktx2Decoder/dist/transcoderManager.js ***!
|
|
1311
|
+
\************************************************************/
|
|
1312
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1313
|
+
|
|
1314
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1315
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1316
|
+
/* harmony export */ "TranscoderManager": () => (/* binding */ TranscoderManager)
|
|
1317
|
+
/* harmony export */ });
|
|
1318
|
+
/* harmony import */ var _transcoder__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./transcoder */ "../../../tools/ktx2Decoder/dist/transcoder.js");
|
|
1319
|
+
/* harmony import */ var _wasmMemoryManager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./wasmMemoryManager */ "../../../tools/ktx2Decoder/dist/wasmMemoryManager.js");
|
|
1320
|
+
|
|
1321
|
+
|
|
1322
|
+
/**
|
|
1323
|
+
* @hidden
|
|
1324
|
+
*/
|
|
1325
|
+
class TranscoderManager {
|
|
1326
|
+
static RegisterTranscoder(transcoder) {
|
|
1327
|
+
TranscoderManager._Transcoders.push(transcoder);
|
|
1328
|
+
}
|
|
1329
|
+
findTranscoder(src, dst, isInGammaSpace, bypass) {
|
|
1330
|
+
let transcoder = null;
|
|
1331
|
+
const key = _transcoder__WEBPACK_IMPORTED_MODULE_0__.sourceTextureFormat[src] + "_" + _transcoder__WEBPACK_IMPORTED_MODULE_0__.transcodeTarget[dst];
|
|
1332
|
+
for (let i = 0; i < TranscoderManager._Transcoders.length; ++i) {
|
|
1333
|
+
if (TranscoderManager._Transcoders[i].CanTranscode(src, dst, isInGammaSpace) && (!bypass || bypass.indexOf(TranscoderManager._Transcoders[i].Name) < 0)) {
|
|
1334
|
+
transcoder = this._getExistingTranscoder(key, TranscoderManager._Transcoders[i].Name);
|
|
1335
|
+
if (!transcoder) {
|
|
1336
|
+
transcoder = new TranscoderManager._Transcoders[i]();
|
|
1337
|
+
transcoder.initialize();
|
|
1338
|
+
if (transcoder.needMemoryManager()) {
|
|
1339
|
+
if (!this._wasmMemoryManager) {
|
|
1340
|
+
this._wasmMemoryManager = new _wasmMemoryManager__WEBPACK_IMPORTED_MODULE_1__.WASMMemoryManager();
|
|
1341
|
+
}
|
|
1342
|
+
transcoder.setMemoryManager(this._wasmMemoryManager);
|
|
1343
|
+
}
|
|
1344
|
+
if (!TranscoderManager._transcoderInstances[key]) {
|
|
1345
|
+
TranscoderManager._transcoderInstances[key] = [];
|
|
1346
|
+
}
|
|
1347
|
+
TranscoderManager._transcoderInstances[key].push(transcoder);
|
|
1348
|
+
}
|
|
1349
|
+
break;
|
|
1350
|
+
}
|
|
1351
|
+
}
|
|
1352
|
+
return transcoder;
|
|
1353
|
+
}
|
|
1354
|
+
_getExistingTranscoder(key, transcoderName) {
|
|
1355
|
+
let transcoders = TranscoderManager._transcoderInstances[key];
|
|
1356
|
+
if (transcoders) {
|
|
1357
|
+
for (let t = 0; t < transcoders.length; ++t) {
|
|
1358
|
+
const transcoder = transcoders[t];
|
|
1359
|
+
if (transcoderName === transcoder.getName()) {
|
|
1360
|
+
return transcoder;
|
|
1361
|
+
}
|
|
1362
|
+
}
|
|
1363
|
+
}
|
|
1364
|
+
return null;
|
|
1365
|
+
}
|
|
1366
|
+
}
|
|
1367
|
+
TranscoderManager._Transcoders = [];
|
|
1368
|
+
TranscoderManager._transcoderInstances = {};
|
|
1369
|
+
|
|
1370
|
+
|
|
1371
|
+
/***/ }),
|
|
1372
|
+
|
|
1373
|
+
/***/ "../../../tools/ktx2Decoder/dist/wasmMemoryManager.js":
|
|
1374
|
+
/*!************************************************************!*\
|
|
1375
|
+
!*** ../../../tools/ktx2Decoder/dist/wasmMemoryManager.js ***!
|
|
1376
|
+
\************************************************************/
|
|
1377
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1378
|
+
|
|
1379
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1380
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1381
|
+
/* harmony export */ "WASMMemoryManager": () => (/* binding */ WASMMemoryManager)
|
|
1382
|
+
/* harmony export */ });
|
|
1383
|
+
/**
|
|
1384
|
+
* @hidden
|
|
1385
|
+
*/
|
|
1386
|
+
class WASMMemoryManager {
|
|
1387
|
+
constructor(initialMemoryPages = WASMMemoryManager.InitialMemoryPages) {
|
|
1388
|
+
this._numPages = initialMemoryPages;
|
|
1389
|
+
this._memory = new WebAssembly.Memory({ initial: this._numPages });
|
|
1390
|
+
this._memoryViewByteLength = this._numPages << 16;
|
|
1391
|
+
this._memoryViewOffset = 0;
|
|
1392
|
+
this._memoryView = new Uint8Array(this._memory.buffer, this._memoryViewOffset, this._memoryViewByteLength);
|
|
1393
|
+
}
|
|
1394
|
+
static LoadWASM(path) {
|
|
1395
|
+
if (this.LoadBinariesFromCurrentThread) {
|
|
1396
|
+
return new Promise((resolve, reject) => {
|
|
1397
|
+
fetch(path)
|
|
1398
|
+
.then((response) => {
|
|
1399
|
+
if (response.ok) {
|
|
1400
|
+
return response.arrayBuffer();
|
|
1401
|
+
}
|
|
1402
|
+
throw new Error(`Could not fetch the wasm component from "${path}": ${response.status} - ${response.statusText}`);
|
|
1403
|
+
})
|
|
1404
|
+
.then((wasmBinary) => resolve(wasmBinary))
|
|
1405
|
+
.catch((reason) => {
|
|
1406
|
+
reject(reason);
|
|
1407
|
+
});
|
|
1408
|
+
});
|
|
1409
|
+
}
|
|
1410
|
+
const id = this._RequestId++;
|
|
1411
|
+
return new Promise((resolve) => {
|
|
1412
|
+
const wasmLoadedHandler = (msg) => {
|
|
1413
|
+
if (msg.data.action === "wasmLoaded" && msg.data.id === id) {
|
|
1414
|
+
self.removeEventListener("message", wasmLoadedHandler);
|
|
1415
|
+
resolve(msg.data.wasmBinary);
|
|
1416
|
+
}
|
|
1417
|
+
};
|
|
1418
|
+
self.addEventListener("message", wasmLoadedHandler);
|
|
1419
|
+
postMessage({ action: "loadWASM", path: path, id: id });
|
|
1420
|
+
});
|
|
1421
|
+
}
|
|
1422
|
+
get wasmMemory() {
|
|
1423
|
+
return this._memory;
|
|
1424
|
+
}
|
|
1425
|
+
getMemoryView(numPages, offset = 0, byteLength) {
|
|
1426
|
+
byteLength = byteLength !== null && byteLength !== void 0 ? byteLength : numPages << 16;
|
|
1427
|
+
if (this._numPages < numPages) {
|
|
1428
|
+
this._memory.grow(numPages - this._numPages);
|
|
1429
|
+
this._numPages = numPages;
|
|
1430
|
+
this._memoryView = new Uint8Array(this._memory.buffer, offset, byteLength);
|
|
1431
|
+
this._memoryViewByteLength = byteLength;
|
|
1432
|
+
this._memoryViewOffset = offset;
|
|
1433
|
+
}
|
|
1434
|
+
else {
|
|
1435
|
+
this._memoryView = new Uint8Array(this._memory.buffer, offset, byteLength);
|
|
1436
|
+
this._memoryViewByteLength = byteLength;
|
|
1437
|
+
this._memoryViewOffset = offset;
|
|
1438
|
+
}
|
|
1439
|
+
return this._memoryView;
|
|
1440
|
+
}
|
|
1441
|
+
}
|
|
1442
|
+
WASMMemoryManager.LoadBinariesFromCurrentThread = true;
|
|
1443
|
+
WASMMemoryManager.InitialMemoryPages = (1 * 1024 * 1024) >> 16; // 1 Mbytes
|
|
1444
|
+
WASMMemoryManager._RequestId = 0;
|
|
1445
|
+
|
|
1446
|
+
|
|
1447
|
+
/***/ }),
|
|
1448
|
+
|
|
1449
|
+
/***/ "../../../tools/ktx2Decoder/dist/zstddec.js":
|
|
1450
|
+
/*!**************************************************!*\
|
|
1451
|
+
!*** ../../../tools/ktx2Decoder/dist/zstddec.js ***!
|
|
1452
|
+
\**************************************************/
|
|
1453
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1454
|
+
|
|
1455
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1456
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1457
|
+
/* harmony export */ "ZSTDDecoder": () => (/* binding */ ZSTDDecoder)
|
|
1458
|
+
/* harmony export */ });
|
|
1459
|
+
let init;
|
|
1460
|
+
let instance;
|
|
1461
|
+
let heap;
|
|
1462
|
+
const IMPORT_OBJECT = {
|
|
1463
|
+
env: {
|
|
1464
|
+
emscripten_notify_memory_growth: function (index) {
|
|
1465
|
+
heap = new Uint8Array(instance.exports.memory.buffer);
|
|
1466
|
+
}
|
|
1467
|
+
}
|
|
1468
|
+
};
|
|
1469
|
+
/**
|
|
1470
|
+
* ZSTD (Zstandard) decoder.
|
|
1471
|
+
*/
|
|
1472
|
+
class ZSTDDecoder {
|
|
1473
|
+
init() {
|
|
1474
|
+
if (init) {
|
|
1475
|
+
return init;
|
|
1476
|
+
}
|
|
1477
|
+
if (typeof fetch !== 'undefined') {
|
|
1478
|
+
// Web.
|
|
1479
|
+
init = fetch(ZSTDDecoder.WasmModuleURL)
|
|
1480
|
+
.then((response) => {
|
|
1481
|
+
if (response.ok) {
|
|
1482
|
+
return response.arrayBuffer();
|
|
1483
|
+
}
|
|
1484
|
+
throw new Error(`Could not fetch the wasm component for the Zstandard decompression lib: ${response.status} - ${response.statusText}`);
|
|
1485
|
+
})
|
|
1486
|
+
.then((arrayBuffer) => WebAssembly.instantiate(arrayBuffer, IMPORT_OBJECT))
|
|
1487
|
+
.then(this._init);
|
|
1488
|
+
}
|
|
1489
|
+
else {
|
|
1490
|
+
// Node.js.
|
|
1491
|
+
init = WebAssembly
|
|
1492
|
+
.instantiateStreaming(fetch(ZSTDDecoder.WasmModuleURL), IMPORT_OBJECT)
|
|
1493
|
+
.then(this._init);
|
|
1494
|
+
}
|
|
1495
|
+
return init;
|
|
1496
|
+
}
|
|
1497
|
+
_init(result) {
|
|
1498
|
+
instance = result.instance;
|
|
1499
|
+
IMPORT_OBJECT.env.emscripten_notify_memory_growth(0); // initialize heap.
|
|
1500
|
+
}
|
|
1501
|
+
decode(array, uncompressedSize = 0) {
|
|
1502
|
+
if (!instance) {
|
|
1503
|
+
throw new Error(`ZSTDDecoder: Await .init() before decoding.`);
|
|
1504
|
+
}
|
|
1505
|
+
// Write compressed data into WASM memory.
|
|
1506
|
+
const compressedSize = array.byteLength;
|
|
1507
|
+
const compressedPtr = instance.exports.malloc(compressedSize);
|
|
1508
|
+
heap.set(array, compressedPtr);
|
|
1509
|
+
// Decompress into WASM memory.
|
|
1510
|
+
uncompressedSize = uncompressedSize || Number(instance.exports.ZSTD_findDecompressedSize(compressedPtr, compressedSize));
|
|
1511
|
+
const uncompressedPtr = instance.exports.malloc(uncompressedSize);
|
|
1512
|
+
const actualSize = instance.exports.ZSTD_decompress(uncompressedPtr, uncompressedSize, compressedPtr, compressedSize);
|
|
1513
|
+
// Read decompressed data and free WASM memory.
|
|
1514
|
+
const dec = heap.slice(uncompressedPtr, uncompressedPtr + actualSize);
|
|
1515
|
+
instance.exports.free(compressedPtr);
|
|
1516
|
+
instance.exports.free(uncompressedPtr);
|
|
1517
|
+
return dec;
|
|
1518
|
+
}
|
|
1519
|
+
}
|
|
1520
|
+
ZSTDDecoder.WasmModuleURL = "https://preview.babylonjs.com/zstddec.wasm";
|
|
1521
|
+
/**
|
|
1522
|
+
* BSD License
|
|
1523
|
+
*
|
|
1524
|
+
* For Zstandard software
|
|
1525
|
+
*
|
|
1526
|
+
* Copyright (c) 2016-present, Yann Collet, Facebook, Inc. All rights reserved.
|
|
1527
|
+
*
|
|
1528
|
+
* Redistribution and use in source and binary forms, with or without modification,
|
|
1529
|
+
* are permitted provided that the following conditions are met:
|
|
1530
|
+
*
|
|
1531
|
+
* * Redistributions of source code must retain the above copyright notice, this
|
|
1532
|
+
* list of conditions and the following disclaimer.
|
|
1533
|
+
*
|
|
1534
|
+
* * Redistributions in binary form must reproduce the above copyright notice,
|
|
1535
|
+
* this list of conditions and the following disclaimer in the documentation
|
|
1536
|
+
* and/or other materials provided with the distribution.
|
|
1537
|
+
*
|
|
1538
|
+
* * Neither the name Facebook nor the names of its contributors may be used to
|
|
1539
|
+
* endorse or promote products derived from this software without specific
|
|
1540
|
+
* prior written permission.
|
|
1541
|
+
*
|
|
1542
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
1543
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
1544
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
1545
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
|
1546
|
+
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
1547
|
+
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
1548
|
+
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
|
1549
|
+
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
1550
|
+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
1551
|
+
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
1552
|
+
*/
|
|
1553
|
+
|
|
1554
|
+
|
|
1555
|
+
/***/ })
|
|
1556
|
+
|
|
1557
|
+
/******/ });
|
|
1558
|
+
/************************************************************************/
|
|
1559
|
+
/******/ // The module cache
|
|
1560
|
+
/******/ var __webpack_module_cache__ = {};
|
|
1561
|
+
/******/
|
|
1562
|
+
/******/ // The require function
|
|
1563
|
+
/******/ function __webpack_require__(moduleId) {
|
|
1564
|
+
/******/ // Check if module is in cache
|
|
1565
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
1566
|
+
/******/ if (cachedModule !== undefined) {
|
|
1567
|
+
/******/ return cachedModule.exports;
|
|
1568
|
+
/******/ }
|
|
1569
|
+
/******/ // Create a new module (and put it into the cache)
|
|
1570
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
1571
|
+
/******/ // no module.id needed
|
|
1572
|
+
/******/ // no module.loaded needed
|
|
1573
|
+
/******/ exports: {}
|
|
1574
|
+
/******/ };
|
|
1575
|
+
/******/
|
|
1576
|
+
/******/ // Execute the module function
|
|
1577
|
+
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
1578
|
+
/******/
|
|
1579
|
+
/******/ // Return the exports of the module
|
|
1580
|
+
/******/ return module.exports;
|
|
1581
|
+
/******/ }
|
|
1582
|
+
/******/
|
|
1583
|
+
/************************************************************************/
|
|
1584
|
+
/******/ /* webpack/runtime/define property getters */
|
|
1585
|
+
/******/ (() => {
|
|
1586
|
+
/******/ // define getter functions for harmony exports
|
|
1587
|
+
/******/ __webpack_require__.d = (exports, definition) => {
|
|
1588
|
+
/******/ for(var key in definition) {
|
|
1589
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
1590
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
1591
|
+
/******/ }
|
|
1592
|
+
/******/ }
|
|
1593
|
+
/******/ };
|
|
1594
|
+
/******/ })();
|
|
1595
|
+
/******/
|
|
1596
|
+
/******/ /* webpack/runtime/global */
|
|
1597
|
+
/******/ (() => {
|
|
1598
|
+
/******/ __webpack_require__.g = (function() {
|
|
1599
|
+
/******/ if (typeof globalThis === 'object') return globalThis;
|
|
1600
|
+
/******/ try {
|
|
1601
|
+
/******/ return this || new Function('return this')();
|
|
1602
|
+
/******/ } catch (e) {
|
|
1603
|
+
/******/ if (typeof window === 'object') return window;
|
|
1604
|
+
/******/ }
|
|
1605
|
+
/******/ })();
|
|
1606
|
+
/******/ })();
|
|
1607
|
+
/******/
|
|
1608
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
1609
|
+
/******/ (() => {
|
|
1610
|
+
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
1611
|
+
/******/ })();
|
|
1612
|
+
/******/
|
|
1613
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
1614
|
+
/******/ (() => {
|
|
1615
|
+
/******/ // define __esModule on exports
|
|
1616
|
+
/******/ __webpack_require__.r = (exports) => {
|
|
1617
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
1618
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
1619
|
+
/******/ }
|
|
1620
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
1621
|
+
/******/ };
|
|
1622
|
+
/******/ })();
|
|
1623
|
+
/******/
|
|
1624
|
+
/************************************************************************/
|
|
1625
|
+
var __webpack_exports__ = {};
|
|
1626
|
+
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
|
|
1627
|
+
(() => {
|
|
1628
|
+
/*!**********************!*\
|
|
1629
|
+
!*** ./src/index.ts ***!
|
|
1630
|
+
\**********************/
|
|
1631
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1632
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1633
|
+
/* harmony export */ "ktx2decoder": () => (/* reexport module object */ ktx2decoder_legacy_legacy__WEBPACK_IMPORTED_MODULE_0__),
|
|
1634
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
1635
|
+
/* harmony export */ });
|
|
1636
|
+
/* harmony import */ var ktx2decoder_legacy_legacy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ktx2decoder/legacy/legacy */ "../../../tools/ktx2Decoder/dist/legacy/legacy.js");
|
|
1637
|
+
|
|
1638
|
+
|
|
1639
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ktx2decoder_legacy_legacy__WEBPACK_IMPORTED_MODULE_0__);
|
|
1640
|
+
|
|
1641
|
+
})();
|
|
1642
|
+
|
|
1643
|
+
__webpack_exports__ = __webpack_exports__["default"];
|
|
1644
|
+
/******/ return __webpack_exports__;
|
|
1645
|
+
/******/ })()
|
|
1646
|
+
;
|
|
1647
|
+
});
|
|
1648
|
+
//# sourceMappingURL=babylon.ktx2Decoder.max.js.map
|