@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/main.js
CHANGED
|
@@ -354,7 +354,7 @@ var GLBuffer = /*#__PURE__*/ function() {
|
|
|
354
354
|
var cap = this.capabilityList;
|
|
355
355
|
var isWebGL2 = this.rhi.isWebGL2;
|
|
356
356
|
var requireExtension = this.rhi.requireExtension.bind(this.rhi);
|
|
357
|
-
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, s3tc_srgb = engineCore.GLCapabilityType.s3tc_srgb, 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, fragDepth = engineCore.GLCapabilityType.fragDepth, sRGB = engineCore.GLCapabilityType.sRGB;
|
|
357
|
+
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, astc_hdr = engineCore.GLCapabilityType.astc_hdr, 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, s3tc_srgb = engineCore.GLCapabilityType.s3tc_srgb, 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, fragDepth = engineCore.GLCapabilityType.fragDepth, sRGB = engineCore.GLCapabilityType.sRGB;
|
|
358
358
|
cap.set(shaderVertexID, isWebGL2);
|
|
359
359
|
cap.set(standardDerivatives, isWebGL2 || !!requireExtension(standardDerivatives));
|
|
360
360
|
cap.set(shaderTextureLod, isWebGL2 || !!requireExtension(shaderTextureLod));
|
|
@@ -373,13 +373,15 @@ var GLBuffer = /*#__PURE__*/ function() {
|
|
|
373
373
|
cap.set(colorBufferHalfFloat, isWebGL2 && !!requireExtension(colorBufferFloat) || !!requireExtension(colorBufferHalfFloat));
|
|
374
374
|
cap.set(textureFilterAnisotropic, !!requireExtension(textureFilterAnisotropic));
|
|
375
375
|
cap.set(fragDepth, isWebGL2 || !!requireExtension(fragDepth));
|
|
376
|
-
cap.set(astc, !!(requireExtension(astc) || requireExtension(astc_webkit)));
|
|
377
376
|
cap.set(etc, !!(requireExtension(etc) || requireExtension(etc_webkit)));
|
|
378
377
|
cap.set(etc1, !!(requireExtension(etc1) || requireExtension(etc1_webkit)));
|
|
379
378
|
cap.set(pvrtc, !!(requireExtension(pvrtc) || requireExtension(pvrtc_webkit)));
|
|
380
379
|
cap.set(s3tc, !!(requireExtension(s3tc) || requireExtension(s3tc_webkit)));
|
|
381
380
|
cap.set(s3tc_srgb, !!requireExtension(s3tc_srgb));
|
|
382
381
|
cap.set(bptc, !!requireExtension(bptc));
|
|
382
|
+
var astcExtension = requireExtension(astc) || requireExtension(astc_webkit);
|
|
383
|
+
cap.set(astc, !!astcExtension);
|
|
384
|
+
cap.set(astc_hdr, !!(astcExtension == null ? void 0 : astcExtension.getSupportedProfiles().includes("hdr")));
|
|
383
385
|
cap.set(sRGB, isWebGL2 || !!requireExtension(sRGB));
|
|
384
386
|
};
|
|
385
387
|
/**
|
|
@@ -1018,6 +1020,11 @@ var GLBuffer = /*#__PURE__*/ function() {
|
|
|
1018
1020
|
internalFormat: isSRGBColorSpace ? GLCompressedTextureInternalFormat.SRGB_ALPHA_BPTC_UNORM_EXT : GLCompressedTextureInternalFormat.RGBA_BPTC_UNORM_EXT,
|
|
1019
1021
|
isCompressed: true
|
|
1020
1022
|
};
|
|
1023
|
+
case engineCore.TextureFormat.BC6H:
|
|
1024
|
+
return {
|
|
1025
|
+
internalFormat: GLCompressedTextureInternalFormat.RGB_BPTC_UNSIGNED_FLOAT_EXT,
|
|
1026
|
+
isCompressed: true
|
|
1027
|
+
};
|
|
1021
1028
|
case engineCore.TextureFormat.ETC1_RGB:
|
|
1022
1029
|
return {
|
|
1023
1030
|
internalFormat: GLCompressedTextureInternalFormat.RGB_ETC1_WEBGL,
|
|
@@ -2117,6 +2124,12 @@ var GLBuffer = /*#__PURE__*/ function() {
|
|
|
2117
2124
|
var extension = this.requireExtension(engineCore.GLCapabilityType.WEBGL_lose_context);
|
|
2118
2125
|
extension.restoreContext();
|
|
2119
2126
|
};
|
|
2127
|
+
/**
|
|
2128
|
+
* @remarks
|
|
2129
|
+
* WebGL context loss and restore can happen at any GPU execution point. refs to: https://www.khronos.org/webgl/wiki/HandlingContextLost
|
|
2130
|
+
*/ _proto.isContextLost = function isContextLost() {
|
|
2131
|
+
return this.gl.isContextLost();
|
|
2132
|
+
};
|
|
2120
2133
|
_proto.resetState = function resetState() {
|
|
2121
2134
|
this._readFrameBuffer = null;
|
|
2122
2135
|
this._enableGlobalDepthBias = false;
|