@galacean/engine-loader 1.0.3 → 1.0.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galacean/engine-loader",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -15,10 +15,10 @@
15
15
  "types/**/*"
16
16
  ],
17
17
  "dependencies": {
18
- "@galacean/engine-core": "1.0.3",
19
- "@galacean/engine-draco": "1.0.3",
20
- "@galacean/engine-math": "1.0.3",
21
- "@galacean/engine-rhi-webgl": "1.0.3"
18
+ "@galacean/engine-rhi-webgl": "1.0.5",
19
+ "@galacean/engine-core": "1.0.5",
20
+ "@galacean/engine-draco": "1.0.5",
21
+ "@galacean/engine-math": "1.0.5"
22
22
  },
23
23
  "scripts": {
24
24
  "b:types": "tsc"
@@ -5,6 +5,7 @@ export declare class KTX2Loader extends Loader<Texture2D | TextureCube> {
5
5
  private static _isBinomialInit;
6
6
  private static _binomialLLCTranscoder;
7
7
  private static _khronosTranscoder;
8
+ private static _priorityFormats;
8
9
  private static _supportedMap;
9
10
  /**
10
11
  * Destroy ktx2 transcoder worker.
@@ -24,30 +25,40 @@ export declare class KTX2Loader extends Loader<Texture2D | TextureCube> {
24
25
  private static _getBinomialLLCTranscoder;
25
26
  private static _getKhronosTranscoder;
26
27
  private static _getEngineTextureFormat;
27
- initialize(engine: Engine, configuration: EngineConfiguration): Promise<void>;
28
+ initialize(_: Engine, configuration: EngineConfiguration): Promise<void>;
28
29
  /**
29
30
  * @internal
30
31
  */
31
32
  load(item: LoadItem & {
32
33
  params?: KTX2Params;
33
34
  }, resourceManager: ResourceManager): AssetPromise<Texture2D | TextureCube>;
34
- private _isKhronosSupported;
35
35
  }
36
36
  /**
37
37
  * KTX2 loader params interface.
38
38
  */
39
39
  export interface KTX2Params {
40
- /** Priority transcoding format queue, default is ASTC/ETC/DXT/PVRTC/RGBA8. */
40
+ /** Priority transcoding format queue which is preferred options, default is BC7/ASTC/BC3_BC1/ETC/PVRTC/R8G8B8A8. */
41
+ /** @deprecated */
41
42
  priorityFormats: KTX2TargetFormat[];
42
43
  }
44
+ /** Used for initialize KTX2 transcoder. */
45
+ export declare enum KTX2Transcoder {
46
+ /** BinomialLLC transcoder. */
47
+ BinomialLLC = 0,
48
+ /** Khronos transcoder. */
49
+ Khronos = 1
50
+ }
43
51
  declare module "@galacean/engine-core" {
44
52
  interface EngineConfiguration {
45
53
  /** KTX2 loader options. */
46
54
  ktx2Loader?: {
47
55
  /** Worker count for transcoder, default is 4. */
48
56
  workerCount?: number;
49
- /** Pre-initialization according to the priority transcoding format queue, default is ASTC/ETC/DXT/PVRTC/RGBA8. */
50
- priorityFormats?: KTX2TargetFormat[] | KTX2TargetFormat[][];
57
+ /** Global transcoding format queue which will be used if not specified in per-instance param, default is BC7/ASTC/BC3_BC1/ETC/PVRTC/R8G8B8A8. */
58
+ /** @deprecated */
59
+ priorityFormats?: KTX2TargetFormat[];
60
+ /** Used for initialize KTX2 transcoder, default is BinomialLLC. */
61
+ transcoder?: KTX2Transcoder;
51
62
  };
52
63
  }
53
64
  }
@@ -20,7 +20,7 @@ export interface InitMessage extends BaseMessage {
20
20
  export interface BinomialTranscodeMessage extends BaseMessage {
21
21
  type: "transcode";
22
22
  format: number;
23
- buffer: ArrayBuffer;
23
+ buffer: Uint8Array;
24
24
  }
25
25
  export type IBinomialMessage = InitMessage | BinomialTranscodeMessage;
26
26
  export type TranscodeResult = {
@@ -4,5 +4,5 @@ import { AbstractTranscoder, TranscodeResult } from "./AbstractTranscoder";
4
4
  export declare class BinomialLLCTranscoder extends AbstractTranscoder {
5
5
  constructor(workerLimitCount: number);
6
6
  _initTranscodeWorkerPool(): Promise<any>;
7
- transcode(buffer: ArrayBuffer, format: KTX2TargetFormat): Promise<TranscodeResult>;
7
+ transcode(buffer: Uint8Array, format: KTX2TargetFormat): Promise<TranscodeResult>;
8
8
  }
@@ -3,4 +3,4 @@ import { TranscodeResult } from "./AbstractTranscoder";
3
3
  export declare function TranscodeWorkerCode(): void;
4
4
  export declare const _init: () => (wasmBinary?: ArrayBuffer) => any;
5
5
  export declare const init: (wasmBinary?: ArrayBuffer) => any;
6
- export declare function transcode(buffer: ArrayBuffer, targetFormat: any, KTX2File: any): TranscodeResult;
6
+ export declare function transcode(buffer: Uint8Array, targetFormat: any, KTX2File: any): TranscodeResult;