@galacean/engine-rhi-webgl 1.3.23 → 1.4.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.js CHANGED
@@ -7,66 +7,68 @@ var engineMath = require('@galacean/engine-math');
7
7
 
8
8
  /**
9
9
  * Smoothing plug-in.
10
- * */ exports.GLCompressedTextureInternalFormat = void 0;
11
- (function(GLCompressedTextureInternalFormat) {
12
- GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat[// astc
13
- "RGBA_ASTC_4X4_KHR"] = 0x93b0] = "RGBA_ASTC_4X4_KHR";
14
- GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_ASTC_5X4_KHR"] = 0x93b1] = "RGBA_ASTC_5X4_KHR";
15
- GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_ASTC_5X5_KHR"] = 0x93b2] = "RGBA_ASTC_5X5_KHR";
16
- GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_ASTC_6X5_KHR"] = 0x93b3] = "RGBA_ASTC_6X5_KHR";
17
- GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_ASTC_6X6_KHR"] = 0x93b4] = "RGBA_ASTC_6X6_KHR";
18
- GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_ASTC_8X5_KHR"] = 0x93b5] = "RGBA_ASTC_8X5_KHR";
19
- GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_ASTC_8X6_KHR"] = 0x93b6] = "RGBA_ASTC_8X6_KHR";
20
- GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_ASTC_8X8_KHR"] = 0x93b7] = "RGBA_ASTC_8X8_KHR";
21
- GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_ASTC_10X5_KHR"] = 0x93b8] = "RGBA_ASTC_10X5_KHR";
22
- GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_ASTC_10X6_KHR"] = 0x93b9] = "RGBA_ASTC_10X6_KHR";
23
- GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_ASTC_10X8_KHR"] = 0x93ba] = "RGBA_ASTC_10X8_KHR";
24
- GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_ASTC_10X10_KHR"] = 0x93bb] = "RGBA_ASTC_10X10_KHR";
25
- GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_ASTC_12X10_KHR"] = 0x93bc] = "RGBA_ASTC_12X10_KHR";
26
- GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_ASTC_12X12_KHR"] = 0x93bd] = "RGBA_ASTC_12X12_KHR";
27
- GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SRGB8_ALPHA8_ASTC_4X4_KHR"] = 0x93d0] = "SRGB8_ALPHA8_ASTC_4X4_KHR";
28
- GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SRGB8_ALPHA8_ASTC_5X4_KHR"] = 0x93d1] = "SRGB8_ALPHA8_ASTC_5X4_KHR";
29
- GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SRGB8_ALPHA8_ASTC_5X5_KHR"] = 0x93d2] = "SRGB8_ALPHA8_ASTC_5X5_KHR";
30
- GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SRGB8_ALPHA8_ASTC_6X5_KHR"] = 0x93d3] = "SRGB8_ALPHA8_ASTC_6X5_KHR";
31
- GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SRGB8_ALPHA8_ASTC_6X6_KHR"] = 0x93d4] = "SRGB8_ALPHA8_ASTC_6X6_KHR";
32
- GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SRGB8_ALPHA8_ASTC_8X5_KHR"] = 0x93d5] = "SRGB8_ALPHA8_ASTC_8X5_KHR";
33
- GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SRGB8_ALPHA8_ASTC_8X6_KHR"] = 0x93d6] = "SRGB8_ALPHA8_ASTC_8X6_KHR";
34
- GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SRGB8_ALPHA8_ASTC_8X8_KHR"] = 0x93d7] = "SRGB8_ALPHA8_ASTC_8X8_KHR";
35
- GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SRGB8_ALPHA8_ASTC_10X5_KHR"] = 0x93d8] = "SRGB8_ALPHA8_ASTC_10X5_KHR";
36
- GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SRGB8_ALPHA8_ASTC_10X6_KHR"] = 0x93d9] = "SRGB8_ALPHA8_ASTC_10X6_KHR";
37
- GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SRGB8_ALPHA8_ASTC_10X8_KHR"] = 0x93da] = "SRGB8_ALPHA8_ASTC_10X8_KHR";
38
- GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SRGB8_ALPHA8_ASTC_10X10_KHR"] = 0x93db] = "SRGB8_ALPHA8_ASTC_10X10_KHR";
39
- GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SRGB8_ALPHA8_ASTC_12X10_KHR"] = 0x93dc] = "SRGB8_ALPHA8_ASTC_12X10_KHR";
40
- GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SRGB8_ALPHA8_ASTC_12X12_KHR"] = 0x93dd] = "SRGB8_ALPHA8_ASTC_12X12_KHR";
41
- GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat[// etc1
42
- "RGB_ETC1_WEBGL"] = 0x8d64] = "RGB_ETC1_WEBGL";
43
- GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat[// etc2
44
- "R11_EAC"] = 0x9270] = "R11_EAC";
45
- GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SIGNED_R11_EAC"] = 0x9271] = "SIGNED_R11_EAC";
46
- GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RG11_EAC"] = 0x9272] = "RG11_EAC";
47
- GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SIGNED_RG11_EAC"] = 0x9273] = "SIGNED_RG11_EAC";
48
- GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGB8_ETC2"] = 0x9274] = "RGB8_ETC2";
49
- GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SRGB8_ETC2"] = 0x9275] = "SRGB8_ETC2";
50
- GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGB8_PUNCHTHROUGH_ALPHA1_ETC2"] = 0x9276] = "RGB8_PUNCHTHROUGH_ALPHA1_ETC2";
51
- GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SRGB8_PUNCHTHROUGH_ALPHA1_ETC2"] = 0x9277] = "SRGB8_PUNCHTHROUGH_ALPHA1_ETC2";
52
- GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA8_ETC2_EAC"] = 0x9278] = "RGBA8_ETC2_EAC";
53
- GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SRGB8_ALPHA8_ETC2_EAC"] = 0x9279] = "SRGB8_ALPHA8_ETC2_EAC";
54
- GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat[// pvrtc
55
- "RGB_PVRTC_4BPPV1_IMG"] = 0x8c00] = "RGB_PVRTC_4BPPV1_IMG";
56
- GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGB_PVRTC_2BPPV1_IMG"] = 0x8c01] = "RGB_PVRTC_2BPPV1_IMG";
57
- GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_PVRTC_4BPPV1_IMG"] = 0x8c02] = "RGBA_PVRTC_4BPPV1_IMG";
58
- GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_PVRTC_2BPPV1_IMG"] = 0x8c03] = "RGBA_PVRTC_2BPPV1_IMG";
59
- GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat[// s3tc
60
- "RGB_S3TC_DXT1_EXT"] = 0x83f0] = "RGB_S3TC_DXT1_EXT";
61
- GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_S3TC_DXT1_EXT"] = 0x83f1] = "RGBA_S3TC_DXT1_EXT";
62
- GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_S3TC_DXT3_EXT"] = 0x83f2] = "RGBA_S3TC_DXT3_EXT";
63
- GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_S3TC_DXT5_EXT"] = 0x83f3] = "RGBA_S3TC_DXT5_EXT";
64
- GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat[// bptc
65
- "RGBA_BPTC_UNORM_EXT"] = 0x8e8c] = "RGBA_BPTC_UNORM_EXT";
66
- GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SRGB_ALPHA_BPTC_UNORM_EXT"] = 0x8e8d] = "SRGB_ALPHA_BPTC_UNORM_EXT";
67
- GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGB_BPTC_SIGNED_FLOAT_EXT"] = 0x8e8e] = "RGB_BPTC_SIGNED_FLOAT_EXT";
68
- GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGB_BPTC_UNSIGNED_FLOAT_EXT"] = 0x8e8f] = "RGB_BPTC_UNSIGNED_FLOAT_EXT";
69
- })(exports.GLCompressedTextureInternalFormat || (exports.GLCompressedTextureInternalFormat = {}));
10
+ * */ /**
11
+ * @deprecated
12
+ */ var GLCompressedTextureInternalFormat = /*#__PURE__*/ function(GLCompressedTextureInternalFormat) {
13
+ // astc
14
+ GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_ASTC_4X4_KHR"] = 37808] = "RGBA_ASTC_4X4_KHR";
15
+ GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_ASTC_5X4_KHR"] = 37809] = "RGBA_ASTC_5X4_KHR";
16
+ GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_ASTC_5X5_KHR"] = 37810] = "RGBA_ASTC_5X5_KHR";
17
+ GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_ASTC_6X5_KHR"] = 37811] = "RGBA_ASTC_6X5_KHR";
18
+ GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_ASTC_6X6_KHR"] = 37812] = "RGBA_ASTC_6X6_KHR";
19
+ GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_ASTC_8X5_KHR"] = 37813] = "RGBA_ASTC_8X5_KHR";
20
+ GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_ASTC_8X6_KHR"] = 37814] = "RGBA_ASTC_8X6_KHR";
21
+ GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_ASTC_8X8_KHR"] = 37815] = "RGBA_ASTC_8X8_KHR";
22
+ GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_ASTC_10X5_KHR"] = 37816] = "RGBA_ASTC_10X5_KHR";
23
+ GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_ASTC_10X6_KHR"] = 37817] = "RGBA_ASTC_10X6_KHR";
24
+ GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_ASTC_10X8_KHR"] = 37818] = "RGBA_ASTC_10X8_KHR";
25
+ GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_ASTC_10X10_KHR"] = 37819] = "RGBA_ASTC_10X10_KHR";
26
+ GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_ASTC_12X10_KHR"] = 37820] = "RGBA_ASTC_12X10_KHR";
27
+ GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_ASTC_12X12_KHR"] = 37821] = "RGBA_ASTC_12X12_KHR";
28
+ GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SRGB8_ALPHA8_ASTC_4X4_KHR"] = 37840] = "SRGB8_ALPHA8_ASTC_4X4_KHR";
29
+ GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SRGB8_ALPHA8_ASTC_5X4_KHR"] = 37841] = "SRGB8_ALPHA8_ASTC_5X4_KHR";
30
+ GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SRGB8_ALPHA8_ASTC_5X5_KHR"] = 37842] = "SRGB8_ALPHA8_ASTC_5X5_KHR";
31
+ GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SRGB8_ALPHA8_ASTC_6X5_KHR"] = 37843] = "SRGB8_ALPHA8_ASTC_6X5_KHR";
32
+ GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SRGB8_ALPHA8_ASTC_6X6_KHR"] = 37844] = "SRGB8_ALPHA8_ASTC_6X6_KHR";
33
+ GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SRGB8_ALPHA8_ASTC_8X5_KHR"] = 37845] = "SRGB8_ALPHA8_ASTC_8X5_KHR";
34
+ GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SRGB8_ALPHA8_ASTC_8X6_KHR"] = 37846] = "SRGB8_ALPHA8_ASTC_8X6_KHR";
35
+ GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SRGB8_ALPHA8_ASTC_8X8_KHR"] = 37847] = "SRGB8_ALPHA8_ASTC_8X8_KHR";
36
+ GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SRGB8_ALPHA8_ASTC_10X5_KHR"] = 37848] = "SRGB8_ALPHA8_ASTC_10X5_KHR";
37
+ GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SRGB8_ALPHA8_ASTC_10X6_KHR"] = 37849] = "SRGB8_ALPHA8_ASTC_10X6_KHR";
38
+ GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SRGB8_ALPHA8_ASTC_10X8_KHR"] = 37850] = "SRGB8_ALPHA8_ASTC_10X8_KHR";
39
+ GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SRGB8_ALPHA8_ASTC_10X10_KHR"] = 37851] = "SRGB8_ALPHA8_ASTC_10X10_KHR";
40
+ GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SRGB8_ALPHA8_ASTC_12X10_KHR"] = 37852] = "SRGB8_ALPHA8_ASTC_12X10_KHR";
41
+ GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SRGB8_ALPHA8_ASTC_12X12_KHR"] = 37853] = "SRGB8_ALPHA8_ASTC_12X12_KHR";
42
+ // etc1
43
+ GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGB_ETC1_WEBGL"] = 36196] = "RGB_ETC1_WEBGL";
44
+ // etc2
45
+ GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["R11_EAC"] = 37488] = "R11_EAC";
46
+ GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SIGNED_R11_EAC"] = 37489] = "SIGNED_R11_EAC";
47
+ GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RG11_EAC"] = 37490] = "RG11_EAC";
48
+ GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SIGNED_RG11_EAC"] = 37491] = "SIGNED_RG11_EAC";
49
+ GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGB8_ETC2"] = 37492] = "RGB8_ETC2";
50
+ GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SRGB8_ETC2"] = 37493] = "SRGB8_ETC2";
51
+ GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGB8_PUNCHTHROUGH_ALPHA1_ETC2"] = 37494] = "RGB8_PUNCHTHROUGH_ALPHA1_ETC2";
52
+ GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SRGB8_PUNCHTHROUGH_ALPHA1_ETC2"] = 37495] = "SRGB8_PUNCHTHROUGH_ALPHA1_ETC2";
53
+ GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA8_ETC2_EAC"] = 37496] = "RGBA8_ETC2_EAC";
54
+ GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SRGB8_ALPHA8_ETC2_EAC"] = 37497] = "SRGB8_ALPHA8_ETC2_EAC";
55
+ // pvrtc
56
+ GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGB_PVRTC_4BPPV1_IMG"] = 35840] = "RGB_PVRTC_4BPPV1_IMG";
57
+ GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGB_PVRTC_2BPPV1_IMG"] = 35841] = "RGB_PVRTC_2BPPV1_IMG";
58
+ GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_PVRTC_4BPPV1_IMG"] = 35842] = "RGBA_PVRTC_4BPPV1_IMG";
59
+ GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_PVRTC_2BPPV1_IMG"] = 35843] = "RGBA_PVRTC_2BPPV1_IMG";
60
+ // s3tc
61
+ GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGB_S3TC_DXT1_EXT"] = 33776] = "RGB_S3TC_DXT1_EXT";
62
+ GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_S3TC_DXT1_EXT"] = 33777] = "RGBA_S3TC_DXT1_EXT";
63
+ GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_S3TC_DXT3_EXT"] = 33778] = "RGBA_S3TC_DXT3_EXT";
64
+ GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_S3TC_DXT5_EXT"] = 33779] = "RGBA_S3TC_DXT5_EXT";
65
+ // bptc
66
+ GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGBA_BPTC_UNORM_EXT"] = 36492] = "RGBA_BPTC_UNORM_EXT";
67
+ GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["SRGB_ALPHA_BPTC_UNORM_EXT"] = 36493] = "SRGB_ALPHA_BPTC_UNORM_EXT";
68
+ GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGB_BPTC_SIGNED_FLOAT_EXT"] = 36494] = "RGB_BPTC_SIGNED_FLOAT_EXT";
69
+ GLCompressedTextureInternalFormat[GLCompressedTextureInternalFormat["RGB_BPTC_UNSIGNED_FLOAT_EXT"] = 36495] = "RGB_BPTC_UNSIGNED_FLOAT_EXT";
70
+ return GLCompressedTextureInternalFormat;
71
+ }({});
70
72
 
