@galacean/engine-rhi-webgl 1.5.13 → 1.6.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 +15 -2
- package/dist/main.js.map +1 -1
- package/dist/module.js +15 -2
- package/dist/module.js.map +1 -1
- package/package.json +4 -4
- package/types/WebGLGraphicDevice.d.ts +7 -2
package/dist/module.js
CHANGED
|
@@ -350,7 +350,7 @@ var GLBuffer = /*#__PURE__*/ function() {
|
|
|
350
350
|
var cap = this.capabilityList;
|
|
351
351
|
var isWebGL2 = this.rhi.isWebGL2;
|
|
352
352
|
var requireExtension = this.rhi.requireExtension.bind(this.rhi);
|
|
353
|
-
var shaderVertexID = GLCapabilityType.shaderVertexID, standardDerivatives = GLCapabilityType.standardDerivatives, shaderTextureLod = GLCapabilityType.shaderTextureLod, elementIndexUint = GLCapabilityType.elementIndexUint, depthTexture = GLCapabilityType.depthTexture, vertexArrayObject = GLCapabilityType.vertexArrayObject, instancedArrays = GLCapabilityType.instancedArrays, multipleSample = GLCapabilityType.multipleSample, drawBuffers = GLCapabilityType.drawBuffers, blendMinMax = GLCapabilityType.blendMinMax, astc = GLCapabilityType.astc, astc_webkit = GLCapabilityType.astc_webkit, etc = GLCapabilityType.etc, etc_webkit = GLCapabilityType.etc_webkit, etc1 = GLCapabilityType.etc1, etc1_webkit = GLCapabilityType.etc1_webkit, pvrtc = GLCapabilityType.pvrtc, pvrtc_webkit = GLCapabilityType.pvrtc_webkit, s3tc = GLCapabilityType.s3tc, s3tc_webkit = GLCapabilityType.s3tc_webkit, bptc = GLCapabilityType.bptc, s3tc_srgb = GLCapabilityType.s3tc_srgb, textureFloat = GLCapabilityType.textureFloat, textureHalfFloat = GLCapabilityType.textureHalfFloat, textureFloatLinear = GLCapabilityType.textureFloatLinear, textureHalfFloatLinear = GLCapabilityType.textureHalfFloatLinear, WEBGL_colorBufferFloat = GLCapabilityType.WEBGL_colorBufferFloat, colorBufferFloat = GLCapabilityType.colorBufferFloat, colorBufferHalfFloat = GLCapabilityType.colorBufferHalfFloat, textureFilterAnisotropic = GLCapabilityType.textureFilterAnisotropic, fragDepth = GLCapabilityType.fragDepth, sRGB = GLCapabilityType.sRGB;
|
|
353
|
+
var shaderVertexID = GLCapabilityType.shaderVertexID, standardDerivatives = GLCapabilityType.standardDerivatives, shaderTextureLod = GLCapabilityType.shaderTextureLod, elementIndexUint = GLCapabilityType.elementIndexUint, depthTexture = GLCapabilityType.depthTexture, vertexArrayObject = GLCapabilityType.vertexArrayObject, instancedArrays = GLCapabilityType.instancedArrays, multipleSample = GLCapabilityType.multipleSample, drawBuffers = GLCapabilityType.drawBuffers, blendMinMax = GLCapabilityType.blendMinMax, astc = GLCapabilityType.astc, astc_webkit = GLCapabilityType.astc_webkit, astc_hdr = GLCapabilityType.astc_hdr, etc = GLCapabilityType.etc, etc_webkit = GLCapabilityType.etc_webkit, etc1 = GLCapabilityType.etc1, etc1_webkit = GLCapabilityType.etc1_webkit, pvrtc = GLCapabilityType.pvrtc, pvrtc_webkit = GLCapabilityType.pvrtc_webkit, s3tc = GLCapabilityType.s3tc, s3tc_webkit = GLCapabilityType.s3tc_webkit, bptc = GLCapabilityType.bptc, s3tc_srgb = GLCapabilityType.s3tc_srgb, textureFloat = GLCapabilityType.textureFloat, textureHalfFloat = GLCapabilityType.textureHalfFloat, textureFloatLinear = GLCapabilityType.textureFloatLinear, textureHalfFloatLinear = GLCapabilityType.textureHalfFloatLinear, WEBGL_colorBufferFloat = GLCapabilityType.WEBGL_colorBufferFloat, colorBufferFloat = GLCapabilityType.colorBufferFloat, colorBufferHalfFloat = GLCapabilityType.colorBufferHalfFloat, textureFilterAnisotropic = GLCapabilityType.textureFilterAnisotropic, fragDepth = GLCapabilityType.fragDepth, sRGB = GLCapabilityType.sRGB;
|
|
354
354
|
cap.set(shaderVertexID, isWebGL2);
|
|
355
355
|
cap.set(standardDerivatives, isWebGL2 || !!requireExtension(standardDerivatives));
|
|
356
356
|
cap.set(shaderTextureLod, isWebGL2 || !!requireExtension(shaderTextureLod));
|
|
@@ -369,13 +369,15 @@ var GLBuffer = /*#__PURE__*/ function() {
|
|
|
369
369
|
cap.set(colorBufferHalfFloat, isWebGL2 && !!requireExtension(colorBufferFloat) || !!requireExtension(colorBufferHalfFloat));
|
|
370
370
|
cap.set(textureFilterAnisotropic, !!requireExtension(textureFilterAnisotropic));
|
|
371
371
|
cap.set(fragDepth, isWebGL2 || !!requireExtension(fragDepth));
|
|
372
|
-
cap.set(astc, !!(requireExtension(astc) || requireExtension(astc_webkit)));
|
|
373
372
|
cap.set(etc, !!(requireExtension(etc) || requireExtension(etc_webkit)));
|
|
374
373
|
cap.set(etc1, !!(requireExtension(etc1) || requireExtension(etc1_webkit)));
|
|
375
374
|
cap.set(pvrtc, !!(requireExtension(pvrtc) || requireExtension(pvrtc_webkit)));
|
|
376
375
|
cap.set(s3tc, !!(requireExtension(s3tc) || requireExtension(s3tc_webkit)));
|
|
377
376
|
cap.set(s3tc_srgb, !!requireExtension(s3tc_srgb));
|
|
378
377
|
cap.set(bptc, !!requireExtension(bptc));
|
|
378
|
+
var astcExtension = requireExtension(astc) || requireExtension(astc_webkit);
|
|
379
|
+
cap.set(astc, !!astcExtension);
|
|
380
|
+
cap.set(astc_hdr, !!(astcExtension == null ? void 0 : astcExtension.getSupportedProfiles().includes("hdr")));
|
|
379
381
|
cap.set(sRGB, isWebGL2 || !!requireExtension(sRGB));
|
|
380
382
|
};
|
|
381
383
|
/**
|
|
@@ -1014,6 +1016,11 @@ var GLBuffer = /*#__PURE__*/ function() {
|
|
|
1014
1016
|
internalFormat: isSRGBColorSpace ? GLCompressedTextureInternalFormat.SRGB_ALPHA_BPTC_UNORM_EXT : GLCompressedTextureInternalFormat.RGBA_BPTC_UNORM_EXT,
|
|
1015
1017
|
isCompressed: true
|
|
1016
1018
|
};
|
|
1019
|
+
case TextureFormat.BC6H:
|
|
1020
|
+
return {
|
|
1021
|
+
internalFormat: GLCompressedTextureInternalFormat.RGB_BPTC_UNSIGNED_FLOAT_EXT,
|
|
1022
|
+
isCompressed: true
|
|
1023
|
+
};
|
|
1017
1024
|
case TextureFormat.ETC1_RGB:
|
|
1018
1025
|
return {
|
|
1019
1026
|
internalFormat: GLCompressedTextureInternalFormat.RGB_ETC1_WEBGL,
|
|
@@ -2113,6 +2120,12 @@ var GLBuffer = /*#__PURE__*/ function() {
|
|
|
2113
2120
|
var extension = this.requireExtension(GLCapabilityType.WEBGL_lose_context);
|
|
2114
2121
|
extension.restoreContext();
|
|
2115
2122
|
};
|
|
2123
|
+
/**
|
|
2124
|
+
* @remarks
|
|
2125
|
+
* WebGL context loss and restore can happen at any GPU execution point. refs to: https://www.khronos.org/webgl/wiki/HandlingContextLost
|
|
2126
|
+
*/ _proto.isContextLost = function isContextLost() {
|
|
2127
|
+
return this.gl.isContextLost();
|
|
2128
|
+
};
|
|
2116
2129
|
_proto.resetState = function resetState() {
|
|
2117
2130
|
this._readFrameBuffer = null;
|
|
2118
2131
|
this._enableGlobalDepthBias = false;
|