@itwin/webgl-compatibility 3.0.0-extension.0 → 3.1.0-dev.11
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/CHANGELOG.md +78 -1
- package/LICENSE.md +1 -1
- package/lib/cjs/Capabilities.d.ts.map +1 -1
- package/lib/cjs/Capabilities.js +8 -1
- package/lib/cjs/Capabilities.js.map +1 -1
- package/lib/cjs/webgl-compatibility.d.ts +2 -2
- package/lib/cjs/webgl-compatibility.js +2 -2
- package/lib/cjs/webgl-compatibility.js.map +1 -1
- package/lib/esm/Capabilities.d.ts.map +1 -1
- package/lib/esm/Capabilities.js +8 -1
- package/lib/esm/Capabilities.js.map +1 -1
- package/lib/esm/webgl-compatibility.d.ts +2 -2
- package/lib/esm/webgl-compatibility.js +2 -2
- package/lib/esm/webgl-compatibility.js.map +1 -1
- package/package.json +10 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,83 @@
|
|
|
1
1
|
# Change Log - @itwin/webgl-compatibility
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Wed, 12 Jan 2022 14:52:38 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 2.19.28
|
|
6
|
+
Wed, 12 Jan 2022 14:52:38 GMT
|
|
7
|
+
|
|
8
|
+
_Version update only_
|
|
9
|
+
|
|
10
|
+
## 2.19.27
|
|
11
|
+
Wed, 05 Jan 2022 20:07:20 GMT
|
|
12
|
+
|
|
13
|
+
_Version update only_
|
|
14
|
+
|
|
15
|
+
## 2.19.26
|
|
16
|
+
Wed, 08 Dec 2021 20:54:53 GMT
|
|
17
|
+
|
|
18
|
+
_Version update only_
|
|
19
|
+
|
|
20
|
+
## 2.19.25
|
|
21
|
+
Fri, 03 Dec 2021 20:05:49 GMT
|
|
22
|
+
|
|
23
|
+
_Version update only_
|
|
24
|
+
|
|
25
|
+
## 2.19.24
|
|
26
|
+
Mon, 29 Nov 2021 18:44:31 GMT
|
|
27
|
+
|
|
28
|
+
_Version update only_
|
|
29
|
+
|
|
30
|
+
## 2.19.23
|
|
31
|
+
Mon, 22 Nov 2021 20:41:40 GMT
|
|
32
|
+
|
|
33
|
+
_Version update only_
|
|
34
|
+
|
|
35
|
+
## 2.19.22
|
|
36
|
+
Wed, 17 Nov 2021 01:23:26 GMT
|
|
37
|
+
|
|
38
|
+
_Version update only_
|
|
39
|
+
|
|
40
|
+
## 2.19.21
|
|
41
|
+
Wed, 10 Nov 2021 10:58:24 GMT
|
|
42
|
+
|
|
43
|
+
### Updates
|
|
44
|
+
|
|
45
|
+
- Update work-around for Intel driver bug.
|
|
46
|
+
|
|
47
|
+
## 2.19.20
|
|
48
|
+
Fri, 29 Oct 2021 16:14:22 GMT
|
|
49
|
+
|
|
50
|
+
_Version update only_
|
|
51
|
+
|
|
52
|
+
## 2.19.19
|
|
53
|
+
Mon, 25 Oct 2021 16:16:25 GMT
|
|
54
|
+
|
|
55
|
+
_Version update only_
|
|
56
|
+
|
|
57
|
+
## 2.19.18
|
|
58
|
+
Thu, 21 Oct 2021 20:59:44 GMT
|
|
59
|
+
|
|
60
|
+
_Version update only_
|
|
61
|
+
|
|
62
|
+
## 2.19.17
|
|
63
|
+
Thu, 14 Oct 2021 21:19:43 GMT
|
|
64
|
+
|
|
65
|
+
_Version update only_
|
|
66
|
+
|
|
67
|
+
## 2.19.16
|
|
68
|
+
Mon, 11 Oct 2021 17:37:46 GMT
|
|
69
|
+
|
|
70
|
+
_Version update only_
|
|
71
|
+
|
|
72
|
+
## 2.19.15
|
|
73
|
+
Fri, 08 Oct 2021 16:44:23 GMT
|
|
74
|
+
|
|
75
|
+
_Version update only_
|
|
76
|
+
|
|
77
|
+
## 2.19.14
|
|
78
|
+
Fri, 01 Oct 2021 13:07:03 GMT
|
|
79
|
+
|
|
80
|
+
_Version update only_
|
|
4
81
|
|
|
5
82
|
## 2.19.13
|
|
6
83
|
Tue, 21 Sep 2021 21:06:40 GMT
|
package/LICENSE.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# MIT License
|
|
2
2
|
|
|
3
|
-
Copyright © 2017-
|
|
3
|
+
Copyright © 2017-2022 Bentley Systems, Incorporated. All rights reserved.
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
6
|
|
|
@@ -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;
|
|
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,uBAAu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AAO,CAA0C;IACvF,IAAW,sBAAsB,IAAI,OAAO,CAA0C;IAEtF,IAAW,0BAA0B,IAAI,OAAO,CAA6C;IAE7F,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;WAoFxF,MAAM,CAAC,EAAE,EAAE,YAAY,EAAE,kBAAkB,CAAC,EAAE,kBAAkB,EAAE,GAAG,YAAY,GAAG,SAAS;IAQ3G,sFAAsF;IACtF,OAAO,CAAC,mBAAmB;IAyB3B,oHAAoH;IACpH,OAAO,CAAC,6BAA6B;IAuB9B,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,EAAE,EAAE,EAAE,YAAY,GAAG,IAAI;CAWhF"}
|
package/lib/cjs/Capabilities.js
CHANGED
|
@@ -55,6 +55,13 @@ var DepthType;
|
|
|
55
55
|
// TextureFloat32Stencil8, // core to WeBGL2
|
|
56
56
|
})(DepthType = exports.DepthType || (exports.DepthType = {}));
|
|
57
57
|
const maxTexSizeAllowed = 4096; // many devices and browsers have issues with source textures larger than this
|
|
58
|
+
// Regexes to match Intel UHD/HD 620/630 integrated GPUS that suffer from GraphicsDriverBugs.fragDepthDoesNotDisableEarlyZ.
|
|
59
|
+
const buggyIntelMatchers = [
|
|
60
|
+
// Original unmasked renderer string when workaround we implemented.
|
|
61
|
+
/ANGLE \(Intel\(R\) (U)?HD Graphics 6(2|3)0 Direct3D11/,
|
|
62
|
+
// New unmasked renderer string circa October 2021.
|
|
63
|
+
/ANGLE \(Intel, Intel\(R\) (U)?HD Graphics 6(2|3)0 Direct3D11/,
|
|
64
|
+
];
|
|
58
65
|
/** Describes the rendering capabilities of the host system.
|
|
59
66
|
* @internal
|
|
60
67
|
*/
|
|
@@ -238,7 +245,7 @@ class Capabilities {
|
|
|
238
245
|
const unmaskedRenderer = debugInfo !== null ? gl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL) : undefined;
|
|
239
246
|
const unmaskedVendor = debugInfo !== null ? gl.getParameter(debugInfo.UNMASKED_VENDOR_WEBGL) : undefined;
|
|
240
247
|
this._driverBugs = {};
|
|
241
|
-
if (
|
|
248
|
+
if (unmaskedRenderer && buggyIntelMatchers.some((x) => x.test(unmaskedRenderer)))
|
|
242
249
|
this._driverBugs.fragDepthDoesNotDisableEarlyZ = true;
|
|
243
250
|
return {
|
|
244
251
|
status: this._getCompatibilityStatus(missingRequiredFeatures, missingOptionalFeatures),
|
|
@@ -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,0BAA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AQ,EAAE,CAAC,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;;AAnTH,oCAoTC;AAnOwB,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/** 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 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._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 // Note: iOS>=15 allows full-float rendering. However, it does not actually work on non-M1 devices. 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 const allowFloatRender = (undefined === disabledExtensions || -1 === disabledExtensions.indexOf(\"OES_texture_float\")) && !ProcessDetector.isIOSBrowser;\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 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 (undefined !== unmaskedRenderer && /ANGLE \\(Intel\\(R\\) (U)?HD Graphics 6(2|3)0 Direct3D11/.test(unmaskedRenderer))\r\n this._driverBugs.fragDepthDoesNotDisableEarlyZ = true;\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 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;;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ACpB,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/** 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 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._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 // Note: iOS>=15 allows full-float rendering. However, it does not actually work on non-M1 devices. 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 const allowFloatRender = (undefined === disabledExtensions || -1 === disabledExtensions.indexOf(\"OES_texture_float\")) && !ProcessDetector.isIOSBrowser;\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 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 return {\r\n status: this._getCompatibilityStatus(missingRequiredFeatures, missingOptionalFeatures),\r\n missingRequiredFeatures,\r\n missingOptionalFeatures,\r\n unmaskedRenderer,\r\n unmaskedVendor,\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,10 +1,10 @@
|
|
|
1
1
|
export * from "./Capabilities";
|
|
2
2
|
export * from "./RenderCompatibility";
|
|
3
3
|
/** @docs-package-description
|
|
4
|
-
* The webgl-compatibility package provides APIs for determining the level of compatibility of a browser+device with the
|
|
4
|
+
* The webgl-compatibility package provides APIs for determining the level of compatibility of a browser+device with the iTwin.js rendering system.
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
7
7
|
* @docs-group-description Compatibility
|
|
8
|
-
* APIs for evaluating compatibility with the
|
|
8
|
+
* APIs for evaluating compatibility with the iTwin.js rendering system.
|
|
9
9
|
*/
|
|
10
10
|
//# sourceMappingURL=webgl-compatibility.d.ts.map
|
|
@@ -17,10 +17,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./Capabilities"), exports);
|
|
18
18
|
__exportStar(require("./RenderCompatibility"), exports);
|
|
19
19
|
/** @docs-package-description
|
|
20
|
-
* The webgl-compatibility package provides APIs for determining the level of compatibility of a browser+device with the
|
|
20
|
+
* The webgl-compatibility package provides APIs for determining the level of compatibility of a browser+device with the iTwin.js rendering system.
|
|
21
21
|
*/
|
|
22
22
|
/**
|
|
23
23
|
* @docs-group-description Compatibility
|
|
24
|
-
* APIs for evaluating compatibility with the
|
|
24
|
+
* APIs for evaluating compatibility with the iTwin.js rendering system.
|
|
25
25
|
*/
|
|
26
26
|
//# sourceMappingURL=webgl-compatibility.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webgl-compatibility.js","sourceRoot":"","sources":["../../src/webgl-compatibility.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,iDAA+B;AAC/B,wDAAsC;AAEtC;;GAEG;AAEH;;;GAGG","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\nexport * from \"./Capabilities\";\r\nexport * from \"./RenderCompatibility\";\r\n\r\n/** @docs-package-description\r\n * The webgl-compatibility package provides APIs for determining the level of compatibility of a browser+device with the
|
|
1
|
+
{"version":3,"file":"webgl-compatibility.js","sourceRoot":"","sources":["../../src/webgl-compatibility.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,iDAA+B;AAC/B,wDAAsC;AAEtC;;GAEG;AAEH;;;GAGG","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\nexport * from \"./Capabilities\";\r\nexport * from \"./RenderCompatibility\";\r\n\r\n/** @docs-package-description\r\n * The webgl-compatibility package provides APIs for determining the level of compatibility of a browser+device with the iTwin.js rendering system.\r\n */\r\n\r\n/**\r\n * @docs-group-description Compatibility\r\n * APIs for evaluating compatibility with the iTwin.js rendering system.\r\n */\r\n"]}
|
|
@@ -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;
|
|
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,CA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,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;WAoFxF,MAAM,CAAC,EAAE,EAAE,YAAY,EAAE,kBAAkB,CAAC,EAAE,kBAAkB,EAAE,GAAG,YAAY,GAAG,SAAS;IAQ3G,sFAAsF;IACtF,OAAO,CAAC,mBAAmB;IAyB3B,oHAAoH;IACpH,OAAO,CAAC,6BAA6B;IAuB9B,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,EAAE,EAAE,EAAE,YAAY,GAAG,IAAI;CAWhF"}
|
package/lib/esm/Capabilities.js
CHANGED
|
@@ -52,6 +52,13 @@ export var DepthType;
|
|
|
52
52
|
// TextureFloat32Stencil8, // core to WeBGL2
|
|
53
53
|
})(DepthType || (DepthType = {}));
|
|
54
54
|
const maxTexSizeAllowed = 4096; // many devices and browsers have issues with source textures larger than this
|
|
55
|
+
// Regexes to match Intel UHD/HD 620/630 integrated GPUS that suffer from GraphicsDriverBugs.fragDepthDoesNotDisableEarlyZ.
|
|
56
|
+
const buggyIntelMatchers = [
|
|
57
|
+
// Original unmasked renderer string when workaround we implemented.
|
|
58
|
+
/ANGLE \(Intel\(R\) (U)?HD Graphics 6(2|3)0 Direct3D11/,
|
|
59
|
+
// New unmasked renderer string circa October 2021.
|
|
60
|
+
/ANGLE \(Intel, Intel\(R\) (U)?HD Graphics 6(2|3)0 Direct3D11/,
|
|
61
|
+
];
|
|
55
62
|
/** Describes the rendering capabilities of the host system.
|
|
56
63
|
* @internal
|
|
57
64
|
*/
|
|
@@ -235,7 +242,7 @@ export class Capabilities {
|
|
|
235
242
|
const unmaskedRenderer = debugInfo !== null ? gl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL) : undefined;
|
|
236
243
|
const unmaskedVendor = debugInfo !== null ? gl.getParameter(debugInfo.UNMASKED_VENDOR_WEBGL) : undefined;
|
|
237
244
|
this._driverBugs = {};
|
|
238
|
-
if (
|
|
245
|
+
if (unmaskedRenderer && buggyIntelMatchers.some((x) => x.test(unmaskedRenderer)))
|
|
239
246
|
this._driverBugs.fragDepthDoesNotDisableEarlyZ = true;
|
|
240
247
|
return {
|
|
241
248
|
status: this._getCompatibilityStatus(missingRequiredFeatures, missingOptionalFeatures),
|
|
@@ -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,mEAAgB,CAAA;IAChB,2DAAY,CAAA;AACd,CAAC,EAJW,UAAU,KAAV,UAAU,QAIrB;AAED;;;;GAIG;AACH,MAAM,CAAN,IAAY,SA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;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;;AAlOsB,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/** 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 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._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 // Note: iOS>=15 allows full-float rendering. However, it does not actually work on non-M1 devices. 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 const allowFloatRender = (undefined === disabledExtensions || -1 === disabledExtensions.indexOf(\"OES_texture_float\")) && !ProcessDetector.isIOSBrowser;\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 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 (undefined !== unmaskedRenderer && /ANGLE \\(Intel\\(R\\) (U)?HD Graphics 6(2|3)0 Direct3D11/.test(unmaskedRenderer))\r\n this._driverBugs.fragDepthDoesNotDisableEarlyZ = true;\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 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,0BAA0B;IAC1B,wBAAwB;IACxB,+BAA+B;IAC/B,gCAAgC;IAChC,qBAAqB;IACrB,wB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AAgB;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/** 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 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._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 // Note: iOS>=15 allows full-float rendering. However, it does not actually work on non-M1 devices. 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 const allowFloatRender = (undefined === disabledExtensions || -1 === disabledExtensions.indexOf(\"OES_texture_float\")) && !ProcessDetector.isIOSBrowser;\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 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 return {\r\n status: this._getCompatibilityStatus(missingRequiredFeatures, missingOptionalFeatures),\r\n missingRequiredFeatures,\r\n missingOptionalFeatures,\r\n unmaskedRenderer,\r\n unmaskedVendor,\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,10 +1,10 @@
|
|
|
1
1
|
export * from "./Capabilities";
|
|
2
2
|
export * from "./RenderCompatibility";
|
|
3
3
|
/** @docs-package-description
|
|
4
|
-
* The webgl-compatibility package provides APIs for determining the level of compatibility of a browser+device with the
|
|
4
|
+
* The webgl-compatibility package provides APIs for determining the level of compatibility of a browser+device with the iTwin.js rendering system.
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
7
7
|
* @docs-group-description Compatibility
|
|
8
|
-
* APIs for evaluating compatibility with the
|
|
8
|
+
* APIs for evaluating compatibility with the iTwin.js rendering system.
|
|
9
9
|
*/
|
|
10
10
|
//# sourceMappingURL=webgl-compatibility.d.ts.map
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
export * from "./Capabilities";
|
|
6
6
|
export * from "./RenderCompatibility";
|
|
7
7
|
/** @docs-package-description
|
|
8
|
-
* The webgl-compatibility package provides APIs for determining the level of compatibility of a browser+device with the
|
|
8
|
+
* The webgl-compatibility package provides APIs for determining the level of compatibility of a browser+device with the iTwin.js rendering system.
|
|
9
9
|
*/
|
|
10
10
|
/**
|
|
11
11
|
* @docs-group-description Compatibility
|
|
12
|
-
* APIs for evaluating compatibility with the
|
|
12
|
+
* APIs for evaluating compatibility with the iTwin.js rendering system.
|
|
13
13
|
*/
|
|
14
14
|
//# sourceMappingURL=webgl-compatibility.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webgl-compatibility.js","sourceRoot":"","sources":["../../src/webgl-compatibility.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AAEtC;;GAEG;AAEH;;;GAGG","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\nexport * from \"./Capabilities\";\r\nexport * from \"./RenderCompatibility\";\r\n\r\n/** @docs-package-description\r\n * The webgl-compatibility package provides APIs for determining the level of compatibility of a browser+device with the
|
|
1
|
+
{"version":3,"file":"webgl-compatibility.js","sourceRoot":"","sources":["../../src/webgl-compatibility.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AAEtC;;GAEG;AAEH;;;GAGG","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\nexport * from \"./Capabilities\";\r\nexport * from \"./RenderCompatibility\";\r\n\r\n/** @docs-package-description\r\n * The webgl-compatibility package provides APIs for determining the level of compatibility of a browser+device with the iTwin.js rendering system.\r\n */\r\n\r\n/**\r\n * @docs-group-description Compatibility\r\n * APIs for evaluating compatibility with the iTwin.js rendering system.\r\n */\r\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/webgl-compatibility",
|
|
3
|
-
"version": "3.
|
|
4
|
-
"description": "APIs for determining the level of compatibility of a browser+device with the
|
|
3
|
+
"version": "3.1.0-dev.11",
|
|
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",
|
|
7
7
|
"module": "lib/esm/webgl-compatibility.js",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"imodeljsSharedLibrary": true,
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
12
|
-
"url": "https://github.com/
|
|
12
|
+
"url": "https://github.com/iTwin/itwinjs-core/tree/master/core/webgl-compatibility"
|
|
13
13
|
},
|
|
14
14
|
"keywords": [
|
|
15
15
|
"Bentley",
|
|
@@ -23,14 +23,13 @@
|
|
|
23
23
|
"name": "Bentley Systems, Inc.",
|
|
24
24
|
"url": "http://www.bentley.com"
|
|
25
25
|
},
|
|
26
|
-
"
|
|
27
|
-
"@itwin/core-bentley": "
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"@itwin/core-bentley": "3.1.0-dev.11"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@itwin/
|
|
31
|
-
"@itwin/
|
|
32
|
-
"@itwin/
|
|
33
|
-
"@itwin/eslint-plugin": "3.0.0-extension.0",
|
|
30
|
+
"@itwin/build-tools": "3.1.0-dev.11",
|
|
31
|
+
"@itwin/certa": "3.1.0-dev.11",
|
|
32
|
+
"@itwin/eslint-plugin": "3.1.0-dev.11",
|
|
34
33
|
"@types/chai": "^4.1.4",
|
|
35
34
|
"@types/mocha": "^8.2.2",
|
|
36
35
|
"@types/node": "14.14.31",
|
|
@@ -61,5 +60,6 @@
|
|
|
61
60
|
"lint": "eslint -f visualstudio \"./src/**/*.ts\" 1>&2",
|
|
62
61
|
"test": "npm run -s webpackTests && certa -r chrome",
|
|
63
62
|
"webpackTests": "webpack --config ./src/test/utils/webpack.config.js 1>&2"
|
|
64
|
-
}
|
|
63
|
+
},
|
|
64
|
+
"readme": "# @itwin/webgl-compatibility\r\n\r\nCopyright © Bentley Systems, Incorporated. All rights reserved. See LICENSE.md for license terms and full copyright notice.\r\n\r\n## Description\r\n\r\nThe __@itwin/webgl-compatibility__ package provides APIs for determining the level of compatibility of a browser+device with the iTwin.js rendering system.\r\n\r\n## Documentation\r\n\r\nSee the [iTwin.js](https://www.itwinjs.org) documentation for more information.\r\n"
|
|
65
65
|
}
|