71
73
  function _defineProperties(target, props) {
72
74
  for (var i = 0; i < props.length; i++) {
@@ -114,12 +116,11 @@ function _instanceof(left, right) {
114
116
 
115
117
  /**
116
118
  * The canvas used on the web, which can support HTMLCanvasElement and OffscreenCanvas.
117
- */ var WebCanvas = /*#__PURE__*/ function(Canvas1) {
118
- _inherits(WebCanvas, Canvas1);
119
+ */ var WebCanvas = /*#__PURE__*/ function(Canvas) {
120
+ _inherits(WebCanvas, Canvas);
119
121
  function WebCanvas(webCanvas) {
120
122
  var _this;
121
- _this = Canvas1.call(this) || this;
122
- _this._scale = new engineMath.Vector2();
123
+ _this = Canvas.call(this) || this, _this._scale = new engineMath.Vector2();
123
124
  var width = webCanvas.width;
124
125
  var height = webCanvas.height;
125
126
  _this._webCanvas = webCanvas;
@@ -182,10 +183,10 @@ function _instanceof(left, right) {
182
183
 
183
184
  /**
184
185
  * WebGL platform engine,support includes WebGL1.0 and WebGL2.0.
185
- */ var WebGLEngine = /*#__PURE__*/ function(Engine1) {
186
- _inherits(WebGLEngine, Engine1);
186
+ */ var WebGLEngine = /*#__PURE__*/ function(Engine) {
187
+ _inherits(WebGLEngine, Engine);
187
188
  function WebGLEngine() {
188
- return Engine1.apply(this, arguments);
189
+ return Engine.apply(this, arguments) || this;
189
190
  }
190
191
  /**
191
192
  * Create a WebGL engine.
@@ -323,12 +324,12 @@ var GLBuffer = /*#__PURE__*/ function() {
323
324
  * Check if can use some compressed texture format.
324
325
  */ _proto.canIUseCompressedTextureInternalFormat = function canIUseCompressedTextureInternalFormat(internalType) {
325
326
  var // astc
326
- RGBA_ASTC_4X4_KHR = exports.GLCompressedTextureInternalFormat.RGBA_ASTC_4X4_KHR, RGBA_ASTC_12X12_KHR = exports.GLCompressedTextureInternalFormat.RGBA_ASTC_12X12_KHR, SRGB8_ALPHA8_ASTC_4X4_KHR = exports.GLCompressedTextureInternalFormat.SRGB8_ALPHA8_ASTC_4X4_KHR, SRGB8_ALPHA8_ASTC_12X12_KHR = exports.GLCompressedTextureInternalFormat.SRGB8_ALPHA8_ASTC_12X12_KHR, // etc1
327
- RGB_ETC1_WEBGL = exports.GLCompressedTextureInternalFormat.RGB_ETC1_WEBGL, // etc
328
- R11_EAC = exports.GLCompressedTextureInternalFormat.R11_EAC, SRGB8_ALPHA8_ETC2_EAC = exports.GLCompressedTextureInternalFormat.SRGB8_ALPHA8_ETC2_EAC, // pvrtc
329
- RGB_PVRTC_4BPPV1_IMG = exports.GLCompressedTextureInternalFormat.RGB_PVRTC_4BPPV1_IMG, RGBA_PVRTC_2BPPV1_IMG = exports.GLCompressedTextureInternalFormat.RGBA_PVRTC_2BPPV1_IMG, // s3tc
330
- RGB_S3TC_DXT1_EXT = exports.GLCompressedTextureInternalFormat.RGB_S3TC_DXT1_EXT, RGBA_S3TC_DXT5_EXT = exports.GLCompressedTextureInternalFormat.RGBA_S3TC_DXT5_EXT, // bptc
331
- RGBA_BPTC_UNORM_EXT = exports.GLCompressedTextureInternalFormat.RGBA_BPTC_UNORM_EXT, RGB_BPTC_UNSIGNED_FLOAT_EXT = exports.GLCompressedTextureInternalFormat.RGB_BPTC_UNSIGNED_FLOAT_EXT;
327
+ RGBA_ASTC_4X4_KHR = GLCompressedTextureInternalFormat.RGBA_ASTC_4X4_KHR, RGBA_ASTC_12X12_KHR = GLCompressedTextureInternalFormat.RGBA_ASTC_12X12_KHR, SRGB8_ALPHA8_ASTC_4X4_KHR = GLCompressedTextureInternalFormat.SRGB8_ALPHA8_ASTC_4X4_KHR, SRGB8_ALPHA8_ASTC_12X12_KHR = GLCompressedTextureInternalFormat.SRGB8_ALPHA8_ASTC_12X12_KHR, // etc1
328
+ RGB_ETC1_WEBGL = GLCompressedTextureInternalFormat.RGB_ETC1_WEBGL, // etc
329
+ R11_EAC = GLCompressedTextureInternalFormat.R11_EAC, SRGB8_ALPHA8_ETC2_EAC = GLCompressedTextureInternalFormat.SRGB8_ALPHA8_ETC2_EAC, // pvrtc
330
+ RGB_PVRTC_4BPPV1_IMG = GLCompressedTextureInternalFormat.RGB_PVRTC_4BPPV1_IMG, RGBA_PVRTC_2BPPV1_IMG = GLCompressedTextureInternalFormat.RGBA_PVRTC_2BPPV1_IMG, // s3tc
331
+ RGB_S3TC_DXT1_EXT = GLCompressedTextureInternalFormat.RGB_S3TC_DXT1_EXT, RGBA_S3TC_DXT5_EXT = GLCompressedTextureInternalFormat.RGBA_S3TC_DXT5_EXT, // bptc
332
+ RGBA_BPTC_UNORM_EXT = GLCompressedTextureInternalFormat.RGBA_BPTC_UNORM_EXT, RGB_BPTC_UNSIGNED_FLOAT_EXT = GLCompressedTextureInternalFormat.RGB_BPTC_UNSIGNED_FLOAT_EXT;
332
333
  if (internalType >= RGBA_ASTC_4X4_KHR && RGBA_ASTC_12X12_KHR <= RGBA_ASTC_12X12_KHR || internalType >= SRGB8_ALPHA8_ASTC_4X4_KHR && internalType <= SRGB8_ALPHA8_ASTC_12X12_KHR) {
333
334
  return this.canIUse(engineCore.GLCapabilityType.astc);
334
335
  } else if (internalType === RGB_ETC1_WEBGL) {
@@ -389,11 +390,10 @@ var GLBuffer = /*#__PURE__*/ function() {
389
390
  var ext = null;
390
391
  if (ext = rhi.requireExtension(capabilityType)) {
391
392
  for(var glKey in flatItem){
392
- var _extensionVal;
393
393
  var extensionKey = flatItem[glKey];
394
394
  var extensionVal = ext[extensionKey];
395
395
  // Mini game hack the native function,use “.bind” to smooth out if is “Funcion”.
396
- if ((_extensionVal = extensionVal) == null ? void 0 : _extensionVal.bind) {
396
+ if (extensionVal == null ? void 0 : extensionVal.bind) {
397
397
  gl[glKey] = extensionVal.bind(ext);
398
398
  } else {
399
399
  gl[glKey] = extensionVal;
@@ -937,87 +937,87 @@ var GLBuffer = /*#__PURE__*/ function() {
937
937
  };
938
938
  case engineCore.TextureFormat.BC1:
939
939
  return {
940
- internalFormat: exports.GLCompressedTextureInternalFormat.RGB_S3TC_DXT1_EXT,
940
+ internalFormat: GLCompressedTextureInternalFormat.RGB_S3TC_DXT1_EXT,
941
941
  isCompressed: true
942
942
  };
943
943
  case engineCore.TextureFormat.BC3:
944
944
  return {
945
- internalFormat: exports.GLCompressedTextureInternalFormat.RGBA_S3TC_DXT5_EXT,
945
+ internalFormat: GLCompressedTextureInternalFormat.RGBA_S3TC_DXT5_EXT,
946
946
  isCompressed: true
947
947
  };
948
948
  case engineCore.TextureFormat.BC7:
949
949
  return {
950
- internalFormat: exports.GLCompressedTextureInternalFormat.RGBA_BPTC_UNORM_EXT,
950
+ internalFormat: GLCompressedTextureInternalFormat.RGBA_BPTC_UNORM_EXT,
951
951
  isCompressed: true
952
952
  };
953
953
  case engineCore.TextureFormat.ETC1_RGB:
954
954
  return {
955
- internalFormat: exports.GLCompressedTextureInternalFormat.RGB_ETC1_WEBGL,
955
+ internalFormat: GLCompressedTextureInternalFormat.RGB_ETC1_WEBGL,
956
956
  isCompressed: true
957
957
  };
958
958
  case engineCore.TextureFormat.ETC2_RGB:
959
959
  return {
960
- internalFormat: exports.GLCompressedTextureInternalFormat.RGB8_ETC2,
960
+ internalFormat: GLCompressedTextureInternalFormat.RGB8_ETC2,
961
961
  isCompressed: true
962
962
  };
963
963
  case engineCore.TextureFormat.ETC2_RGBA5:
964
964
  return {
965
- internalFormat: exports.GLCompressedTextureInternalFormat.RGB8_PUNCHTHROUGH_ALPHA1_ETC2,
965
+ internalFormat: GLCompressedTextureInternalFormat.RGB8_PUNCHTHROUGH_ALPHA1_ETC2,
966
966
  isCompressed: true
967
967
  };
968
968
  case engineCore.TextureFormat.ETC2_RGBA8:
969
969
  return {
970
- internalFormat: exports.GLCompressedTextureInternalFormat.RGBA8_ETC2_EAC,
970
+ internalFormat: GLCompressedTextureInternalFormat.RGBA8_ETC2_EAC,
971
971
  isCompressed: true
972
972
  };
973
973
  case engineCore.TextureFormat.PVRTC_RGB2:
974
974
  return {
975
- internalFormat: exports.GLCompressedTextureInternalFormat.RGB_PVRTC_2BPPV1_IMG,
975
+ internalFormat: GLCompressedTextureInternalFormat.RGB_PVRTC_2BPPV1_IMG,
976
976
  isCompressed: true
977
977
  };
978
978
  case engineCore.TextureFormat.PVRTC_RGBA2:
979
979
  return {
980
- internalFormat: exports.GLCompressedTextureInternalFormat.RGBA_PVRTC_2BPPV1_IMG,
980
+ internalFormat: GLCompressedTextureInternalFormat.RGBA_PVRTC_2BPPV1_IMG,
981
981
  isCompressed: true
982
982
  };
983
983
  case engineCore.TextureFormat.PVRTC_RGB4:
984
984
  return {
985
- internalFormat: exports.GLCompressedTextureInternalFormat.RGB_PVRTC_4BPPV1_IMG,
985
+ internalFormat: GLCompressedTextureInternalFormat.RGB_PVRTC_4BPPV1_IMG,
986
986
  isCompressed: true
987
987
  };
988
988
  case engineCore.TextureFormat.PVRTC_RGBA4:
989
989
  return {
990
- internalFormat: exports.GLCompressedTextureInternalFormat.RGBA_PVRTC_4BPPV1_IMG,
990
+ internalFormat: GLCompressedTextureInternalFormat.RGBA_PVRTC_4BPPV1_IMG,
991
991
  isCompressed: true
992
992
  };
993
993
  case engineCore.TextureFormat.ASTC_4x4:
994
994
  return {
995
- internalFormat: exports.GLCompressedTextureInternalFormat.RGBA_ASTC_4X4_KHR,
995
+ internalFormat: GLCompressedTextureInternalFormat.RGBA_ASTC_4X4_KHR,
996
996
  isCompressed: true
997
997
  };
998
998
  case engineCore.TextureFormat.ASTC_5x5:
999
999
  return {
1000
- internalFormat: exports.GLCompressedTextureInternalFormat.RGBA_ASTC_5X5_KHR,
1000
+ internalFormat: GLCompressedTextureInternalFormat.RGBA_ASTC_5X5_KHR,
1001
1001
  isCompressed: true
1002
1002
  };
1003
1003
  case engineCore.TextureFormat.ASTC_6x6:
1004
1004
  return {
1005
- internalFormat: exports.GLCompressedTextureInternalFormat.RGBA_ASTC_6X6_KHR,
1005
+ internalFormat: GLCompressedTextureInternalFormat.RGBA_ASTC_6X6_KHR,
1006
1006
  isCompressed: true
1007
1007
  };
1008
1008
  case engineCore.TextureFormat.ASTC_8x8:
1009
1009
  return {
1010
- internalFormat: exports.GLCompressedTextureInternalFormat.RGBA_ASTC_8X8_KHR,
1010
+ internalFormat: GLCompressedTextureInternalFormat.RGBA_ASTC_8X8_KHR,
1011
1011
  isCompressed: true
1012
1012
  };
1013
1013
  case engineCore.TextureFormat.ASTC_10x10:
1014
1014
  return {
1015
- internalFormat: exports.GLCompressedTextureInternalFormat.RGBA_ASTC_10X10_KHR,
1015
+ internalFormat: GLCompressedTextureInternalFormat.RGBA_ASTC_10X10_KHR,
1016
1016
  isCompressed: true
1017
1017
  };
1018
1018
  case engineCore.TextureFormat.ASTC_12x12:
1019
1019
  return {
1020
- internalFormat: exports.GLCompressedTextureInternalFormat.RGBA_ASTC_12X12_KHR,
1020
+ internalFormat: GLCompressedTextureInternalFormat.RGBA_ASTC_12X12_KHR,
1021
1021
  isCompressed: true
1022
1022
  };
1023
1023
  case engineCore.TextureFormat.Depth:
@@ -1539,8 +1539,7 @@ var GLBuffer = /*#__PURE__*/ function() {
1539
1539
  _inherits(GLTexture2D, GLTexture1);
1540
1540
  function GLTexture2D(rhi, texture2D) {
1541
1541
  var _this;
1542
- _this = GLTexture1.call(this, rhi, texture2D, rhi.gl.TEXTURE_2D) || this;
1543
- /** Backward compatible with WebGL1.0. */ _this._compressedMipFilled = 0;
1542
+ _this = GLTexture1.call(this, rhi, texture2D, rhi.gl.TEXTURE_2D) || this, /** Backward compatible with WebGL1.0. */ _this._compressedMipFilled = 0;
1544
1543
  /** @ts-ignore */ var format = texture2D.format, _mipmap = texture2D._mipmap, width = texture2D.width, height = texture2D.height;
1545
1544
  var isWebGL2 = _this._isWebGL2;
1546
1545
  /** @ts-ignore */ if (!GLTexture._supportTextureFormat(format, rhi)) {
@@ -1676,8 +1675,7 @@ var GLBuffer = /*#__PURE__*/ function() {
1676
1675
  _inherits(GLTextureCube, GLTexture1);
1677
1676
  function GLTextureCube(rhi, textureCube) {
1678
1677
  var _this;
1679
- _this = GLTexture1.call(this, rhi, textureCube, rhi.gl.TEXTURE_CUBE_MAP) || this;
1680
- /** Backward compatible with WebGL1.0. */ _this._compressedFaceFilled = [
1678
+ _this = GLTexture1.call(this, rhi, textureCube, rhi.gl.TEXTURE_CUBE_MAP) || this, /** Backward compatible with WebGL1.0. */ _this._compressedFaceFilled = [
1681
1679
  0,
1682
1680
  0,
1683
1681
  0,
@@ -1745,12 +1743,14 @@ var GLBuffer = /*#__PURE__*/ function() {
1745
1743
  return GLTextureCube;
1746
1744
  }(GLTexture);
1747
1745
 
1748
- exports.WebGLMode = void 0;
1749
- (function(WebGLMode) {
1750
- WebGLMode[WebGLMode[/** Auto, use WebGL2.0 if support, or will fallback to WebGL1.0. */ "Auto"] = 0] = "Auto";
1751
- WebGLMode[WebGLMode[/** WebGL2.0. */ "WebGL2"] = 1] = "WebGL2";
1752
- WebGLMode[WebGLMode[/** WebGL1.0, */ "WebGL1"] = 2] = "WebGL1";
1753
- })(exports.WebGLMode || (exports.WebGLMode = {}));
1746
+ /**
1747
+ * WebGL mode.
1748
+ */ var WebGLMode = /*#__PURE__*/ function(WebGLMode) {
1749
+ /** Auto, use WebGL2.0 if support, or will fallback to WebGL1.0. */ WebGLMode[WebGLMode["Auto"] = 0] = "Auto";
1750
+ /** WebGL2.0. */ WebGLMode[WebGLMode["WebGL2"] = 1] = "WebGL2";
1751
+ /** WebGL1.0, */ WebGLMode[WebGLMode["WebGL1"] = 2] = "WebGL1";
1752
+ return WebGLMode;
1753
+ }({});
1754
1754
  /**
1755
1755
  * WebGL graphic device, including WebGL1.0 and WebGL2.0.
1756
1756
  */ var WebGLGraphicDevice = /*#__PURE__*/ function() {
@@ -2070,7 +2070,9 @@ exports.WebGLMode = void 0;
2070
2070
  return WebGLGraphicDevice;
2071
2071
  }();
2072
2072
 
2073
+ exports.GLCompressedTextureInternalFormat = GLCompressedTextureInternalFormat;
2073
2074
  exports.WebCanvas = WebCanvas;
2074
2075
  exports.WebGLEngine = WebGLEngine;
2075
2076
  exports.WebGLGraphicDevice = WebGLGraphicDevice;
2077
+ exports.WebGLMode = WebGLMode;
2076
2078
  //# sourceMappingURL=main.js.map