@itwin/webgl-compatibility 4.0.0-dev.4 → 4.0.0-dev.7
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/lib/cjs/Capabilities.d.ts +0 -4
- package/lib/cjs/Capabilities.d.ts.map +1 -1
- package/lib/cjs/Capabilities.js +0 -21
- package/lib/cjs/Capabilities.js.map +1 -1
- package/lib/esm/Capabilities.d.ts +0 -4
- package/lib/esm/Capabilities.d.ts.map +1 -1
- package/lib/esm/Capabilities.js +0 -21
- package/lib/esm/Capabilities.js.map +1 -1
- package/package.json +5 -5
|
@@ -37,7 +37,6 @@ export declare class Capabilities {
|
|
|
37
37
|
private _maxVertUniformVectors;
|
|
38
38
|
private _maxVaryingVectors;
|
|
39
39
|
private _maxFragUniformVectors;
|
|
40
|
-
private _canRenderDepthWithoutColor;
|
|
41
40
|
private _maxAnisotropy?;
|
|
42
41
|
private _maxAntialiasSamples;
|
|
43
42
|
private _supportsCreateImageBitmap;
|
|
@@ -80,7 +79,6 @@ export declare class Capabilities {
|
|
|
80
79
|
get supportsStandardDerivatives(): boolean;
|
|
81
80
|
get supportsMRTTransparency(): boolean;
|
|
82
81
|
get supportsMRTPickShaders(): boolean;
|
|
83
|
-
get canRenderDepthWithoutColor(): boolean;
|
|
84
82
|
get supportsShadowMaps(): boolean;
|
|
85
83
|
get supportsAntiAliasing(): boolean;
|
|
86
84
|
get isMobile(): boolean;
|
|
@@ -101,8 +99,6 @@ export declare class Capabilities {
|
|
|
101
99
|
static create(gl: WebGLContext, disabledExtensions?: WebGLExtensionName[]): Capabilities | undefined;
|
|
102
100
|
/** Determines if a particular texture type is color-renderable on the host system. */
|
|
103
101
|
private isTextureRenderable;
|
|
104
|
-
/** Determines if depth textures can be rendered without also having a color attachment bound on the host system. */
|
|
105
|
-
private isDepthRenderableWithoutColor;
|
|
106
102
|
setMaxAnisotropy(desiredMax: number | undefined, gl: WebGLContext): void;
|
|
107
103
|
}
|
|
108
104
|
//# sourceMappingURL=Capabilities.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Capabilities.d.ts","sourceRoot":"","sources":["../../src/Capabilities.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EACL,kBAAkB,EAAE,YAAY,EAAE,YAAY,EAAE,4BAA4B,EAC7E,MAAM,uBAAuB,CAAC;AAE/B,gBAAgB;AAChB,oBAAY,kBAAkB,GAC5B,oBAAoB,GAAG,wBAAwB,GAAG,mBAAmB,GAAG,0BAA0B,GAClG,wBAAwB,GAAG,+BAA+B,GAAG,gCAAgC,GAAG,qBAAqB,GACrH,wBAAwB,GAAG,wBAAwB,GAAG,wBAAwB,GAAG,yBAAyB,GAAG,oBAAoB,GACjI,gBAAgB,GAAG,0BAA0B,GAAG,iCAAiC,GAAG,0BAA0B,GAAG,iBAAiB,CAAC;AAuBrI;;GAEG;AACH,oBAAY,UAAU;IACpB,mBAAmB,IAAA;IACnB,gBAAgB,IAAA;IAChB,YAAY,IAAA;CACb;AAED;;;;GAIG;AACH,oBAAY,SAAS;IACnB,2BAA2B,IAAA;IAG3B,4BAA4B,IAAA;IAC5B,oBAAoB,IAAA;CAGrB;AAoCD;;GAEG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,cAAc,CAA8C;IACpE,OAAO,CAAC,aAAa,CAAoD;IACzE,OAAO,CAAC,eAAe,CAAa;IACpC,OAAO,CAAC,oBAAoB,CAAa;IACzC,OAAO,CAAC,eAAe,CAAa;IACpC,OAAO,CAAC,oBAAoB,CAAa;IACzC,OAAO,CAAC,oBAAoB,CAAa;IACzC,OAAO,CAAC,eAAe,CAAa;IACpC,OAAO,CAAC,sBAAsB,CAAa;IAC3C,OAAO,CAAC,kBAAkB,CAAa;IACvC,OAAO,CAAC,sBAAsB,CAAa;IAC3C,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"Capabilities.d.ts","sourceRoot":"","sources":["../../src/Capabilities.ts"],"names":[],"mappings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5O,IAAW,2BAA2B,IAAI,OAAO,CAA4H;IAE7K,IAAW,uBAAuB,IAAI,OAAO,CAA0C;IACvF,IAAW,sBAAsB,IAAI,OAAO,CAA0C;IAEtF,IAAW,kBAAkB,IAAI,OAAO,CAEvC;IAED,IAAW,oBAAoB,IAAI,OAAO,CAA2D;IAErG,IAAW,QAAQ,IAAI,OAAO,CAA2B;IAEzD,OAAO,CAAC,aAAa;IAKrB,6IAA6I;IACtI,oBAAoB,CAAC,CAAC,EAAE,GAAG,EAAE,kBAAkB,GAAG,CAAC,GAAG,SAAS;IAItE,gBAAuB,gBAAgB,EAAE,YAAY,EAAE,CAUrD;IACF,gBAAuB,gBAAgB,EAAE,YAAY,EAAE,CAGrD;IAEF,OAAO,KAAK,wBAAwB,GAAsF;IAE1H,0GAA0G;IAC1G,OAAO,CAAC,oBAAoB;IAS5B,kFAAkF;IAClF,OAAO,CAAC,eAAe;IAkCvB,2EAA2E;IAC3E,OAAO,CAAC,uBAAuB;IAS/B,gFAAgF;IACzE,IAAI,CAAC,EAAE,EAAE,YAAY,EAAE,kBAAkB,CAAC,EAAE,kBAAkB,EAAE,GAAG,4BAA4B;WA+FxF,MAAM,CAAC,EAAE,EAAE,YAAY,EAAE,kBAAkB,CAAC,EAAE,kBAAkB,EAAE,GAAG,YAAY,GAAG,SAAS;IAQ3G,sFAAsF;IACtF,OAAO,CAAC,mBAAmB;IAyBpB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,EAAE,EAAE,EAAE,YAAY,GAAG,IAAI;CAWhF"}
|
package/lib/cjs/Capabilities.js
CHANGED
|
@@ -97,7 +97,6 @@ class Capabilities {
|
|
|
97
97
|
this._maxVertUniformVectors = 0;
|
|
98
98
|
this._maxVaryingVectors = 0;
|
|
99
99
|
this._maxFragUniformVectors = 0;
|
|
100
|
-
this._canRenderDepthWithoutColor = false;
|
|
101
100
|
this._maxAntialiasSamples = 1;
|
|
102
101
|
this._supportsCreateImageBitmap = false;
|
|
103
102
|
this._maxTexSizeAllow = maxTexSizeAllowed;
|
|
@@ -140,7 +139,6 @@ class Capabilities {
|
|
|
140
139
|
get supportsStandardDerivatives() { return this._isWebGL2 || this.queryExtensionObject("OES_standard_derivatives") !== undefined; }
|
|
141
140
|
get supportsMRTTransparency() { return this.maxColorAttachments >= 2; }
|
|
142
141
|
get supportsMRTPickShaders() { return this.maxColorAttachments >= 3; }
|
|
143
|
-
get canRenderDepthWithoutColor() { return this._canRenderDepthWithoutColor; }
|
|
144
142
|
get supportsShadowMaps() {
|
|
145
143
|
return this.supportsTextureFloat || this.supportsTextureHalfFloat;
|
|
146
144
|
}
|
|
@@ -271,7 +269,6 @@ class Capabilities {
|
|
|
271
269
|
// Determine the maximum depth attachment type.
|
|
272
270
|
// this._maxDepthType = this.queryExtensionObject("WEBGL_depth_texture") !== undefined ? DepthType.TextureUnsignedInt32 : DepthType.RenderBufferUnsignedShort16;
|
|
273
271
|
this._maxDepthType = this._isWebGL2 || this.queryExtensionObject("WEBGL_depth_texture") !== undefined ? DepthType.TextureUnsignedInt24Stencil8 : DepthType.RenderBufferUnsignedShort16;
|
|
274
|
-
this._canRenderDepthWithoutColor = this._maxDepthType === DepthType.TextureUnsignedInt24Stencil8 ? this.isDepthRenderableWithoutColor(gl) : false;
|
|
275
272
|
this._presentFeatures = this._gatherFeatures();
|
|
276
273
|
const missingRequiredFeatures = this._findMissingFeatures(Capabilities.requiredFeatures);
|
|
277
274
|
const missingOptionalFeatures = this._findMissingFeatures(Capabilities.optionalFeatures);
|
|
@@ -316,24 +313,6 @@ class Capabilities {
|
|
|
316
313
|
gl.getError(); // clear any errors
|
|
317
314
|
return fbStatus === gl.FRAMEBUFFER_COMPLETE;
|
|
318
315
|
}
|
|
319
|
-
/** Determines if depth textures can be rendered without also having a color attachment bound on the host system. */
|
|
320
|
-
isDepthRenderableWithoutColor(gl) {
|
|
321
|
-
const dtExt = this.queryExtensionObject("WEBGL_depth_texture");
|
|
322
|
-
if (dtExt === undefined)
|
|
323
|
-
return false;
|
|
324
|
-
const tex = gl.createTexture();
|
|
325
|
-
gl.bindTexture(gl.TEXTURE_2D, tex);
|
|
326
|
-
gl.texImage2D(gl.TEXTURE_2D, 0, gl.DEPTH_STENCIL, 1, 1, 0, gl.DEPTH_STENCIL, dtExt.UNSIGNED_INT_24_8_WEBGL, null);
|
|
327
|
-
const fb = gl.createFramebuffer();
|
|
328
|
-
gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
|
|
329
|
-
gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.TEXTURE_2D, tex, 0);
|
|
330
|
-
const fbStatus = gl.checkFramebufferStatus(gl.FRAMEBUFFER);
|
|
331
|
-
gl.bindFramebuffer(gl.FRAMEBUFFER, null);
|
|
332
|
-
gl.deleteFramebuffer(fb);
|
|
333
|
-
gl.deleteTexture(tex);
|
|
334
|
-
gl.getError(); // clear any errors
|
|
335
|
-
return fbStatus === gl.FRAMEBUFFER_COMPLETE;
|
|
336
|
-
}
|
|
337
316
|
setMaxAnisotropy(desiredMax, gl) {
|
|
338
317
|
const ext = this.queryExtensionObject("EXT_texture_filter_anisotropic");
|
|
339
318
|
if (undefined === ext)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Capabilities.js","sourceRoot":"","sources":["../../src/Capabilities.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAsD;AACtD,+DAE+B;AAS/B,MAAM,eAAe,GAAyB;IAC5C,oBAAoB;IACpB,wBAAwB;IACxB,mBAAmB;IACnB,0BAA0B;IAC1B,wBAAwB;IACxB,+BAA+B;IAC/B,gCAAgC;IAChC,qBAAqB;IACrB,wBAAwB;IACxB,wBAAwB;IACxB,gBAAgB;IAChB,wBAAwB;IACxB,yBAAyB;IACzB,oBAAoB;IACpB,0BAA0B;IAC1B,iCAAiC;IACjC,0BAA0B;IAC1B,iBAAiB;CAClB,CAAC;AAEF;;GAE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AC,UAA8B,EAAE,EAAgB;QACtE,MAAM,GAAG,GAAG,IAAI,CAAC,oBAAoB,CAAiC,gCAAgC,CAAC,CAAC;QACxG,IAAI,SAAS,KAAK,GAAG;YACnB,OAAO;QAET,IAAI,SAAS,KAAK,IAAI,CAAC,cAAc;YACnC,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,8BAA8B,CAAW,CAAC;QAEtF,MAAM,GAAG,GAAG,CAAC,SAAS,KAAK,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC;QACzG,EAAE,CAAC,aAAa,CAAC,EAAE,CAAC,UAAU,EAAE,GAAG,CAAC,0BAA0B,EAAE,GAAG,CAAC,CAAC;IACvE,CAAC;;AAhUH,oCAiUC;AAhPwB,6BAAgB,GAAmB;IACxD,kCAAY,CAAC,eAAe;IAC5B,kCAAY,CAAC,OAAO;IACpB,kCAAY,CAAC,YAAY;IACzB,kCAAY,CAAC,cAAc;IAC3B,kCAAY,CAAC,UAAU;IACvB,kCAAY,CAAC,UAAU;IACvB,kCAAY,CAAC,SAAS;IACtB,kCAAY,CAAC,mBAAmB;IAChC,kCAAY,CAAC,YAAY;CAC1B,CAAC;AACqB,6BAAgB,GAAmB;IACxD,kCAAY,CAAC,gBAAgB;IAC7B,kCAAY,CAAC,mBAAmB;CACjC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Compatibility\r\n */\r\n\r\nimport { ProcessDetector } from \"@itwin/core-bentley\";\r\nimport {\r\n GraphicsDriverBugs, WebGLContext, WebGLFeature, WebGLRenderCompatibilityInfo, WebGLRenderCompatibilityStatus,\r\n} from \"./RenderCompatibility\";\r\n\r\n/** @internal */\r\nexport type WebGLExtensionName =\r\n \"WEBGL_draw_buffers\" | \"OES_element_index_uint\" | \"OES_texture_float\" | \"OES_texture_float_linear\" |\r\n \"OES_texture_half_float\" | \"OES_texture_half_float_linear\" | \"EXT_texture_filter_anisotropic\" | \"WEBGL_depth_texture\" |\r\n \"EXT_color_buffer_float\" | \"EXT_shader_texture_lod\" | \"ANGLE_instanced_arrays\" | \"OES_vertex_array_object\" | \"WEBGL_lose_context\" |\r\n \"EXT_frag_depth\" | \"EXT_disjoint_timer_query\" | \"EXT_disjoint_timer_query_webgl2\" | \"OES_standard_derivatives\" | \"EXT_float_blend\";\r\n\r\nconst knownExtensions: WebGLExtensionName[] = [\r\n \"WEBGL_draw_buffers\",\r\n \"OES_element_index_uint\",\r\n \"OES_texture_float\",\r\n \"OES_texture_float_linear\",\r\n \"OES_texture_half_float\",\r\n \"OES_texture_half_float_linear\",\r\n \"EXT_texture_filter_anisotropic\",\r\n \"WEBGL_depth_texture\",\r\n \"EXT_color_buffer_float\",\r\n \"EXT_shader_texture_lod\",\r\n \"EXT_frag_depth\",\r\n \"ANGLE_instanced_arrays\",\r\n \"OES_vertex_array_object\",\r\n \"WEBGL_lose_context\",\r\n \"EXT_disjoint_timer_query\",\r\n \"EXT_disjoint_timer_query_webgl2\",\r\n \"OES_standard_derivatives\",\r\n \"EXT_float_blend\",\r\n];\r\n\r\n/** Describes the type of a render target. Used by Capabilities to represent maximum precision render target available on host system.\r\n * @internal\r\n */\r\nexport enum RenderType {\r\n TextureUnsignedByte,\r\n TextureHalfFloat,\r\n TextureFloat,\r\n}\r\n\r\n/**\r\n * Describes the type of a depth buffer. Used by Capabilities to represent maximum depth buffer precision available on host system.\r\n * Note: the commented-out values are unimplemented but left in place for reference, in case desired for future implementation.\r\n * @internal\r\n */\r\nexport enum DepthType {\r\n RenderBufferUnsignedShort16, // core to WebGL1\r\n // TextureUnsignedShort16, // core to WebGL2; available to WebGL1 via WEBGL_depth_texture\r\n // TextureUnsignedInt24, // core to WebGL2\r\n TextureUnsignedInt24Stencil8, // core to WebGL2; available to WebGL1 via WEBGL_depth_texture\r\n TextureUnsignedInt32, // core to WebGL2; available to WebGL1 via WEBGL_depth_texture\r\n // TextureFloat32, // core to WebGL2\r\n // TextureFloat32Stencil8, // core to WeBGL2\r\n}\r\n\r\nconst maxTexSizeAllowed = 4096; // many devices and browsers have issues with source textures larger than this\r\n\r\n// Regexes to match Intel UHD/HD 620/630 integrated GPUS that suffer from GraphicsDriverBugs.fragDepthDoesNotDisableEarlyZ.\r\nconst buggyIntelMatchers = [\r\n // Original unmasked renderer string when workaround we implemented.\r\n /ANGLE \\(Intel\\(R\\) (U)?HD Graphics 6(2|3)0 Direct3D11/,\r\n // New unmasked renderer string circa October 2021.\r\n /ANGLE \\(Intel, Intel\\(R\\) (U)?HD Graphics 6(2|3)0 Direct3D11/,\r\n];\r\n\r\n// Regexes to match Mali GPUs known to suffer from GraphicsDriverBugs.msaaWillHang.\r\nconst buggyMaliMatchers = [\r\n /Mali-G71/,\r\n /Mali-G72/,\r\n /Mali-G76/,\r\n];\r\n\r\n// Regexes to match as many Intel integrated GPUs as possible.\r\n// https://en.wikipedia.org/wiki/List_of_Intel_graphics_processing_units\r\nconst integratedIntelGpuMatchers = [\r\n /(U)?HD Graphics/,\r\n /Iris/,\r\n];\r\n\r\nfunction isIntegratedGraphics(args: {unmaskedVendor?: string, unmaskedRenderer?: string}): boolean {\r\n if (args.unmaskedRenderer && args.unmaskedRenderer.includes(\"Intel\") && integratedIntelGpuMatchers.some((x) => x.test(args.unmaskedRenderer!)))\r\n return true;\r\n\r\n // NB: For now, we do not attempt to detect AMD integrated graphics.\r\n // It appears that AMD integrated graphics are not usually paired with a graphics card so detecting integrated usage there is less important than Intel.\r\n\r\n return false;\r\n}\r\n\r\n/** Describes the rendering capabilities of the host system.\r\n * @internal\r\n */\r\nexport class Capabilities {\r\n private _maxRenderType: RenderType = RenderType.TextureUnsignedByte;\r\n private _maxDepthType: DepthType = DepthType.RenderBufferUnsignedShort16;\r\n private _maxTextureSize: number = 0;\r\n private _maxColorAttachments: number = 0;\r\n private _maxDrawBuffers: number = 0;\r\n private _maxFragTextureUnits: number = 0;\r\n private _maxVertTextureUnits: number = 0;\r\n private _maxVertAttribs: number = 0;\r\n private _maxVertUniformVectors: number = 0;\r\n private _maxVaryingVectors: number = 0;\r\n private _maxFragUniformVectors: number = 0;\r\n private _canRenderDepthWithoutColor: boolean = false;\r\n private _maxAnisotropy?: number;\r\n private _maxAntialiasSamples: number = 1;\r\n private _supportsCreateImageBitmap: boolean = false;\r\n private _maxTexSizeAllow: number = maxTexSizeAllowed;\r\n\r\n private _extensionMap: { [key: string]: any } = {}; // Use this map to store actual extension objects retrieved from GL.\r\n private _presentFeatures: WebGLFeature[] = []; // List of features the system can support (not necessarily dependent on extensions)\r\n\r\n private _isWebGL2: boolean = false;\r\n private _isMobile: boolean = false;\r\n private _driverBugs: GraphicsDriverBugs = {};\r\n\r\n public get maxRenderType(): RenderType { return this._maxRenderType; }\r\n public get maxDepthType(): DepthType { return this._maxDepthType; }\r\n public get maxTextureSize(): number { return this._maxTextureSize; }\r\n public get maxTexSizeAllow(): number { return this._maxTexSizeAllow; }\r\n public get supportsCreateImageBitmap(): boolean { return this._supportsCreateImageBitmap; }\r\n public get maxColorAttachments(): number { return this._maxColorAttachments; }\r\n public get maxDrawBuffers(): number { return this._maxDrawBuffers; }\r\n public get maxFragTextureUnits(): number { return this._maxFragTextureUnits; }\r\n public get maxVertTextureUnits(): number { return this._maxVertTextureUnits; }\r\n public get maxVertAttribs(): number { return this._maxVertAttribs; }\r\n public get maxVertUniformVectors(): number { return this._maxVertUniformVectors; }\r\n public get maxVaryingVectors(): number { return this._maxVaryingVectors; }\r\n public get maxFragUniformVectors(): number { return this._maxFragUniformVectors; }\r\n public get maxAntialiasSamples(): number { return this._maxAntialiasSamples; }\r\n public get isWebGL2(): boolean { return this._isWebGL2; }\r\n public get driverBugs(): GraphicsDriverBugs { return this._driverBugs; }\r\n\r\n /** These getters check for existence of extension objects to determine availability of features. In WebGL2, could just return true for some. */\r\n public get supportsNonPowerOf2Textures(): boolean { return false; }\r\n public get supportsDrawBuffers(): boolean { return this._isWebGL2 || this.queryExtensionObject<WEBGL_draw_buffers>(\"WEBGL_draw_buffers\") !== undefined; }\r\n public get supportsInstancing(): boolean { return this._isWebGL2 || this.queryExtensionObject<ANGLE_instanced_arrays>(\"ANGLE_instanced_arrays\") !== undefined; }\r\n public get supports32BitElementIndex(): boolean { return this._isWebGL2 || this.queryExtensionObject<OES_element_index_uint>(\"OES_element_index_uint\") !== undefined; }\r\n public get supportsTextureFloat(): boolean { return this._isWebGL2 || this.queryExtensionObject<OES_texture_float>(\"OES_texture_float\") !== undefined; }\r\n public get supportsTextureFloatLinear(): boolean { return this._isWebGL2 || this.queryExtensionObject<OES_texture_float_linear>(\"OES_texture_float_linear\") !== undefined; }\r\n public get supportsTextureHalfFloat(): boolean { return this._isWebGL2 || this.queryExtensionObject<OES_texture_half_float>(\"OES_texture_half_float\") !== undefined; }\r\n public get supportsTextureHalfFloatLinear(): boolean { return this._isWebGL2 || this.queryExtensionObject<OES_texture_half_float_linear>(\"OES_texture_half_float_linear\") !== undefined; }\r\n public get supportsTextureFilterAnisotropic(): boolean { return this.queryExtensionObject<EXT_texture_filter_anisotropic>(\"EXT_texture_filter_anisotropic\") !== undefined; }\r\n public get supportsShaderTextureLOD(): boolean { return this._isWebGL2 || this.queryExtensionObject<EXT_shader_texture_lod>(\"EXT_shader_texture_lod\") !== undefined; }\r\n public get supportsVertexArrayObjects(): boolean { return this._isWebGL2 || this.queryExtensionObject<OES_vertex_array_object>(\"OES_vertex_array_object\") !== undefined; }\r\n public get supportsFragDepth(): boolean { return this._isWebGL2 || this.queryExtensionObject<EXT_frag_depth>(\"EXT_frag_depth\") !== undefined; }\r\n public get supportsDisjointTimerQuery(): boolean { return (this._isWebGL2 && this.queryExtensionObject<any>(\"EXT_disjoint_timer_query_webgl2\") !== undefined) || this.queryExtensionObject<any>(\"EXT_disjoint_timer_query\") !== undefined; }\r\n public get supportsStandardDerivatives(): boolean { return this._isWebGL2 || this.queryExtensionObject<OES_standard_derivatives>(\"OES_standard_derivatives\") !== undefined; }\r\n\r\n public get supportsMRTTransparency(): boolean { return this.maxColorAttachments >= 2; }\r\n public get supportsMRTPickShaders(): boolean { return this.maxColorAttachments >= 3; }\r\n\r\n public get canRenderDepthWithoutColor(): boolean { return this._canRenderDepthWithoutColor; }\r\n\r\n public get supportsShadowMaps(): boolean {\r\n return this.supportsTextureFloat || this.supportsTextureHalfFloat;\r\n }\r\n\r\n public get supportsAntiAliasing(): boolean { return this._isWebGL2 && this.maxAntialiasSamples > 1; }\r\n\r\n public get isMobile(): boolean { return this._isMobile; }\r\n\r\n private findExtension(name: WebGLExtensionName): any {\r\n const ext = this._extensionMap[name];\r\n return null !== ext ? ext : undefined;\r\n }\r\n\r\n /** Queries an extension object if available. This is necessary for other parts of the system to access some constants within extensions. */\r\n public queryExtensionObject<T>(ext: WebGLExtensionName): T | undefined {\r\n return this.findExtension(ext) as T;\r\n }\r\n\r\n public static readonly optionalFeatures: WebGLFeature[] = [\r\n WebGLFeature.MrtTransparency,\r\n WebGLFeature.MrtPick,\r\n WebGLFeature.DepthTexture,\r\n WebGLFeature.FloatRendering,\r\n WebGLFeature.Instancing,\r\n WebGLFeature.ShadowMaps,\r\n WebGLFeature.FragDepth,\r\n WebGLFeature.StandardDerivatives,\r\n WebGLFeature.AntiAliasing,\r\n ];\r\n public static readonly requiredFeatures: WebGLFeature[] = [\r\n WebGLFeature.UintElementIndex,\r\n WebGLFeature.MinimalTextureUnits,\r\n ];\r\n\r\n private get _hasRequiredTextureUnits(): boolean { return this.maxFragTextureUnits >= 4 && this.maxVertTextureUnits >= 5; }\r\n\r\n /** Return an array containing any features not supported by the system as compared to the input array. */\r\n private _findMissingFeatures(featuresToSeek: WebGLFeature[]): WebGLFeature[] {\r\n const missingFeatures: WebGLFeature[] = [];\r\n for (const featureName of featuresToSeek) {\r\n if (-1 === this._presentFeatures.indexOf(featureName))\r\n missingFeatures.push(featureName);\r\n }\r\n return missingFeatures;\r\n }\r\n\r\n /** Populate and return an array containing features that this system supports. */\r\n private _gatherFeatures(): WebGLFeature[] {\r\n const features: WebGLFeature[] = [];\r\n\r\n // simply check for presence of various extensions if that gives enough information\r\n if (this._isWebGL2 || this._extensionMap[\"OES_element_index_uint\" as WebGLExtensionName] !== undefined)\r\n features.push(WebGLFeature.UintElementIndex);\r\n if (this._isWebGL2 || this._extensionMap[\"ANGLE_instanced_arrays\" as WebGLExtensionName] !== undefined)\r\n features.push(WebGLFeature.Instancing);\r\n\r\n if (this.supportsMRTTransparency)\r\n features.push(WebGLFeature.MrtTransparency);\r\n if (this.supportsMRTPickShaders)\r\n features.push(WebGLFeature.MrtPick);\r\n if (this.supportsShadowMaps)\r\n features.push(WebGLFeature.ShadowMaps);\r\n if (this._hasRequiredTextureUnits)\r\n features.push(WebGLFeature.MinimalTextureUnits);\r\n if (this.supportsFragDepth)\r\n features.push(WebGLFeature.FragDepth);\r\n if (this.supportsStandardDerivatives)\r\n features.push(WebGLFeature.StandardDerivatives);\r\n if (this.supportsAntiAliasing)\r\n features.push(WebGLFeature.AntiAliasing);\r\n\r\n if (DepthType.TextureUnsignedInt24Stencil8 === this._maxDepthType)\r\n features.push(WebGLFeature.DepthTexture);\r\n\r\n // check if at least half-float rendering is available based on maximum discovered renderable target\r\n if (RenderType.TextureUnsignedByte !== this._maxRenderType)\r\n features.push(WebGLFeature.FloatRendering);\r\n\r\n return features;\r\n }\r\n\r\n /** Retrieve compatibility status based on presence of various features. */\r\n private _getCompatibilityStatus(missingRequiredFeatures: WebGLFeature[], missingOptionalFeatures: WebGLFeature[]): WebGLRenderCompatibilityStatus {\r\n let status: WebGLRenderCompatibilityStatus = WebGLRenderCompatibilityStatus.AllOkay;\r\n if (missingOptionalFeatures.length > 0)\r\n status = WebGLRenderCompatibilityStatus.MissingOptionalFeatures;\r\n if (missingRequiredFeatures.length > 0)\r\n status = WebGLRenderCompatibilityStatus.MissingRequiredFeatures;\r\n return status;\r\n }\r\n\r\n /** Initializes the capabilities based on a GL context. Must be called first. */\r\n public init(gl: WebGLContext, disabledExtensions?: WebGLExtensionName[]): WebGLRenderCompatibilityInfo {\r\n const gl2 = !(gl instanceof WebGLRenderingContext) ? gl : undefined;\r\n this._isWebGL2 = undefined !== gl2;\r\n\r\n this._isMobile = ProcessDetector.isMobileBrowser;\r\n\r\n const debugInfo = gl.getExtension(\"WEBGL_debug_renderer_info\");\r\n const unmaskedRenderer = debugInfo !== null ? gl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL) : undefined;\r\n const unmaskedVendor = debugInfo !== null ? gl.getParameter(debugInfo.UNMASKED_VENDOR_WEBGL) : undefined;\r\n\r\n this._driverBugs = {};\r\n if (unmaskedRenderer && buggyIntelMatchers.some((x) => x.test(unmaskedRenderer)))\r\n this._driverBugs.fragDepthDoesNotDisableEarlyZ = true;\r\n\r\n if (unmaskedRenderer && buggyMaliMatchers.some((x) => x.test(unmaskedRenderer)))\r\n this._driverBugs.msaaWillHang = true;\r\n\r\n this._maxTextureSize = gl.getParameter(gl.MAX_TEXTURE_SIZE);\r\n this._supportsCreateImageBitmap = typeof createImageBitmap === \"function\" && ProcessDetector.isChromium && !ProcessDetector.isIOSBrowser;\r\n this._maxTexSizeAllow = Math.min(this._maxTextureSize, maxTexSizeAllowed);\r\n this._maxFragTextureUnits = gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS);\r\n this._maxVertTextureUnits = gl.getParameter(gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS);\r\n this._maxVertAttribs = gl.getParameter(gl.MAX_VERTEX_ATTRIBS);\r\n this._maxVertUniformVectors = gl.getParameter(gl.MAX_VERTEX_UNIFORM_VECTORS);\r\n this._maxVaryingVectors = gl.getParameter(gl.MAX_VARYING_VECTORS);\r\n this._maxFragUniformVectors = gl.getParameter(gl.MAX_FRAGMENT_UNIFORM_VECTORS);\r\n this._maxAntialiasSamples = this._driverBugs.msaaWillHang ? 1 : (this._isWebGL2 && undefined !== gl2 ? gl.getParameter(gl2.MAX_SAMPLES) : 1);\r\n\r\n const extensions = gl.getSupportedExtensions(); // This just retrieves a list of available extensions (not necessarily enabled).\r\n if (extensions) {\r\n for (const extStr of extensions) {\r\n const ext = extStr as WebGLExtensionName;\r\n if (-1 === knownExtensions.indexOf(ext))\r\n continue;\r\n else if (undefined !== disabledExtensions && -1 !== disabledExtensions.indexOf(ext))\r\n continue;\r\n\r\n const extObj: any = gl.getExtension(ext); // This call enables the extension and returns a WebGLObject containing extension instance.\r\n if (null !== extObj)\r\n this._extensionMap[ext] = extObj;\r\n }\r\n }\r\n\r\n if (this._isWebGL2 && undefined !== gl2) {\r\n this._maxColorAttachments = gl.getParameter(gl2.MAX_COLOR_ATTACHMENTS);\r\n this._maxDrawBuffers = gl.getParameter(gl2.MAX_DRAW_BUFFERS);\r\n } else {\r\n const dbExt: WEBGL_draw_buffers | undefined = this.queryExtensionObject<WEBGL_draw_buffers>(\"WEBGL_draw_buffers\");\r\n this._maxColorAttachments = dbExt !== undefined ? gl.getParameter(dbExt.MAX_COLOR_ATTACHMENTS_WEBGL) : 1;\r\n this._maxDrawBuffers = dbExt !== undefined ? gl.getParameter(dbExt.MAX_DRAW_BUFFERS_WEBGL) : 1;\r\n }\r\n\r\n // Determine the maximum color-renderable attachment type.\r\n const allowFloatRender =\r\n (undefined === disabledExtensions || -1 === disabledExtensions.indexOf(\"OES_texture_float\"))\r\n // iOS>=15 allows full-float rendering. However, it does not actually work on non-M1 devices.\r\n // Because of this, for now we disallow full float rendering on iOS devices.\r\n // ###TODO: Re-assess this after future iOS updates.\r\n && !ProcessDetector.isIOSBrowser\r\n // Samsung Galaxy Note 8 exhibits same issue as described above for iOS >= 15.\r\n // It uses specifically Mali-G71 MP20 but reports its renderer as follows.\r\n // Samsung Galaxy A50 and S9 exhibits same issue; they use Mali-G72.\r\n // HUAWEI P30 exhibits same issue; it uses Mali-G76.\r\n && unmaskedRenderer !== \"Mali-G71\" && unmaskedRenderer !== \"Mali-G72\" && unmaskedRenderer !== \"Mali-G76\";\r\n\r\n if (allowFloatRender && undefined !== this.queryExtensionObject(\"EXT_float_blend\") && this.isTextureRenderable(gl, gl.FLOAT)) {\r\n this._maxRenderType = RenderType.TextureFloat;\r\n } else if (this.isWebGL2) {\r\n this._maxRenderType = (this.isTextureRenderable(gl, (gl as WebGL2RenderingContext).HALF_FLOAT)) ? RenderType.TextureHalfFloat : RenderType.TextureUnsignedByte;\r\n } else {\r\n const hfExt: OES_texture_half_float | undefined = this.queryExtensionObject<OES_texture_half_float>(\"OES_texture_half_float\");\r\n this._maxRenderType = (hfExt !== undefined && this.isTextureRenderable(gl, hfExt.HALF_FLOAT_OES)) ? RenderType.TextureHalfFloat : RenderType.TextureUnsignedByte;\r\n }\r\n\r\n // Determine the maximum depth attachment type.\r\n // this._maxDepthType = this.queryExtensionObject(\"WEBGL_depth_texture\") !== undefined ? DepthType.TextureUnsignedInt32 : DepthType.RenderBufferUnsignedShort16;\r\n this._maxDepthType = this._isWebGL2 || this.queryExtensionObject(\"WEBGL_depth_texture\") !== undefined ? DepthType.TextureUnsignedInt24Stencil8 : DepthType.RenderBufferUnsignedShort16;\r\n\r\n this._canRenderDepthWithoutColor = this._maxDepthType === DepthType.TextureUnsignedInt24Stencil8 ? this.isDepthRenderableWithoutColor(gl) : false;\r\n\r\n this._presentFeatures = this._gatherFeatures();\r\n const missingRequiredFeatures = this._findMissingFeatures(Capabilities.requiredFeatures);\r\n const missingOptionalFeatures = this._findMissingFeatures(Capabilities.optionalFeatures);\r\n\r\n return {\r\n status: this._getCompatibilityStatus(missingRequiredFeatures, missingOptionalFeatures),\r\n missingRequiredFeatures,\r\n missingOptionalFeatures,\r\n unmaskedRenderer,\r\n unmaskedVendor,\r\n usingIntegratedGraphics: isIntegratedGraphics({unmaskedVendor, unmaskedRenderer}),\r\n driverBugs: { ...this._driverBugs },\r\n userAgent: navigator.userAgent,\r\n createdContext: gl,\r\n };\r\n }\r\n\r\n public static create(gl: WebGLContext, disabledExtensions?: WebGLExtensionName[]): Capabilities | undefined {\r\n const caps = new Capabilities();\r\n const compatibility = caps.init(gl, disabledExtensions);\r\n if (WebGLRenderCompatibilityStatus.CannotCreateContext === compatibility.status || WebGLRenderCompatibilityStatus.MissingRequiredFeatures === compatibility.status)\r\n return undefined;\r\n return caps;\r\n }\r\n\r\n /** Determines if a particular texture type is color-renderable on the host system. */\r\n private isTextureRenderable(gl: WebGLContext, texType: number): boolean {\r\n const tex: WebGLTexture | null = gl.createTexture();\r\n gl.bindTexture(gl.TEXTURE_2D, tex);\r\n if (this.isWebGL2) {\r\n if (gl.FLOAT === texType)\r\n gl.texImage2D(gl.TEXTURE_2D, 0, (gl as WebGL2RenderingContext).RGBA32F, 1, 1, 0, gl.RGBA, texType, null);\r\n else\r\n gl.texImage2D(gl.TEXTURE_2D, 0, (gl as WebGL2RenderingContext).RGBA16F, 1, 1, 0, gl.RGBA, texType, null);\r\n } else\r\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, texType, null);\r\n\r\n const fb: WebGLFramebuffer | null = gl.createFramebuffer();\r\n gl.bindFramebuffer(gl.FRAMEBUFFER, fb);\r\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0);\r\n\r\n const fbStatus: number = gl.checkFramebufferStatus(gl.FRAMEBUFFER);\r\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\r\n gl.deleteFramebuffer(fb);\r\n gl.deleteTexture(tex);\r\n\r\n gl.getError(); // clear any errors\r\n\r\n return fbStatus === gl.FRAMEBUFFER_COMPLETE;\r\n }\r\n\r\n /** Determines if depth textures can be rendered without also having a color attachment bound on the host system. */\r\n private isDepthRenderableWithoutColor(gl: WebGLContext): boolean {\r\n const dtExt = this.queryExtensionObject<WEBGL_depth_texture>(\"WEBGL_depth_texture\");\r\n if (dtExt === undefined)\r\n return false;\r\n\r\n const tex: WebGLTexture | null = gl.createTexture();\r\n gl.bindTexture(gl.TEXTURE_2D, tex);\r\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.DEPTH_STENCIL, 1, 1, 0, gl.DEPTH_STENCIL, dtExt.UNSIGNED_INT_24_8_WEBGL, null);\r\n\r\n const fb: WebGLFramebuffer | null = gl.createFramebuffer();\r\n gl.bindFramebuffer(gl.FRAMEBUFFER, fb);\r\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.TEXTURE_2D, tex, 0);\r\n\r\n const fbStatus: number = gl.checkFramebufferStatus(gl.FRAMEBUFFER);\r\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\r\n gl.deleteFramebuffer(fb);\r\n gl.deleteTexture(tex);\r\n\r\n gl.getError(); // clear any errors\r\n\r\n return fbStatus === gl.FRAMEBUFFER_COMPLETE;\r\n }\r\n\r\n public setMaxAnisotropy(desiredMax: number | undefined, gl: WebGLContext): void {\r\n const ext = this.queryExtensionObject<EXT_texture_filter_anisotropic>(\"EXT_texture_filter_anisotropic\");\r\n if (undefined === ext)\r\n return;\r\n\r\n if (undefined === this._maxAnisotropy)\r\n this._maxAnisotropy = gl.getParameter(ext.MAX_TEXTURE_MAX_ANISOTROPY_EXT) as number;\r\n\r\n const max = (undefined !== desiredMax) ? Math.min(desiredMax, this._maxAnisotropy) : this._maxAnisotropy;\r\n gl.texParameterf(gl.TEXTURE_2D, ext.TEXTURE_MAX_ANISOTROPY_EXT, max);\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"Capabilities.js","sourceRoot":"","sources":["../../src/Capabilities.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAsD;AACtD,+DAE+B;AAS/B,MAAM,eAAe,GAAyB;IAC5C,oBAAoB;IACpB,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AC,CAAC,mBAAmB;QAElC,OAAO,QAAQ,KAAK,EAAE,CAAC,oBAAoB,CAAC;IAC9C,CAAC;IAEM,gBAAgB,CAAC,UAA8B,EAAE,EAAgB;QACtE,MAAM,GAAG,GAAG,IAAI,CAAC,oBAAoB,CAAiC,gCAAgC,CAAC,CAAC;QACxG,IAAI,SAAS,KAAK,GAAG;YACnB,OAAO;QAET,IAAI,SAAS,KAAK,IAAI,CAAC,cAAc;YACnC,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,8BAA8B,CAAW,CAAC;QAEtF,MAAM,GAAG,GAAG,CAAC,SAAS,KAAK,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC;QACzG,EAAE,CAAC,aAAa,CAAC,EAAE,CAAC,UAAU,EAAE,GAAG,CAAC,0BAA0B,EAAE,GAAG,CAAC,CAAC;IACvE,CAAC;;AAnSH,oCAoSC;AAtNwB,6BAAgB,GAAmB;IACxD,kCAAY,CAAC,eAAe;IAC5B,kCAAY,CAAC,OAAO;IACpB,kCAAY,CAAC,YAAY;IACzB,kCAAY,CAAC,cAAc;IAC3B,kCAAY,CAAC,UAAU;IACvB,kCAAY,CAAC,UAAU;IACvB,kCAAY,CAAC,SAAS;IACtB,kCAAY,CAAC,mBAAmB;IAChC,kCAAY,CAAC,YAAY;CAC1B,CAAC;AACqB,6BAAgB,GAAmB;IACxD,kCAAY,CAAC,gBAAgB;IAC7B,kCAAY,CAAC,mBAAmB;CACjC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Compatibility\r\n */\r\n\r\nimport { ProcessDetector } from \"@itwin/core-bentley\";\r\nimport {\r\n GraphicsDriverBugs, WebGLContext, WebGLFeature, WebGLRenderCompatibilityInfo, WebGLRenderCompatibilityStatus,\r\n} from \"./RenderCompatibility\";\r\n\r\n/** @internal */\r\nexport type WebGLExtensionName =\r\n \"WEBGL_draw_buffers\" | \"OES_element_index_uint\" | \"OES_texture_float\" | \"OES_texture_float_linear\" |\r\n \"OES_texture_half_float\" | \"OES_texture_half_float_linear\" | \"EXT_texture_filter_anisotropic\" | \"WEBGL_depth_texture\" |\r\n \"EXT_color_buffer_float\" | \"EXT_shader_texture_lod\" | \"ANGLE_instanced_arrays\" | \"OES_vertex_array_object\" | \"WEBGL_lose_context\" |\r\n \"EXT_frag_depth\" | \"EXT_disjoint_timer_query\" | \"EXT_disjoint_timer_query_webgl2\" | \"OES_standard_derivatives\" | \"EXT_float_blend\";\r\n\r\nconst knownExtensions: WebGLExtensionName[] = [\r\n \"WEBGL_draw_buffers\",\r\n \"OES_element_index_uint\",\r\n \"OES_texture_float\",\r\n \"OES_texture_float_linear\",\r\n \"OES_texture_half_float\",\r\n \"OES_texture_half_float_linear\",\r\n \"EXT_texture_filter_anisotropic\",\r\n \"WEBGL_depth_texture\",\r\n \"EXT_color_buffer_float\",\r\n \"EXT_shader_texture_lod\",\r\n \"EXT_frag_depth\",\r\n \"ANGLE_instanced_arrays\",\r\n \"OES_vertex_array_object\",\r\n \"WEBGL_lose_context\",\r\n \"EXT_disjoint_timer_query\",\r\n \"EXT_disjoint_timer_query_webgl2\",\r\n \"OES_standard_derivatives\",\r\n \"EXT_float_blend\",\r\n];\r\n\r\n/** Describes the type of a render target. Used by Capabilities to represent maximum precision render target available on host system.\r\n * @internal\r\n */\r\nexport enum RenderType {\r\n TextureUnsignedByte,\r\n TextureHalfFloat,\r\n TextureFloat,\r\n}\r\n\r\n/**\r\n * Describes the type of a depth buffer. Used by Capabilities to represent maximum depth buffer precision available on host system.\r\n * Note: the commented-out values are unimplemented but left in place for reference, in case desired for future implementation.\r\n * @internal\r\n */\r\nexport enum DepthType {\r\n RenderBufferUnsignedShort16, // core to WebGL1\r\n // TextureUnsignedShort16, // core to WebGL2; available to WebGL1 via WEBGL_depth_texture\r\n // TextureUnsignedInt24, // core to WebGL2\r\n TextureUnsignedInt24Stencil8, // core to WebGL2; available to WebGL1 via WEBGL_depth_texture\r\n TextureUnsignedInt32, // core to WebGL2; available to WebGL1 via WEBGL_depth_texture\r\n // TextureFloat32, // core to WebGL2\r\n // TextureFloat32Stencil8, // core to WeBGL2\r\n}\r\n\r\nconst maxTexSizeAllowed = 4096; // many devices and browsers have issues with source textures larger than this\r\n\r\n// Regexes to match Intel UHD/HD 620/630 integrated GPUS that suffer from GraphicsDriverBugs.fragDepthDoesNotDisableEarlyZ.\r\nconst buggyIntelMatchers = [\r\n // Original unmasked renderer string when workaround we implemented.\r\n /ANGLE \\(Intel\\(R\\) (U)?HD Graphics 6(2|3)0 Direct3D11/,\r\n // New unmasked renderer string circa October 2021.\r\n /ANGLE \\(Intel, Intel\\(R\\) (U)?HD Graphics 6(2|3)0 Direct3D11/,\r\n];\r\n\r\n// Regexes to match Mali GPUs known to suffer from GraphicsDriverBugs.msaaWillHang.\r\nconst buggyMaliMatchers = [\r\n /Mali-G71/,\r\n /Mali-G72/,\r\n /Mali-G76/,\r\n];\r\n\r\n// Regexes to match as many Intel integrated GPUs as possible.\r\n// https://en.wikipedia.org/wiki/List_of_Intel_graphics_processing_units\r\nconst integratedIntelGpuMatchers = [\r\n /(U)?HD Graphics/,\r\n /Iris/,\r\n];\r\n\r\nfunction isIntegratedGraphics(args: {unmaskedVendor?: string, unmaskedRenderer?: string}): boolean {\r\n if (args.unmaskedRenderer && args.unmaskedRenderer.includes(\"Intel\") && integratedIntelGpuMatchers.some((x) => x.test(args.unmaskedRenderer!)))\r\n return true;\r\n\r\n // NB: For now, we do not attempt to detect AMD integrated graphics.\r\n // It appears that AMD integrated graphics are not usually paired with a graphics card so detecting integrated usage there is less important than Intel.\r\n\r\n return false;\r\n}\r\n\r\n/** Describes the rendering capabilities of the host system.\r\n * @internal\r\n */\r\nexport class Capabilities {\r\n private _maxRenderType: RenderType = RenderType.TextureUnsignedByte;\r\n private _maxDepthType: DepthType = DepthType.RenderBufferUnsignedShort16;\r\n private _maxTextureSize: number = 0;\r\n private _maxColorAttachments: number = 0;\r\n private _maxDrawBuffers: number = 0;\r\n private _maxFragTextureUnits: number = 0;\r\n private _maxVertTextureUnits: number = 0;\r\n private _maxVertAttribs: number = 0;\r\n private _maxVertUniformVectors: number = 0;\r\n private _maxVaryingVectors: number = 0;\r\n private _maxFragUniformVectors: number = 0;\r\n private _maxAnisotropy?: number;\r\n private _maxAntialiasSamples: number = 1;\r\n private _supportsCreateImageBitmap: boolean = false;\r\n private _maxTexSizeAllow: number = maxTexSizeAllowed;\r\n\r\n private _extensionMap: { [key: string]: any } = {}; // Use this map to store actual extension objects retrieved from GL.\r\n private _presentFeatures: WebGLFeature[] = []; // List of features the system can support (not necessarily dependent on extensions)\r\n\r\n private _isWebGL2: boolean = false;\r\n private _isMobile: boolean = false;\r\n private _driverBugs: GraphicsDriverBugs = {};\r\n\r\n public get maxRenderType(): RenderType { return this._maxRenderType; }\r\n public get maxDepthType(): DepthType { return this._maxDepthType; }\r\n public get maxTextureSize(): number { return this._maxTextureSize; }\r\n public get maxTexSizeAllow(): number { return this._maxTexSizeAllow; }\r\n public get supportsCreateImageBitmap(): boolean { return this._supportsCreateImageBitmap; }\r\n public get maxColorAttachments(): number { return this._maxColorAttachments; }\r\n public get maxDrawBuffers(): number { return this._maxDrawBuffers; }\r\n public get maxFragTextureUnits(): number { return this._maxFragTextureUnits; }\r\n public get maxVertTextureUnits(): number { return this._maxVertTextureUnits; }\r\n public get maxVertAttribs(): number { return this._maxVertAttribs; }\r\n public get maxVertUniformVectors(): number { return this._maxVertUniformVectors; }\r\n public get maxVaryingVectors(): number { return this._maxVaryingVectors; }\r\n public get maxFragUniformVectors(): number { return this._maxFragUniformVectors; }\r\n public get maxAntialiasSamples(): number { return this._maxAntialiasSamples; }\r\n public get isWebGL2(): boolean { return this._isWebGL2; }\r\n public get driverBugs(): GraphicsDriverBugs { return this._driverBugs; }\r\n\r\n /** These getters check for existence of extension objects to determine availability of features. In WebGL2, could just return true for some. */\r\n public get supportsNonPowerOf2Textures(): boolean { return false; }\r\n public get supportsDrawBuffers(): boolean { return this._isWebGL2 || this.queryExtensionObject<WEBGL_draw_buffers>(\"WEBGL_draw_buffers\") !== undefined; }\r\n public get supportsInstancing(): boolean { return this._isWebGL2 || this.queryExtensionObject<ANGLE_instanced_arrays>(\"ANGLE_instanced_arrays\") !== undefined; }\r\n public get supports32BitElementIndex(): boolean { return this._isWebGL2 || this.queryExtensionObject<OES_element_index_uint>(\"OES_element_index_uint\") !== undefined; }\r\n public get supportsTextureFloat(): boolean { return this._isWebGL2 || this.queryExtensionObject<OES_texture_float>(\"OES_texture_float\") !== undefined; }\r\n public get supportsTextureFloatLinear(): boolean { return this._isWebGL2 || this.queryExtensionObject<OES_texture_float_linear>(\"OES_texture_float_linear\") !== undefined; }\r\n public get supportsTextureHalfFloat(): boolean { return this._isWebGL2 || this.queryExtensionObject<OES_texture_half_float>(\"OES_texture_half_float\") !== undefined; }\r\n public get supportsTextureHalfFloatLinear(): boolean { return this._isWebGL2 || this.queryExtensionObject<OES_texture_half_float_linear>(\"OES_texture_half_float_linear\") !== undefined; }\r\n public get supportsTextureFilterAnisotropic(): boolean { return this.queryExtensionObject<EXT_texture_filter_anisotropic>(\"EXT_texture_filter_anisotropic\") !== undefined; }\r\n public get supportsShaderTextureLOD(): boolean { return this._isWebGL2 || this.queryExtensionObject<EXT_shader_texture_lod>(\"EXT_shader_texture_lod\") !== undefined; }\r\n public get supportsVertexArrayObjects(): boolean { return this._isWebGL2 || this.queryExtensionObject<OES_vertex_array_object>(\"OES_vertex_array_object\") !== undefined; }\r\n public get supportsFragDepth(): boolean { return this._isWebGL2 || this.queryExtensionObject<EXT_frag_depth>(\"EXT_frag_depth\") !== undefined; }\r\n public get supportsDisjointTimerQuery(): boolean { return (this._isWebGL2 && this.queryExtensionObject<any>(\"EXT_disjoint_timer_query_webgl2\") !== undefined) || this.queryExtensionObject<any>(\"EXT_disjoint_timer_query\") !== undefined; }\r\n public get supportsStandardDerivatives(): boolean { return this._isWebGL2 || this.queryExtensionObject<OES_standard_derivatives>(\"OES_standard_derivatives\") !== undefined; }\r\n\r\n public get supportsMRTTransparency(): boolean { return this.maxColorAttachments >= 2; }\r\n public get supportsMRTPickShaders(): boolean { return this.maxColorAttachments >= 3; }\r\n\r\n public get supportsShadowMaps(): boolean {\r\n return this.supportsTextureFloat || this.supportsTextureHalfFloat;\r\n }\r\n\r\n public get supportsAntiAliasing(): boolean { return this._isWebGL2 && this.maxAntialiasSamples > 1; }\r\n\r\n public get isMobile(): boolean { return this._isMobile; }\r\n\r\n private findExtension(name: WebGLExtensionName): any {\r\n const ext = this._extensionMap[name];\r\n return null !== ext ? ext : undefined;\r\n }\r\n\r\n /** Queries an extension object if available. This is necessary for other parts of the system to access some constants within extensions. */\r\n public queryExtensionObject<T>(ext: WebGLExtensionName): T | undefined {\r\n return this.findExtension(ext) as T;\r\n }\r\n\r\n public static readonly optionalFeatures: WebGLFeature[] = [\r\n WebGLFeature.MrtTransparency,\r\n WebGLFeature.MrtPick,\r\n WebGLFeature.DepthTexture,\r\n WebGLFeature.FloatRendering,\r\n WebGLFeature.Instancing,\r\n WebGLFeature.ShadowMaps,\r\n WebGLFeature.FragDepth,\r\n WebGLFeature.StandardDerivatives,\r\n WebGLFeature.AntiAliasing,\r\n ];\r\n public static readonly requiredFeatures: WebGLFeature[] = [\r\n WebGLFeature.UintElementIndex,\r\n WebGLFeature.MinimalTextureUnits,\r\n ];\r\n\r\n private get _hasRequiredTextureUnits(): boolean { return this.maxFragTextureUnits >= 4 && this.maxVertTextureUnits >= 5; }\r\n\r\n /** Return an array containing any features not supported by the system as compared to the input array. */\r\n private _findMissingFeatures(featuresToSeek: WebGLFeature[]): WebGLFeature[] {\r\n const missingFeatures: WebGLFeature[] = [];\r\n for (const featureName of featuresToSeek) {\r\n if (-1 === this._presentFeatures.indexOf(featureName))\r\n missingFeatures.push(featureName);\r\n }\r\n return missingFeatures;\r\n }\r\n\r\n /** Populate and return an array containing features that this system supports. */\r\n private _gatherFeatures(): WebGLFeature[] {\r\n const features: WebGLFeature[] = [];\r\n\r\n // simply check for presence of various extensions if that gives enough information\r\n if (this._isWebGL2 || this._extensionMap[\"OES_element_index_uint\" as WebGLExtensionName] !== undefined)\r\n features.push(WebGLFeature.UintElementIndex);\r\n if (this._isWebGL2 || this._extensionMap[\"ANGLE_instanced_arrays\" as WebGLExtensionName] !== undefined)\r\n features.push(WebGLFeature.Instancing);\r\n\r\n if (this.supportsMRTTransparency)\r\n features.push(WebGLFeature.MrtTransparency);\r\n if (this.supportsMRTPickShaders)\r\n features.push(WebGLFeature.MrtPick);\r\n if (this.supportsShadowMaps)\r\n features.push(WebGLFeature.ShadowMaps);\r\n if (this._hasRequiredTextureUnits)\r\n features.push(WebGLFeature.MinimalTextureUnits);\r\n if (this.supportsFragDepth)\r\n features.push(WebGLFeature.FragDepth);\r\n if (this.supportsStandardDerivatives)\r\n features.push(WebGLFeature.StandardDerivatives);\r\n if (this.supportsAntiAliasing)\r\n features.push(WebGLFeature.AntiAliasing);\r\n\r\n if (DepthType.TextureUnsignedInt24Stencil8 === this._maxDepthType)\r\n features.push(WebGLFeature.DepthTexture);\r\n\r\n // check if at least half-float rendering is available based on maximum discovered renderable target\r\n if (RenderType.TextureUnsignedByte !== this._maxRenderType)\r\n features.push(WebGLFeature.FloatRendering);\r\n\r\n return features;\r\n }\r\n\r\n /** Retrieve compatibility status based on presence of various features. */\r\n private _getCompatibilityStatus(missingRequiredFeatures: WebGLFeature[], missingOptionalFeatures: WebGLFeature[]): WebGLRenderCompatibilityStatus {\r\n let status: WebGLRenderCompatibilityStatus = WebGLRenderCompatibilityStatus.AllOkay;\r\n if (missingOptionalFeatures.length > 0)\r\n status = WebGLRenderCompatibilityStatus.MissingOptionalFeatures;\r\n if (missingRequiredFeatures.length > 0)\r\n status = WebGLRenderCompatibilityStatus.MissingRequiredFeatures;\r\n return status;\r\n }\r\n\r\n /** Initializes the capabilities based on a GL context. Must be called first. */\r\n public init(gl: WebGLContext, disabledExtensions?: WebGLExtensionName[]): WebGLRenderCompatibilityInfo {\r\n const gl2 = !(gl instanceof WebGLRenderingContext) ? gl : undefined;\r\n this._isWebGL2 = undefined !== gl2;\r\n\r\n this._isMobile = ProcessDetector.isMobileBrowser;\r\n\r\n const debugInfo = gl.getExtension(\"WEBGL_debug_renderer_info\");\r\n const unmaskedRenderer = debugInfo !== null ? gl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL) : undefined;\r\n const unmaskedVendor = debugInfo !== null ? gl.getParameter(debugInfo.UNMASKED_VENDOR_WEBGL) : undefined;\r\n\r\n this._driverBugs = {};\r\n if (unmaskedRenderer && buggyIntelMatchers.some((x) => x.test(unmaskedRenderer)))\r\n this._driverBugs.fragDepthDoesNotDisableEarlyZ = true;\r\n\r\n if (unmaskedRenderer && buggyMaliMatchers.some((x) => x.test(unmaskedRenderer)))\r\n this._driverBugs.msaaWillHang = true;\r\n\r\n this._maxTextureSize = gl.getParameter(gl.MAX_TEXTURE_SIZE);\r\n this._supportsCreateImageBitmap = typeof createImageBitmap === \"function\" && ProcessDetector.isChromium && !ProcessDetector.isIOSBrowser;\r\n this._maxTexSizeAllow = Math.min(this._maxTextureSize, maxTexSizeAllowed);\r\n this._maxFragTextureUnits = gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS);\r\n this._maxVertTextureUnits = gl.getParameter(gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS);\r\n this._maxVertAttribs = gl.getParameter(gl.MAX_VERTEX_ATTRIBS);\r\n this._maxVertUniformVectors = gl.getParameter(gl.MAX_VERTEX_UNIFORM_VECTORS);\r\n this._maxVaryingVectors = gl.getParameter(gl.MAX_VARYING_VECTORS);\r\n this._maxFragUniformVectors = gl.getParameter(gl.MAX_FRAGMENT_UNIFORM_VECTORS);\r\n this._maxAntialiasSamples = this._driverBugs.msaaWillHang ? 1 : (this._isWebGL2 && undefined !== gl2 ? gl.getParameter(gl2.MAX_SAMPLES) : 1);\r\n\r\n const extensions = gl.getSupportedExtensions(); // This just retrieves a list of available extensions (not necessarily enabled).\r\n if (extensions) {\r\n for (const extStr of extensions) {\r\n const ext = extStr as WebGLExtensionName;\r\n if (-1 === knownExtensions.indexOf(ext))\r\n continue;\r\n else if (undefined !== disabledExtensions && -1 !== disabledExtensions.indexOf(ext))\r\n continue;\r\n\r\n const extObj: any = gl.getExtension(ext); // This call enables the extension and returns a WebGLObject containing extension instance.\r\n if (null !== extObj)\r\n this._extensionMap[ext] = extObj;\r\n }\r\n }\r\n\r\n if (this._isWebGL2 && undefined !== gl2) {\r\n this._maxColorAttachments = gl.getParameter(gl2.MAX_COLOR_ATTACHMENTS);\r\n this._maxDrawBuffers = gl.getParameter(gl2.MAX_DRAW_BUFFERS);\r\n } else {\r\n const dbExt: WEBGL_draw_buffers | undefined = this.queryExtensionObject<WEBGL_draw_buffers>(\"WEBGL_draw_buffers\");\r\n this._maxColorAttachments = dbExt !== undefined ? gl.getParameter(dbExt.MAX_COLOR_ATTACHMENTS_WEBGL) : 1;\r\n this._maxDrawBuffers = dbExt !== undefined ? gl.getParameter(dbExt.MAX_DRAW_BUFFERS_WEBGL) : 1;\r\n }\r\n\r\n // Determine the maximum color-renderable attachment type.\r\n const allowFloatRender =\r\n (undefined === disabledExtensions || -1 === disabledExtensions.indexOf(\"OES_texture_float\"))\r\n // iOS>=15 allows full-float rendering. However, it does not actually work on non-M1 devices.\r\n // Because of this, for now we disallow full float rendering on iOS devices.\r\n // ###TODO: Re-assess this after future iOS updates.\r\n && !ProcessDetector.isIOSBrowser\r\n // Samsung Galaxy Note 8 exhibits same issue as described above for iOS >= 15.\r\n // It uses specifically Mali-G71 MP20 but reports its renderer as follows.\r\n // Samsung Galaxy A50 and S9 exhibits same issue; they use Mali-G72.\r\n // HUAWEI P30 exhibits same issue; it uses Mali-G76.\r\n && unmaskedRenderer !== \"Mali-G71\" && unmaskedRenderer !== \"Mali-G72\" && unmaskedRenderer !== \"Mali-G76\";\r\n\r\n if (allowFloatRender && undefined !== this.queryExtensionObject(\"EXT_float_blend\") && this.isTextureRenderable(gl, gl.FLOAT)) {\r\n this._maxRenderType = RenderType.TextureFloat;\r\n } else if (this.isWebGL2) {\r\n this._maxRenderType = (this.isTextureRenderable(gl, (gl as WebGL2RenderingContext).HALF_FLOAT)) ? RenderType.TextureHalfFloat : RenderType.TextureUnsignedByte;\r\n } else {\r\n const hfExt: OES_texture_half_float | undefined = this.queryExtensionObject<OES_texture_half_float>(\"OES_texture_half_float\");\r\n this._maxRenderType = (hfExt !== undefined && this.isTextureRenderable(gl, hfExt.HALF_FLOAT_OES)) ? RenderType.TextureHalfFloat : RenderType.TextureUnsignedByte;\r\n }\r\n\r\n // Determine the maximum depth attachment type.\r\n // this._maxDepthType = this.queryExtensionObject(\"WEBGL_depth_texture\") !== undefined ? DepthType.TextureUnsignedInt32 : DepthType.RenderBufferUnsignedShort16;\r\n this._maxDepthType = this._isWebGL2 || this.queryExtensionObject(\"WEBGL_depth_texture\") !== undefined ? DepthType.TextureUnsignedInt24Stencil8 : DepthType.RenderBufferUnsignedShort16;\r\n\r\n this._presentFeatures = this._gatherFeatures();\r\n const missingRequiredFeatures = this._findMissingFeatures(Capabilities.requiredFeatures);\r\n const missingOptionalFeatures = this._findMissingFeatures(Capabilities.optionalFeatures);\r\n\r\n return {\r\n status: this._getCompatibilityStatus(missingRequiredFeatures, missingOptionalFeatures),\r\n missingRequiredFeatures,\r\n missingOptionalFeatures,\r\n unmaskedRenderer,\r\n unmaskedVendor,\r\n usingIntegratedGraphics: isIntegratedGraphics({unmaskedVendor, unmaskedRenderer}),\r\n driverBugs: { ...this._driverBugs },\r\n userAgent: navigator.userAgent,\r\n createdContext: gl,\r\n };\r\n }\r\n\r\n public static create(gl: WebGLContext, disabledExtensions?: WebGLExtensionName[]): Capabilities | undefined {\r\n const caps = new Capabilities();\r\n const compatibility = caps.init(gl, disabledExtensions);\r\n if (WebGLRenderCompatibilityStatus.CannotCreateContext === compatibility.status || WebGLRenderCompatibilityStatus.MissingRequiredFeatures === compatibility.status)\r\n return undefined;\r\n return caps;\r\n }\r\n\r\n /** Determines if a particular texture type is color-renderable on the host system. */\r\n private isTextureRenderable(gl: WebGLContext, texType: number): boolean {\r\n const tex: WebGLTexture | null = gl.createTexture();\r\n gl.bindTexture(gl.TEXTURE_2D, tex);\r\n if (this.isWebGL2) {\r\n if (gl.FLOAT === texType)\r\n gl.texImage2D(gl.TEXTURE_2D, 0, (gl as WebGL2RenderingContext).RGBA32F, 1, 1, 0, gl.RGBA, texType, null);\r\n else\r\n gl.texImage2D(gl.TEXTURE_2D, 0, (gl as WebGL2RenderingContext).RGBA16F, 1, 1, 0, gl.RGBA, texType, null);\r\n } else\r\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, texType, null);\r\n\r\n const fb: WebGLFramebuffer | null = gl.createFramebuffer();\r\n gl.bindFramebuffer(gl.FRAMEBUFFER, fb);\r\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0);\r\n\r\n const fbStatus: number = gl.checkFramebufferStatus(gl.FRAMEBUFFER);\r\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\r\n gl.deleteFramebuffer(fb);\r\n gl.deleteTexture(tex);\r\n\r\n gl.getError(); // clear any errors\r\n\r\n return fbStatus === gl.FRAMEBUFFER_COMPLETE;\r\n }\r\n\r\n public setMaxAnisotropy(desiredMax: number | undefined, gl: WebGLContext): void {\r\n const ext = this.queryExtensionObject<EXT_texture_filter_anisotropic>(\"EXT_texture_filter_anisotropic\");\r\n if (undefined === ext)\r\n return;\r\n\r\n if (undefined === this._maxAnisotropy)\r\n this._maxAnisotropy = gl.getParameter(ext.MAX_TEXTURE_MAX_ANISOTROPY_EXT) as number;\r\n\r\n const max = (undefined !== desiredMax) ? Math.min(desiredMax, this._maxAnisotropy) : this._maxAnisotropy;\r\n gl.texParameterf(gl.TEXTURE_2D, ext.TEXTURE_MAX_ANISOTROPY_EXT, max);\r\n }\r\n}\r\n"]}
|
|
@@ -37,7 +37,6 @@ export declare class Capabilities {
|
|
|
37
37
|
private _maxVertUniformVectors;
|
|
38
38
|
private _maxVaryingVectors;
|
|
39
39
|
private _maxFragUniformVectors;
|
|
40
|
-
private _canRenderDepthWithoutColor;
|
|
41
40
|
private _maxAnisotropy?;
|
|
42
41
|
private _maxAntialiasSamples;
|
|
43
42
|
private _supportsCreateImageBitmap;
|
|
@@ -80,7 +79,6 @@ export declare class Capabilities {
|
|
|
80
79
|
get supportsStandardDerivatives(): boolean;
|
|
81
80
|
get supportsMRTTransparency(): boolean;
|
|
82
81
|
get supportsMRTPickShaders(): boolean;
|
|
83
|
-
get canRenderDepthWithoutColor(): boolean;
|
|
84
82
|
get supportsShadowMaps(): boolean;
|
|
85
83
|
get supportsAntiAliasing(): boolean;
|
|
86
84
|
get isMobile(): boolean;
|
|
@@ -101,8 +99,6 @@ export declare class Capabilities {
|
|
|
101
99
|
static create(gl: WebGLContext, disabledExtensions?: WebGLExtensionName[]): Capabilities | undefined;
|
|
102
100
|
/** Determines if a particular texture type is color-renderable on the host system. */
|
|
103
101
|
private isTextureRenderable;
|
|
104
|
-
/** Determines if depth textures can be rendered without also having a color attachment bound on the host system. */
|
|
105
|
-
private isDepthRenderableWithoutColor;
|
|
106
102
|
setMaxAnisotropy(desiredMax: number | undefined, gl: WebGLContext): void;
|
|
107
103
|
}
|
|
108
104
|
//# sourceMappingURL=Capabilities.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Capabilities.d.ts","sourceRoot":"","sources":["../../src/Capabilities.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAC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W,oBAAoB,IAAI,OAAO,CAA2D;IAErG,IAAW,QAAQ,IAAI,OAAO,CAA2B;IAEzD,OAAO,CAAC,aAAa;IAKrB,6IAA6I;IACtI,oBAAoB,CAAC,CAAC,EAAE,GAAG,EAAE,kBAAkB,GAAG,CAAC,GAAG,SAAS;IAItE,gBAAuB,gBAAgB,EAAE,YAAY,EAAE,CAUrD;IACF,gBAAuB,gBAAgB,EAAE,YAAY,EAAE,CAGrD;IAEF,OAAO,KAAK,wBAAwB,GAAsF;IAE1H,0GAA0G;IAC1G,OAAO,CAAC,oBAAoB;IAS5B,kFAAkF;IAClF,OAAO,CAAC,eAAe;IAkCvB,2EAA2E;IAC3E,OAAO,CAAC,uBAAuB;IAS/B,gFAAgF;IACzE,IAAI,CAAC,EAAE,EAAE,YAAY,EAAE,kBAAkB,CAAC,EAAE,kBAAkB,EAAE,GAAG,4BAA4B;WA+FxF,MAAM,CAAC,EAAE,EAAE,YAAY,EAAE,kBAAkB,CAAC,EAAE,kBAAkB,EAAE,GAAG,YAAY,GAAG,SAAS;IAQ3G,sFAAsF;IACtF,OAAO,CAAC,mBAAmB;IAyBpB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,EAAE,EAAE,EAAE,YAAY,GAAG,IAAI;CAWhF"}
|
package/lib/esm/Capabilities.js
CHANGED
|
@@ -94,7 +94,6 @@ export class Capabilities {
|
|
|
94
94
|
this._maxVertUniformVectors = 0;
|
|
95
95
|
this._maxVaryingVectors = 0;
|
|
96
96
|
this._maxFragUniformVectors = 0;
|
|
97
|
-
this._canRenderDepthWithoutColor = false;
|
|
98
97
|
this._maxAntialiasSamples = 1;
|
|
99
98
|
this._supportsCreateImageBitmap = false;
|
|
100
99
|
this._maxTexSizeAllow = maxTexSizeAllowed;
|
|
@@ -137,7 +136,6 @@ export class Capabilities {
|
|
|
137
136
|
get supportsStandardDerivatives() { return this._isWebGL2 || this.queryExtensionObject("OES_standard_derivatives") !== undefined; }
|
|
138
137
|
get supportsMRTTransparency() { return this.maxColorAttachments >= 2; }
|
|
139
138
|
get supportsMRTPickShaders() { return this.maxColorAttachments >= 3; }
|
|
140
|
-
get canRenderDepthWithoutColor() { return this._canRenderDepthWithoutColor; }
|
|
141
139
|
get supportsShadowMaps() {
|
|
142
140
|
return this.supportsTextureFloat || this.supportsTextureHalfFloat;
|
|
143
141
|
}
|
|
@@ -268,7 +266,6 @@ export class Capabilities {
|
|
|
268
266
|
// Determine the maximum depth attachment type.
|
|
269
267
|
// this._maxDepthType = this.queryExtensionObject("WEBGL_depth_texture") !== undefined ? DepthType.TextureUnsignedInt32 : DepthType.RenderBufferUnsignedShort16;
|
|
270
268
|
this._maxDepthType = this._isWebGL2 || this.queryExtensionObject("WEBGL_depth_texture") !== undefined ? DepthType.TextureUnsignedInt24Stencil8 : DepthType.RenderBufferUnsignedShort16;
|
|
271
|
-
this._canRenderDepthWithoutColor = this._maxDepthType === DepthType.TextureUnsignedInt24Stencil8 ? this.isDepthRenderableWithoutColor(gl) : false;
|
|
272
269
|
this._presentFeatures = this._gatherFeatures();
|
|
273
270
|
const missingRequiredFeatures = this._findMissingFeatures(Capabilities.requiredFeatures);
|
|
274
271
|
const missingOptionalFeatures = this._findMissingFeatures(Capabilities.optionalFeatures);
|
|
@@ -313,24 +310,6 @@ export class Capabilities {
|
|
|
313
310
|
gl.getError(); // clear any errors
|
|
314
311
|
return fbStatus === gl.FRAMEBUFFER_COMPLETE;
|
|
315
312
|
}
|
|
316
|
-
/** Determines if depth textures can be rendered without also having a color attachment bound on the host system. */
|
|
317
|
-
isDepthRenderableWithoutColor(gl) {
|
|
318
|
-
const dtExt = this.queryExtensionObject("WEBGL_depth_texture");
|
|
319
|
-
if (dtExt === undefined)
|
|
320
|
-
return false;
|
|
321
|
-
const tex = gl.createTexture();
|
|
322
|
-
gl.bindTexture(gl.TEXTURE_2D, tex);
|
|
323
|
-
gl.texImage2D(gl.TEXTURE_2D, 0, gl.DEPTH_STENCIL, 1, 1, 0, gl.DEPTH_STENCIL, dtExt.UNSIGNED_INT_24_8_WEBGL, null);
|
|
324
|
-
const fb = gl.createFramebuffer();
|
|
325
|
-
gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
|
|
326
|
-
gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.TEXTURE_2D, tex, 0);
|
|
327
|
-
const fbStatus = gl.checkFramebufferStatus(gl.FRAMEBUFFER);
|
|
328
|
-
gl.bindFramebuffer(gl.FRAMEBUFFER, null);
|
|
329
|
-
gl.deleteFramebuffer(fb);
|
|
330
|
-
gl.deleteTexture(tex);
|
|
331
|
-
gl.getError(); // clear any errors
|
|
332
|
-
return fbStatus === gl.FRAMEBUFFER_COMPLETE;
|
|
333
|
-
}
|
|
334
313
|
setMaxAnisotropy(desiredMax, gl) {
|
|
335
314
|
const ext = this.queryExtensionObject("EXT_texture_filter_anisotropic");
|
|
336
315
|
if (undefined === ext)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Capabilities.js","sourceRoot":"","sources":["../../src/Capabilities.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAC6B,YAAY,EAAgC,8BAA8B,GAC7G,MAAM,uBAAuB,CAAC;AAS/B,MAAM,eAAe,GAAyB;IAC5C,oBAAoB;IACpB,wBAAwB;IACxB,mBAAmB;IACnB,0BAA0B;IAC1B,wBAAwB;IACxB,+BAA+B;IAC/B,gCAAgC;IAChC,qBAAqB;IACrB,wBAAwB;IACxB,wBAAwB;IACxB,gBAAgB;IAChB,wBAAwB;IACxB,yBAAyB;IACzB,oBAAoB;IACpB,0BAA0B;IAC1B,iCAAiC;IACjC,0BAA0B;IAC1B,iBAAiB;CAClB,CAAC;AAEF;;GAEG;AACH,MAAM,CAAN,IAAY,UAIX;AAJD,WAAY,UAAU;IACpB,yEAAmB,CAAA;IACnB,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AC;QACxG,IAAI,SAAS,KAAK,GAAG;YACnB,OAAO;QAET,IAAI,SAAS,KAAK,IAAI,CAAC,cAAc;YACnC,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,8BAA8B,CAAW,CAAC;QAEtF,MAAM,GAAG,GAAG,CAAC,SAAS,KAAK,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC;QACzG,EAAE,CAAC,aAAa,CAAC,EAAE,CAAC,UAAU,EAAE,GAAG,CAAC,0BAA0B,EAAE,GAAG,CAAC,CAAC;IACvE,CAAC;;AA/OsB,6BAAgB,GAAmB;IACxD,YAAY,CAAC,eAAe;IAC5B,YAAY,CAAC,OAAO;IACpB,YAAY,CAAC,YAAY;IACzB,YAAY,CAAC,cAAc;IAC3B,YAAY,CAAC,UAAU;IACvB,YAAY,CAAC,UAAU;IACvB,YAAY,CAAC,SAAS;IACtB,YAAY,CAAC,mBAAmB;IAChC,YAAY,CAAC,YAAY;CAC1B,CAAC;AACqB,6BAAgB,GAAmB;IACxD,YAAY,CAAC,gBAAgB;IAC7B,YAAY,CAAC,mBAAmB;CACjC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Compatibility\r\n */\r\n\r\nimport { ProcessDetector } from \"@itwin/core-bentley\";\r\nimport {\r\n GraphicsDriverBugs, WebGLContext, WebGLFeature, WebGLRenderCompatibilityInfo, WebGLRenderCompatibilityStatus,\r\n} from \"./RenderCompatibility\";\r\n\r\n/** @internal */\r\nexport type WebGLExtensionName =\r\n \"WEBGL_draw_buffers\" | \"OES_element_index_uint\" | \"OES_texture_float\" | \"OES_texture_float_linear\" |\r\n \"OES_texture_half_float\" | \"OES_texture_half_float_linear\" | \"EXT_texture_filter_anisotropic\" | \"WEBGL_depth_texture\" |\r\n \"EXT_color_buffer_float\" | \"EXT_shader_texture_lod\" | \"ANGLE_instanced_arrays\" | \"OES_vertex_array_object\" | \"WEBGL_lose_context\" |\r\n \"EXT_frag_depth\" | \"EXT_disjoint_timer_query\" | \"EXT_disjoint_timer_query_webgl2\" | \"OES_standard_derivatives\" | \"EXT_float_blend\";\r\n\r\nconst knownExtensions: WebGLExtensionName[] = [\r\n \"WEBGL_draw_buffers\",\r\n \"OES_element_index_uint\",\r\n \"OES_texture_float\",\r\n \"OES_texture_float_linear\",\r\n \"OES_texture_half_float\",\r\n \"OES_texture_half_float_linear\",\r\n \"EXT_texture_filter_anisotropic\",\r\n \"WEBGL_depth_texture\",\r\n \"EXT_color_buffer_float\",\r\n \"EXT_shader_texture_lod\",\r\n \"EXT_frag_depth\",\r\n \"ANGLE_instanced_arrays\",\r\n \"OES_vertex_array_object\",\r\n \"WEBGL_lose_context\",\r\n \"EXT_disjoint_timer_query\",\r\n \"EXT_disjoint_timer_query_webgl2\",\r\n \"OES_standard_derivatives\",\r\n \"EXT_float_blend\",\r\n];\r\n\r\n/** Describes the type of a render target. Used by Capabilities to represent maximum precision render target available on host system.\r\n * @internal\r\n */\r\nexport enum RenderType {\r\n TextureUnsignedByte,\r\n TextureHalfFloat,\r\n TextureFloat,\r\n}\r\n\r\n/**\r\n * Describes the type of a depth buffer. Used by Capabilities to represent maximum depth buffer precision available on host system.\r\n * Note: the commented-out values are unimplemented but left in place for reference, in case desired for future implementation.\r\n * @internal\r\n */\r\nexport enum DepthType {\r\n RenderBufferUnsignedShort16, // core to WebGL1\r\n // TextureUnsignedShort16, // core to WebGL2; available to WebGL1 via WEBGL_depth_texture\r\n // TextureUnsignedInt24, // core to WebGL2\r\n TextureUnsignedInt24Stencil8, // core to WebGL2; available to WebGL1 via WEBGL_depth_texture\r\n TextureUnsignedInt32, // core to WebGL2; available to WebGL1 via WEBGL_depth_texture\r\n // TextureFloat32, // core to WebGL2\r\n // TextureFloat32Stencil8, // core to WeBGL2\r\n}\r\n\r\nconst maxTexSizeAllowed = 4096; // many devices and browsers have issues with source textures larger than this\r\n\r\n// Regexes to match Intel UHD/HD 620/630 integrated GPUS that suffer from GraphicsDriverBugs.fragDepthDoesNotDisableEarlyZ.\r\nconst buggyIntelMatchers = [\r\n // Original unmasked renderer string when workaround we implemented.\r\n /ANGLE \\(Intel\\(R\\) (U)?HD Graphics 6(2|3)0 Direct3D11/,\r\n // New unmasked renderer string circa October 2021.\r\n /ANGLE \\(Intel, Intel\\(R\\) (U)?HD Graphics 6(2|3)0 Direct3D11/,\r\n];\r\n\r\n// Regexes to match Mali GPUs known to suffer from GraphicsDriverBugs.msaaWillHang.\r\nconst buggyMaliMatchers = [\r\n /Mali-G71/,\r\n /Mali-G72/,\r\n /Mali-G76/,\r\n];\r\n\r\n// Regexes to match as many Intel integrated GPUs as possible.\r\n// https://en.wikipedia.org/wiki/List_of_Intel_graphics_processing_units\r\nconst integratedIntelGpuMatchers = [\r\n /(U)?HD Graphics/,\r\n /Iris/,\r\n];\r\n\r\nfunction isIntegratedGraphics(args: {unmaskedVendor?: string, unmaskedRenderer?: string}): boolean {\r\n if (args.unmaskedRenderer && args.unmaskedRenderer.includes(\"Intel\") && integratedIntelGpuMatchers.some((x) => x.test(args.unmaskedRenderer!)))\r\n return true;\r\n\r\n // NB: For now, we do not attempt to detect AMD integrated graphics.\r\n // It appears that AMD integrated graphics are not usually paired with a graphics card so detecting integrated usage there is less important than Intel.\r\n\r\n return false;\r\n}\r\n\r\n/** Describes the rendering capabilities of the host system.\r\n * @internal\r\n */\r\nexport class Capabilities {\r\n private _maxRenderType: RenderType = RenderType.TextureUnsignedByte;\r\n private _maxDepthType: DepthType = DepthType.RenderBufferUnsignedShort16;\r\n private _maxTextureSize: number = 0;\r\n private _maxColorAttachments: number = 0;\r\n private _maxDrawBuffers: number = 0;\r\n private _maxFragTextureUnits: number = 0;\r\n private _maxVertTextureUnits: number = 0;\r\n private _maxVertAttribs: number = 0;\r\n private _maxVertUniformVectors: number = 0;\r\n private _maxVaryingVectors: number = 0;\r\n private _maxFragUniformVectors: number = 0;\r\n private _canRenderDepthWithoutColor: boolean = false;\r\n private _maxAnisotropy?: number;\r\n private _maxAntialiasSamples: number = 1;\r\n private _supportsCreateImageBitmap: boolean = false;\r\n private _maxTexSizeAllow: number = maxTexSizeAllowed;\r\n\r\n private _extensionMap: { [key: string]: any } = {}; // Use this map to store actual extension objects retrieved from GL.\r\n private _presentFeatures: WebGLFeature[] = []; // List of features the system can support (not necessarily dependent on extensions)\r\n\r\n private _isWebGL2: boolean = false;\r\n private _isMobile: boolean = false;\r\n private _driverBugs: GraphicsDriverBugs = {};\r\n\r\n public get maxRenderType(): RenderType { return this._maxRenderType; }\r\n public get maxDepthType(): DepthType { return this._maxDepthType; }\r\n public get maxTextureSize(): number { return this._maxTextureSize; }\r\n public get maxTexSizeAllow(): number { return this._maxTexSizeAllow; }\r\n public get supportsCreateImageBitmap(): boolean { return this._supportsCreateImageBitmap; }\r\n public get maxColorAttachments(): number { return this._maxColorAttachments; }\r\n public get maxDrawBuffers(): number { return this._maxDrawBuffers; }\r\n public get maxFragTextureUnits(): number { return this._maxFragTextureUnits; }\r\n public get maxVertTextureUnits(): number { return this._maxVertTextureUnits; }\r\n public get maxVertAttribs(): number { return this._maxVertAttribs; }\r\n public get maxVertUniformVectors(): number { return this._maxVertUniformVectors; }\r\n public get maxVaryingVectors(): number { return this._maxVaryingVectors; }\r\n public get maxFragUniformVectors(): number { return this._maxFragUniformVectors; }\r\n public get maxAntialiasSamples(): number { return this._maxAntialiasSamples; }\r\n public get isWebGL2(): boolean { return this._isWebGL2; }\r\n public get driverBugs(): GraphicsDriverBugs { return this._driverBugs; }\r\n\r\n /** These getters check for existence of extension objects to determine availability of features. In WebGL2, could just return true for some. */\r\n public get supportsNonPowerOf2Textures(): boolean { return false; }\r\n public get supportsDrawBuffers(): boolean { return this._isWebGL2 || this.queryExtensionObject<WEBGL_draw_buffers>(\"WEBGL_draw_buffers\") !== undefined; }\r\n public get supportsInstancing(): boolean { return this._isWebGL2 || this.queryExtensionObject<ANGLE_instanced_arrays>(\"ANGLE_instanced_arrays\") !== undefined; }\r\n public get supports32BitElementIndex(): boolean { return this._isWebGL2 || this.queryExtensionObject<OES_element_index_uint>(\"OES_element_index_uint\") !== undefined; }\r\n public get supportsTextureFloat(): boolean { return this._isWebGL2 || this.queryExtensionObject<OES_texture_float>(\"OES_texture_float\") !== undefined; }\r\n public get supportsTextureFloatLinear(): boolean { return this._isWebGL2 || this.queryExtensionObject<OES_texture_float_linear>(\"OES_texture_float_linear\") !== undefined; }\r\n public get supportsTextureHalfFloat(): boolean { return this._isWebGL2 || this.queryExtensionObject<OES_texture_half_float>(\"OES_texture_half_float\") !== undefined; }\r\n public get supportsTextureHalfFloatLinear(): boolean { return this._isWebGL2 || this.queryExtensionObject<OES_texture_half_float_linear>(\"OES_texture_half_float_linear\") !== undefined; }\r\n public get supportsTextureFilterAnisotropic(): boolean { return this.queryExtensionObject<EXT_texture_filter_anisotropic>(\"EXT_texture_filter_anisotropic\") !== undefined; }\r\n public get supportsShaderTextureLOD(): boolean { return this._isWebGL2 || this.queryExtensionObject<EXT_shader_texture_lod>(\"EXT_shader_texture_lod\") !== undefined; }\r\n public get supportsVertexArrayObjects(): boolean { return this._isWebGL2 || this.queryExtensionObject<OES_vertex_array_object>(\"OES_vertex_array_object\") !== undefined; }\r\n public get supportsFragDepth(): boolean { return this._isWebGL2 || this.queryExtensionObject<EXT_frag_depth>(\"EXT_frag_depth\") !== undefined; }\r\n public get supportsDisjointTimerQuery(): boolean { return (this._isWebGL2 && this.queryExtensionObject<any>(\"EXT_disjoint_timer_query_webgl2\") !== undefined) || this.queryExtensionObject<any>(\"EXT_disjoint_timer_query\") !== undefined; }\r\n public get supportsStandardDerivatives(): boolean { return this._isWebGL2 || this.queryExtensionObject<OES_standard_derivatives>(\"OES_standard_derivatives\") !== undefined; }\r\n\r\n public get supportsMRTTransparency(): boolean { return this.maxColorAttachments >= 2; }\r\n public get supportsMRTPickShaders(): boolean { return this.maxColorAttachments >= 3; }\r\n\r\n public get canRenderDepthWithoutColor(): boolean { return this._canRenderDepthWithoutColor; }\r\n\r\n public get supportsShadowMaps(): boolean {\r\n return this.supportsTextureFloat || this.supportsTextureHalfFloat;\r\n }\r\n\r\n public get supportsAntiAliasing(): boolean { return this._isWebGL2 && this.maxAntialiasSamples > 1; }\r\n\r\n public get isMobile(): boolean { return this._isMobile; }\r\n\r\n private findExtension(name: WebGLExtensionName): any {\r\n const ext = this._extensionMap[name];\r\n return null !== ext ? ext : undefined;\r\n }\r\n\r\n /** Queries an extension object if available. This is necessary for other parts of the system to access some constants within extensions. */\r\n public queryExtensionObject<T>(ext: WebGLExtensionName): T | undefined {\r\n return this.findExtension(ext) as T;\r\n }\r\n\r\n public static readonly optionalFeatures: WebGLFeature[] = [\r\n WebGLFeature.MrtTransparency,\r\n WebGLFeature.MrtPick,\r\n WebGLFeature.DepthTexture,\r\n WebGLFeature.FloatRendering,\r\n WebGLFeature.Instancing,\r\n WebGLFeature.ShadowMaps,\r\n WebGLFeature.FragDepth,\r\n WebGLFeature.StandardDerivatives,\r\n WebGLFeature.AntiAliasing,\r\n ];\r\n public static readonly requiredFeatures: WebGLFeature[] = [\r\n WebGLFeature.UintElementIndex,\r\n WebGLFeature.MinimalTextureUnits,\r\n ];\r\n\r\n private get _hasRequiredTextureUnits(): boolean { return this.maxFragTextureUnits >= 4 && this.maxVertTextureUnits >= 5; }\r\n\r\n /** Return an array containing any features not supported by the system as compared to the input array. */\r\n private _findMissingFeatures(featuresToSeek: WebGLFeature[]): WebGLFeature[] {\r\n const missingFeatures: WebGLFeature[] = [];\r\n for (const featureName of featuresToSeek) {\r\n if (-1 === this._presentFeatures.indexOf(featureName))\r\n missingFeatures.push(featureName);\r\n }\r\n return missingFeatures;\r\n }\r\n\r\n /** Populate and return an array containing features that this system supports. */\r\n private _gatherFeatures(): WebGLFeature[] {\r\n const features: WebGLFeature[] = [];\r\n\r\n // simply check for presence of various extensions if that gives enough information\r\n if (this._isWebGL2 || this._extensionMap[\"OES_element_index_uint\" as WebGLExtensionName] !== undefined)\r\n features.push(WebGLFeature.UintElementIndex);\r\n if (this._isWebGL2 || this._extensionMap[\"ANGLE_instanced_arrays\" as WebGLExtensionName] !== undefined)\r\n features.push(WebGLFeature.Instancing);\r\n\r\n if (this.supportsMRTTransparency)\r\n features.push(WebGLFeature.MrtTransparency);\r\n if (this.supportsMRTPickShaders)\r\n features.push(WebGLFeature.MrtPick);\r\n if (this.supportsShadowMaps)\r\n features.push(WebGLFeature.ShadowMaps);\r\n if (this._hasRequiredTextureUnits)\r\n features.push(WebGLFeature.MinimalTextureUnits);\r\n if (this.supportsFragDepth)\r\n features.push(WebGLFeature.FragDepth);\r\n if (this.supportsStandardDerivatives)\r\n features.push(WebGLFeature.StandardDerivatives);\r\n if (this.supportsAntiAliasing)\r\n features.push(WebGLFeature.AntiAliasing);\r\n\r\n if (DepthType.TextureUnsignedInt24Stencil8 === this._maxDepthType)\r\n features.push(WebGLFeature.DepthTexture);\r\n\r\n // check if at least half-float rendering is available based on maximum discovered renderable target\r\n if (RenderType.TextureUnsignedByte !== this._maxRenderType)\r\n features.push(WebGLFeature.FloatRendering);\r\n\r\n return features;\r\n }\r\n\r\n /** Retrieve compatibility status based on presence of various features. */\r\n private _getCompatibilityStatus(missingRequiredFeatures: WebGLFeature[], missingOptionalFeatures: WebGLFeature[]): WebGLRenderCompatibilityStatus {\r\n let status: WebGLRenderCompatibilityStatus = WebGLRenderCompatibilityStatus.AllOkay;\r\n if (missingOptionalFeatures.length > 0)\r\n status = WebGLRenderCompatibilityStatus.MissingOptionalFeatures;\r\n if (missingRequiredFeatures.length > 0)\r\n status = WebGLRenderCompatibilityStatus.MissingRequiredFeatures;\r\n return status;\r\n }\r\n\r\n /** Initializes the capabilities based on a GL context. Must be called first. */\r\n public init(gl: WebGLContext, disabledExtensions?: WebGLExtensionName[]): WebGLRenderCompatibilityInfo {\r\n const gl2 = !(gl instanceof WebGLRenderingContext) ? gl : undefined;\r\n this._isWebGL2 = undefined !== gl2;\r\n\r\n this._isMobile = ProcessDetector.isMobileBrowser;\r\n\r\n const debugInfo = gl.getExtension(\"WEBGL_debug_renderer_info\");\r\n const unmaskedRenderer = debugInfo !== null ? gl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL) : undefined;\r\n const unmaskedVendor = debugInfo !== null ? gl.getParameter(debugInfo.UNMASKED_VENDOR_WEBGL) : undefined;\r\n\r\n this._driverBugs = {};\r\n if (unmaskedRenderer && buggyIntelMatchers.some((x) => x.test(unmaskedRenderer)))\r\n this._driverBugs.fragDepthDoesNotDisableEarlyZ = true;\r\n\r\n if (unmaskedRenderer && buggyMaliMatchers.some((x) => x.test(unmaskedRenderer)))\r\n this._driverBugs.msaaWillHang = true;\r\n\r\n this._maxTextureSize = gl.getParameter(gl.MAX_TEXTURE_SIZE);\r\n this._supportsCreateImageBitmap = typeof createImageBitmap === \"function\" && ProcessDetector.isChromium && !ProcessDetector.isIOSBrowser;\r\n this._maxTexSizeAllow = Math.min(this._maxTextureSize, maxTexSizeAllowed);\r\n this._maxFragTextureUnits = gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS);\r\n this._maxVertTextureUnits = gl.getParameter(gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS);\r\n this._maxVertAttribs = gl.getParameter(gl.MAX_VERTEX_ATTRIBS);\r\n this._maxVertUniformVectors = gl.getParameter(gl.MAX_VERTEX_UNIFORM_VECTORS);\r\n this._maxVaryingVectors = gl.getParameter(gl.MAX_VARYING_VECTORS);\r\n this._maxFragUniformVectors = gl.getParameter(gl.MAX_FRAGMENT_UNIFORM_VECTORS);\r\n this._maxAntialiasSamples = this._driverBugs.msaaWillHang ? 1 : (this._isWebGL2 && undefined !== gl2 ? gl.getParameter(gl2.MAX_SAMPLES) : 1);\r\n\r\n const extensions = gl.getSupportedExtensions(); // This just retrieves a list of available extensions (not necessarily enabled).\r\n if (extensions) {\r\n for (const extStr of extensions) {\r\n const ext = extStr as WebGLExtensionName;\r\n if (-1 === knownExtensions.indexOf(ext))\r\n continue;\r\n else if (undefined !== disabledExtensions && -1 !== disabledExtensions.indexOf(ext))\r\n continue;\r\n\r\n const extObj: any = gl.getExtension(ext); // This call enables the extension and returns a WebGLObject containing extension instance.\r\n if (null !== extObj)\r\n this._extensionMap[ext] = extObj;\r\n }\r\n }\r\n\r\n if (this._isWebGL2 && undefined !== gl2) {\r\n this._maxColorAttachments = gl.getParameter(gl2.MAX_COLOR_ATTACHMENTS);\r\n this._maxDrawBuffers = gl.getParameter(gl2.MAX_DRAW_BUFFERS);\r\n } else {\r\n const dbExt: WEBGL_draw_buffers | undefined = this.queryExtensionObject<WEBGL_draw_buffers>(\"WEBGL_draw_buffers\");\r\n this._maxColorAttachments = dbExt !== undefined ? gl.getParameter(dbExt.MAX_COLOR_ATTACHMENTS_WEBGL) : 1;\r\n this._maxDrawBuffers = dbExt !== undefined ? gl.getParameter(dbExt.MAX_DRAW_BUFFERS_WEBGL) : 1;\r\n }\r\n\r\n // Determine the maximum color-renderable attachment type.\r\n const allowFloatRender =\r\n (undefined === disabledExtensions || -1 === disabledExtensions.indexOf(\"OES_texture_float\"))\r\n // iOS>=15 allows full-float rendering. However, it does not actually work on non-M1 devices.\r\n // Because of this, for now we disallow full float rendering on iOS devices.\r\n // ###TODO: Re-assess this after future iOS updates.\r\n && !ProcessDetector.isIOSBrowser\r\n // Samsung Galaxy Note 8 exhibits same issue as described above for iOS >= 15.\r\n // It uses specifically Mali-G71 MP20 but reports its renderer as follows.\r\n // Samsung Galaxy A50 and S9 exhibits same issue; they use Mali-G72.\r\n // HUAWEI P30 exhibits same issue; it uses Mali-G76.\r\n && unmaskedRenderer !== \"Mali-G71\" && unmaskedRenderer !== \"Mali-G72\" && unmaskedRenderer !== \"Mali-G76\";\r\n\r\n if (allowFloatRender && undefined !== this.queryExtensionObject(\"EXT_float_blend\") && this.isTextureRenderable(gl, gl.FLOAT)) {\r\n this._maxRenderType = RenderType.TextureFloat;\r\n } else if (this.isWebGL2) {\r\n this._maxRenderType = (this.isTextureRenderable(gl, (gl as WebGL2RenderingContext).HALF_FLOAT)) ? RenderType.TextureHalfFloat : RenderType.TextureUnsignedByte;\r\n } else {\r\n const hfExt: OES_texture_half_float | undefined = this.queryExtensionObject<OES_texture_half_float>(\"OES_texture_half_float\");\r\n this._maxRenderType = (hfExt !== undefined && this.isTextureRenderable(gl, hfExt.HALF_FLOAT_OES)) ? RenderType.TextureHalfFloat : RenderType.TextureUnsignedByte;\r\n }\r\n\r\n // Determine the maximum depth attachment type.\r\n // this._maxDepthType = this.queryExtensionObject(\"WEBGL_depth_texture\") !== undefined ? DepthType.TextureUnsignedInt32 : DepthType.RenderBufferUnsignedShort16;\r\n this._maxDepthType = this._isWebGL2 || this.queryExtensionObject(\"WEBGL_depth_texture\") !== undefined ? DepthType.TextureUnsignedInt24Stencil8 : DepthType.RenderBufferUnsignedShort16;\r\n\r\n this._canRenderDepthWithoutColor = this._maxDepthType === DepthType.TextureUnsignedInt24Stencil8 ? this.isDepthRenderableWithoutColor(gl) : false;\r\n\r\n this._presentFeatures = this._gatherFeatures();\r\n const missingRequiredFeatures = this._findMissingFeatures(Capabilities.requiredFeatures);\r\n const missingOptionalFeatures = this._findMissingFeatures(Capabilities.optionalFeatures);\r\n\r\n return {\r\n status: this._getCompatibilityStatus(missingRequiredFeatures, missingOptionalFeatures),\r\n missingRequiredFeatures,\r\n missingOptionalFeatures,\r\n unmaskedRenderer,\r\n unmaskedVendor,\r\n usingIntegratedGraphics: isIntegratedGraphics({unmaskedVendor, unmaskedRenderer}),\r\n driverBugs: { ...this._driverBugs },\r\n userAgent: navigator.userAgent,\r\n createdContext: gl,\r\n };\r\n }\r\n\r\n public static create(gl: WebGLContext, disabledExtensions?: WebGLExtensionName[]): Capabilities | undefined {\r\n const caps = new Capabilities();\r\n const compatibility = caps.init(gl, disabledExtensions);\r\n if (WebGLRenderCompatibilityStatus.CannotCreateContext === compatibility.status || WebGLRenderCompatibilityStatus.MissingRequiredFeatures === compatibility.status)\r\n return undefined;\r\n return caps;\r\n }\r\n\r\n /** Determines if a particular texture type is color-renderable on the host system. */\r\n private isTextureRenderable(gl: WebGLContext, texType: number): boolean {\r\n const tex: WebGLTexture | null = gl.createTexture();\r\n gl.bindTexture(gl.TEXTURE_2D, tex);\r\n if (this.isWebGL2) {\r\n if (gl.FLOAT === texType)\r\n gl.texImage2D(gl.TEXTURE_2D, 0, (gl as WebGL2RenderingContext).RGBA32F, 1, 1, 0, gl.RGBA, texType, null);\r\n else\r\n gl.texImage2D(gl.TEXTURE_2D, 0, (gl as WebGL2RenderingContext).RGBA16F, 1, 1, 0, gl.RGBA, texType, null);\r\n } else\r\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, texType, null);\r\n\r\n const fb: WebGLFramebuffer | null = gl.createFramebuffer();\r\n gl.bindFramebuffer(gl.FRAMEBUFFER, fb);\r\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0);\r\n\r\n const fbStatus: number = gl.checkFramebufferStatus(gl.FRAMEBUFFER);\r\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\r\n gl.deleteFramebuffer(fb);\r\n gl.deleteTexture(tex);\r\n\r\n gl.getError(); // clear any errors\r\n\r\n return fbStatus === gl.FRAMEBUFFER_COMPLETE;\r\n }\r\n\r\n /** Determines if depth textures can be rendered without also having a color attachment bound on the host system. */\r\n private isDepthRenderableWithoutColor(gl: WebGLContext): boolean {\r\n const dtExt = this.queryExtensionObject<WEBGL_depth_texture>(\"WEBGL_depth_texture\");\r\n if (dtExt === undefined)\r\n return false;\r\n\r\n const tex: WebGLTexture | null = gl.createTexture();\r\n gl.bindTexture(gl.TEXTURE_2D, tex);\r\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.DEPTH_STENCIL, 1, 1, 0, gl.DEPTH_STENCIL, dtExt.UNSIGNED_INT_24_8_WEBGL, null);\r\n\r\n const fb: WebGLFramebuffer | null = gl.createFramebuffer();\r\n gl.bindFramebuffer(gl.FRAMEBUFFER, fb);\r\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.TEXTURE_2D, tex, 0);\r\n\r\n const fbStatus: number = gl.checkFramebufferStatus(gl.FRAMEBUFFER);\r\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\r\n gl.deleteFramebuffer(fb);\r\n gl.deleteTexture(tex);\r\n\r\n gl.getError(); // clear any errors\r\n\r\n return fbStatus === gl.FRAMEBUFFER_COMPLETE;\r\n }\r\n\r\n public setMaxAnisotropy(desiredMax: number | undefined, gl: WebGLContext): void {\r\n const ext = this.queryExtensionObject<EXT_texture_filter_anisotropic>(\"EXT_texture_filter_anisotropic\");\r\n if (undefined === ext)\r\n return;\r\n\r\n if (undefined === this._maxAnisotropy)\r\n this._maxAnisotropy = gl.getParameter(ext.MAX_TEXTURE_MAX_ANISOTROPY_EXT) as number;\r\n\r\n const max = (undefined !== desiredMax) ? Math.min(desiredMax, this._maxAnisotropy) : this._maxAnisotropy;\r\n gl.texParameterf(gl.TEXTURE_2D, ext.TEXTURE_MAX_ANISOTROPY_EXT, max);\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"Capabilities.js","sourceRoot":"","sources":["../../src/Capabilities.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAC6B,YAAY,EAAgC,8BAA8B,GAC7G,MAAM,uBAAuB,CAAC;AAS/B,MAAM,eAAe,GAAyB;IAC5C,oBAAoB;IACpB,wBAAwB;IACxB,mBAAmB;IACnB,0BAA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AAC,oBAAoB,CAAC;IAC9C,CAAC;IAEM,gBAAgB,CAAC,UAA8B,EAAE,EAAgB;QACtE,MAAM,GAAG,GAAG,IAAI,CAAC,oBAAoB,CAAiC,gCAAgC,CAAC,CAAC;QACxG,IAAI,SAAS,KAAK,GAAG;YACnB,OAAO;QAET,IAAI,SAAS,KAAK,IAAI,CAAC,cAAc;YACnC,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,8BAA8B,CAAW,CAAC;QAEtF,MAAM,GAAG,GAAG,CAAC,SAAS,KAAK,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC;QACzG,EAAE,CAAC,aAAa,CAAC,EAAE,CAAC,UAAU,EAAE,GAAG,CAAC,0BAA0B,EAAE,GAAG,CAAC,CAAC;IACvE,CAAC;;AArNsB,6BAAgB,GAAmB;IACxD,YAAY,CAAC,eAAe;IAC5B,YAAY,CAAC,OAAO;IACpB,YAAY,CAAC,YAAY;IACzB,YAAY,CAAC,cAAc;IAC3B,YAAY,CAAC,UAAU;IACvB,YAAY,CAAC,UAAU;IACvB,YAAY,CAAC,SAAS;IACtB,YAAY,CAAC,mBAAmB;IAChC,YAAY,CAAC,YAAY;CAC1B,CAAC;AACqB,6BAAgB,GAAmB;IACxD,YAAY,CAAC,gBAAgB;IAC7B,YAAY,CAAC,mBAAmB;CACjC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Compatibility\r\n */\r\n\r\nimport { ProcessDetector } from \"@itwin/core-bentley\";\r\nimport {\r\n GraphicsDriverBugs, WebGLContext, WebGLFeature, WebGLRenderCompatibilityInfo, WebGLRenderCompatibilityStatus,\r\n} from \"./RenderCompatibility\";\r\n\r\n/** @internal */\r\nexport type WebGLExtensionName =\r\n \"WEBGL_draw_buffers\" | \"OES_element_index_uint\" | \"OES_texture_float\" | \"OES_texture_float_linear\" |\r\n \"OES_texture_half_float\" | \"OES_texture_half_float_linear\" | \"EXT_texture_filter_anisotropic\" | \"WEBGL_depth_texture\" |\r\n \"EXT_color_buffer_float\" | \"EXT_shader_texture_lod\" | \"ANGLE_instanced_arrays\" | \"OES_vertex_array_object\" | \"WEBGL_lose_context\" |\r\n \"EXT_frag_depth\" | \"EXT_disjoint_timer_query\" | \"EXT_disjoint_timer_query_webgl2\" | \"OES_standard_derivatives\" | \"EXT_float_blend\";\r\n\r\nconst knownExtensions: WebGLExtensionName[] = [\r\n \"WEBGL_draw_buffers\",\r\n \"OES_element_index_uint\",\r\n \"OES_texture_float\",\r\n \"OES_texture_float_linear\",\r\n \"OES_texture_half_float\",\r\n \"OES_texture_half_float_linear\",\r\n \"EXT_texture_filter_anisotropic\",\r\n \"WEBGL_depth_texture\",\r\n \"EXT_color_buffer_float\",\r\n \"EXT_shader_texture_lod\",\r\n \"EXT_frag_depth\",\r\n \"ANGLE_instanced_arrays\",\r\n \"OES_vertex_array_object\",\r\n \"WEBGL_lose_context\",\r\n \"EXT_disjoint_timer_query\",\r\n \"EXT_disjoint_timer_query_webgl2\",\r\n \"OES_standard_derivatives\",\r\n \"EXT_float_blend\",\r\n];\r\n\r\n/** Describes the type of a render target. Used by Capabilities to represent maximum precision render target available on host system.\r\n * @internal\r\n */\r\nexport enum RenderType {\r\n TextureUnsignedByte,\r\n TextureHalfFloat,\r\n TextureFloat,\r\n}\r\n\r\n/**\r\n * Describes the type of a depth buffer. Used by Capabilities to represent maximum depth buffer precision available on host system.\r\n * Note: the commented-out values are unimplemented but left in place for reference, in case desired for future implementation.\r\n * @internal\r\n */\r\nexport enum DepthType {\r\n RenderBufferUnsignedShort16, // core to WebGL1\r\n // TextureUnsignedShort16, // core to WebGL2; available to WebGL1 via WEBGL_depth_texture\r\n // TextureUnsignedInt24, // core to WebGL2\r\n TextureUnsignedInt24Stencil8, // core to WebGL2; available to WebGL1 via WEBGL_depth_texture\r\n TextureUnsignedInt32, // core to WebGL2; available to WebGL1 via WEBGL_depth_texture\r\n // TextureFloat32, // core to WebGL2\r\n // TextureFloat32Stencil8, // core to WeBGL2\r\n}\r\n\r\nconst maxTexSizeAllowed = 4096; // many devices and browsers have issues with source textures larger than this\r\n\r\n// Regexes to match Intel UHD/HD 620/630 integrated GPUS that suffer from GraphicsDriverBugs.fragDepthDoesNotDisableEarlyZ.\r\nconst buggyIntelMatchers = [\r\n // Original unmasked renderer string when workaround we implemented.\r\n /ANGLE \\(Intel\\(R\\) (U)?HD Graphics 6(2|3)0 Direct3D11/,\r\n // New unmasked renderer string circa October 2021.\r\n /ANGLE \\(Intel, Intel\\(R\\) (U)?HD Graphics 6(2|3)0 Direct3D11/,\r\n];\r\n\r\n// Regexes to match Mali GPUs known to suffer from GraphicsDriverBugs.msaaWillHang.\r\nconst buggyMaliMatchers = [\r\n /Mali-G71/,\r\n /Mali-G72/,\r\n /Mali-G76/,\r\n];\r\n\r\n// Regexes to match as many Intel integrated GPUs as possible.\r\n// https://en.wikipedia.org/wiki/List_of_Intel_graphics_processing_units\r\nconst integratedIntelGpuMatchers = [\r\n /(U)?HD Graphics/,\r\n /Iris/,\r\n];\r\n\r\nfunction isIntegratedGraphics(args: {unmaskedVendor?: string, unmaskedRenderer?: string}): boolean {\r\n if (args.unmaskedRenderer && args.unmaskedRenderer.includes(\"Intel\") && integratedIntelGpuMatchers.some((x) => x.test(args.unmaskedRenderer!)))\r\n return true;\r\n\r\n // NB: For now, we do not attempt to detect AMD integrated graphics.\r\n // It appears that AMD integrated graphics are not usually paired with a graphics card so detecting integrated usage there is less important than Intel.\r\n\r\n return false;\r\n}\r\n\r\n/** Describes the rendering capabilities of the host system.\r\n * @internal\r\n */\r\nexport class Capabilities {\r\n private _maxRenderType: RenderType = RenderType.TextureUnsignedByte;\r\n private _maxDepthType: DepthType = DepthType.RenderBufferUnsignedShort16;\r\n private _maxTextureSize: number = 0;\r\n private _maxColorAttachments: number = 0;\r\n private _maxDrawBuffers: number = 0;\r\n private _maxFragTextureUnits: number = 0;\r\n private _maxVertTextureUnits: number = 0;\r\n private _maxVertAttribs: number = 0;\r\n private _maxVertUniformVectors: number = 0;\r\n private _maxVaryingVectors: number = 0;\r\n private _maxFragUniformVectors: number = 0;\r\n private _maxAnisotropy?: number;\r\n private _maxAntialiasSamples: number = 1;\r\n private _supportsCreateImageBitmap: boolean = false;\r\n private _maxTexSizeAllow: number = maxTexSizeAllowed;\r\n\r\n private _extensionMap: { [key: string]: any } = {}; // Use this map to store actual extension objects retrieved from GL.\r\n private _presentFeatures: WebGLFeature[] = []; // List of features the system can support (not necessarily dependent on extensions)\r\n\r\n private _isWebGL2: boolean = false;\r\n private _isMobile: boolean = false;\r\n private _driverBugs: GraphicsDriverBugs = {};\r\n\r\n public get maxRenderType(): RenderType { return this._maxRenderType; }\r\n public get maxDepthType(): DepthType { return this._maxDepthType; }\r\n public get maxTextureSize(): number { return this._maxTextureSize; }\r\n public get maxTexSizeAllow(): number { return this._maxTexSizeAllow; }\r\n public get supportsCreateImageBitmap(): boolean { return this._supportsCreateImageBitmap; }\r\n public get maxColorAttachments(): number { return this._maxColorAttachments; }\r\n public get maxDrawBuffers(): number { return this._maxDrawBuffers; }\r\n public get maxFragTextureUnits(): number { return this._maxFragTextureUnits; }\r\n public get maxVertTextureUnits(): number { return this._maxVertTextureUnits; }\r\n public get maxVertAttribs(): number { return this._maxVertAttribs; }\r\n public get maxVertUniformVectors(): number { return this._maxVertUniformVectors; }\r\n public get maxVaryingVectors(): number { return this._maxVaryingVectors; }\r\n public get maxFragUniformVectors(): number { return this._maxFragUniformVectors; }\r\n public get maxAntialiasSamples(): number { return this._maxAntialiasSamples; }\r\n public get isWebGL2(): boolean { return this._isWebGL2; }\r\n public get driverBugs(): GraphicsDriverBugs { return this._driverBugs; }\r\n\r\n /** These getters check for existence of extension objects to determine availability of features. In WebGL2, could just return true for some. */\r\n public get supportsNonPowerOf2Textures(): boolean { return false; }\r\n public get supportsDrawBuffers(): boolean { return this._isWebGL2 || this.queryExtensionObject<WEBGL_draw_buffers>(\"WEBGL_draw_buffers\") !== undefined; }\r\n public get supportsInstancing(): boolean { return this._isWebGL2 || this.queryExtensionObject<ANGLE_instanced_arrays>(\"ANGLE_instanced_arrays\") !== undefined; }\r\n public get supports32BitElementIndex(): boolean { return this._isWebGL2 || this.queryExtensionObject<OES_element_index_uint>(\"OES_element_index_uint\") !== undefined; }\r\n public get supportsTextureFloat(): boolean { return this._isWebGL2 || this.queryExtensionObject<OES_texture_float>(\"OES_texture_float\") !== undefined; }\r\n public get supportsTextureFloatLinear(): boolean { return this._isWebGL2 || this.queryExtensionObject<OES_texture_float_linear>(\"OES_texture_float_linear\") !== undefined; }\r\n public get supportsTextureHalfFloat(): boolean { return this._isWebGL2 || this.queryExtensionObject<OES_texture_half_float>(\"OES_texture_half_float\") !== undefined; }\r\n public get supportsTextureHalfFloatLinear(): boolean { return this._isWebGL2 || this.queryExtensionObject<OES_texture_half_float_linear>(\"OES_texture_half_float_linear\") !== undefined; }\r\n public get supportsTextureFilterAnisotropic(): boolean { return this.queryExtensionObject<EXT_texture_filter_anisotropic>(\"EXT_texture_filter_anisotropic\") !== undefined; }\r\n public get supportsShaderTextureLOD(): boolean { return this._isWebGL2 || this.queryExtensionObject<EXT_shader_texture_lod>(\"EXT_shader_texture_lod\") !== undefined; }\r\n public get supportsVertexArrayObjects(): boolean { return this._isWebGL2 || this.queryExtensionObject<OES_vertex_array_object>(\"OES_vertex_array_object\") !== undefined; }\r\n public get supportsFragDepth(): boolean { return this._isWebGL2 || this.queryExtensionObject<EXT_frag_depth>(\"EXT_frag_depth\") !== undefined; }\r\n public get supportsDisjointTimerQuery(): boolean { return (this._isWebGL2 && this.queryExtensionObject<any>(\"EXT_disjoint_timer_query_webgl2\") !== undefined) || this.queryExtensionObject<any>(\"EXT_disjoint_timer_query\") !== undefined; }\r\n public get supportsStandardDerivatives(): boolean { return this._isWebGL2 || this.queryExtensionObject<OES_standard_derivatives>(\"OES_standard_derivatives\") !== undefined; }\r\n\r\n public get supportsMRTTransparency(): boolean { return this.maxColorAttachments >= 2; }\r\n public get supportsMRTPickShaders(): boolean { return this.maxColorAttachments >= 3; }\r\n\r\n public get supportsShadowMaps(): boolean {\r\n return this.supportsTextureFloat || this.supportsTextureHalfFloat;\r\n }\r\n\r\n public get supportsAntiAliasing(): boolean { return this._isWebGL2 && this.maxAntialiasSamples > 1; }\r\n\r\n public get isMobile(): boolean { return this._isMobile; }\r\n\r\n private findExtension(name: WebGLExtensionName): any {\r\n const ext = this._extensionMap[name];\r\n return null !== ext ? ext : undefined;\r\n }\r\n\r\n /** Queries an extension object if available. This is necessary for other parts of the system to access some constants within extensions. */\r\n public queryExtensionObject<T>(ext: WebGLExtensionName): T | undefined {\r\n return this.findExtension(ext) as T;\r\n }\r\n\r\n public static readonly optionalFeatures: WebGLFeature[] = [\r\n WebGLFeature.MrtTransparency,\r\n WebGLFeature.MrtPick,\r\n WebGLFeature.DepthTexture,\r\n WebGLFeature.FloatRendering,\r\n WebGLFeature.Instancing,\r\n WebGLFeature.ShadowMaps,\r\n WebGLFeature.FragDepth,\r\n WebGLFeature.StandardDerivatives,\r\n WebGLFeature.AntiAliasing,\r\n ];\r\n public static readonly requiredFeatures: WebGLFeature[] = [\r\n WebGLFeature.UintElementIndex,\r\n WebGLFeature.MinimalTextureUnits,\r\n ];\r\n\r\n private get _hasRequiredTextureUnits(): boolean { return this.maxFragTextureUnits >= 4 && this.maxVertTextureUnits >= 5; }\r\n\r\n /** Return an array containing any features not supported by the system as compared to the input array. */\r\n private _findMissingFeatures(featuresToSeek: WebGLFeature[]): WebGLFeature[] {\r\n const missingFeatures: WebGLFeature[] = [];\r\n for (const featureName of featuresToSeek) {\r\n if (-1 === this._presentFeatures.indexOf(featureName))\r\n missingFeatures.push(featureName);\r\n }\r\n return missingFeatures;\r\n }\r\n\r\n /** Populate and return an array containing features that this system supports. */\r\n private _gatherFeatures(): WebGLFeature[] {\r\n const features: WebGLFeature[] = [];\r\n\r\n // simply check for presence of various extensions if that gives enough information\r\n if (this._isWebGL2 || this._extensionMap[\"OES_element_index_uint\" as WebGLExtensionName] !== undefined)\r\n features.push(WebGLFeature.UintElementIndex);\r\n if (this._isWebGL2 || this._extensionMap[\"ANGLE_instanced_arrays\" as WebGLExtensionName] !== undefined)\r\n features.push(WebGLFeature.Instancing);\r\n\r\n if (this.supportsMRTTransparency)\r\n features.push(WebGLFeature.MrtTransparency);\r\n if (this.supportsMRTPickShaders)\r\n features.push(WebGLFeature.MrtPick);\r\n if (this.supportsShadowMaps)\r\n features.push(WebGLFeature.ShadowMaps);\r\n if (this._hasRequiredTextureUnits)\r\n features.push(WebGLFeature.MinimalTextureUnits);\r\n if (this.supportsFragDepth)\r\n features.push(WebGLFeature.FragDepth);\r\n if (this.supportsStandardDerivatives)\r\n features.push(WebGLFeature.StandardDerivatives);\r\n if (this.supportsAntiAliasing)\r\n features.push(WebGLFeature.AntiAliasing);\r\n\r\n if (DepthType.TextureUnsignedInt24Stencil8 === this._maxDepthType)\r\n features.push(WebGLFeature.DepthTexture);\r\n\r\n // check if at least half-float rendering is available based on maximum discovered renderable target\r\n if (RenderType.TextureUnsignedByte !== this._maxRenderType)\r\n features.push(WebGLFeature.FloatRendering);\r\n\r\n return features;\r\n }\r\n\r\n /** Retrieve compatibility status based on presence of various features. */\r\n private _getCompatibilityStatus(missingRequiredFeatures: WebGLFeature[], missingOptionalFeatures: WebGLFeature[]): WebGLRenderCompatibilityStatus {\r\n let status: WebGLRenderCompatibilityStatus = WebGLRenderCompatibilityStatus.AllOkay;\r\n if (missingOptionalFeatures.length > 0)\r\n status = WebGLRenderCompatibilityStatus.MissingOptionalFeatures;\r\n if (missingRequiredFeatures.length > 0)\r\n status = WebGLRenderCompatibilityStatus.MissingRequiredFeatures;\r\n return status;\r\n }\r\n\r\n /** Initializes the capabilities based on a GL context. Must be called first. */\r\n public init(gl: WebGLContext, disabledExtensions?: WebGLExtensionName[]): WebGLRenderCompatibilityInfo {\r\n const gl2 = !(gl instanceof WebGLRenderingContext) ? gl : undefined;\r\n this._isWebGL2 = undefined !== gl2;\r\n\r\n this._isMobile = ProcessDetector.isMobileBrowser;\r\n\r\n const debugInfo = gl.getExtension(\"WEBGL_debug_renderer_info\");\r\n const unmaskedRenderer = debugInfo !== null ? gl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL) : undefined;\r\n const unmaskedVendor = debugInfo !== null ? gl.getParameter(debugInfo.UNMASKED_VENDOR_WEBGL) : undefined;\r\n\r\n this._driverBugs = {};\r\n if (unmaskedRenderer && buggyIntelMatchers.some((x) => x.test(unmaskedRenderer)))\r\n this._driverBugs.fragDepthDoesNotDisableEarlyZ = true;\r\n\r\n if (unmaskedRenderer && buggyMaliMatchers.some((x) => x.test(unmaskedRenderer)))\r\n this._driverBugs.msaaWillHang = true;\r\n\r\n this._maxTextureSize = gl.getParameter(gl.MAX_TEXTURE_SIZE);\r\n this._supportsCreateImageBitmap = typeof createImageBitmap === \"function\" && ProcessDetector.isChromium && !ProcessDetector.isIOSBrowser;\r\n this._maxTexSizeAllow = Math.min(this._maxTextureSize, maxTexSizeAllowed);\r\n this._maxFragTextureUnits = gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS);\r\n this._maxVertTextureUnits = gl.getParameter(gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS);\r\n this._maxVertAttribs = gl.getParameter(gl.MAX_VERTEX_ATTRIBS);\r\n this._maxVertUniformVectors = gl.getParameter(gl.MAX_VERTEX_UNIFORM_VECTORS);\r\n this._maxVaryingVectors = gl.getParameter(gl.MAX_VARYING_VECTORS);\r\n this._maxFragUniformVectors = gl.getParameter(gl.MAX_FRAGMENT_UNIFORM_VECTORS);\r\n this._maxAntialiasSamples = this._driverBugs.msaaWillHang ? 1 : (this._isWebGL2 && undefined !== gl2 ? gl.getParameter(gl2.MAX_SAMPLES) : 1);\r\n\r\n const extensions = gl.getSupportedExtensions(); // This just retrieves a list of available extensions (not necessarily enabled).\r\n if (extensions) {\r\n for (const extStr of extensions) {\r\n const ext = extStr as WebGLExtensionName;\r\n if (-1 === knownExtensions.indexOf(ext))\r\n continue;\r\n else if (undefined !== disabledExtensions && -1 !== disabledExtensions.indexOf(ext))\r\n continue;\r\n\r\n const extObj: any = gl.getExtension(ext); // This call enables the extension and returns a WebGLObject containing extension instance.\r\n if (null !== extObj)\r\n this._extensionMap[ext] = extObj;\r\n }\r\n }\r\n\r\n if (this._isWebGL2 && undefined !== gl2) {\r\n this._maxColorAttachments = gl.getParameter(gl2.MAX_COLOR_ATTACHMENTS);\r\n this._maxDrawBuffers = gl.getParameter(gl2.MAX_DRAW_BUFFERS);\r\n } else {\r\n const dbExt: WEBGL_draw_buffers | undefined = this.queryExtensionObject<WEBGL_draw_buffers>(\"WEBGL_draw_buffers\");\r\n this._maxColorAttachments = dbExt !== undefined ? gl.getParameter(dbExt.MAX_COLOR_ATTACHMENTS_WEBGL) : 1;\r\n this._maxDrawBuffers = dbExt !== undefined ? gl.getParameter(dbExt.MAX_DRAW_BUFFERS_WEBGL) : 1;\r\n }\r\n\r\n // Determine the maximum color-renderable attachment type.\r\n const allowFloatRender =\r\n (undefined === disabledExtensions || -1 === disabledExtensions.indexOf(\"OES_texture_float\"))\r\n // iOS>=15 allows full-float rendering. However, it does not actually work on non-M1 devices.\r\n // Because of this, for now we disallow full float rendering on iOS devices.\r\n // ###TODO: Re-assess this after future iOS updates.\r\n && !ProcessDetector.isIOSBrowser\r\n // Samsung Galaxy Note 8 exhibits same issue as described above for iOS >= 15.\r\n // It uses specifically Mali-G71 MP20 but reports its renderer as follows.\r\n // Samsung Galaxy A50 and S9 exhibits same issue; they use Mali-G72.\r\n // HUAWEI P30 exhibits same issue; it uses Mali-G76.\r\n && unmaskedRenderer !== \"Mali-G71\" && unmaskedRenderer !== \"Mali-G72\" && unmaskedRenderer !== \"Mali-G76\";\r\n\r\n if (allowFloatRender && undefined !== this.queryExtensionObject(\"EXT_float_blend\") && this.isTextureRenderable(gl, gl.FLOAT)) {\r\n this._maxRenderType = RenderType.TextureFloat;\r\n } else if (this.isWebGL2) {\r\n this._maxRenderType = (this.isTextureRenderable(gl, (gl as WebGL2RenderingContext).HALF_FLOAT)) ? RenderType.TextureHalfFloat : RenderType.TextureUnsignedByte;\r\n } else {\r\n const hfExt: OES_texture_half_float | undefined = this.queryExtensionObject<OES_texture_half_float>(\"OES_texture_half_float\");\r\n this._maxRenderType = (hfExt !== undefined && this.isTextureRenderable(gl, hfExt.HALF_FLOAT_OES)) ? RenderType.TextureHalfFloat : RenderType.TextureUnsignedByte;\r\n }\r\n\r\n // Determine the maximum depth attachment type.\r\n // this._maxDepthType = this.queryExtensionObject(\"WEBGL_depth_texture\") !== undefined ? DepthType.TextureUnsignedInt32 : DepthType.RenderBufferUnsignedShort16;\r\n this._maxDepthType = this._isWebGL2 || this.queryExtensionObject(\"WEBGL_depth_texture\") !== undefined ? DepthType.TextureUnsignedInt24Stencil8 : DepthType.RenderBufferUnsignedShort16;\r\n\r\n this._presentFeatures = this._gatherFeatures();\r\n const missingRequiredFeatures = this._findMissingFeatures(Capabilities.requiredFeatures);\r\n const missingOptionalFeatures = this._findMissingFeatures(Capabilities.optionalFeatures);\r\n\r\n return {\r\n status: this._getCompatibilityStatus(missingRequiredFeatures, missingOptionalFeatures),\r\n missingRequiredFeatures,\r\n missingOptionalFeatures,\r\n unmaskedRenderer,\r\n unmaskedVendor,\r\n usingIntegratedGraphics: isIntegratedGraphics({unmaskedVendor, unmaskedRenderer}),\r\n driverBugs: { ...this._driverBugs },\r\n userAgent: navigator.userAgent,\r\n createdContext: gl,\r\n };\r\n }\r\n\r\n public static create(gl: WebGLContext, disabledExtensions?: WebGLExtensionName[]): Capabilities | undefined {\r\n const caps = new Capabilities();\r\n const compatibility = caps.init(gl, disabledExtensions);\r\n if (WebGLRenderCompatibilityStatus.CannotCreateContext === compatibility.status || WebGLRenderCompatibilityStatus.MissingRequiredFeatures === compatibility.status)\r\n return undefined;\r\n return caps;\r\n }\r\n\r\n /** Determines if a particular texture type is color-renderable on the host system. */\r\n private isTextureRenderable(gl: WebGLContext, texType: number): boolean {\r\n const tex: WebGLTexture | null = gl.createTexture();\r\n gl.bindTexture(gl.TEXTURE_2D, tex);\r\n if (this.isWebGL2) {\r\n if (gl.FLOAT === texType)\r\n gl.texImage2D(gl.TEXTURE_2D, 0, (gl as WebGL2RenderingContext).RGBA32F, 1, 1, 0, gl.RGBA, texType, null);\r\n else\r\n gl.texImage2D(gl.TEXTURE_2D, 0, (gl as WebGL2RenderingContext).RGBA16F, 1, 1, 0, gl.RGBA, texType, null);\r\n } else\r\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, texType, null);\r\n\r\n const fb: WebGLFramebuffer | null = gl.createFramebuffer();\r\n gl.bindFramebuffer(gl.FRAMEBUFFER, fb);\r\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0);\r\n\r\n const fbStatus: number = gl.checkFramebufferStatus(gl.FRAMEBUFFER);\r\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\r\n gl.deleteFramebuffer(fb);\r\n gl.deleteTexture(tex);\r\n\r\n gl.getError(); // clear any errors\r\n\r\n return fbStatus === gl.FRAMEBUFFER_COMPLETE;\r\n }\r\n\r\n public setMaxAnisotropy(desiredMax: number | undefined, gl: WebGLContext): void {\r\n const ext = this.queryExtensionObject<EXT_texture_filter_anisotropic>(\"EXT_texture_filter_anisotropic\");\r\n if (undefined === ext)\r\n return;\r\n\r\n if (undefined === this._maxAnisotropy)\r\n this._maxAnisotropy = gl.getParameter(ext.MAX_TEXTURE_MAX_ANISOTROPY_EXT) as number;\r\n\r\n const max = (undefined !== desiredMax) ? Math.min(desiredMax, this._maxAnisotropy) : this._maxAnisotropy;\r\n gl.texParameterf(gl.TEXTURE_2D, ext.TEXTURE_MAX_ANISOTROPY_EXT, max);\r\n }\r\n}\r\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/webgl-compatibility",
|
|
3
|
-
"version": "4.0.0-dev.
|
|
3
|
+
"version": "4.0.0-dev.7",
|
|
4
4
|
"description": "APIs for determining the level of compatibility of a browser+device with the iTwin.js rendering system.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "lib/cjs/webgl-compatibility.js",
|
|
@@ -23,12 +23,12 @@
|
|
|
23
23
|
"url": "http://www.bentley.com"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@itwin/core-bentley": "4.0.0-dev.
|
|
26
|
+
"@itwin/core-bentley": "4.0.0-dev.7"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@itwin/build-tools": "4.0.0-dev.
|
|
30
|
-
"@itwin/certa": "4.0.0-dev.
|
|
31
|
-
"@itwin/eslint-plugin": "4.0.0-dev.
|
|
29
|
+
"@itwin/build-tools": "4.0.0-dev.7",
|
|
30
|
+
"@itwin/certa": "4.0.0-dev.7",
|
|
31
|
+
"@itwin/eslint-plugin": "4.0.0-dev.7",
|
|
32
32
|
"@types/chai": "4.3.1",
|
|
33
33
|
"@types/mocha": "^8.2.2",
|
|
34
34
|
"@types/node": "18.11.5",
|