@galacean/engine-rhi-webgl 1.2.0-alpha.1 → 1.2.0-alpha.10

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
@@ -135,8 +135,10 @@ function _instanceof(left, right) {
135
135
  if (pixelRatio === void 0) pixelRatio = window.devicePixelRatio;
136
136
  var webCanvas = this._webCanvas;
137
137
  if (typeof OffscreenCanvas === "undefined" || !_instanceof(webCanvas, OffscreenCanvas)) {
138
- this.width = webCanvas.clientWidth * pixelRatio;
139
- this.height = webCanvas.clientHeight * pixelRatio;
138
+ var exportWidth = webCanvas.clientWidth * pixelRatio;
139
+ var exportHeight = webCanvas.clientHeight * pixelRatio;
140
+ this.width = exportWidth;
141
+ this.height = exportHeight;
140
142
  }
141
143
  };
142
144
  /**
@@ -147,9 +149,11 @@ function _instanceof(left, right) {
147
149
  this._scale.set(x, y);
148
150
  this.scale = this._scale;
149
151
  };
150
- _proto._onSizeChanged = function _onSizeChanged(width, height) {
151
- this._webCanvas.width = width;
152
- this._webCanvas.height = height;
152
+ _proto._onWidthChanged = function _onWidthChanged(value) {
153
+ this._webCanvas.width = value;
154
+ };
155
+ _proto._onHeightChange = function _onHeightChange(value) {
156
+ this._webCanvas.height = value;
153
157
  };
154
158
  _create_class(WebCanvas, [
155
159
  {
@@ -346,7 +350,7 @@ var GLBuffer = /*#__PURE__*/ function() {
346
350
  var cap = this.capabilityList;
347
351
  var isWebGL2 = this.rhi.isWebGL2;
348
352
  var requireExtension = this.rhi.requireExtension.bind(this.rhi);
349
- var shaderVertexID = engineCore.GLCapabilityType.shaderVertexID, standardDerivatives = engineCore.GLCapabilityType.standardDerivatives, shaderTextureLod = engineCore.GLCapabilityType.shaderTextureLod, elementIndexUint = engineCore.GLCapabilityType.elementIndexUint, depthTexture = engineCore.GLCapabilityType.depthTexture, vertexArrayObject = engineCore.GLCapabilityType.vertexArrayObject, instancedArrays = engineCore.GLCapabilityType.instancedArrays, multipleSample = engineCore.GLCapabilityType.multipleSample, drawBuffers = engineCore.GLCapabilityType.drawBuffers, astc = engineCore.GLCapabilityType.astc, astc_webkit = engineCore.GLCapabilityType.astc_webkit, etc = engineCore.GLCapabilityType.etc, etc_webkit = engineCore.GLCapabilityType.etc_webkit, etc1 = engineCore.GLCapabilityType.etc1, etc1_webkit = engineCore.GLCapabilityType.etc1_webkit, pvrtc = engineCore.GLCapabilityType.pvrtc, pvrtc_webkit = engineCore.GLCapabilityType.pvrtc_webkit, s3tc = engineCore.GLCapabilityType.s3tc, s3tc_webkit = engineCore.GLCapabilityType.s3tc_webkit, bptc = engineCore.GLCapabilityType.bptc, textureFloat = engineCore.GLCapabilityType.textureFloat, textureHalfFloat = engineCore.GLCapabilityType.textureHalfFloat, textureFloatLinear = engineCore.GLCapabilityType.textureFloatLinear, textureHalfFloatLinear = engineCore.GLCapabilityType.textureHalfFloatLinear, WEBGL_colorBufferFloat = engineCore.GLCapabilityType.WEBGL_colorBufferFloat, colorBufferFloat = engineCore.GLCapabilityType.colorBufferFloat, colorBufferHalfFloat = engineCore.GLCapabilityType.colorBufferHalfFloat, textureFilterAnisotropic = engineCore.GLCapabilityType.textureFilterAnisotropic;
353
+ var shaderVertexID = engineCore.GLCapabilityType.shaderVertexID, standardDerivatives = engineCore.GLCapabilityType.standardDerivatives, shaderTextureLod = engineCore.GLCapabilityType.shaderTextureLod, elementIndexUint = engineCore.GLCapabilityType.elementIndexUint, depthTexture = engineCore.GLCapabilityType.depthTexture, vertexArrayObject = engineCore.GLCapabilityType.vertexArrayObject, instancedArrays = engineCore.GLCapabilityType.instancedArrays, multipleSample = engineCore.GLCapabilityType.multipleSample, drawBuffers = engineCore.GLCapabilityType.drawBuffers, blendMinMax = engineCore.GLCapabilityType.blendMinMax, astc = engineCore.GLCapabilityType.astc, astc_webkit = engineCore.GLCapabilityType.astc_webkit, etc = engineCore.GLCapabilityType.etc, etc_webkit = engineCore.GLCapabilityType.etc_webkit, etc1 = engineCore.GLCapabilityType.etc1, etc1_webkit = engineCore.GLCapabilityType.etc1_webkit, pvrtc = engineCore.GLCapabilityType.pvrtc, pvrtc_webkit = engineCore.GLCapabilityType.pvrtc_webkit, s3tc = engineCore.GLCapabilityType.s3tc, s3tc_webkit = engineCore.GLCapabilityType.s3tc_webkit, bptc = engineCore.GLCapabilityType.bptc, textureFloat = engineCore.GLCapabilityType.textureFloat, textureHalfFloat = engineCore.GLCapabilityType.textureHalfFloat, textureFloatLinear = engineCore.GLCapabilityType.textureFloatLinear, textureHalfFloatLinear = engineCore.GLCapabilityType.textureHalfFloatLinear, WEBGL_colorBufferFloat = engineCore.GLCapabilityType.WEBGL_colorBufferFloat, colorBufferFloat = engineCore.GLCapabilityType.colorBufferFloat, colorBufferHalfFloat = engineCore.GLCapabilityType.colorBufferHalfFloat, textureFilterAnisotropic = engineCore.GLCapabilityType.textureFilterAnisotropic;
350
354
  cap.set(shaderVertexID, isWebGL2);
351
355
  cap.set(standardDerivatives, isWebGL2 || !!requireExtension(standardDerivatives));
352
356
  cap.set(shaderTextureLod, isWebGL2 || !!requireExtension(shaderTextureLod));
@@ -356,6 +360,7 @@ var GLBuffer = /*#__PURE__*/ function() {
356
360
  cap.set(instancedArrays, isWebGL2 || !!requireExtension(instancedArrays));
357
361
  cap.set(multipleSample, isWebGL2);
358
362
  cap.set(drawBuffers, isWebGL2 || !!requireExtension(drawBuffers));
363
+ cap.set(blendMinMax, isWebGL2 || !!requireExtension(blendMinMax));
359
364
  cap.set(textureFloat, isWebGL2 || !!requireExtension(textureFloat));
360
365
  cap.set(textureHalfFloat, isWebGL2 || !!requireExtension(textureHalfFloat));
361
366
  cap.set(textureFloatLinear, !!requireExtension(textureFloatLinear));
@@ -396,9 +401,13 @@ var GLBuffer = /*#__PURE__*/ function() {
396
401
  }
397
402
  };
398
403
  _proto._compatibleAllInterface = function _compatibleAllInterface() {
399
- var depthTexture = engineCore.GLCapabilityType.depthTexture, vertexArrayObject = engineCore.GLCapabilityType.vertexArrayObject, instancedArrays = engineCore.GLCapabilityType.instancedArrays, drawBuffers = engineCore.GLCapabilityType.drawBuffers, textureFilterAnisotropic = engineCore.GLCapabilityType.textureFilterAnisotropic, textureHalfFloat = engineCore.GLCapabilityType.textureHalfFloat, colorBufferHalfFloat = engineCore.GLCapabilityType.colorBufferHalfFloat, WEBGL_colorBufferFloat = engineCore.GLCapabilityType.WEBGL_colorBufferFloat;
404
+ var depthTexture = engineCore.GLCapabilityType.depthTexture, vertexArrayObject = engineCore.GLCapabilityType.vertexArrayObject, instancedArrays = engineCore.GLCapabilityType.instancedArrays, drawBuffers = engineCore.GLCapabilityType.drawBuffers, textureFilterAnisotropic = engineCore.GLCapabilityType.textureFilterAnisotropic, textureHalfFloat = engineCore.GLCapabilityType.textureHalfFloat, colorBufferHalfFloat = engineCore.GLCapabilityType.colorBufferHalfFloat, WEBGL_colorBufferFloat = engineCore.GLCapabilityType.WEBGL_colorBufferFloat, blendMinMax = engineCore.GLCapabilityType.blendMinMax;
400
405
  var isWebGL2 = this.rhi.isWebGL2;
401
406
  if (!isWebGL2) {
407
+ this._compatibleInterface(blendMinMax, {
408
+ MIN: "MIN_EXT",
409
+ MAX: "MAX_EXT"
410
+ });
402
411
  this._compatibleInterface(depthTexture, {
403
412
  UNSIGNED_INT_24_8: "UNSIGNED_INT_24_8_WEBGL"
404
413
  });
@@ -911,6 +920,13 @@ var GLBuffer = /*#__PURE__*/ function() {
911
920
  dataType: gl.FLOAT,
912
921
  isCompressed: false
913
922
  };
923
+ case engineCore.TextureFormat.R32G32B32A32_UInt:
924
+ return {
925
+ internalFormat: isWebGL2 ? gl.RGBA32UI : gl.NONE,
926
+ baseFormat: gl.RGBA_INTEGER,
927
+ dataType: gl.UNSIGNED_INT,
928
+ isCompressed: false
929
+ };
914
930
  case engineCore.TextureFormat.BC1:
915
931
  return {
916
932
  internalFormat: exports.GLCompressedTextureInternalFormat.RGB_S3TC_DXT1_EXT,
@@ -1152,6 +1168,7 @@ var GLBuffer = /*#__PURE__*/ function() {
1152
1168
  return false;
1153
1169
  }
1154
1170
  break;
1171
+ case engineCore.TextureFormat.R32G32B32A32_UInt:
1155
1172
  case engineCore.TextureFormat.Depth24:
1156
1173
  case engineCore.TextureFormat.Depth32:
1157
1174
  case engineCore.TextureFormat.Depth32Stencil8: