@galacean/engine-loader 1.1.0-beta.21 → 1.1.0-beta.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +28 -14
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +28 -14
- package/dist/module.js +29 -15
- package/dist/module.js.map +1 -1
- package/package.json +5 -5
- package/types/gltf/GLTFUtil.d.ts +3 -3
- package/types/index.d.ts +1 -1
- package/types/ktx2/BinomialLLCTranscoder/BinomialLLCTranscoder.d.ts +13 -0
- package/types/ktx2/BinomialLLCTranscoder/TranscodeWorkerCode.d.ts +33 -0
- package/types/ktx2/KTX2Loader.d.ts +12 -2
- package/types/ktx2/KhronosTranscoder/KhronosTranscoder.d.ts +17 -0
- package/types/ktx2/KhronosTranscoder/TranscoderWorkerCode.d.ts +34 -0
- package/types/ktx2/TranscodeResult.d.ts +10 -0
- package/types/ktx2/constants.d.ts +7 -0
- package/types/ktx2/zstddec.d.ts +62 -0
package/dist/main.js
CHANGED
|
@@ -2961,11 +2961,14 @@ exports.KTX2Loader = (_KTX2Loader = /*#__PURE__*/ function(Loader1) {
|
|
|
2961
2961
|
return Loader1.apply(this, arguments);
|
|
2962
2962
|
}
|
|
2963
2963
|
var _proto = KTX2Loader1.prototype;
|
|
2964
|
-
_proto.initialize = function initialize(
|
|
2964
|
+
_proto.initialize = function initialize(_, configuration) {
|
|
2965
2965
|
if (configuration.ktx2Loader) {
|
|
2966
2966
|
var options = configuration.ktx2Loader;
|
|
2967
|
-
if (options.priorityFormats)
|
|
2968
|
-
|
|
2967
|
+
if (options.priorityFormats) {
|
|
2968
|
+
exports.KTX2Loader._priorityFormats["etc1s"] = options.priorityFormats;
|
|
2969
|
+
exports.KTX2Loader._priorityFormats["uastc"] = options.priorityFormats;
|
|
2970
|
+
}
|
|
2971
|
+
if (options.transcoder === /** Khronos transcoder. */ 1) {
|
|
2969
2972
|
return exports.KTX2Loader._getKhronosTranscoder(options.workerCount).init();
|
|
2970
2973
|
} else {
|
|
2971
2974
|
return exports.KTX2Loader._getBinomialLLCTranscoder(options.workerCount).init();
|
|
@@ -2984,9 +2987,6 @@ exports.KTX2Loader = (_KTX2Loader = /*#__PURE__*/ function(Loader1) {
|
|
|
2984
2987
|
});
|
|
2985
2988
|
});
|
|
2986
2989
|
};
|
|
2987
|
-
_proto._isKhronosSupported = function _isKhronosSupported(priorityFormats, engine) {
|
|
2988
|
-
return !!KhronosTranscoder.transcoderMap[exports.KTX2Loader._detectSupportedFormat(engine._hardwareRenderer, priorityFormats)];
|
|
2989
|
-
};
|
|
2990
2990
|
/**
|
|
2991
2991
|
* Destroy ktx2 transcoder worker.
|
|
2992
2992
|
*/ KTX2Loader1.destroy = function destroy() {
|
|
@@ -3000,7 +3000,7 @@ exports.KTX2Loader = (_KTX2Loader = /*#__PURE__*/ function(Loader1) {
|
|
|
3000
3000
|
var _params;
|
|
3001
3001
|
var ktx2Container = new KTX2Container(buffer);
|
|
3002
3002
|
var _params_priorityFormats;
|
|
3003
|
-
var formatPriorities = (_params_priorityFormats = (_params = params) == null ? void 0 : _params.priorityFormats) != null ? _params_priorityFormats : exports.KTX2Loader._priorityFormats;
|
|
3003
|
+
var formatPriorities = (_params_priorityFormats = (_params = params) == null ? void 0 : _params.priorityFormats) != null ? _params_priorityFormats : exports.KTX2Loader._priorityFormats[ktx2Container.isUASTC ? "uastc" : "etc1s"];
|
|
3004
3004
|
var targetFormat = exports.KTX2Loader._decideTargetFormat(engine, ktx2Container, formatPriorities);
|
|
3005
3005
|
var transcodeResultPromise;
|
|
3006
3006
|
if (exports.KTX2Loader._isBinomialInit || !KhronosTranscoder.transcoderMap[targetFormat] || !ktx2Container.isUASTC) {
|
|
@@ -3120,13 +3120,22 @@ exports.KTX2Loader = (_KTX2Loader = /*#__PURE__*/ function(Loader1) {
|
|
|
3120
3120
|
}(engineCore.Loader), function() {
|
|
3121
3121
|
_KTX2Loader._isBinomialInit = false;
|
|
3122
3122
|
}(), function() {
|
|
3123
|
-
_KTX2Loader._priorityFormats =
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3123
|
+
_KTX2Loader._priorityFormats = {
|
|
3124
|
+
etc1s: [
|
|
3125
|
+
exports.KTX2TargetFormat.ETC,
|
|
3126
|
+
exports.KTX2TargetFormat.BC7,
|
|
3127
|
+
exports.KTX2TargetFormat.ASTC,
|
|
3128
|
+
exports.KTX2TargetFormat.BC1_BC3,
|
|
3129
|
+
exports.KTX2TargetFormat.PVRTC
|
|
3130
|
+
],
|
|
3131
|
+
uastc: [
|
|
3132
|
+
exports.KTX2TargetFormat.ASTC,
|
|
3133
|
+
exports.KTX2TargetFormat.BC7,
|
|
3134
|
+
exports.KTX2TargetFormat.ETC,
|
|
3135
|
+
exports.KTX2TargetFormat.BC1_BC3,
|
|
3136
|
+
exports.KTX2TargetFormat.PVRTC
|
|
3137
|
+
]
|
|
3138
|
+
};
|
|
3130
3139
|
}(), function() {
|
|
3131
3140
|
var _obj;
|
|
3132
3141
|
_KTX2Loader._supportedMap = (_obj = {}, _obj[exports.KTX2TargetFormat.ASTC] = [
|
|
@@ -3147,6 +3156,11 @@ exports.KTX2Loader = __decorate([
|
|
|
3147
3156
|
"ktx2"
|
|
3148
3157
|
])
|
|
3149
3158
|
], exports.KTX2Loader);
|
|
3159
|
+
exports.KTX2Transcoder = void 0;
|
|
3160
|
+
(function(KTX2Transcoder) {
|
|
3161
|
+
KTX2Transcoder[KTX2Transcoder[/** BinomialLLC transcoder. */ "BinomialLLC"] = 0] = "BinomialLLC";
|
|
3162
|
+
KTX2Transcoder[KTX2Transcoder["Khronos"] = 1] = "Khronos";
|
|
3163
|
+
})(exports.KTX2Transcoder || (exports.KTX2Transcoder = {}));
|
|
3150
3164
|
|
|
3151
3165
|
/**
|
|
3152
3166
|
* @internal
|