@itwin/webgl-compatibility 5.5.0-dev.2 → 5.5.0-dev.5
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 +6 -1
- package/lib/cjs/Capabilities.js.map +1 -1
- package/lib/cjs/RenderCompatibility.js.map +1 -1
- package/lib/cjs/webgl-compatibility.js.map +1 -1
- package/lib/esm/Capabilities.js.map +1 -1
- package/lib/esm/RenderCompatibility.js.map +1 -1
- package/lib/esm/webgl-compatibility.js.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
# Change Log - @itwin/webgl-compatibility
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Tue, 02 Dec 2025 23:11:57 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 5.4.0
|
|
6
|
+
Tue, 02 Dec 2025 21:22:25 GMT
|
|
7
|
+
|
|
8
|
+
_Version update only_
|
|
4
9
|
|
|
5
10
|
## 5.3.3
|
|
6
11
|
Thu, 20 Nov 2025 22:30:37 GMT
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Capabilities.js","sourceRoot":"","sources":["../../src/Capabilities.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAsD;AACtD,+DAE+B;AAS/B,MAAM,eAAe,GAAyB;IAC5C,oBAAoB;IACpB,wBAAwB;IACxB,mBAAmB;IACnB,0BAA0B;IAC1B,wBAAwB;IACxB,+BAA+B;IAC/B,gCAAgC;IAChC,qBAAqB;IACrB,wBAAwB;IACxB,wBAAwB;IACxB,gBAAgB;IAChB,wBAAwB;IACxB,yBAAyB;IACzB,oBAAoB;IACpB,0BAA0B;IAC1B,iCAAiC;IACjC,0BAA0B;IAC1B,iBAAiB;CAClB,CAAC;AAEF;;GAEG;AACH,IAAY,UAIX;AAJD,WAAY,UAAU;IAC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AC;QACzC,EAAE,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC;QACzB,EAAE,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;QAEtB,EAAE,CAAC,QAAQ,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;;AAnSH,oCAoSC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Compatibility\n */\n\nimport { ProcessDetector } from \"@itwin/core-bentley\";\nimport {\n GraphicsDriverBugs, WebGLContext, WebGLFeature, WebGLRenderCompatibilityInfo, WebGLRenderCompatibilityStatus,\n} from \"./RenderCompatibility\";\n\n/** @internal */\nexport type WebGLExtensionName =\n \"WEBGL_draw_buffers\" | \"OES_element_index_uint\" | \"OES_texture_float\" | \"OES_texture_float_linear\" |\n \"OES_texture_half_float\" | \"OES_texture_half_float_linear\" | \"EXT_texture_filter_anisotropic\" | \"WEBGL_depth_texture\" |\n \"EXT_color_buffer_float\" | \"EXT_shader_texture_lod\" | \"ANGLE_instanced_arrays\" | \"OES_vertex_array_object\" | \"WEBGL_lose_context\" |\n \"EXT_frag_depth\" | \"EXT_disjoint_timer_query\" | \"EXT_disjoint_timer_query_webgl2\" | \"OES_standard_derivatives\" | \"EXT_float_blend\";\n\nconst knownExtensions: WebGLExtensionName[] = [\n \"WEBGL_draw_buffers\",\n \"OES_element_index_uint\",\n \"OES_texture_float\",\n \"OES_texture_float_linear\",\n \"OES_texture_half_float\",\n \"OES_texture_half_float_linear\",\n \"EXT_texture_filter_anisotropic\",\n \"WEBGL_depth_texture\",\n \"EXT_color_buffer_float\",\n \"EXT_shader_texture_lod\",\n \"EXT_frag_depth\",\n \"ANGLE_instanced_arrays\",\n \"OES_vertex_array_object\",\n \"WEBGL_lose_context\",\n \"EXT_disjoint_timer_query\",\n \"EXT_disjoint_timer_query_webgl2\",\n \"OES_standard_derivatives\",\n \"EXT_float_blend\",\n];\n\n/** Describes the type of a render target. Used by Capabilities to represent maximum precision render target available on host system.\n * @internal\n */\nexport enum RenderType {\n TextureUnsignedByte,\n TextureHalfFloat,\n TextureFloat,\n}\n\n/**\n * Describes the type of a depth buffer. Used by Capabilities to represent maximum depth buffer precision available on host system.\n * Note: the commented-out values are unimplemented but left in place for reference, in case desired for future implementation.\n * @internal\n */\nexport enum DepthType {\n RenderBufferUnsignedShort16, // core to WebGL1\n // TextureUnsignedShort16, // core to WebGL2; available to WebGL1 via WEBGL_depth_texture\n // TextureUnsignedInt24, // core to WebGL2\n TextureUnsignedInt24Stencil8, // core to WebGL2; available to WebGL1 via WEBGL_depth_texture\n TextureUnsignedInt32, // core to WebGL2; available to WebGL1 via WEBGL_depth_texture\n // TextureFloat32, // core to WebGL2\n // TextureFloat32Stencil8, // core to WeBGL2\n}\n\nconst maxTexSizeAllowed = 4096; // many devices and browsers have issues with source textures larger than this\n\n// Regexes to match Intel UHD/HD 620/630 integrated GPUS that suffer from GraphicsDriverBugs.fragDepthDoesNotDisableEarlyZ.\nconst buggyIntelMatchers = [\n // Original unmasked renderer string when workaround we implemented.\n /ANGLE \\(Intel\\(R\\) (U)?HD Graphics 6(2|3)0 Direct3D11/,\n // New unmasked renderer string circa October 2021.\n /ANGLE \\(Intel, Intel\\(R\\) (U)?HD Graphics 6(2|3)0 Direct3D11/,\n];\n\n// Regexes to match Mali GPUs known to suffer from GraphicsDriverBugs.msaaWillHang.\nconst buggyMaliMatchers = [\n /Mali-G71/,\n /Mali-G72/,\n /Mali-G76/,\n];\n\n// Regexes to match as many Intel integrated GPUs as possible.\n// https://en.wikipedia.org/wiki/List_of_Intel_graphics_processing_units\nconst integratedIntelGpuMatchers = [\n /(U)?HD Graphics/,\n /Iris/,\n];\n\nfunction isIntegratedGraphics(args: {unmaskedVendor?: string, unmaskedRenderer?: string}): boolean {\n if (args.unmaskedRenderer && args.unmaskedRenderer.includes(\"Intel\") && integratedIntelGpuMatchers.some((x) => x.test(args.unmaskedRenderer!)))\n return true;\n\n // NB: For now, we do not attempt to detect AMD integrated graphics.\n // It appears that AMD integrated graphics are not usually paired with a graphics card so detecting integrated usage there is less important than Intel.\n\n return false;\n}\n\n/** Describes the rendering capabilities of the host system.\n * @internal\n */\nexport class Capabilities {\n private _maxRenderType: RenderType = RenderType.TextureUnsignedByte;\n private _maxDepthType: DepthType = DepthType.RenderBufferUnsignedShort16;\n private _maxTextureSize: number = 0;\n private _maxColorAttachments: number = 0;\n private _maxDrawBuffers: number = 0;\n private _maxFragTextureUnits: number = 0;\n private _maxVertTextureUnits: number = 0;\n private _maxVertAttribs: number = 0;\n private _maxVertUniformVectors: number = 0;\n private _maxVaryingVectors: number = 0;\n private _maxFragUniformVectors: number = 0;\n private _maxAnisotropy?: number;\n private _maxAntialiasSamples: number = 1;\n private _supportsCreateImageBitmap: boolean = false;\n private _maxTexSizeAllow: number = maxTexSizeAllowed;\n\n private _extensionMap: { [key: string]: any } = {}; // Use this map to store actual extension objects retrieved from GL.\n private _presentFeatures: WebGLFeature[] = []; // List of features the system can support (not necessarily dependent on extensions)\n\n private _isWebGL2: boolean = false;\n private _isMobile: boolean = false;\n private _driverBugs: GraphicsDriverBugs = {};\n\n public get maxRenderType(): RenderType { return this._maxRenderType; }\n public get maxDepthType(): DepthType { return this._maxDepthType; }\n public get maxTextureSize(): number { return this._maxTextureSize; }\n public get maxTexSizeAllow(): number { return this._maxTexSizeAllow; }\n public get supportsCreateImageBitmap(): boolean { return this._supportsCreateImageBitmap; }\n public get maxColorAttachments(): number { return this._maxColorAttachments; }\n public get maxDrawBuffers(): number { return this._maxDrawBuffers; }\n public get maxFragTextureUnits(): number { return this._maxFragTextureUnits; }\n public get maxVertTextureUnits(): number { return this._maxVertTextureUnits; }\n public get maxVertAttribs(): number { return this._maxVertAttribs; }\n public get maxVertUniformVectors(): number { return this._maxVertUniformVectors; }\n public get maxVaryingVectors(): number { return this._maxVaryingVectors; }\n public get maxFragUniformVectors(): number { return this._maxFragUniformVectors; }\n public get maxAntialiasSamples(): number { return this._maxAntialiasSamples; }\n public get isWebGL2(): boolean { return this._isWebGL2; }\n public get driverBugs(): GraphicsDriverBugs { return this._driverBugs; }\n\n /** These getters check for existence of extension objects to determine availability of features. In WebGL2, could just return true for some. */\n public get supportsNonPowerOf2Textures(): boolean { return false; }\n public get supportsDrawBuffers(): boolean { return this._isWebGL2 || this.queryExtensionObject<WEBGL_draw_buffers>(\"WEBGL_draw_buffers\") !== undefined; }\n public get supportsInstancing(): boolean { return this._isWebGL2 || this.queryExtensionObject<ANGLE_instanced_arrays>(\"ANGLE_instanced_arrays\") !== undefined; }\n public get supports32BitElementIndex(): boolean { return this._isWebGL2 || this.queryExtensionObject<OES_element_index_uint>(\"OES_element_index_uint\") !== undefined; }\n public get supportsTextureFloat(): boolean { return this._isWebGL2 || this.queryExtensionObject<OES_texture_float>(\"OES_texture_float\") !== undefined; }\n public get supportsTextureFloatLinear(): boolean { return this._isWebGL2 || this.queryExtensionObject<OES_texture_float_linear>(\"OES_texture_float_linear\") !== undefined; }\n public get supportsTextureHalfFloat(): boolean { return this._isWebGL2 || this.queryExtensionObject<OES_texture_half_float>(\"OES_texture_half_float\") !== undefined; }\n public get supportsTextureHalfFloatLinear(): boolean { return this._isWebGL2 || this.queryExtensionObject<OES_texture_half_float_linear>(\"OES_texture_half_float_linear\") !== undefined; }\n public get supportsTextureFilterAnisotropic(): boolean { return this.queryExtensionObject<EXT_texture_filter_anisotropic>(\"EXT_texture_filter_anisotropic\") !== undefined; }\n public get supportsShaderTextureLOD(): boolean { return this._isWebGL2 || this.queryExtensionObject<EXT_shader_texture_lod>(\"EXT_shader_texture_lod\") !== undefined; }\n public get supportsVertexArrayObjects(): boolean { return this._isWebGL2 || this.queryExtensionObject<OES_vertex_array_object>(\"OES_vertex_array_object\") !== undefined; }\n public get supportsFragDepth(): boolean { return this._isWebGL2 || this.queryExtensionObject<EXT_frag_depth>(\"EXT_frag_depth\") !== undefined; }\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; }\n public get supportsStandardDerivatives(): boolean { return this._isWebGL2 || this.queryExtensionObject<OES_standard_derivatives>(\"OES_standard_derivatives\") !== undefined; }\n\n public get supportsMRTTransparency(): boolean { return this.maxColorAttachments >= 2; }\n public get supportsMRTPickShaders(): boolean { return this.maxColorAttachments >= 3; }\n\n public get supportsShadowMaps(): boolean {\n return this.supportsTextureFloat || this.supportsTextureHalfFloat;\n }\n\n public get supportsAntiAliasing(): boolean { return this._isWebGL2 && this.maxAntialiasSamples > 1; }\n\n public get isMobile(): boolean { return this._isMobile; }\n\n private findExtension(name: WebGLExtensionName): any {\n const ext = this._extensionMap[name];\n return null !== ext ? ext : undefined;\n }\n\n /** Queries an extension object if available. This is necessary for other parts of the system to access some constants within extensions. */\n public queryExtensionObject<T>(ext: WebGLExtensionName): T | undefined {\n return this.findExtension(ext) as T;\n }\n\n public static readonly optionalFeatures: WebGLFeature[] = [\n WebGLFeature.MrtTransparency,\n WebGLFeature.MrtPick,\n WebGLFeature.DepthTexture,\n WebGLFeature.FloatRendering,\n WebGLFeature.Instancing,\n WebGLFeature.ShadowMaps,\n WebGLFeature.FragDepth,\n WebGLFeature.StandardDerivatives,\n WebGLFeature.AntiAliasing,\n ];\n public static readonly requiredFeatures: WebGLFeature[] = [\n WebGLFeature.UintElementIndex,\n WebGLFeature.MinimalTextureUnits,\n ];\n\n private get _hasRequiredTextureUnits(): boolean { return this.maxFragTextureUnits >= 4 && this.maxVertTextureUnits >= 5; }\n\n /** Return an array containing any features not supported by the system as compared to the input array. */\n private _findMissingFeatures(featuresToSeek: WebGLFeature[]): WebGLFeature[] {\n const missingFeatures: WebGLFeature[] = [];\n for (const featureName of featuresToSeek) {\n if (-1 === this._presentFeatures.indexOf(featureName))\n missingFeatures.push(featureName);\n }\n return missingFeatures;\n }\n\n /** Populate and return an array containing features that this system supports. */\n private _gatherFeatures(): WebGLFeature[] {\n const features: WebGLFeature[] = [];\n\n // simply check for presence of various extensions if that gives enough information\n if (this._isWebGL2 || this._extensionMap[\"OES_element_index_uint\" as WebGLExtensionName] !== undefined)\n features.push(WebGLFeature.UintElementIndex);\n if (this._isWebGL2 || this._extensionMap[\"ANGLE_instanced_arrays\" as WebGLExtensionName] !== undefined)\n features.push(WebGLFeature.Instancing);\n\n if (this.supportsMRTTransparency)\n features.push(WebGLFeature.MrtTransparency);\n if (this.supportsMRTPickShaders)\n features.push(WebGLFeature.MrtPick);\n if (this.supportsShadowMaps)\n features.push(WebGLFeature.ShadowMaps);\n if (this._hasRequiredTextureUnits)\n features.push(WebGLFeature.MinimalTextureUnits);\n if (this.supportsFragDepth)\n features.push(WebGLFeature.FragDepth);\n if (this.supportsStandardDerivatives)\n features.push(WebGLFeature.StandardDerivatives);\n if (this.supportsAntiAliasing)\n features.push(WebGLFeature.AntiAliasing);\n\n if (DepthType.TextureUnsignedInt24Stencil8 === this._maxDepthType)\n features.push(WebGLFeature.DepthTexture);\n\n // check if at least half-float rendering is available based on maximum discovered renderable target\n if (RenderType.TextureUnsignedByte !== this._maxRenderType)\n features.push(WebGLFeature.FloatRendering);\n\n return features;\n }\n\n /** Retrieve compatibility status based on presence of various features. */\n private _getCompatibilityStatus(missingRequiredFeatures: WebGLFeature[], missingOptionalFeatures: WebGLFeature[]): WebGLRenderCompatibilityStatus {\n let status: WebGLRenderCompatibilityStatus = WebGLRenderCompatibilityStatus.AllOkay;\n if (missingOptionalFeatures.length > 0)\n status = WebGLRenderCompatibilityStatus.MissingOptionalFeatures;\n if (missingRequiredFeatures.length > 0)\n status = WebGLRenderCompatibilityStatus.MissingRequiredFeatures;\n return status;\n }\n\n /** Initializes the capabilities based on a GL context. Must be called first. */\n public init(gl: WebGLContext, disabledExtensions?: WebGLExtensionName[]): WebGLRenderCompatibilityInfo {\n const gl2 = !(gl instanceof WebGLRenderingContext) ? gl : undefined;\n this._isWebGL2 = undefined !== gl2;\n\n this._isMobile = ProcessDetector.isMobileBrowser;\n\n const debugInfo = gl.getExtension(\"WEBGL_debug_renderer_info\");\n const unmaskedRenderer = debugInfo !== null ? gl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL) : undefined;\n const unmaskedVendor = debugInfo !== null ? gl.getParameter(debugInfo.UNMASKED_VENDOR_WEBGL) : undefined;\n\n this._driverBugs = {};\n if (unmaskedRenderer && buggyIntelMatchers.some((x) => x.test(unmaskedRenderer)))\n this._driverBugs.fragDepthDoesNotDisableEarlyZ = true;\n\n if (unmaskedRenderer && buggyMaliMatchers.some((x) => x.test(unmaskedRenderer)))\n this._driverBugs.msaaWillHang = true;\n\n this._maxTextureSize = gl.getParameter(gl.MAX_TEXTURE_SIZE);\n this._supportsCreateImageBitmap = typeof createImageBitmap === \"function\" && ProcessDetector.isChromium && !ProcessDetector.isIOSBrowser;\n this._maxTexSizeAllow = Math.min(this._maxTextureSize, maxTexSizeAllowed);\n this._maxFragTextureUnits = gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS);\n this._maxVertTextureUnits = gl.getParameter(gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS);\n this._maxVertAttribs = gl.getParameter(gl.MAX_VERTEX_ATTRIBS);\n this._maxVertUniformVectors = gl.getParameter(gl.MAX_VERTEX_UNIFORM_VECTORS);\n this._maxVaryingVectors = gl.getParameter(gl.MAX_VARYING_VECTORS);\n this._maxFragUniformVectors = gl.getParameter(gl.MAX_FRAGMENT_UNIFORM_VECTORS);\n this._maxAntialiasSamples = this._driverBugs.msaaWillHang ? 1 : (this._isWebGL2 && undefined !== gl2 ? gl.getParameter(gl2.MAX_SAMPLES) : 1);\n\n const extensions = gl.getSupportedExtensions(); // This just retrieves a list of available extensions (not necessarily enabled).\n if (extensions) {\n for (const extStr of extensions) {\n const ext = extStr as WebGLExtensionName;\n if (-1 === knownExtensions.indexOf(ext))\n continue;\n else if (undefined !== disabledExtensions && -1 !== disabledExtensions.indexOf(ext))\n continue;\n\n const extObj: any = gl.getExtension(ext); // This call enables the extension and returns a WebGLObject containing extension instance.\n if (null !== extObj)\n this._extensionMap[ext] = extObj;\n }\n }\n\n if (this._isWebGL2 && undefined !== gl2) {\n this._maxColorAttachments = gl.getParameter(gl2.MAX_COLOR_ATTACHMENTS);\n this._maxDrawBuffers = gl.getParameter(gl2.MAX_DRAW_BUFFERS);\n } else {\n const dbExt: WEBGL_draw_buffers | undefined = this.queryExtensionObject<WEBGL_draw_buffers>(\"WEBGL_draw_buffers\");\n this._maxColorAttachments = dbExt !== undefined ? gl.getParameter(dbExt.MAX_COLOR_ATTACHMENTS_WEBGL) : 1;\n this._maxDrawBuffers = dbExt !== undefined ? gl.getParameter(dbExt.MAX_DRAW_BUFFERS_WEBGL) : 1;\n }\n\n // Determine the maximum color-renderable attachment type.\n const allowFloatRender =\n (undefined === disabledExtensions || -1 === disabledExtensions.indexOf(\"OES_texture_float\"))\n // iOS>=15 allows full-float rendering. However, it does not actually work on non-M1 devices.\n // Because of this, for now we disallow full float rendering on iOS devices.\n // ###TODO: Re-assess this after future iOS updates.\n && !ProcessDetector.isIOSBrowser\n // Samsung Galaxy Note 8 exhibits same issue as described above for iOS >= 15.\n // It uses specifically Mali-G71 MP20 but reports its renderer as follows.\n // Samsung Galaxy A50 and S9 exhibits same issue; they use Mali-G72.\n // HUAWEI P30 exhibits same issue; it uses Mali-G76.\n && unmaskedRenderer !== \"Mali-G71\" && unmaskedRenderer !== \"Mali-G72\" && unmaskedRenderer !== \"Mali-G76\";\n\n if (allowFloatRender && undefined !== this.queryExtensionObject(\"EXT_float_blend\") && this.isTextureRenderable(gl, gl.FLOAT)) {\n this._maxRenderType = RenderType.TextureFloat;\n } else if (this.isWebGL2) {\n this._maxRenderType = (this.isTextureRenderable(gl, (gl as WebGL2RenderingContext).HALF_FLOAT)) ? RenderType.TextureHalfFloat : RenderType.TextureUnsignedByte;\n } else {\n const hfExt: OES_texture_half_float | undefined = this.queryExtensionObject<OES_texture_half_float>(\"OES_texture_half_float\");\n this._maxRenderType = (hfExt !== undefined && this.isTextureRenderable(gl, hfExt.HALF_FLOAT_OES)) ? RenderType.TextureHalfFloat : RenderType.TextureUnsignedByte;\n }\n\n // Determine the maximum depth attachment type.\n // this._maxDepthType = this.queryExtensionObject(\"WEBGL_depth_texture\") !== undefined ? DepthType.TextureUnsignedInt32 : DepthType.RenderBufferUnsignedShort16;\n this._maxDepthType = this._isWebGL2 || this.queryExtensionObject(\"WEBGL_depth_texture\") !== undefined ? DepthType.TextureUnsignedInt24Stencil8 : DepthType.RenderBufferUnsignedShort16;\n\n this._presentFeatures = this._gatherFeatures();\n const missingRequiredFeatures = this._findMissingFeatures(Capabilities.requiredFeatures);\n const missingOptionalFeatures = this._findMissingFeatures(Capabilities.optionalFeatures);\n\n return {\n status: this._getCompatibilityStatus(missingRequiredFeatures, missingOptionalFeatures),\n missingRequiredFeatures,\n missingOptionalFeatures,\n unmaskedRenderer,\n unmaskedVendor,\n usingIntegratedGraphics: isIntegratedGraphics({unmaskedVendor, unmaskedRenderer}),\n driverBugs: { ...this._driverBugs },\n userAgent: navigator.userAgent,\n createdContext: gl,\n };\n }\n\n public static create(gl: WebGLContext, disabledExtensions?: WebGLExtensionName[]): Capabilities | undefined {\n const caps = new Capabilities();\n const compatibility = caps.init(gl, disabledExtensions);\n if (WebGLRenderCompatibilityStatus.CannotCreateContext === compatibility.status || WebGLRenderCompatibilityStatus.MissingRequiredFeatures === compatibility.status)\n return undefined;\n return caps;\n }\n\n /** Determines if a particular texture type is color-renderable on the host system. */\n private isTextureRenderable(gl: WebGLContext, texType: number): boolean {\n const tex: WebGLTexture | null = gl.createTexture();\n gl.bindTexture(gl.TEXTURE_2D, tex);\n if (this.isWebGL2) {\n if (gl.FLOAT === texType)\n gl.texImage2D(gl.TEXTURE_2D, 0, (gl as WebGL2RenderingContext).RGBA32F, 1, 1, 0, gl.RGBA, texType, null);\n else\n gl.texImage2D(gl.TEXTURE_2D, 0, (gl as WebGL2RenderingContext).RGBA16F, 1, 1, 0, gl.RGBA, texType, null);\n } else\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, texType, null);\n\n const fb: WebGLFramebuffer | null = gl.createFramebuffer();\n gl.bindFramebuffer(gl.FRAMEBUFFER, fb);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0);\n\n const fbStatus: number = gl.checkFramebufferStatus(gl.FRAMEBUFFER);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.deleteFramebuffer(fb);\n gl.deleteTexture(tex);\n\n gl.getError(); // clear any errors\n\n return fbStatus === gl.FRAMEBUFFER_COMPLETE;\n }\n\n public setMaxAnisotropy(desiredMax: number | undefined, gl: WebGLContext): void {\n const ext = this.queryExtensionObject<EXT_texture_filter_anisotropic>(\"EXT_texture_filter_anisotropic\");\n if (undefined === ext)\n return;\n\n if (undefined === this._maxAnisotropy)\n this._maxAnisotropy = gl.getParameter(ext.MAX_TEXTURE_MAX_ANISOTROPY_EXT) as number;\n\n const max = (undefined !== desiredMax) ? Math.min(desiredMax, this._maxAnisotropy) : this._maxAnisotropy;\n gl.texParameterf(gl.TEXTURE_2D, ext.TEXTURE_MAX_ANISOTROPY_EXT, max);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Capabilities.js","sourceRoot":"","sources":["../../src/Capabilities.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAsD;AACtD,+DAE+B;AAS/B,MAAM,eAAe,GAAyB;IAC5C,oBAAoB;IACpB,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,IAAY,UAIX;AAJD,WAAY,UAAU;IACpB,yEAAmB,CAAA;IACnB,mEAAgB,CAAA;IAChB,2DAAY,CAAA;AACd,CAAC,EAJW,UAAU,0BAAV,UAAU,QAIrB;AAED;;;;GAIG;AACH,IAAY,SAQX;AARD,WAAY,SAAS;IACnB,uFAA2B,CAAA;IAC3B,+FAA+F;IAC/F,kDAAkD;IAClD,yFAA4B,CAAA;IAC5B,yEAAoB,CAAA;IACpB,kDAAkD;IAClD,kDAAkD;AACpD,CAAC,EARW,SAAS,yBAAT,SAAS,QAQpB;AAED,MAAM,iBAAiB,GAAG,IAAI,CAAC,CAAC,8EAA8E;AAE9G,2HAA2H;AAC3H,MAAM,kBAAkB,GAAG;IACzB,oEAAoE;IACpE,uDAAuD;IACvD,mDAAmD;IACnD,8D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Y,CAAC,GAAG,CAAC,8BAA8B,CAAW,CAAC;QAEtF,MAAM,GAAG,GAAG,CAAC,SAAS,KAAK,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC;QACzG,EAAE,CAAC,aAAa,CAAC,EAAE,CAAC,UAAU,EAAE,GAAG,CAAC,0BAA0B,EAAE,GAAG,CAAC,CAAC;IACvE,CAAC;;AAnSH,oCAoSC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Compatibility\r\n */\r\n\r\nimport { ProcessDetector } from \"@itwin/core-bentley\";\r\nimport {\r\n GraphicsDriverBugs, WebGLContext, WebGLFeature, WebGLRenderCompatibilityInfo, WebGLRenderCompatibilityStatus,\r\n} from \"./RenderCompatibility\";\r\n\r\n/** @internal */\r\nexport type WebGLExtensionName =\r\n \"WEBGL_draw_buffers\" | \"OES_element_index_uint\" | \"OES_texture_float\" | \"OES_texture_float_linear\" |\r\n \"OES_texture_half_float\" | \"OES_texture_half_float_linear\" | \"EXT_texture_filter_anisotropic\" | \"WEBGL_depth_texture\" |\r\n \"EXT_color_buffer_float\" | \"EXT_shader_texture_lod\" | \"ANGLE_instanced_arrays\" | \"OES_vertex_array_object\" | \"WEBGL_lose_context\" |\r\n \"EXT_frag_depth\" | \"EXT_disjoint_timer_query\" | \"EXT_disjoint_timer_query_webgl2\" | \"OES_standard_derivatives\" | \"EXT_float_blend\";\r\n\r\nconst knownExtensions: WebGLExtensionName[] = [\r\n \"WEBGL_draw_buffers\",\r\n \"OES_element_index_uint\",\r\n \"OES_texture_float\",\r\n \"OES_texture_float_linear\",\r\n \"OES_texture_half_float\",\r\n \"OES_texture_half_float_linear\",\r\n \"EXT_texture_filter_anisotropic\",\r\n \"WEBGL_depth_texture\",\r\n \"EXT_color_buffer_float\",\r\n \"EXT_shader_texture_lod\",\r\n \"EXT_frag_depth\",\r\n \"ANGLE_instanced_arrays\",\r\n \"OES_vertex_array_object\",\r\n \"WEBGL_lose_context\",\r\n \"EXT_disjoint_timer_query\",\r\n \"EXT_disjoint_timer_query_webgl2\",\r\n \"OES_standard_derivatives\",\r\n \"EXT_float_blend\",\r\n];\r\n\r\n/** Describes the type of a render target. Used by Capabilities to represent maximum precision render target available on host system.\r\n * @internal\r\n */\r\nexport enum RenderType {\r\n TextureUnsignedByte,\r\n TextureHalfFloat,\r\n TextureFloat,\r\n}\r\n\r\n/**\r\n * Describes the type of a depth buffer. Used by Capabilities to represent maximum depth buffer precision available on host system.\r\n * Note: the commented-out values are unimplemented but left in place for reference, in case desired for future implementation.\r\n * @internal\r\n */\r\nexport enum DepthType {\r\n RenderBufferUnsignedShort16, // core to WebGL1\r\n // TextureUnsignedShort16, // core to WebGL2; available to WebGL1 via WEBGL_depth_texture\r\n // TextureUnsignedInt24, // core to WebGL2\r\n TextureUnsignedInt24Stencil8, // core to WebGL2; available to WebGL1 via WEBGL_depth_texture\r\n TextureUnsignedInt32, // core to WebGL2; available to WebGL1 via WEBGL_depth_texture\r\n // TextureFloat32, // core to WebGL2\r\n // TextureFloat32Stencil8, // core to WeBGL2\r\n}\r\n\r\nconst maxTexSizeAllowed = 4096; // many devices and browsers have issues with source textures larger than this\r\n\r\n// Regexes to match Intel UHD/HD 620/630 integrated GPUS that suffer from GraphicsDriverBugs.fragDepthDoesNotDisableEarlyZ.\r\nconst buggyIntelMatchers = [\r\n // Original unmasked renderer string when workaround we implemented.\r\n /ANGLE \\(Intel\\(R\\) (U)?HD Graphics 6(2|3)0 Direct3D11/,\r\n // New unmasked renderer string circa October 2021.\r\n /ANGLE \\(Intel, Intel\\(R\\) (U)?HD Graphics 6(2|3)0 Direct3D11/,\r\n];\r\n\r\n// Regexes to match Mali GPUs known to suffer from GraphicsDriverBugs.msaaWillHang.\r\nconst buggyMaliMatchers = [\r\n /Mali-G71/,\r\n /Mali-G72/,\r\n /Mali-G76/,\r\n];\r\n\r\n// Regexes to match as many Intel integrated GPUs as possible.\r\n// https://en.wikipedia.org/wiki/List_of_Intel_graphics_processing_units\r\nconst integratedIntelGpuMatchers = [\r\n /(U)?HD Graphics/,\r\n /Iris/,\r\n];\r\n\r\nfunction isIntegratedGraphics(args: {unmaskedVendor?: string, unmaskedRenderer?: string}): boolean {\r\n if (args.unmaskedRenderer && args.unmaskedRenderer.includes(\"Intel\") && integratedIntelGpuMatchers.some((x) => x.test(args.unmaskedRenderer!)))\r\n return true;\r\n\r\n // NB: For now, we do not attempt to detect AMD integrated graphics.\r\n // It appears that AMD integrated graphics are not usually paired with a graphics card so detecting integrated usage there is less important than Intel.\r\n\r\n return false;\r\n}\r\n\r\n/** Describes the rendering capabilities of the host system.\r\n * @internal\r\n */\r\nexport class Capabilities {\r\n private _maxRenderType: RenderType = RenderType.TextureUnsignedByte;\r\n private _maxDepthType: DepthType = DepthType.RenderBufferUnsignedShort16;\r\n private _maxTextureSize: number = 0;\r\n private _maxColorAttachments: number = 0;\r\n private _maxDrawBuffers: number = 0;\r\n private _maxFragTextureUnits: number = 0;\r\n private _maxVertTextureUnits: number = 0;\r\n private _maxVertAttribs: number = 0;\r\n private _maxVertUniformVectors: number = 0;\r\n private _maxVaryingVectors: number = 0;\r\n private _maxFragUniformVectors: number = 0;\r\n private _maxAnisotropy?: number;\r\n private _maxAntialiasSamples: number = 1;\r\n private _supportsCreateImageBitmap: boolean = false;\r\n private _maxTexSizeAllow: number = maxTexSizeAllowed;\r\n\r\n private _extensionMap: { [key: string]: any } = {}; // Use this map to store actual extension objects retrieved from GL.\r\n private _presentFeatures: WebGLFeature[] = []; // List of features the system can support (not necessarily dependent on extensions)\r\n\r\n private _isWebGL2: boolean = false;\r\n private _isMobile: boolean = false;\r\n private _driverBugs: GraphicsDriverBugs = {};\r\n\r\n public get maxRenderType(): RenderType { return this._maxRenderType; }\r\n public get maxDepthType(): DepthType { return this._maxDepthType; }\r\n public get maxTextureSize(): number { return this._maxTextureSize; }\r\n public get maxTexSizeAllow(): number { return this._maxTexSizeAllow; }\r\n public get supportsCreateImageBitmap(): boolean { return this._supportsCreateImageBitmap; }\r\n public get maxColorAttachments(): number { return this._maxColorAttachments; }\r\n public get maxDrawBuffers(): number { return this._maxDrawBuffers; }\r\n public get maxFragTextureUnits(): number { return this._maxFragTextureUnits; }\r\n public get maxVertTextureUnits(): number { return this._maxVertTextureUnits; }\r\n public get maxVertAttribs(): number { return this._maxVertAttribs; }\r\n public get maxVertUniformVectors(): number { return this._maxVertUniformVectors; }\r\n public get maxVaryingVectors(): number { return this._maxVaryingVectors; }\r\n public get maxFragUniformVectors(): number { return this._maxFragUniformVectors; }\r\n public get maxAntialiasSamples(): number { return this._maxAntialiasSamples; }\r\n public get isWebGL2(): boolean { return this._isWebGL2; }\r\n public get driverBugs(): GraphicsDriverBugs { return this._driverBugs; }\r\n\r\n /** These getters check for existence of extension objects to determine availability of features. In WebGL2, could just return true for some. */\r\n public get supportsNonPowerOf2Textures(): boolean { return false; }\r\n public get supportsDrawBuffers(): boolean { return this._isWebGL2 || this.queryExtensionObject<WEBGL_draw_buffers>(\"WEBGL_draw_buffers\") !== undefined; }\r\n public get supportsInstancing(): boolean { return this._isWebGL2 || this.queryExtensionObject<ANGLE_instanced_arrays>(\"ANGLE_instanced_arrays\") !== undefined; }\r\n public get supports32BitElementIndex(): boolean { return this._isWebGL2 || this.queryExtensionObject<OES_element_index_uint>(\"OES_element_index_uint\") !== undefined; }\r\n public get supportsTextureFloat(): boolean { return this._isWebGL2 || this.queryExtensionObject<OES_texture_float>(\"OES_texture_float\") !== undefined; }\r\n public get supportsTextureFloatLinear(): boolean { return this._isWebGL2 || this.queryExtensionObject<OES_texture_float_linear>(\"OES_texture_float_linear\") !== undefined; }\r\n public get supportsTextureHalfFloat(): boolean { return this._isWebGL2 || this.queryExtensionObject<OES_texture_half_float>(\"OES_texture_half_float\") !== undefined; }\r\n public get supportsTextureHalfFloatLinear(): boolean { return this._isWebGL2 || this.queryExtensionObject<OES_texture_half_float_linear>(\"OES_texture_half_float_linear\") !== undefined; }\r\n public get supportsTextureFilterAnisotropic(): boolean { return this.queryExtensionObject<EXT_texture_filter_anisotropic>(\"EXT_texture_filter_anisotropic\") !== undefined; }\r\n public get supportsShaderTextureLOD(): boolean { return this._isWebGL2 || this.queryExtensionObject<EXT_shader_texture_lod>(\"EXT_shader_texture_lod\") !== undefined; }\r\n public get supportsVertexArrayObjects(): boolean { return this._isWebGL2 || this.queryExtensionObject<OES_vertex_array_object>(\"OES_vertex_array_object\") !== undefined; }\r\n public get supportsFragDepth(): boolean { return this._isWebGL2 || this.queryExtensionObject<EXT_frag_depth>(\"EXT_frag_depth\") !== undefined; }\r\n public get supportsDisjointTimerQuery(): boolean { return (this._isWebGL2 && this.queryExtensionObject<any>(\"EXT_disjoint_timer_query_webgl2\") !== undefined) || this.queryExtensionObject<any>(\"EXT_disjoint_timer_query\") !== undefined; }\r\n public get supportsStandardDerivatives(): boolean { return this._isWebGL2 || this.queryExtensionObject<OES_standard_derivatives>(\"OES_standard_derivatives\") !== undefined; }\r\n\r\n public get supportsMRTTransparency(): boolean { return this.maxColorAttachments >= 2; }\r\n public get supportsMRTPickShaders(): boolean { return this.maxColorAttachments >= 3; }\r\n\r\n public get supportsShadowMaps(): boolean {\r\n return this.supportsTextureFloat || this.supportsTextureHalfFloat;\r\n }\r\n\r\n public get supportsAntiAliasing(): boolean { return this._isWebGL2 && this.maxAntialiasSamples > 1; }\r\n\r\n public get isMobile(): boolean { return this._isMobile; }\r\n\r\n private findExtension(name: WebGLExtensionName): any {\r\n const ext = this._extensionMap[name];\r\n return null !== ext ? ext : undefined;\r\n }\r\n\r\n /** Queries an extension object if available. This is necessary for other parts of the system to access some constants within extensions. */\r\n public queryExtensionObject<T>(ext: WebGLExtensionName): T | undefined {\r\n return this.findExtension(ext) as T;\r\n }\r\n\r\n public static readonly optionalFeatures: WebGLFeature[] = [\r\n WebGLFeature.MrtTransparency,\r\n WebGLFeature.MrtPick,\r\n WebGLFeature.DepthTexture,\r\n WebGLFeature.FloatRendering,\r\n WebGLFeature.Instancing,\r\n WebGLFeature.ShadowMaps,\r\n WebGLFeature.FragDepth,\r\n WebGLFeature.StandardDerivatives,\r\n WebGLFeature.AntiAliasing,\r\n ];\r\n public static readonly requiredFeatures: WebGLFeature[] = [\r\n WebGLFeature.UintElementIndex,\r\n WebGLFeature.MinimalTextureUnits,\r\n ];\r\n\r\n private get _hasRequiredTextureUnits(): boolean { return this.maxFragTextureUnits >= 4 && this.maxVertTextureUnits >= 5; }\r\n\r\n /** Return an array containing any features not supported by the system as compared to the input array. */\r\n private _findMissingFeatures(featuresToSeek: WebGLFeature[]): WebGLFeature[] {\r\n const missingFeatures: WebGLFeature[] = [];\r\n for (const featureName of featuresToSeek) {\r\n if (-1 === this._presentFeatures.indexOf(featureName))\r\n missingFeatures.push(featureName);\r\n }\r\n return missingFeatures;\r\n }\r\n\r\n /** Populate and return an array containing features that this system supports. */\r\n private _gatherFeatures(): WebGLFeature[] {\r\n const features: WebGLFeature[] = [];\r\n\r\n // simply check for presence of various extensions if that gives enough information\r\n if (this._isWebGL2 || this._extensionMap[\"OES_element_index_uint\" as WebGLExtensionName] !== undefined)\r\n features.push(WebGLFeature.UintElementIndex);\r\n if (this._isWebGL2 || this._extensionMap[\"ANGLE_instanced_arrays\" as WebGLExtensionName] !== undefined)\r\n features.push(WebGLFeature.Instancing);\r\n\r\n if (this.supportsMRTTransparency)\r\n features.push(WebGLFeature.MrtTransparency);\r\n if (this.supportsMRTPickShaders)\r\n features.push(WebGLFeature.MrtPick);\r\n if (this.supportsShadowMaps)\r\n features.push(WebGLFeature.ShadowMaps);\r\n if (this._hasRequiredTextureUnits)\r\n features.push(WebGLFeature.MinimalTextureUnits);\r\n if (this.supportsFragDepth)\r\n features.push(WebGLFeature.FragDepth);\r\n if (this.supportsStandardDerivatives)\r\n features.push(WebGLFeature.StandardDerivatives);\r\n if (this.supportsAntiAliasing)\r\n features.push(WebGLFeature.AntiAliasing);\r\n\r\n if (DepthType.TextureUnsignedInt24Stencil8 === this._maxDepthType)\r\n features.push(WebGLFeature.DepthTexture);\r\n\r\n // check if at least half-float rendering is available based on maximum discovered renderable target\r\n if (RenderType.TextureUnsignedByte !== this._maxRenderType)\r\n features.push(WebGLFeature.FloatRendering);\r\n\r\n return features;\r\n }\r\n\r\n /** Retrieve compatibility status based on presence of various features. */\r\n private _getCompatibilityStatus(missingRequiredFeatures: WebGLFeature[], missingOptionalFeatures: WebGLFeature[]): WebGLRenderCompatibilityStatus {\r\n let status: WebGLRenderCompatibilityStatus = WebGLRenderCompatibilityStatus.AllOkay;\r\n if (missingOptionalFeatures.length > 0)\r\n status = WebGLRenderCompatibilityStatus.MissingOptionalFeatures;\r\n if (missingRequiredFeatures.length > 0)\r\n status = WebGLRenderCompatibilityStatus.MissingRequiredFeatures;\r\n return status;\r\n }\r\n\r\n /** Initializes the capabilities based on a GL context. Must be called first. */\r\n public init(gl: WebGLContext, disabledExtensions?: WebGLExtensionName[]): WebGLRenderCompatibilityInfo {\r\n const gl2 = !(gl instanceof WebGLRenderingContext) ? gl : undefined;\r\n this._isWebGL2 = undefined !== gl2;\r\n\r\n this._isMobile = ProcessDetector.isMobileBrowser;\r\n\r\n const debugInfo = gl.getExtension(\"WEBGL_debug_renderer_info\");\r\n const unmaskedRenderer = debugInfo !== null ? gl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL) : undefined;\r\n const unmaskedVendor = debugInfo !== null ? gl.getParameter(debugInfo.UNMASKED_VENDOR_WEBGL) : undefined;\r\n\r\n this._driverBugs = {};\r\n if (unmaskedRenderer && buggyIntelMatchers.some((x) => x.test(unmaskedRenderer)))\r\n this._driverBugs.fragDepthDoesNotDisableEarlyZ = true;\r\n\r\n if (unmaskedRenderer && buggyMaliMatchers.some((x) => x.test(unmaskedRenderer)))\r\n this._driverBugs.msaaWillHang = true;\r\n\r\n this._maxTextureSize = gl.getParameter(gl.MAX_TEXTURE_SIZE);\r\n this._supportsCreateImageBitmap = typeof createImageBitmap === \"function\" && ProcessDetector.isChromium && !ProcessDetector.isIOSBrowser;\r\n this._maxTexSizeAllow = Math.min(this._maxTextureSize, maxTexSizeAllowed);\r\n this._maxFragTextureUnits = gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS);\r\n this._maxVertTextureUnits = gl.getParameter(gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS);\r\n this._maxVertAttribs = gl.getParameter(gl.MAX_VERTEX_ATTRIBS);\r\n this._maxVertUniformVectors = gl.getParameter(gl.MAX_VERTEX_UNIFORM_VECTORS);\r\n this._maxVaryingVectors = gl.getParameter(gl.MAX_VARYING_VECTORS);\r\n this._maxFragUniformVectors = gl.getParameter(gl.MAX_FRAGMENT_UNIFORM_VECTORS);\r\n this._maxAntialiasSamples = this._driverBugs.msaaWillHang ? 1 : (this._isWebGL2 && undefined !== gl2 ? gl.getParameter(gl2.MAX_SAMPLES) : 1);\r\n\r\n const extensions = gl.getSupportedExtensions(); // This just retrieves a list of available extensions (not necessarily enabled).\r\n if (extensions) {\r\n for (const extStr of extensions) {\r\n const ext = extStr as WebGLExtensionName;\r\n if (-1 === knownExtensions.indexOf(ext))\r\n continue;\r\n else if (undefined !== disabledExtensions && -1 !== disabledExtensions.indexOf(ext))\r\n continue;\r\n\r\n const extObj: any = gl.getExtension(ext); // This call enables the extension and returns a WebGLObject containing extension instance.\r\n if (null !== extObj)\r\n this._extensionMap[ext] = extObj;\r\n }\r\n }\r\n\r\n if (this._isWebGL2 && undefined !== gl2) {\r\n this._maxColorAttachments = gl.getParameter(gl2.MAX_COLOR_ATTACHMENTS);\r\n this._maxDrawBuffers = gl.getParameter(gl2.MAX_DRAW_BUFFERS);\r\n } else {\r\n const dbExt: WEBGL_draw_buffers | undefined = this.queryExtensionObject<WEBGL_draw_buffers>(\"WEBGL_draw_buffers\");\r\n this._maxColorAttachments = dbExt !== undefined ? gl.getParameter(dbExt.MAX_COLOR_ATTACHMENTS_WEBGL) : 1;\r\n this._maxDrawBuffers = dbExt !== undefined ? gl.getParameter(dbExt.MAX_DRAW_BUFFERS_WEBGL) : 1;\r\n }\r\n\r\n // Determine the maximum color-renderable attachment type.\r\n const allowFloatRender =\r\n (undefined === disabledExtensions || -1 === disabledExtensions.indexOf(\"OES_texture_float\"))\r\n // iOS>=15 allows full-float rendering. However, it does not actually work on non-M1 devices.\r\n // Because of this, for now we disallow full float rendering on iOS devices.\r\n // ###TODO: Re-assess this after future iOS updates.\r\n && !ProcessDetector.isIOSBrowser\r\n // Samsung Galaxy Note 8 exhibits same issue as described above for iOS >= 15.\r\n // It uses specifically Mali-G71 MP20 but reports its renderer as follows.\r\n // Samsung Galaxy A50 and S9 exhibits same issue; they use Mali-G72.\r\n // HUAWEI P30 exhibits same issue; it uses Mali-G76.\r\n && unmaskedRenderer !== \"Mali-G71\" && unmaskedRenderer !== \"Mali-G72\" && unmaskedRenderer !== \"Mali-G76\";\r\n\r\n if (allowFloatRender && undefined !== this.queryExtensionObject(\"EXT_float_blend\") && this.isTextureRenderable(gl, gl.FLOAT)) {\r\n this._maxRenderType = RenderType.TextureFloat;\r\n } else if (this.isWebGL2) {\r\n this._maxRenderType = (this.isTextureRenderable(gl, (gl as WebGL2RenderingContext).HALF_FLOAT)) ? RenderType.TextureHalfFloat : RenderType.TextureUnsignedByte;\r\n } else {\r\n const hfExt: OES_texture_half_float | undefined = this.queryExtensionObject<OES_texture_half_float>(\"OES_texture_half_float\");\r\n this._maxRenderType = (hfExt !== undefined && this.isTextureRenderable(gl, hfExt.HALF_FLOAT_OES)) ? RenderType.TextureHalfFloat : RenderType.TextureUnsignedByte;\r\n }\r\n\r\n // Determine the maximum depth attachment type.\r\n // this._maxDepthType = this.queryExtensionObject(\"WEBGL_depth_texture\") !== undefined ? DepthType.TextureUnsignedInt32 : DepthType.RenderBufferUnsignedShort16;\r\n this._maxDepthType = this._isWebGL2 || this.queryExtensionObject(\"WEBGL_depth_texture\") !== undefined ? DepthType.TextureUnsignedInt24Stencil8 : DepthType.RenderBufferUnsignedShort16;\r\n\r\n this._presentFeatures = this._gatherFeatures();\r\n const missingRequiredFeatures = this._findMissingFeatures(Capabilities.requiredFeatures);\r\n const missingOptionalFeatures = this._findMissingFeatures(Capabilities.optionalFeatures);\r\n\r\n return {\r\n status: this._getCompatibilityStatus(missingRequiredFeatures, missingOptionalFeatures),\r\n missingRequiredFeatures,\r\n missingOptionalFeatures,\r\n unmaskedRenderer,\r\n unmaskedVendor,\r\n usingIntegratedGraphics: isIntegratedGraphics({unmaskedVendor, unmaskedRenderer}),\r\n driverBugs: { ...this._driverBugs },\r\n userAgent: navigator.userAgent,\r\n createdContext: gl,\r\n };\r\n }\r\n\r\n public static create(gl: WebGLContext, disabledExtensions?: WebGLExtensionName[]): Capabilities | undefined {\r\n const caps = new Capabilities();\r\n const compatibility = caps.init(gl, disabledExtensions);\r\n if (WebGLRenderCompatibilityStatus.CannotCreateContext === compatibility.status || WebGLRenderCompatibilityStatus.MissingRequiredFeatures === compatibility.status)\r\n return undefined;\r\n return caps;\r\n }\r\n\r\n /** Determines if a particular texture type is color-renderable on the host system. */\r\n private isTextureRenderable(gl: WebGLContext, texType: number): boolean {\r\n const tex: WebGLTexture | null = gl.createTexture();\r\n gl.bindTexture(gl.TEXTURE_2D, tex);\r\n if (this.isWebGL2) {\r\n if (gl.FLOAT === texType)\r\n gl.texImage2D(gl.TEXTURE_2D, 0, (gl as WebGL2RenderingContext).RGBA32F, 1, 1, 0, gl.RGBA, texType, null);\r\n else\r\n gl.texImage2D(gl.TEXTURE_2D, 0, (gl as WebGL2RenderingContext).RGBA16F, 1, 1, 0, gl.RGBA, texType, null);\r\n } else\r\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, texType, null);\r\n\r\n const fb: WebGLFramebuffer | null = gl.createFramebuffer();\r\n gl.bindFramebuffer(gl.FRAMEBUFFER, fb);\r\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0);\r\n\r\n const fbStatus: number = gl.checkFramebufferStatus(gl.FRAMEBUFFER);\r\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\r\n gl.deleteFramebuffer(fb);\r\n gl.deleteTexture(tex);\r\n\r\n gl.getError(); // clear any errors\r\n\r\n return fbStatus === gl.FRAMEBUFFER_COMPLETE;\r\n }\r\n\r\n public setMaxAnisotropy(desiredMax: number | undefined, gl: WebGLContext): void {\r\n const ext = this.queryExtensionObject<EXT_texture_filter_anisotropic>(\"EXT_texture_filter_anisotropic\");\r\n if (undefined === ext)\r\n return;\r\n\r\n if (undefined === this._maxAnisotropy)\r\n this._maxAnisotropy = gl.getParameter(ext.MAX_TEXTURE_MAX_ANISOTROPY_EXT) as number;\r\n\r\n const max = (undefined !== desiredMax) ? Math.min(desiredMax, this._maxAnisotropy) : this._maxAnisotropy;\r\n gl.texParameterf(gl.TEXTURE_2D, ext.TEXTURE_MAX_ANISOTROPY_EXT, max);\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderCompatibility.js","sourceRoot":"","sources":["../../src/RenderCompatibility.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AA6IH,4DAqCC;AAhLD,iDAA8C;AAO9C;;GAEG;AACH,IAAY,YAuBX;AAvBD,WAAY,YAAY;IACtB,2GAA2G;IAC3G,oDAAoC,CAAA;IACpC,wFAAwF;IACxF,oCAAoB,CAAA;IACpB,2FAA2F;IAC3F,uDAAuC,CAAA;IACvC,2JAA2J;IAC3J,kDAAkC,CAAA;IAClC,2FAA2F;IAC3F,8CAA8B,CAAA;IAC9B,gGAAgG;IAChG,yCAAyB,CAAA;IACzB,iHAAiH;IACjH,6DAA6C,C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AgC,CAAC;IACrC,MAAM,CAAC,gBAAgB,CAAC,2BAA2B,EAAE,CAAC,KAAK,EAAE,EAAE;QAC7D,YAAY,GAAI,KAA2B,CAAC,aAAa,IAAI,gEAAgE,CAAC;IAChI,CAAC,EAAE,KAAK,CAAC,CAAC;IAEV,IAAI,SAAS,KAAK,aAAa;QAC7B,aAAa,GAAG,oBAAoB,CAAC;IAEvC,IAAI,yBAAyB,GAAG,KAAK,CAAC;IACtC,IAAI,OAAO,GAAG,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE,EAAE,4BAA4B,EAAE,IAAI,EAAE,CAAC,CAAC;IACvF,IAAI,SAAS,KAAK,OAAO,EAAE,CAAC;QAC1B,yBAAyB,GAAG,IAAI,CAAC;QACjC,OAAO,GAAG,aAAa,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,iDAAiD;QAC7F,IAAI,SAAS,KAAK,OAAO;YACvB,OAAO;gBACL,MAAM,EAAE,8BAA8B,CAAC,mBAAmB;gBAC1D,uBAAuB,EAAE,EAAE;gBAC3B,uBAAuB,EAAE,EAAE;gBAC3B,SAAS,EAAE,SAAS,CAAC,SAAS;gBAC9B,mBAAmB,EAAE,YAAY;gBACjC,UAAU,EAAE,EAAE;aACf,CAAC;IACN,CAAC;IAED,MAAM,YAAY,GAAG,IAAI,2BAAY,EAAE,CAAC;IACxC,MAAM,aAAa,GAAG,YAAY,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAC5D,aAAa,CAAC,mBAAmB,GAAG,YAAY,CAAC;IAEjD,IAAI,yBAAyB,IAAI,aAAa,CAAC,MAAM,KAAK,8BAA8B,CAAC,uBAAuB;QAC9G,aAAa,CAAC,MAAM,GAAG,8BAA8B,CAAC,sBAAsB,CAAC;IAE/E,OAAO,aAAa,CAAC;AACvB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Compatibility\n */\n\nimport { Capabilities } from \"./Capabilities\";\n\n/** A type describing either a WebGL 1 or WebGL 2 rendering context.\n * @public\n */\nexport type WebGLContext = WebGLRenderingContext | WebGL2RenderingContext;\n\n/** Enumerates the required and optional WebGL features used by the [RenderSystem]($frontend).\n * @public\n */\nexport enum WebGLFeature {\n /** This feature allows transparent geometry to be rendered more efficiently, using 1 pass instead of 2. */\n MrtTransparency = \"mrt transparency\",\n /** This feature allows picking to occur more efficiently, using 1 pass instead of 3. */\n MrtPick = \"mrt pick\",\n /** This feature ensures large meshes (with more than 21,845 triangles) can be rendered. */\n UintElementIndex = \"uint element index\",\n /** This feature allows transparency to achieve the optimal quality. Without this feature, overlapping transparent geometry will \"wash out\" more easily. */\n FloatRendering = \"float rendering\",\n /** This feature allows for the display of non-3D classification data and solar shadows. */\n DepthTexture = \"depth texture\",\n /** This feature allows instancing of repeated geometry, which can reduce memory consumption. */\n Instancing = \"instancing\",\n /** This feature indicates that the system has enough texture units available for the shaders to run properly. */\n MinimalTextureUnits = \"minimal texture units\",\n /** Indicates that shadow maps are supported. Without this feature, shadows cannot be displayed. */\n ShadowMaps = \"shadow maps\",\n /** This feature allows a logarithmic depth buffer to be used. Without this feature, z-fighting will be much more likely to occur. */\n FragDepth = \"fragment depth\",\n /** This feature allows the renderer to achieve accurate contour lines for isoline and stepped delimiter modes of thematic display. */\n StandardDerivatives = \"standard derivatives\",\n /** This feature allows the renderer to smooth curved lines. */\n AntiAliasing = \"anti-aliasing\",\n}\n\n/** An enumeration that describes a general \"compatibility rating\" based on the contents of a [[WebGLRenderCompatibilityInfo]].\n * @public\n */\nexport enum WebGLRenderCompatibilityStatus {\n /**\n * Signifies that everything is ideal: context created successfully, all required and optional features are available,\n * and browser did not signal a major performance caveat.\n */\n AllOkay,\n /**\n * Signifies that the base requirements of compatibility are met but at least some optional features are missing.\n * Consult the contents of [[WebGLRenderCompatibilityInfo.missingOptionalFeatures]].\n */\n MissingOptionalFeatures,\n /**\n * Signifies that the base requirements of compatibility are met but WebGL reported a major performance caveat. The browser\n * has likely fallen back to software rendering due to lack of a usable GPU.\n * Consult [[WebGLRenderCompatibilityInfo.contextErrorMessage]] for a possible description of what went wrong.\n * There could also be some missing optional features; consult the contents of [[WebGLRenderCompatibilityInfo.missingOptionalFeatures]].\n */\n MajorPerformanceCaveat,\n /**\n * Signifies that the base requirements of compatibility are not met; rendering cannot occur.\n * Consult the contents of [[WebGLRenderCompatibilityInfo.missingRequiredFeatures]].\n */\n MissingRequiredFeatures,\n /**\n * Signifies an inability to create either a canvas or a WebGL rendering context; rendering cannot occur. Consult\n * [[WebGLRenderCompatibilityInfo.contextErrorMessage]] for a possible description of what went wrong.\n */\n CannotCreateContext,\n}\n\n/** Known bugs associated with specific graphics drivers for which iTwin.js can apply workarounds to produce correct visualization.\n * An instance of this object will exist on the [[WebGLRenderCompatibilityInfo]] object returned by [[queryRenderCompatibility]].\n * @see [[WebGLRenderCompatibilityInfo]]\n * @public\n */\nexport interface GraphicsDriverBugs {\n /** If true, the graphics driver inappropriately applies the \"early Z\" optimization when a fragment shader writes to the depth buffer.\n * Early Z elides execution of the fragment shader if the depth test fails; but if the fragment shader contains code that can alter the depth, it\n * must be executed. The primary symptom of this bug is transparent geometry appearing to be behind opaque geometry despite actually being in front of it.\n *\n * Affects Intel HD/UHD Graphics 620/630.\n *\n * The workaround for this bug has minimal impact on performance and no impact on visual fidelity.\n */\n fragDepthDoesNotDisableEarlyZ?: true;\n /** If true, the graphics driver will hang when applying MSAA to a viewport.\n *\n * Known to affect certain mobile Mali chipsets (G71 and G76). May affect more.\n *\n * The workaround for this bug means MSAA cannot be enabled on those devices.\n */\n msaaWillHang?: true;\n}\n\n/** Describes the level of compatibility of a client device/browser with the iTwin.js rendering system.\n * @public\n */\nexport interface WebGLRenderCompatibilityInfo {\n /** Describes the overall status of rendering compatibility. */\n status: WebGLRenderCompatibilityStatus;\n /** Features that are required by the rendering system but not supported by the client. */\n missingRequiredFeatures: WebGLFeature[];\n /** Optional features unsupported by this client that would provide improved performance or quality if present. */\n missingOptionalFeatures: WebGLFeature[];\n /** Known bugs associated with the client's graphics driver for which iTwin.js can apply workarounds. */\n driverBugs: GraphicsDriverBugs;\n /** The user agent as reported by the browser. */\n userAgent: string;\n /** The renderer string reported by this client's graphics driver. */\n unmaskedRenderer?: string;\n /** The vendor string reported by this client's graphics driver. */\n unmaskedVendor?: string;\n /** If true, there is a likelihood that integrated graphics are being used. This can be used to warn users on systems with both integrated graphics and dedicated graphics that they should try to switch to their dedicated graphics for better performance.\n * @note This property has the possibility of providing false positives and negatives. A user should use this property mainly as a hint and manually verify what graphics chip is being used.\n */\n usingIntegratedGraphics?: boolean;\n /** If WebGL context creation failed, an error message supplied by the browser. */\n contextErrorMessage?: string;\n /** The WebGL context created by the browser and used to generate the compatibility report. */\n createdContext?: WebGLContext;\n}\n\n/** A function that creates and returns a WebGLContext given an HTMLCanvasElement, a boolean specifying whether to use WebGL2, and a WebGLContextAttributes object describing the desired context attributes.\n * @public\n */\nexport type ContextCreator = (canvas: HTMLCanvasElement, useWebGL2: boolean, inputContextAttributes?: WebGLContextAttributes) => WebGLContext | undefined;\n\nfunction createDefaultContext(canvas: HTMLCanvasElement, useWebGL2: boolean = true, attributes?: WebGLContextAttributes): WebGLContext | undefined {\n let context = useWebGL2 ? canvas.getContext(\"webgl2\", attributes) : canvas.getContext(\"webgl\", attributes);\n if (context === null && useWebGL2)\n context = canvas.getContext(\"webgl\", attributes);\n return context ?? undefined;\n}\n\n/** This function returns information about the client system's level of compatibility with the iTwin.js rendering system, describing the client system's support for both optional and required features. It will also report if there is a major issue with the client system such as the browser falling back to software rendering or an inability to create a either a canvas or a WebGL rendering context.\n * @param useWebGL2 A boolean which will be passed to the createContext function in order to create the desired type of context; set this to `true` to use WebGL2, `false` to use WebGL1.\n * @param createContext A function of type [[ContextCreator]] that returns a WebGLContext. If not specified, this by default uses `canvas.getContext()` to create the WebGLContext.\n * @returns A [[WebGLRenderCompatibilityInfo]] object which contains a compatibility summary.\n * @see [[WebGLRenderCompatibilityInfo]]\n * @public\n */\nexport function queryRenderCompatibility(useWebGL2: boolean, createContext?: ContextCreator): WebGLRenderCompatibilityInfo {\n const canvas = document.createElement(\"canvas\");\n if (null === canvas)\n return { status: WebGLRenderCompatibilityStatus.CannotCreateContext, missingOptionalFeatures: [], missingRequiredFeatures: [], userAgent: navigator.userAgent, driverBugs: { } };\n\n let errorMessage: string | undefined;\n canvas.addEventListener(\"webglcontextcreationerror\", (event) => {\n errorMessage = (event as WebGLContextEvent).statusMessage || \"webglcontextcreationerror was triggered with no error provided\";\n }, false);\n\n if (undefined === createContext)\n createContext = createDefaultContext;\n\n let hasMajorPerformanceCaveat = false;\n let context = createContext(canvas, useWebGL2, { failIfMajorPerformanceCaveat: true });\n if (undefined === context) {\n hasMajorPerformanceCaveat = true;\n context = createContext(canvas, useWebGL2); // try to create context without black-listed GPU\n if (undefined === context)\n return {\n status: WebGLRenderCompatibilityStatus.CannotCreateContext,\n missingOptionalFeatures: [],\n missingRequiredFeatures: [],\n userAgent: navigator.userAgent,\n contextErrorMessage: errorMessage,\n driverBugs: {},\n };\n }\n\n const capabilities = new Capabilities();\n const compatibility = capabilities.init(context, undefined);\n compatibility.contextErrorMessage = errorMessage;\n\n if (hasMajorPerformanceCaveat && compatibility.status !== WebGLRenderCompatibilityStatus.MissingRequiredFeatures)\n compatibility.status = WebGLRenderCompatibilityStatus.MajorPerformanceCaveat;\n\n return compatibility;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"RenderCompatibility.js","sourceRoot":"","sources":["../../src/RenderCompatibility.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AA6IH,4DAqCC;AAhLD,iDAA8C;AAO9C;;GAEG;AACH,IAAY,YAuBX;AAvBD,WAAY,YAAY;IACtB,2GAA2G;IAC3G,oDAAoC,CAAA;IACpC,wFAAwF;IACxF,o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,aAAa,CAAC,MAAM,GAAG,8BAA8B,CAAC,sBAAsB,CAAC;IAE/E,OAAO,aAAa,CAAC;AACvB,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 { Capabilities } from \"./Capabilities\";\r\n\r\n/** A type describing either a WebGL 1 or WebGL 2 rendering context.\r\n * @public\r\n */\r\nexport type WebGLContext = WebGLRenderingContext | WebGL2RenderingContext;\r\n\r\n/** Enumerates the required and optional WebGL features used by the [RenderSystem]($frontend).\r\n * @public\r\n */\r\nexport enum WebGLFeature {\r\n /** This feature allows transparent geometry to be rendered more efficiently, using 1 pass instead of 2. */\r\n MrtTransparency = \"mrt transparency\",\r\n /** This feature allows picking to occur more efficiently, using 1 pass instead of 3. */\r\n MrtPick = \"mrt pick\",\r\n /** This feature ensures large meshes (with more than 21,845 triangles) can be rendered. */\r\n UintElementIndex = \"uint element index\",\r\n /** This feature allows transparency to achieve the optimal quality. Without this feature, overlapping transparent geometry will \"wash out\" more easily. */\r\n FloatRendering = \"float rendering\",\r\n /** This feature allows for the display of non-3D classification data and solar shadows. */\r\n DepthTexture = \"depth texture\",\r\n /** This feature allows instancing of repeated geometry, which can reduce memory consumption. */\r\n Instancing = \"instancing\",\r\n /** This feature indicates that the system has enough texture units available for the shaders to run properly. */\r\n MinimalTextureUnits = \"minimal texture units\",\r\n /** Indicates that shadow maps are supported. Without this feature, shadows cannot be displayed. */\r\n ShadowMaps = \"shadow maps\",\r\n /** This feature allows a logarithmic depth buffer to be used. Without this feature, z-fighting will be much more likely to occur. */\r\n FragDepth = \"fragment depth\",\r\n /** This feature allows the renderer to achieve accurate contour lines for isoline and stepped delimiter modes of thematic display. */\r\n StandardDerivatives = \"standard derivatives\",\r\n /** This feature allows the renderer to smooth curved lines. */\r\n AntiAliasing = \"anti-aliasing\",\r\n}\r\n\r\n/** An enumeration that describes a general \"compatibility rating\" based on the contents of a [[WebGLRenderCompatibilityInfo]].\r\n * @public\r\n */\r\nexport enum WebGLRenderCompatibilityStatus {\r\n /**\r\n * Signifies that everything is ideal: context created successfully, all required and optional features are available,\r\n * and browser did not signal a major performance caveat.\r\n */\r\n AllOkay,\r\n /**\r\n * Signifies that the base requirements of compatibility are met but at least some optional features are missing.\r\n * Consult the contents of [[WebGLRenderCompatibilityInfo.missingOptionalFeatures]].\r\n */\r\n MissingOptionalFeatures,\r\n /**\r\n * Signifies that the base requirements of compatibility are met but WebGL reported a major performance caveat. The browser\r\n * has likely fallen back to software rendering due to lack of a usable GPU.\r\n * Consult [[WebGLRenderCompatibilityInfo.contextErrorMessage]] for a possible description of what went wrong.\r\n * There could also be some missing optional features; consult the contents of [[WebGLRenderCompatibilityInfo.missingOptionalFeatures]].\r\n */\r\n MajorPerformanceCaveat,\r\n /**\r\n * Signifies that the base requirements of compatibility are not met; rendering cannot occur.\r\n * Consult the contents of [[WebGLRenderCompatibilityInfo.missingRequiredFeatures]].\r\n */\r\n MissingRequiredFeatures,\r\n /**\r\n * Signifies an inability to create either a canvas or a WebGL rendering context; rendering cannot occur. Consult\r\n * [[WebGLRenderCompatibilityInfo.contextErrorMessage]] for a possible description of what went wrong.\r\n */\r\n CannotCreateContext,\r\n}\r\n\r\n/** Known bugs associated with specific graphics drivers for which iTwin.js can apply workarounds to produce correct visualization.\r\n * An instance of this object will exist on the [[WebGLRenderCompatibilityInfo]] object returned by [[queryRenderCompatibility]].\r\n * @see [[WebGLRenderCompatibilityInfo]]\r\n * @public\r\n */\r\nexport interface GraphicsDriverBugs {\r\n /** If true, the graphics driver inappropriately applies the \"early Z\" optimization when a fragment shader writes to the depth buffer.\r\n * Early Z elides execution of the fragment shader if the depth test fails; but if the fragment shader contains code that can alter the depth, it\r\n * must be executed. The primary symptom of this bug is transparent geometry appearing to be behind opaque geometry despite actually being in front of it.\r\n *\r\n * Affects Intel HD/UHD Graphics 620/630.\r\n *\r\n * The workaround for this bug has minimal impact on performance and no impact on visual fidelity.\r\n */\r\n fragDepthDoesNotDisableEarlyZ?: true;\r\n /** If true, the graphics driver will hang when applying MSAA to a viewport.\r\n *\r\n * Known to affect certain mobile Mali chipsets (G71 and G76). May affect more.\r\n *\r\n * The workaround for this bug means MSAA cannot be enabled on those devices.\r\n */\r\n msaaWillHang?: true;\r\n}\r\n\r\n/** Describes the level of compatibility of a client device/browser with the iTwin.js rendering system.\r\n * @public\r\n */\r\nexport interface WebGLRenderCompatibilityInfo {\r\n /** Describes the overall status of rendering compatibility. */\r\n status: WebGLRenderCompatibilityStatus;\r\n /** Features that are required by the rendering system but not supported by the client. */\r\n missingRequiredFeatures: WebGLFeature[];\r\n /** Optional features unsupported by this client that would provide improved performance or quality if present. */\r\n missingOptionalFeatures: WebGLFeature[];\r\n /** Known bugs associated with the client's graphics driver for which iTwin.js can apply workarounds. */\r\n driverBugs: GraphicsDriverBugs;\r\n /** The user agent as reported by the browser. */\r\n userAgent: string;\r\n /** The renderer string reported by this client's graphics driver. */\r\n unmaskedRenderer?: string;\r\n /** The vendor string reported by this client's graphics driver. */\r\n unmaskedVendor?: string;\r\n /** If true, there is a likelihood that integrated graphics are being used. This can be used to warn users on systems with both integrated graphics and dedicated graphics that they should try to switch to their dedicated graphics for better performance.\r\n * @note This property has the possibility of providing false positives and negatives. A user should use this property mainly as a hint and manually verify what graphics chip is being used.\r\n */\r\n usingIntegratedGraphics?: boolean;\r\n /** If WebGL context creation failed, an error message supplied by the browser. */\r\n contextErrorMessage?: string;\r\n /** The WebGL context created by the browser and used to generate the compatibility report. */\r\n createdContext?: WebGLContext;\r\n}\r\n\r\n/** A function that creates and returns a WebGLContext given an HTMLCanvasElement, a boolean specifying whether to use WebGL2, and a WebGLContextAttributes object describing the desired context attributes.\r\n * @public\r\n */\r\nexport type ContextCreator = (canvas: HTMLCanvasElement, useWebGL2: boolean, inputContextAttributes?: WebGLContextAttributes) => WebGLContext | undefined;\r\n\r\nfunction createDefaultContext(canvas: HTMLCanvasElement, useWebGL2: boolean = true, attributes?: WebGLContextAttributes): WebGLContext | undefined {\r\n let context = useWebGL2 ? canvas.getContext(\"webgl2\", attributes) : canvas.getContext(\"webgl\", attributes);\r\n if (context === null && useWebGL2)\r\n context = canvas.getContext(\"webgl\", attributes);\r\n return context ?? undefined;\r\n}\r\n\r\n/** This function returns information about the client system's level of compatibility with the iTwin.js rendering system, describing the client system's support for both optional and required features. It will also report if there is a major issue with the client system such as the browser falling back to software rendering or an inability to create a either a canvas or a WebGL rendering context.\r\n * @param useWebGL2 A boolean which will be passed to the createContext function in order to create the desired type of context; set this to `true` to use WebGL2, `false` to use WebGL1.\r\n * @param createContext A function of type [[ContextCreator]] that returns a WebGLContext. If not specified, this by default uses `canvas.getContext()` to create the WebGLContext.\r\n * @returns A [[WebGLRenderCompatibilityInfo]] object which contains a compatibility summary.\r\n * @see [[WebGLRenderCompatibilityInfo]]\r\n * @public\r\n */\r\nexport function queryRenderCompatibility(useWebGL2: boolean, createContext?: ContextCreator): WebGLRenderCompatibilityInfo {\r\n const canvas = document.createElement(\"canvas\");\r\n if (null === canvas)\r\n return { status: WebGLRenderCompatibilityStatus.CannotCreateContext, missingOptionalFeatures: [], missingRequiredFeatures: [], userAgent: navigator.userAgent, driverBugs: { } };\r\n\r\n let errorMessage: string | undefined;\r\n canvas.addEventListener(\"webglcontextcreationerror\", (event) => {\r\n errorMessage = (event as WebGLContextEvent).statusMessage || \"webglcontextcreationerror was triggered with no error provided\";\r\n }, false);\r\n\r\n if (undefined === createContext)\r\n createContext = createDefaultContext;\r\n\r\n let hasMajorPerformanceCaveat = false;\r\n let context = createContext(canvas, useWebGL2, { failIfMajorPerformanceCaveat: true });\r\n if (undefined === context) {\r\n hasMajorPerformanceCaveat = true;\r\n context = createContext(canvas, useWebGL2); // try to create context without black-listed GPU\r\n if (undefined === context)\r\n return {\r\n status: WebGLRenderCompatibilityStatus.CannotCreateContext,\r\n missingOptionalFeatures: [],\r\n missingRequiredFeatures: [],\r\n userAgent: navigator.userAgent,\r\n contextErrorMessage: errorMessage,\r\n driverBugs: {},\r\n };\r\n }\r\n\r\n const capabilities = new Capabilities();\r\n const compatibility = capabilities.init(context, undefined);\r\n compatibility.contextErrorMessage = errorMessage;\r\n\r\n if (hasMajorPerformanceCaveat && compatibility.status !== WebGLRenderCompatibilityStatus.MissingRequiredFeatures)\r\n compatibility.status = WebGLRenderCompatibilityStatus.MajorPerformanceCaveat;\r\n\r\n return compatibility;\r\n}\r\n"]}
|
|
@@ -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;;;;;GAKG;AAEH;;;GAGG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nexport * from \"./Capabilities\";\nexport * from \"./RenderCompatibility\";\n\n/** @docs-package-description\n * The webgl-compatibility package provides APIs for determining the level of compatibility of a browser and device with the iTwin.js rendering system.\n *\n * This package is used by the [iTwin.js Compatibility Checker website](https://itwinjscompatibility.bentley.com/) to evaluate whether\n * a user's browser and hardware meet the requirements for running iTwin.js applications.\n */\n\n/**\n * @docs-group-description Compatibility\n * APIs for evaluating compatibility with the iTwin.js rendering system.\n */\n"]}
|
|
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;;;;;GAKG;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 and device with the iTwin.js rendering system.\r\n *\r\n * This package is used by the [iTwin.js Compatibility Checker website](https://itwinjscompatibility.bentley.com/) to evaluate whether\r\n * a user's browser and hardware meet the requirements for running iTwin.js applications.\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.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,SAQX;AARD,WAAY,SAAS;IACnB,uFAA2B,CAAA;IAC3B,+FAA+F;IAC/F,kDAA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M,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","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Compatibility\n */\n\nimport { ProcessDetector } from \"@itwin/core-bentley\";\nimport {\n GraphicsDriverBugs, WebGLContext, WebGLFeature, WebGLRenderCompatibilityInfo, WebGLRenderCompatibilityStatus,\n} from \"./RenderCompatibility\";\n\n/** @internal */\nexport type WebGLExtensionName =\n \"WEBGL_draw_buffers\" | \"OES_element_index_uint\" | \"OES_texture_float\" | \"OES_texture_float_linear\" |\n \"OES_texture_half_float\" | \"OES_texture_half_float_linear\" | \"EXT_texture_filter_anisotropic\" | \"WEBGL_depth_texture\" |\n \"EXT_color_buffer_float\" | \"EXT_shader_texture_lod\" | \"ANGLE_instanced_arrays\" | \"OES_vertex_array_object\" | \"WEBGL_lose_context\" |\n \"EXT_frag_depth\" | \"EXT_disjoint_timer_query\" | \"EXT_disjoint_timer_query_webgl2\" | \"OES_standard_derivatives\" | \"EXT_float_blend\";\n\nconst knownExtensions: WebGLExtensionName[] = [\n \"WEBGL_draw_buffers\",\n \"OES_element_index_uint\",\n \"OES_texture_float\",\n \"OES_texture_float_linear\",\n \"OES_texture_half_float\",\n \"OES_texture_half_float_linear\",\n \"EXT_texture_filter_anisotropic\",\n \"WEBGL_depth_texture\",\n \"EXT_color_buffer_float\",\n \"EXT_shader_texture_lod\",\n \"EXT_frag_depth\",\n \"ANGLE_instanced_arrays\",\n \"OES_vertex_array_object\",\n \"WEBGL_lose_context\",\n \"EXT_disjoint_timer_query\",\n \"EXT_disjoint_timer_query_webgl2\",\n \"OES_standard_derivatives\",\n \"EXT_float_blend\",\n];\n\n/** Describes the type of a render target. Used by Capabilities to represent maximum precision render target available on host system.\n * @internal\n */\nexport enum RenderType {\n TextureUnsignedByte,\n TextureHalfFloat,\n TextureFloat,\n}\n\n/**\n * Describes the type of a depth buffer. Used by Capabilities to represent maximum depth buffer precision available on host system.\n * Note: the commented-out values are unimplemented but left in place for reference, in case desired for future implementation.\n * @internal\n */\nexport enum DepthType {\n RenderBufferUnsignedShort16, // core to WebGL1\n // TextureUnsignedShort16, // core to WebGL2; available to WebGL1 via WEBGL_depth_texture\n // TextureUnsignedInt24, // core to WebGL2\n TextureUnsignedInt24Stencil8, // core to WebGL2; available to WebGL1 via WEBGL_depth_texture\n TextureUnsignedInt32, // core to WebGL2; available to WebGL1 via WEBGL_depth_texture\n // TextureFloat32, // core to WebGL2\n // TextureFloat32Stencil8, // core to WeBGL2\n}\n\nconst maxTexSizeAllowed = 4096; // many devices and browsers have issues with source textures larger than this\n\n// Regexes to match Intel UHD/HD 620/630 integrated GPUS that suffer from GraphicsDriverBugs.fragDepthDoesNotDisableEarlyZ.\nconst buggyIntelMatchers = [\n // Original unmasked renderer string when workaround we implemented.\n /ANGLE \\(Intel\\(R\\) (U)?HD Graphics 6(2|3)0 Direct3D11/,\n // New unmasked renderer string circa October 2021.\n /ANGLE \\(Intel, Intel\\(R\\) (U)?HD Graphics 6(2|3)0 Direct3D11/,\n];\n\n// Regexes to match Mali GPUs known to suffer from GraphicsDriverBugs.msaaWillHang.\nconst buggyMaliMatchers = [\n /Mali-G71/,\n /Mali-G72/,\n /Mali-G76/,\n];\n\n// Regexes to match as many Intel integrated GPUs as possible.\n// https://en.wikipedia.org/wiki/List_of_Intel_graphics_processing_units\nconst integratedIntelGpuMatchers = [\n /(U)?HD Graphics/,\n /Iris/,\n];\n\nfunction isIntegratedGraphics(args: {unmaskedVendor?: string, unmaskedRenderer?: string}): boolean {\n if (args.unmaskedRenderer && args.unmaskedRenderer.includes(\"Intel\") && integratedIntelGpuMatchers.some((x) => x.test(args.unmaskedRenderer!)))\n return true;\n\n // NB: For now, we do not attempt to detect AMD integrated graphics.\n // It appears that AMD integrated graphics are not usually paired with a graphics card so detecting integrated usage there is less important than Intel.\n\n return false;\n}\n\n/** Describes the rendering capabilities of the host system.\n * @internal\n */\nexport class Capabilities {\n private _maxRenderType: RenderType = RenderType.TextureUnsignedByte;\n private _maxDepthType: DepthType = DepthType.RenderBufferUnsignedShort16;\n private _maxTextureSize: number = 0;\n private _maxColorAttachments: number = 0;\n private _maxDrawBuffers: number = 0;\n private _maxFragTextureUnits: number = 0;\n private _maxVertTextureUnits: number = 0;\n private _maxVertAttribs: number = 0;\n private _maxVertUniformVectors: number = 0;\n private _maxVaryingVectors: number = 0;\n private _maxFragUniformVectors: number = 0;\n private _maxAnisotropy?: number;\n private _maxAntialiasSamples: number = 1;\n private _supportsCreateImageBitmap: boolean = false;\n private _maxTexSizeAllow: number = maxTexSizeAllowed;\n\n private _extensionMap: { [key: string]: any } = {}; // Use this map to store actual extension objects retrieved from GL.\n private _presentFeatures: WebGLFeature[] = []; // List of features the system can support (not necessarily dependent on extensions)\n\n private _isWebGL2: boolean = false;\n private _isMobile: boolean = false;\n private _driverBugs: GraphicsDriverBugs = {};\n\n public get maxRenderType(): RenderType { return this._maxRenderType; }\n public get maxDepthType(): DepthType { return this._maxDepthType; }\n public get maxTextureSize(): number { return this._maxTextureSize; }\n public get maxTexSizeAllow(): number { return this._maxTexSizeAllow; }\n public get supportsCreateImageBitmap(): boolean { return this._supportsCreateImageBitmap; }\n public get maxColorAttachments(): number { return this._maxColorAttachments; }\n public get maxDrawBuffers(): number { return this._maxDrawBuffers; }\n public get maxFragTextureUnits(): number { return this._maxFragTextureUnits; }\n public get maxVertTextureUnits(): number { return this._maxVertTextureUnits; }\n public get maxVertAttribs(): number { return this._maxVertAttribs; }\n public get maxVertUniformVectors(): number { return this._maxVertUniformVectors; }\n public get maxVaryingVectors(): number { return this._maxVaryingVectors; }\n public get maxFragUniformVectors(): number { return this._maxFragUniformVectors; }\n public get maxAntialiasSamples(): number { return this._maxAntialiasSamples; }\n public get isWebGL2(): boolean { return this._isWebGL2; }\n public get driverBugs(): GraphicsDriverBugs { return this._driverBugs; }\n\n /** These getters check for existence of extension objects to determine availability of features. In WebGL2, could just return true for some. */\n public get supportsNonPowerOf2Textures(): boolean { return false; }\n public get supportsDrawBuffers(): boolean { return this._isWebGL2 || this.queryExtensionObject<WEBGL_draw_buffers>(\"WEBGL_draw_buffers\") !== undefined; }\n public get supportsInstancing(): boolean { return this._isWebGL2 || this.queryExtensionObject<ANGLE_instanced_arrays>(\"ANGLE_instanced_arrays\") !== undefined; }\n public get supports32BitElementIndex(): boolean { return this._isWebGL2 || this.queryExtensionObject<OES_element_index_uint>(\"OES_element_index_uint\") !== undefined; }\n public get supportsTextureFloat(): boolean { return this._isWebGL2 || this.queryExtensionObject<OES_texture_float>(\"OES_texture_float\") !== undefined; }\n public get supportsTextureFloatLinear(): boolean { return this._isWebGL2 || this.queryExtensionObject<OES_texture_float_linear>(\"OES_texture_float_linear\") !== undefined; }\n public get supportsTextureHalfFloat(): boolean { return this._isWebGL2 || this.queryExtensionObject<OES_texture_half_float>(\"OES_texture_half_float\") !== undefined; }\n public get supportsTextureHalfFloatLinear(): boolean { return this._isWebGL2 || this.queryExtensionObject<OES_texture_half_float_linear>(\"OES_texture_half_float_linear\") !== undefined; }\n public get supportsTextureFilterAnisotropic(): boolean { return this.queryExtensionObject<EXT_texture_filter_anisotropic>(\"EXT_texture_filter_anisotropic\") !== undefined; }\n public get supportsShaderTextureLOD(): boolean { return this._isWebGL2 || this.queryExtensionObject<EXT_shader_texture_lod>(\"EXT_shader_texture_lod\") !== undefined; }\n public get supportsVertexArrayObjects(): boolean { return this._isWebGL2 || this.queryExtensionObject<OES_vertex_array_object>(\"OES_vertex_array_object\") !== undefined; }\n public get supportsFragDepth(): boolean { return this._isWebGL2 || this.queryExtensionObject<EXT_frag_depth>(\"EXT_frag_depth\") !== undefined; }\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; }\n public get supportsStandardDerivatives(): boolean { return this._isWebGL2 || this.queryExtensionObject<OES_standard_derivatives>(\"OES_standard_derivatives\") !== undefined; }\n\n public get supportsMRTTransparency(): boolean { return this.maxColorAttachments >= 2; }\n public get supportsMRTPickShaders(): boolean { return this.maxColorAttachments >= 3; }\n\n public get supportsShadowMaps(): boolean {\n return this.supportsTextureFloat || this.supportsTextureHalfFloat;\n }\n\n public get supportsAntiAliasing(): boolean { return this._isWebGL2 && this.maxAntialiasSamples > 1; }\n\n public get isMobile(): boolean { return this._isMobile; }\n\n private findExtension(name: WebGLExtensionName): any {\n const ext = this._extensionMap[name];\n return null !== ext ? ext : undefined;\n }\n\n /** Queries an extension object if available. This is necessary for other parts of the system to access some constants within extensions. */\n public queryExtensionObject<T>(ext: WebGLExtensionName): T | undefined {\n return this.findExtension(ext) as T;\n }\n\n public static readonly optionalFeatures: WebGLFeature[] = [\n WebGLFeature.MrtTransparency,\n WebGLFeature.MrtPick,\n WebGLFeature.DepthTexture,\n WebGLFeature.FloatRendering,\n WebGLFeature.Instancing,\n WebGLFeature.ShadowMaps,\n WebGLFeature.FragDepth,\n WebGLFeature.StandardDerivatives,\n WebGLFeature.AntiAliasing,\n ];\n public static readonly requiredFeatures: WebGLFeature[] = [\n WebGLFeature.UintElementIndex,\n WebGLFeature.MinimalTextureUnits,\n ];\n\n private get _hasRequiredTextureUnits(): boolean { return this.maxFragTextureUnits >= 4 && this.maxVertTextureUnits >= 5; }\n\n /** Return an array containing any features not supported by the system as compared to the input array. */\n private _findMissingFeatures(featuresToSeek: WebGLFeature[]): WebGLFeature[] {\n const missingFeatures: WebGLFeature[] = [];\n for (const featureName of featuresToSeek) {\n if (-1 === this._presentFeatures.indexOf(featureName))\n missingFeatures.push(featureName);\n }\n return missingFeatures;\n }\n\n /** Populate and return an array containing features that this system supports. */\n private _gatherFeatures(): WebGLFeature[] {\n const features: WebGLFeature[] = [];\n\n // simply check for presence of various extensions if that gives enough information\n if (this._isWebGL2 || this._extensionMap[\"OES_element_index_uint\" as WebGLExtensionName] !== undefined)\n features.push(WebGLFeature.UintElementIndex);\n if (this._isWebGL2 || this._extensionMap[\"ANGLE_instanced_arrays\" as WebGLExtensionName] !== undefined)\n features.push(WebGLFeature.Instancing);\n\n if (this.supportsMRTTransparency)\n features.push(WebGLFeature.MrtTransparency);\n if (this.supportsMRTPickShaders)\n features.push(WebGLFeature.MrtPick);\n if (this.supportsShadowMaps)\n features.push(WebGLFeature.ShadowMaps);\n if (this._hasRequiredTextureUnits)\n features.push(WebGLFeature.MinimalTextureUnits);\n if (this.supportsFragDepth)\n features.push(WebGLFeature.FragDepth);\n if (this.supportsStandardDerivatives)\n features.push(WebGLFeature.StandardDerivatives);\n if (this.supportsAntiAliasing)\n features.push(WebGLFeature.AntiAliasing);\n\n if (DepthType.TextureUnsignedInt24Stencil8 === this._maxDepthType)\n features.push(WebGLFeature.DepthTexture);\n\n // check if at least half-float rendering is available based on maximum discovered renderable target\n if (RenderType.TextureUnsignedByte !== this._maxRenderType)\n features.push(WebGLFeature.FloatRendering);\n\n return features;\n }\n\n /** Retrieve compatibility status based on presence of various features. */\n private _getCompatibilityStatus(missingRequiredFeatures: WebGLFeature[], missingOptionalFeatures: WebGLFeature[]): WebGLRenderCompatibilityStatus {\n let status: WebGLRenderCompatibilityStatus = WebGLRenderCompatibilityStatus.AllOkay;\n if (missingOptionalFeatures.length > 0)\n status = WebGLRenderCompatibilityStatus.MissingOptionalFeatures;\n if (missingRequiredFeatures.length > 0)\n status = WebGLRenderCompatibilityStatus.MissingRequiredFeatures;\n return status;\n }\n\n /** Initializes the capabilities based on a GL context. Must be called first. */\n public init(gl: WebGLContext, disabledExtensions?: WebGLExtensionName[]): WebGLRenderCompatibilityInfo {\n const gl2 = !(gl instanceof WebGLRenderingContext) ? gl : undefined;\n this._isWebGL2 = undefined !== gl2;\n\n this._isMobile = ProcessDetector.isMobileBrowser;\n\n const debugInfo = gl.getExtension(\"WEBGL_debug_renderer_info\");\n const unmaskedRenderer = debugInfo !== null ? gl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL) : undefined;\n const unmaskedVendor = debugInfo !== null ? gl.getParameter(debugInfo.UNMASKED_VENDOR_WEBGL) : undefined;\n\n this._driverBugs = {};\n if (unmaskedRenderer && buggyIntelMatchers.some((x) => x.test(unmaskedRenderer)))\n this._driverBugs.fragDepthDoesNotDisableEarlyZ = true;\n\n if (unmaskedRenderer && buggyMaliMatchers.some((x) => x.test(unmaskedRenderer)))\n this._driverBugs.msaaWillHang = true;\n\n this._maxTextureSize = gl.getParameter(gl.MAX_TEXTURE_SIZE);\n this._supportsCreateImageBitmap = typeof createImageBitmap === \"function\" && ProcessDetector.isChromium && !ProcessDetector.isIOSBrowser;\n this._maxTexSizeAllow = Math.min(this._maxTextureSize, maxTexSizeAllowed);\n this._maxFragTextureUnits = gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS);\n this._maxVertTextureUnits = gl.getParameter(gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS);\n this._maxVertAttribs = gl.getParameter(gl.MAX_VERTEX_ATTRIBS);\n this._maxVertUniformVectors = gl.getParameter(gl.MAX_VERTEX_UNIFORM_VECTORS);\n this._maxVaryingVectors = gl.getParameter(gl.MAX_VARYING_VECTORS);\n this._maxFragUniformVectors = gl.getParameter(gl.MAX_FRAGMENT_UNIFORM_VECTORS);\n this._maxAntialiasSamples = this._driverBugs.msaaWillHang ? 1 : (this._isWebGL2 && undefined !== gl2 ? gl.getParameter(gl2.MAX_SAMPLES) : 1);\n\n const extensions = gl.getSupportedExtensions(); // This just retrieves a list of available extensions (not necessarily enabled).\n if (extensions) {\n for (const extStr of extensions) {\n const ext = extStr as WebGLExtensionName;\n if (-1 === knownExtensions.indexOf(ext))\n continue;\n else if (undefined !== disabledExtensions && -1 !== disabledExtensions.indexOf(ext))\n continue;\n\n const extObj: any = gl.getExtension(ext); // This call enables the extension and returns a WebGLObject containing extension instance.\n if (null !== extObj)\n this._extensionMap[ext] = extObj;\n }\n }\n\n if (this._isWebGL2 && undefined !== gl2) {\n this._maxColorAttachments = gl.getParameter(gl2.MAX_COLOR_ATTACHMENTS);\n this._maxDrawBuffers = gl.getParameter(gl2.MAX_DRAW_BUFFERS);\n } else {\n const dbExt: WEBGL_draw_buffers | undefined = this.queryExtensionObject<WEBGL_draw_buffers>(\"WEBGL_draw_buffers\");\n this._maxColorAttachments = dbExt !== undefined ? gl.getParameter(dbExt.MAX_COLOR_ATTACHMENTS_WEBGL) : 1;\n this._maxDrawBuffers = dbExt !== undefined ? gl.getParameter(dbExt.MAX_DRAW_BUFFERS_WEBGL) : 1;\n }\n\n // Determine the maximum color-renderable attachment type.\n const allowFloatRender =\n (undefined === disabledExtensions || -1 === disabledExtensions.indexOf(\"OES_texture_float\"))\n // iOS>=15 allows full-float rendering. However, it does not actually work on non-M1 devices.\n // Because of this, for now we disallow full float rendering on iOS devices.\n // ###TODO: Re-assess this after future iOS updates.\n && !ProcessDetector.isIOSBrowser\n // Samsung Galaxy Note 8 exhibits same issue as described above for iOS >= 15.\n // It uses specifically Mali-G71 MP20 but reports its renderer as follows.\n // Samsung Galaxy A50 and S9 exhibits same issue; they use Mali-G72.\n // HUAWEI P30 exhibits same issue; it uses Mali-G76.\n && unmaskedRenderer !== \"Mali-G71\" && unmaskedRenderer !== \"Mali-G72\" && unmaskedRenderer !== \"Mali-G76\";\n\n if (allowFloatRender && undefined !== this.queryExtensionObject(\"EXT_float_blend\") && this.isTextureRenderable(gl, gl.FLOAT)) {\n this._maxRenderType = RenderType.TextureFloat;\n } else if (this.isWebGL2) {\n this._maxRenderType = (this.isTextureRenderable(gl, (gl as WebGL2RenderingContext).HALF_FLOAT)) ? RenderType.TextureHalfFloat : RenderType.TextureUnsignedByte;\n } else {\n const hfExt: OES_texture_half_float | undefined = this.queryExtensionObject<OES_texture_half_float>(\"OES_texture_half_float\");\n this._maxRenderType = (hfExt !== undefined && this.isTextureRenderable(gl, hfExt.HALF_FLOAT_OES)) ? RenderType.TextureHalfFloat : RenderType.TextureUnsignedByte;\n }\n\n // Determine the maximum depth attachment type.\n // this._maxDepthType = this.queryExtensionObject(\"WEBGL_depth_texture\") !== undefined ? DepthType.TextureUnsignedInt32 : DepthType.RenderBufferUnsignedShort16;\n this._maxDepthType = this._isWebGL2 || this.queryExtensionObject(\"WEBGL_depth_texture\") !== undefined ? DepthType.TextureUnsignedInt24Stencil8 : DepthType.RenderBufferUnsignedShort16;\n\n this._presentFeatures = this._gatherFeatures();\n const missingRequiredFeatures = this._findMissingFeatures(Capabilities.requiredFeatures);\n const missingOptionalFeatures = this._findMissingFeatures(Capabilities.optionalFeatures);\n\n return {\n status: this._getCompatibilityStatus(missingRequiredFeatures, missingOptionalFeatures),\n missingRequiredFeatures,\n missingOptionalFeatures,\n unmaskedRenderer,\n unmaskedVendor,\n usingIntegratedGraphics: isIntegratedGraphics({unmaskedVendor, unmaskedRenderer}),\n driverBugs: { ...this._driverBugs },\n userAgent: navigator.userAgent,\n createdContext: gl,\n };\n }\n\n public static create(gl: WebGLContext, disabledExtensions?: WebGLExtensionName[]): Capabilities | undefined {\n const caps = new Capabilities();\n const compatibility = caps.init(gl, disabledExtensions);\n if (WebGLRenderCompatibilityStatus.CannotCreateContext === compatibility.status || WebGLRenderCompatibilityStatus.MissingRequiredFeatures === compatibility.status)\n return undefined;\n return caps;\n }\n\n /** Determines if a particular texture type is color-renderable on the host system. */\n private isTextureRenderable(gl: WebGLContext, texType: number): boolean {\n const tex: WebGLTexture | null = gl.createTexture();\n gl.bindTexture(gl.TEXTURE_2D, tex);\n if (this.isWebGL2) {\n if (gl.FLOAT === texType)\n gl.texImage2D(gl.TEXTURE_2D, 0, (gl as WebGL2RenderingContext).RGBA32F, 1, 1, 0, gl.RGBA, texType, null);\n else\n gl.texImage2D(gl.TEXTURE_2D, 0, (gl as WebGL2RenderingContext).RGBA16F, 1, 1, 0, gl.RGBA, texType, null);\n } else\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, texType, null);\n\n const fb: WebGLFramebuffer | null = gl.createFramebuffer();\n gl.bindFramebuffer(gl.FRAMEBUFFER, fb);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0);\n\n const fbStatus: number = gl.checkFramebufferStatus(gl.FRAMEBUFFER);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.deleteFramebuffer(fb);\n gl.deleteTexture(tex);\n\n gl.getError(); // clear any errors\n\n return fbStatus === gl.FRAMEBUFFER_COMPLETE;\n }\n\n public setMaxAnisotropy(desiredMax: number | undefined, gl: WebGLContext): void {\n const ext = this.queryExtensionObject<EXT_texture_filter_anisotropic>(\"EXT_texture_filter_anisotropic\");\n if (undefined === ext)\n return;\n\n if (undefined === this._maxAnisotropy)\n this._maxAnisotropy = gl.getParameter(ext.MAX_TEXTURE_MAX_ANISOTROPY_EXT) as number;\n\n const max = (undefined !== desiredMax) ? Math.min(desiredMax, this._maxAnisotropy) : this._maxAnisotropy;\n gl.texParameterf(gl.TEXTURE_2D, ext.TEXTURE_MAX_ANISOTROPY_EXT, max);\n }\n}\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,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,SAQX;AARD,WAAY,SAAS;IACnB,uFAA2B,CAAA;IAC3B,+FAA+F;IAC/F,kDAAkD;IAClD,yFAA4B,CAAA;IAC5B,yEAAoB,CAAA;IACpB,kDAAkD;IAClD,kDAAkD;AACpD,CAAC,EARW,SAAS,KAAT,SAAS,QAQpB;AAED,MAAM,iBAAiB,GAAG,IAAI,CAAC,CAAC,8EAA8E;AAE9G,2HAA2H;AAC3H,MAAM,kBAAkB,GAAG;IACzB,oEAAoE;IACpE,uDAAuD;IACvD,mDAAmD;IACnD,8DAA8D;CAC/D,CAAC;AAEF,mFAAmF;AACnF,MAAM,iBAAiB,GAAG;IACxB,UAAU;IACV,UAAU;IACV,UAAU;CACX,CAAC;AAEF,8DAA8D;AAC9D,wEAA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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","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Compatibility\r\n */\r\n\r\nimport { ProcessDetector } from \"@itwin/core-bentley\";\r\nimport {\r\n GraphicsDriverBugs, WebGLContext, WebGLFeature, WebGLRenderCompatibilityInfo, WebGLRenderCompatibilityStatus,\r\n} from \"./RenderCompatibility\";\r\n\r\n/** @internal */\r\nexport type WebGLExtensionName =\r\n \"WEBGL_draw_buffers\" | \"OES_element_index_uint\" | \"OES_texture_float\" | \"OES_texture_float_linear\" |\r\n \"OES_texture_half_float\" | \"OES_texture_half_float_linear\" | \"EXT_texture_filter_anisotropic\" | \"WEBGL_depth_texture\" |\r\n \"EXT_color_buffer_float\" | \"EXT_shader_texture_lod\" | \"ANGLE_instanced_arrays\" | \"OES_vertex_array_object\" | \"WEBGL_lose_context\" |\r\n \"EXT_frag_depth\" | \"EXT_disjoint_timer_query\" | \"EXT_disjoint_timer_query_webgl2\" | \"OES_standard_derivatives\" | \"EXT_float_blend\";\r\n\r\nconst knownExtensions: WebGLExtensionName[] = [\r\n \"WEBGL_draw_buffers\",\r\n \"OES_element_index_uint\",\r\n \"OES_texture_float\",\r\n \"OES_texture_float_linear\",\r\n \"OES_texture_half_float\",\r\n \"OES_texture_half_float_linear\",\r\n \"EXT_texture_filter_anisotropic\",\r\n \"WEBGL_depth_texture\",\r\n \"EXT_color_buffer_float\",\r\n \"EXT_shader_texture_lod\",\r\n \"EXT_frag_depth\",\r\n \"ANGLE_instanced_arrays\",\r\n \"OES_vertex_array_object\",\r\n \"WEBGL_lose_context\",\r\n \"EXT_disjoint_timer_query\",\r\n \"EXT_disjoint_timer_query_webgl2\",\r\n \"OES_standard_derivatives\",\r\n \"EXT_float_blend\",\r\n];\r\n\r\n/** Describes the type of a render target. Used by Capabilities to represent maximum precision render target available on host system.\r\n * @internal\r\n */\r\nexport enum RenderType {\r\n TextureUnsignedByte,\r\n TextureHalfFloat,\r\n TextureFloat,\r\n}\r\n\r\n/**\r\n * Describes the type of a depth buffer. Used by Capabilities to represent maximum depth buffer precision available on host system.\r\n * Note: the commented-out values are unimplemented but left in place for reference, in case desired for future implementation.\r\n * @internal\r\n */\r\nexport enum DepthType {\r\n RenderBufferUnsignedShort16, // core to WebGL1\r\n // TextureUnsignedShort16, // core to WebGL2; available to WebGL1 via WEBGL_depth_texture\r\n // TextureUnsignedInt24, // core to WebGL2\r\n TextureUnsignedInt24Stencil8, // core to WebGL2; available to WebGL1 via WEBGL_depth_texture\r\n TextureUnsignedInt32, // core to WebGL2; available to WebGL1 via WEBGL_depth_texture\r\n // TextureFloat32, // core to WebGL2\r\n // TextureFloat32Stencil8, // core to WeBGL2\r\n}\r\n\r\nconst maxTexSizeAllowed = 4096; // many devices and browsers have issues with source textures larger than this\r\n\r\n// Regexes to match Intel UHD/HD 620/630 integrated GPUS that suffer from GraphicsDriverBugs.fragDepthDoesNotDisableEarlyZ.\r\nconst buggyIntelMatchers = [\r\n // Original unmasked renderer string when workaround we implemented.\r\n /ANGLE \\(Intel\\(R\\) (U)?HD Graphics 6(2|3)0 Direct3D11/,\r\n // New unmasked renderer string circa October 2021.\r\n /ANGLE \\(Intel, Intel\\(R\\) (U)?HD Graphics 6(2|3)0 Direct3D11/,\r\n];\r\n\r\n// Regexes to match Mali GPUs known to suffer from GraphicsDriverBugs.msaaWillHang.\r\nconst buggyMaliMatchers = [\r\n /Mali-G71/,\r\n /Mali-G72/,\r\n /Mali-G76/,\r\n];\r\n\r\n// Regexes to match as many Intel integrated GPUs as possible.\r\n// https://en.wikipedia.org/wiki/List_of_Intel_graphics_processing_units\r\nconst integratedIntelGpuMatchers = [\r\n /(U)?HD Graphics/,\r\n /Iris/,\r\n];\r\n\r\nfunction isIntegratedGraphics(args: {unmaskedVendor?: string, unmaskedRenderer?: string}): boolean {\r\n if (args.unmaskedRenderer && args.unmaskedRenderer.includes(\"Intel\") && integratedIntelGpuMatchers.some((x) => x.test(args.unmaskedRenderer!)))\r\n return true;\r\n\r\n // NB: For now, we do not attempt to detect AMD integrated graphics.\r\n // It appears that AMD integrated graphics are not usually paired with a graphics card so detecting integrated usage there is less important than Intel.\r\n\r\n return false;\r\n}\r\n\r\n/** Describes the rendering capabilities of the host system.\r\n * @internal\r\n */\r\nexport class Capabilities {\r\n private _maxRenderType: RenderType = RenderType.TextureUnsignedByte;\r\n private _maxDepthType: DepthType = DepthType.RenderBufferUnsignedShort16;\r\n private _maxTextureSize: number = 0;\r\n private _maxColorAttachments: number = 0;\r\n private _maxDrawBuffers: number = 0;\r\n private _maxFragTextureUnits: number = 0;\r\n private _maxVertTextureUnits: number = 0;\r\n private _maxVertAttribs: number = 0;\r\n private _maxVertUniformVectors: number = 0;\r\n private _maxVaryingVectors: number = 0;\r\n private _maxFragUniformVectors: number = 0;\r\n private _maxAnisotropy?: number;\r\n private _maxAntialiasSamples: number = 1;\r\n private _supportsCreateImageBitmap: boolean = false;\r\n private _maxTexSizeAllow: number = maxTexSizeAllowed;\r\n\r\n private _extensionMap: { [key: string]: any } = {}; // Use this map to store actual extension objects retrieved from GL.\r\n private _presentFeatures: WebGLFeature[] = []; // List of features the system can support (not necessarily dependent on extensions)\r\n\r\n private _isWebGL2: boolean = false;\r\n private _isMobile: boolean = false;\r\n private _driverBugs: GraphicsDriverBugs = {};\r\n\r\n public get maxRenderType(): RenderType { return this._maxRenderType; }\r\n public get maxDepthType(): DepthType { return this._maxDepthType; }\r\n public get maxTextureSize(): number { return this._maxTextureSize; }\r\n public get maxTexSizeAllow(): number { return this._maxTexSizeAllow; }\r\n public get supportsCreateImageBitmap(): boolean { return this._supportsCreateImageBitmap; }\r\n public get maxColorAttachments(): number { return this._maxColorAttachments; }\r\n public get maxDrawBuffers(): number { return this._maxDrawBuffers; }\r\n public get maxFragTextureUnits(): number { return this._maxFragTextureUnits; }\r\n public get maxVertTextureUnits(): number { return this._maxVertTextureUnits; }\r\n public get maxVertAttribs(): number { return this._maxVertAttribs; }\r\n public get maxVertUniformVectors(): number { return this._maxVertUniformVectors; }\r\n public get maxVaryingVectors(): number { return this._maxVaryingVectors; }\r\n public get maxFragUniformVectors(): number { return this._maxFragUniformVectors; }\r\n public get maxAntialiasSamples(): number { return this._maxAntialiasSamples; }\r\n public get isWebGL2(): boolean { return this._isWebGL2; }\r\n public get driverBugs(): GraphicsDriverBugs { return this._driverBugs; }\r\n\r\n /** These getters check for existence of extension objects to determine availability of features. In WebGL2, could just return true for some. */\r\n public get supportsNonPowerOf2Textures(): boolean { return false; }\r\n public get supportsDrawBuffers(): boolean { return this._isWebGL2 || this.queryExtensionObject<WEBGL_draw_buffers>(\"WEBGL_draw_buffers\") !== undefined; }\r\n public get supportsInstancing(): boolean { return this._isWebGL2 || this.queryExtensionObject<ANGLE_instanced_arrays>(\"ANGLE_instanced_arrays\") !== undefined; }\r\n public get supports32BitElementIndex(): boolean { return this._isWebGL2 || this.queryExtensionObject<OES_element_index_uint>(\"OES_element_index_uint\") !== undefined; }\r\n public get supportsTextureFloat(): boolean { return this._isWebGL2 || this.queryExtensionObject<OES_texture_float>(\"OES_texture_float\") !== undefined; }\r\n public get supportsTextureFloatLinear(): boolean { return this._isWebGL2 || this.queryExtensionObject<OES_texture_float_linear>(\"OES_texture_float_linear\") !== undefined; }\r\n public get supportsTextureHalfFloat(): boolean { return this._isWebGL2 || this.queryExtensionObject<OES_texture_half_float>(\"OES_texture_half_float\") !== undefined; }\r\n public get supportsTextureHalfFloatLinear(): boolean { return this._isWebGL2 || this.queryExtensionObject<OES_texture_half_float_linear>(\"OES_texture_half_float_linear\") !== undefined; }\r\n public get supportsTextureFilterAnisotropic(): boolean { return this.queryExtensionObject<EXT_texture_filter_anisotropic>(\"EXT_texture_filter_anisotropic\") !== undefined; }\r\n public get supportsShaderTextureLOD(): boolean { return this._isWebGL2 || this.queryExtensionObject<EXT_shader_texture_lod>(\"EXT_shader_texture_lod\") !== undefined; }\r\n public get supportsVertexArrayObjects(): boolean { return this._isWebGL2 || this.queryExtensionObject<OES_vertex_array_object>(\"OES_vertex_array_object\") !== undefined; }\r\n public get supportsFragDepth(): boolean { return this._isWebGL2 || this.queryExtensionObject<EXT_frag_depth>(\"EXT_frag_depth\") !== undefined; }\r\n public get supportsDisjointTimerQuery(): boolean { return (this._isWebGL2 && this.queryExtensionObject<any>(\"EXT_disjoint_timer_query_webgl2\") !== undefined) || this.queryExtensionObject<any>(\"EXT_disjoint_timer_query\") !== undefined; }\r\n public get supportsStandardDerivatives(): boolean { return this._isWebGL2 || this.queryExtensionObject<OES_standard_derivatives>(\"OES_standard_derivatives\") !== undefined; }\r\n\r\n public get supportsMRTTransparency(): boolean { return this.maxColorAttachments >= 2; }\r\n public get supportsMRTPickShaders(): boolean { return this.maxColorAttachments >= 3; }\r\n\r\n public get supportsShadowMaps(): boolean {\r\n return this.supportsTextureFloat || this.supportsTextureHalfFloat;\r\n }\r\n\r\n public get supportsAntiAliasing(): boolean { return this._isWebGL2 && this.maxAntialiasSamples > 1; }\r\n\r\n public get isMobile(): boolean { return this._isMobile; }\r\n\r\n private findExtension(name: WebGLExtensionName): any {\r\n const ext = this._extensionMap[name];\r\n return null !== ext ? ext : undefined;\r\n }\r\n\r\n /** Queries an extension object if available. This is necessary for other parts of the system to access some constants within extensions. */\r\n public queryExtensionObject<T>(ext: WebGLExtensionName): T | undefined {\r\n return this.findExtension(ext) as T;\r\n }\r\n\r\n public static readonly optionalFeatures: WebGLFeature[] = [\r\n WebGLFeature.MrtTransparency,\r\n WebGLFeature.MrtPick,\r\n WebGLFeature.DepthTexture,\r\n WebGLFeature.FloatRendering,\r\n WebGLFeature.Instancing,\r\n WebGLFeature.ShadowMaps,\r\n WebGLFeature.FragDepth,\r\n WebGLFeature.StandardDerivatives,\r\n WebGLFeature.AntiAliasing,\r\n ];\r\n public static readonly requiredFeatures: WebGLFeature[] = [\r\n WebGLFeature.UintElementIndex,\r\n WebGLFeature.MinimalTextureUnits,\r\n ];\r\n\r\n private get _hasRequiredTextureUnits(): boolean { return this.maxFragTextureUnits >= 4 && this.maxVertTextureUnits >= 5; }\r\n\r\n /** Return an array containing any features not supported by the system as compared to the input array. */\r\n private _findMissingFeatures(featuresToSeek: WebGLFeature[]): WebGLFeature[] {\r\n const missingFeatures: WebGLFeature[] = [];\r\n for (const featureName of featuresToSeek) {\r\n if (-1 === this._presentFeatures.indexOf(featureName))\r\n missingFeatures.push(featureName);\r\n }\r\n return missingFeatures;\r\n }\r\n\r\n /** Populate and return an array containing features that this system supports. */\r\n private _gatherFeatures(): WebGLFeature[] {\r\n const features: WebGLFeature[] = [];\r\n\r\n // simply check for presence of various extensions if that gives enough information\r\n if (this._isWebGL2 || this._extensionMap[\"OES_element_index_uint\" as WebGLExtensionName] !== undefined)\r\n features.push(WebGLFeature.UintElementIndex);\r\n if (this._isWebGL2 || this._extensionMap[\"ANGLE_instanced_arrays\" as WebGLExtensionName] !== undefined)\r\n features.push(WebGLFeature.Instancing);\r\n\r\n if (this.supportsMRTTransparency)\r\n features.push(WebGLFeature.MrtTransparency);\r\n if (this.supportsMRTPickShaders)\r\n features.push(WebGLFeature.MrtPick);\r\n if (this.supportsShadowMaps)\r\n features.push(WebGLFeature.ShadowMaps);\r\n if (this._hasRequiredTextureUnits)\r\n features.push(WebGLFeature.MinimalTextureUnits);\r\n if (this.supportsFragDepth)\r\n features.push(WebGLFeature.FragDepth);\r\n if (this.supportsStandardDerivatives)\r\n features.push(WebGLFeature.StandardDerivatives);\r\n if (this.supportsAntiAliasing)\r\n features.push(WebGLFeature.AntiAliasing);\r\n\r\n if (DepthType.TextureUnsignedInt24Stencil8 === this._maxDepthType)\r\n features.push(WebGLFeature.DepthTexture);\r\n\r\n // check if at least half-float rendering is available based on maximum discovered renderable target\r\n if (RenderType.TextureUnsignedByte !== this._maxRenderType)\r\n features.push(WebGLFeature.FloatRendering);\r\n\r\n return features;\r\n }\r\n\r\n /** Retrieve compatibility status based on presence of various features. */\r\n private _getCompatibilityStatus(missingRequiredFeatures: WebGLFeature[], missingOptionalFeatures: WebGLFeature[]): WebGLRenderCompatibilityStatus {\r\n let status: WebGLRenderCompatibilityStatus = WebGLRenderCompatibilityStatus.AllOkay;\r\n if (missingOptionalFeatures.length > 0)\r\n status = WebGLRenderCompatibilityStatus.MissingOptionalFeatures;\r\n if (missingRequiredFeatures.length > 0)\r\n status = WebGLRenderCompatibilityStatus.MissingRequiredFeatures;\r\n return status;\r\n }\r\n\r\n /** Initializes the capabilities based on a GL context. Must be called first. */\r\n public init(gl: WebGLContext, disabledExtensions?: WebGLExtensionName[]): WebGLRenderCompatibilityInfo {\r\n const gl2 = !(gl instanceof WebGLRenderingContext) ? gl : undefined;\r\n this._isWebGL2 = undefined !== gl2;\r\n\r\n this._isMobile = ProcessDetector.isMobileBrowser;\r\n\r\n const debugInfo = gl.getExtension(\"WEBGL_debug_renderer_info\");\r\n const unmaskedRenderer = debugInfo !== null ? gl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL) : undefined;\r\n const unmaskedVendor = debugInfo !== null ? gl.getParameter(debugInfo.UNMASKED_VENDOR_WEBGL) : undefined;\r\n\r\n this._driverBugs = {};\r\n if (unmaskedRenderer && buggyIntelMatchers.some((x) => x.test(unmaskedRenderer)))\r\n this._driverBugs.fragDepthDoesNotDisableEarlyZ = true;\r\n\r\n if (unmaskedRenderer && buggyMaliMatchers.some((x) => x.test(unmaskedRenderer)))\r\n this._driverBugs.msaaWillHang = true;\r\n\r\n this._maxTextureSize = gl.getParameter(gl.MAX_TEXTURE_SIZE);\r\n this._supportsCreateImageBitmap = typeof createImageBitmap === \"function\" && ProcessDetector.isChromium && !ProcessDetector.isIOSBrowser;\r\n this._maxTexSizeAllow = Math.min(this._maxTextureSize, maxTexSizeAllowed);\r\n this._maxFragTextureUnits = gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS);\r\n this._maxVertTextureUnits = gl.getParameter(gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS);\r\n this._maxVertAttribs = gl.getParameter(gl.MAX_VERTEX_ATTRIBS);\r\n this._maxVertUniformVectors = gl.getParameter(gl.MAX_VERTEX_UNIFORM_VECTORS);\r\n this._maxVaryingVectors = gl.getParameter(gl.MAX_VARYING_VECTORS);\r\n this._maxFragUniformVectors = gl.getParameter(gl.MAX_FRAGMENT_UNIFORM_VECTORS);\r\n this._maxAntialiasSamples = this._driverBugs.msaaWillHang ? 1 : (this._isWebGL2 && undefined !== gl2 ? gl.getParameter(gl2.MAX_SAMPLES) : 1);\r\n\r\n const extensions = gl.getSupportedExtensions(); // This just retrieves a list of available extensions (not necessarily enabled).\r\n if (extensions) {\r\n for (const extStr of extensions) {\r\n const ext = extStr as WebGLExtensionName;\r\n if (-1 === knownExtensions.indexOf(ext))\r\n continue;\r\n else if (undefined !== disabledExtensions && -1 !== disabledExtensions.indexOf(ext))\r\n continue;\r\n\r\n const extObj: any = gl.getExtension(ext); // This call enables the extension and returns a WebGLObject containing extension instance.\r\n if (null !== extObj)\r\n this._extensionMap[ext] = extObj;\r\n }\r\n }\r\n\r\n if (this._isWebGL2 && undefined !== gl2) {\r\n this._maxColorAttachments = gl.getParameter(gl2.MAX_COLOR_ATTACHMENTS);\r\n this._maxDrawBuffers = gl.getParameter(gl2.MAX_DRAW_BUFFERS);\r\n } else {\r\n const dbExt: WEBGL_draw_buffers | undefined = this.queryExtensionObject<WEBGL_draw_buffers>(\"WEBGL_draw_buffers\");\r\n this._maxColorAttachments = dbExt !== undefined ? gl.getParameter(dbExt.MAX_COLOR_ATTACHMENTS_WEBGL) : 1;\r\n this._maxDrawBuffers = dbExt !== undefined ? gl.getParameter(dbExt.MAX_DRAW_BUFFERS_WEBGL) : 1;\r\n }\r\n\r\n // Determine the maximum color-renderable attachment type.\r\n const allowFloatRender =\r\n (undefined === disabledExtensions || -1 === disabledExtensions.indexOf(\"OES_texture_float\"))\r\n // iOS>=15 allows full-float rendering. However, it does not actually work on non-M1 devices.\r\n // Because of this, for now we disallow full float rendering on iOS devices.\r\n // ###TODO: Re-assess this after future iOS updates.\r\n && !ProcessDetector.isIOSBrowser\r\n // Samsung Galaxy Note 8 exhibits same issue as described above for iOS >= 15.\r\n // It uses specifically Mali-G71 MP20 but reports its renderer as follows.\r\n // Samsung Galaxy A50 and S9 exhibits same issue; they use Mali-G72.\r\n // HUAWEI P30 exhibits same issue; it uses Mali-G76.\r\n && unmaskedRenderer !== \"Mali-G71\" && unmaskedRenderer !== \"Mali-G72\" && unmaskedRenderer !== \"Mali-G76\";\r\n\r\n if (allowFloatRender && undefined !== this.queryExtensionObject(\"EXT_float_blend\") && this.isTextureRenderable(gl, gl.FLOAT)) {\r\n this._maxRenderType = RenderType.TextureFloat;\r\n } else if (this.isWebGL2) {\r\n this._maxRenderType = (this.isTextureRenderable(gl, (gl as WebGL2RenderingContext).HALF_FLOAT)) ? RenderType.TextureHalfFloat : RenderType.TextureUnsignedByte;\r\n } else {\r\n const hfExt: OES_texture_half_float | undefined = this.queryExtensionObject<OES_texture_half_float>(\"OES_texture_half_float\");\r\n this._maxRenderType = (hfExt !== undefined && this.isTextureRenderable(gl, hfExt.HALF_FLOAT_OES)) ? RenderType.TextureHalfFloat : RenderType.TextureUnsignedByte;\r\n }\r\n\r\n // Determine the maximum depth attachment type.\r\n // this._maxDepthType = this.queryExtensionObject(\"WEBGL_depth_texture\") !== undefined ? DepthType.TextureUnsignedInt32 : DepthType.RenderBufferUnsignedShort16;\r\n this._maxDepthType = this._isWebGL2 || this.queryExtensionObject(\"WEBGL_depth_texture\") !== undefined ? DepthType.TextureUnsignedInt24Stencil8 : DepthType.RenderBufferUnsignedShort16;\r\n\r\n this._presentFeatures = this._gatherFeatures();\r\n const missingRequiredFeatures = this._findMissingFeatures(Capabilities.requiredFeatures);\r\n const missingOptionalFeatures = this._findMissingFeatures(Capabilities.optionalFeatures);\r\n\r\n return {\r\n status: this._getCompatibilityStatus(missingRequiredFeatures, missingOptionalFeatures),\r\n missingRequiredFeatures,\r\n missingOptionalFeatures,\r\n unmaskedRenderer,\r\n unmaskedVendor,\r\n usingIntegratedGraphics: isIntegratedGraphics({unmaskedVendor, unmaskedRenderer}),\r\n driverBugs: { ...this._driverBugs },\r\n userAgent: navigator.userAgent,\r\n createdContext: gl,\r\n };\r\n }\r\n\r\n public static create(gl: WebGLContext, disabledExtensions?: WebGLExtensionName[]): Capabilities | undefined {\r\n const caps = new Capabilities();\r\n const compatibility = caps.init(gl, disabledExtensions);\r\n if (WebGLRenderCompatibilityStatus.CannotCreateContext === compatibility.status || WebGLRenderCompatibilityStatus.MissingRequiredFeatures === compatibility.status)\r\n return undefined;\r\n return caps;\r\n }\r\n\r\n /** Determines if a particular texture type is color-renderable on the host system. */\r\n private isTextureRenderable(gl: WebGLContext, texType: number): boolean {\r\n const tex: WebGLTexture | null = gl.createTexture();\r\n gl.bindTexture(gl.TEXTURE_2D, tex);\r\n if (this.isWebGL2) {\r\n if (gl.FLOAT === texType)\r\n gl.texImage2D(gl.TEXTURE_2D, 0, (gl as WebGL2RenderingContext).RGBA32F, 1, 1, 0, gl.RGBA, texType, null);\r\n else\r\n gl.texImage2D(gl.TEXTURE_2D, 0, (gl as WebGL2RenderingContext).RGBA16F, 1, 1, 0, gl.RGBA, texType, null);\r\n } else\r\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, texType, null);\r\n\r\n const fb: WebGLFramebuffer | null = gl.createFramebuffer();\r\n gl.bindFramebuffer(gl.FRAMEBUFFER, fb);\r\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0);\r\n\r\n const fbStatus: number = gl.checkFramebufferStatus(gl.FRAMEBUFFER);\r\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\r\n gl.deleteFramebuffer(fb);\r\n gl.deleteTexture(tex);\r\n\r\n gl.getError(); // clear any errors\r\n\r\n return fbStatus === gl.FRAMEBUFFER_COMPLETE;\r\n }\r\n\r\n public setMaxAnisotropy(desiredMax: number | undefined, gl: WebGLContext): void {\r\n const ext = this.queryExtensionObject<EXT_texture_filter_anisotropic>(\"EXT_texture_filter_anisotropic\");\r\n if (undefined === ext)\r\n return;\r\n\r\n if (undefined === this._maxAnisotropy)\r\n this._maxAnisotropy = gl.getParameter(ext.MAX_TEXTURE_MAX_ANISOTROPY_EXT) as number;\r\n\r\n const max = (undefined !== desiredMax) ? Math.min(desiredMax, this._maxAnisotropy) : this._maxAnisotropy;\r\n gl.texParameterf(gl.TEXTURE_2D, ext.TEXTURE_MAX_ANISOTROPY_EXT, max);\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderCompatibility.js","sourceRoot":"","sources":["../../src/RenderCompatibility.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAO9C;;GAEG;AACH,MAAM,CAAN,IAAY,YAuBX;AAvBD,WAAY,YAAY;IACtB,2GAA2G;IAC3G,oDAAoC,CAAA;IACpC,wFAAwF;IACxF,oCAAoB,CAAA;IACpB,2FAA2F;IAC3F,uDAAuC,CAAA;IACvC,2JAA2J;IAC3J,kDAAkC,CAAA;IAClC,2FAA2F;IAC3F,8CAA8B,CAAA;IAC9B,gGAAgG;IAChG,yCAAyB,CAAA;IACzB,iHAAiH;IACjH,6DAA6C,CAAA;IAC7C,mGAAmG;IACnG,0CAA0B,CAAA;IAC1B,qIAAqI;IACrI,4CAA4B,CAAA;IAC5B,sIAAsI;IACtI,4DAA4C,CAAA;IAC5C,+DAA+D;IAC/D,8CAA8B,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AgE,CAAC;IAChI,CAAC,EAAE,KAAK,CAAC,CAAC;IAEV,IAAI,SAAS,KAAK,aAAa;QAC7B,aAAa,GAAG,oBAAoB,CAAC;IAEvC,IAAI,yBAAyB,GAAG,KAAK,CAAC;IACtC,IAAI,OAAO,GAAG,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE,EAAE,4BAA4B,EAAE,IAAI,EAAE,CAAC,CAAC;IACvF,IAAI,SAAS,KAAK,OAAO,EAAE,CAAC;QAC1B,yBAAyB,GAAG,IAAI,CAAC;QACjC,OAAO,GAAG,aAAa,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,iDAAiD;QAC7F,IAAI,SAAS,KAAK,OAAO;YACvB,OAAO;gBACL,MAAM,EAAE,8BAA8B,CAAC,mBAAmB;gBAC1D,uBAAuB,EAAE,EAAE;gBAC3B,uBAAuB,EAAE,EAAE;gBAC3B,SAAS,EAAE,SAAS,CAAC,SAAS;gBAC9B,mBAAmB,EAAE,YAAY;gBACjC,UAAU,EAAE,EAAE;aACf,CAAC;IACN,CAAC;IAED,MAAM,YAAY,GAAG,IAAI,YAAY,EAAE,CAAC;IACxC,MAAM,aAAa,GAAG,YAAY,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAC5D,aAAa,CAAC,mBAAmB,GAAG,YAAY,CAAC;IAEjD,IAAI,yBAAyB,IAAI,aAAa,CAAC,MAAM,KAAK,8BAA8B,CAAC,uBAAuB;QAC9G,aAAa,CAAC,MAAM,GAAG,8BAA8B,CAAC,sBAAsB,CAAC;IAE/E,OAAO,aAAa,CAAC;AACvB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Compatibility\n */\n\nimport { Capabilities } from \"./Capabilities\";\n\n/** A type describing either a WebGL 1 or WebGL 2 rendering context.\n * @public\n */\nexport type WebGLContext = WebGLRenderingContext | WebGL2RenderingContext;\n\n/** Enumerates the required and optional WebGL features used by the [RenderSystem]($frontend).\n * @public\n */\nexport enum WebGLFeature {\n /** This feature allows transparent geometry to be rendered more efficiently, using 1 pass instead of 2. */\n MrtTransparency = \"mrt transparency\",\n /** This feature allows picking to occur more efficiently, using 1 pass instead of 3. */\n MrtPick = \"mrt pick\",\n /** This feature ensures large meshes (with more than 21,845 triangles) can be rendered. */\n UintElementIndex = \"uint element index\",\n /** This feature allows transparency to achieve the optimal quality. Without this feature, overlapping transparent geometry will \"wash out\" more easily. */\n FloatRendering = \"float rendering\",\n /** This feature allows for the display of non-3D classification data and solar shadows. */\n DepthTexture = \"depth texture\",\n /** This feature allows instancing of repeated geometry, which can reduce memory consumption. */\n Instancing = \"instancing\",\n /** This feature indicates that the system has enough texture units available for the shaders to run properly. */\n MinimalTextureUnits = \"minimal texture units\",\n /** Indicates that shadow maps are supported. Without this feature, shadows cannot be displayed. */\n ShadowMaps = \"shadow maps\",\n /** This feature allows a logarithmic depth buffer to be used. Without this feature, z-fighting will be much more likely to occur. */\n FragDepth = \"fragment depth\",\n /** This feature allows the renderer to achieve accurate contour lines for isoline and stepped delimiter modes of thematic display. */\n StandardDerivatives = \"standard derivatives\",\n /** This feature allows the renderer to smooth curved lines. */\n AntiAliasing = \"anti-aliasing\",\n}\n\n/** An enumeration that describes a general \"compatibility rating\" based on the contents of a [[WebGLRenderCompatibilityInfo]].\n * @public\n */\nexport enum WebGLRenderCompatibilityStatus {\n /**\n * Signifies that everything is ideal: context created successfully, all required and optional features are available,\n * and browser did not signal a major performance caveat.\n */\n AllOkay,\n /**\n * Signifies that the base requirements of compatibility are met but at least some optional features are missing.\n * Consult the contents of [[WebGLRenderCompatibilityInfo.missingOptionalFeatures]].\n */\n MissingOptionalFeatures,\n /**\n * Signifies that the base requirements of compatibility are met but WebGL reported a major performance caveat. The browser\n * has likely fallen back to software rendering due to lack of a usable GPU.\n * Consult [[WebGLRenderCompatibilityInfo.contextErrorMessage]] for a possible description of what went wrong.\n * There could also be some missing optional features; consult the contents of [[WebGLRenderCompatibilityInfo.missingOptionalFeatures]].\n */\n MajorPerformanceCaveat,\n /**\n * Signifies that the base requirements of compatibility are not met; rendering cannot occur.\n * Consult the contents of [[WebGLRenderCompatibilityInfo.missingRequiredFeatures]].\n */\n MissingRequiredFeatures,\n /**\n * Signifies an inability to create either a canvas or a WebGL rendering context; rendering cannot occur. Consult\n * [[WebGLRenderCompatibilityInfo.contextErrorMessage]] for a possible description of what went wrong.\n */\n CannotCreateContext,\n}\n\n/** Known bugs associated with specific graphics drivers for which iTwin.js can apply workarounds to produce correct visualization.\n * An instance of this object will exist on the [[WebGLRenderCompatibilityInfo]] object returned by [[queryRenderCompatibility]].\n * @see [[WebGLRenderCompatibilityInfo]]\n * @public\n */\nexport interface GraphicsDriverBugs {\n /** If true, the graphics driver inappropriately applies the \"early Z\" optimization when a fragment shader writes to the depth buffer.\n * Early Z elides execution of the fragment shader if the depth test fails; but if the fragment shader contains code that can alter the depth, it\n * must be executed. The primary symptom of this bug is transparent geometry appearing to be behind opaque geometry despite actually being in front of it.\n *\n * Affects Intel HD/UHD Graphics 620/630.\n *\n * The workaround for this bug has minimal impact on performance and no impact on visual fidelity.\n */\n fragDepthDoesNotDisableEarlyZ?: true;\n /** If true, the graphics driver will hang when applying MSAA to a viewport.\n *\n * Known to affect certain mobile Mali chipsets (G71 and G76). May affect more.\n *\n * The workaround for this bug means MSAA cannot be enabled on those devices.\n */\n msaaWillHang?: true;\n}\n\n/** Describes the level of compatibility of a client device/browser with the iTwin.js rendering system.\n * @public\n */\nexport interface WebGLRenderCompatibilityInfo {\n /** Describes the overall status of rendering compatibility. */\n status: WebGLRenderCompatibilityStatus;\n /** Features that are required by the rendering system but not supported by the client. */\n missingRequiredFeatures: WebGLFeature[];\n /** Optional features unsupported by this client that would provide improved performance or quality if present. */\n missingOptionalFeatures: WebGLFeature[];\n /** Known bugs associated with the client's graphics driver for which iTwin.js can apply workarounds. */\n driverBugs: GraphicsDriverBugs;\n /** The user agent as reported by the browser. */\n userAgent: string;\n /** The renderer string reported by this client's graphics driver. */\n unmaskedRenderer?: string;\n /** The vendor string reported by this client's graphics driver. */\n unmaskedVendor?: string;\n /** If true, there is a likelihood that integrated graphics are being used. This can be used to warn users on systems with both integrated graphics and dedicated graphics that they should try to switch to their dedicated graphics for better performance.\n * @note This property has the possibility of providing false positives and negatives. A user should use this property mainly as a hint and manually verify what graphics chip is being used.\n */\n usingIntegratedGraphics?: boolean;\n /** If WebGL context creation failed, an error message supplied by the browser. */\n contextErrorMessage?: string;\n /** The WebGL context created by the browser and used to generate the compatibility report. */\n createdContext?: WebGLContext;\n}\n\n/** A function that creates and returns a WebGLContext given an HTMLCanvasElement, a boolean specifying whether to use WebGL2, and a WebGLContextAttributes object describing the desired context attributes.\n * @public\n */\nexport type ContextCreator = (canvas: HTMLCanvasElement, useWebGL2: boolean, inputContextAttributes?: WebGLContextAttributes) => WebGLContext | undefined;\n\nfunction createDefaultContext(canvas: HTMLCanvasElement, useWebGL2: boolean = true, attributes?: WebGLContextAttributes): WebGLContext | undefined {\n let context = useWebGL2 ? canvas.getContext(\"webgl2\", attributes) : canvas.getContext(\"webgl\", attributes);\n if (context === null && useWebGL2)\n context = canvas.getContext(\"webgl\", attributes);\n return context ?? undefined;\n}\n\n/** This function returns information about the client system's level of compatibility with the iTwin.js rendering system, describing the client system's support for both optional and required features. It will also report if there is a major issue with the client system such as the browser falling back to software rendering or an inability to create a either a canvas or a WebGL rendering context.\n * @param useWebGL2 A boolean which will be passed to the createContext function in order to create the desired type of context; set this to `true` to use WebGL2, `false` to use WebGL1.\n * @param createContext A function of type [[ContextCreator]] that returns a WebGLContext. If not specified, this by default uses `canvas.getContext()` to create the WebGLContext.\n * @returns A [[WebGLRenderCompatibilityInfo]] object which contains a compatibility summary.\n * @see [[WebGLRenderCompatibilityInfo]]\n * @public\n */\nexport function queryRenderCompatibility(useWebGL2: boolean, createContext?: ContextCreator): WebGLRenderCompatibilityInfo {\n const canvas = document.createElement(\"canvas\");\n if (null === canvas)\n return { status: WebGLRenderCompatibilityStatus.CannotCreateContext, missingOptionalFeatures: [], missingRequiredFeatures: [], userAgent: navigator.userAgent, driverBugs: { } };\n\n let errorMessage: string | undefined;\n canvas.addEventListener(\"webglcontextcreationerror\", (event) => {\n errorMessage = (event as WebGLContextEvent).statusMessage || \"webglcontextcreationerror was triggered with no error provided\";\n }, false);\n\n if (undefined === createContext)\n createContext = createDefaultContext;\n\n let hasMajorPerformanceCaveat = false;\n let context = createContext(canvas, useWebGL2, { failIfMajorPerformanceCaveat: true });\n if (undefined === context) {\n hasMajorPerformanceCaveat = true;\n context = createContext(canvas, useWebGL2); // try to create context without black-listed GPU\n if (undefined === context)\n return {\n status: WebGLRenderCompatibilityStatus.CannotCreateContext,\n missingOptionalFeatures: [],\n missingRequiredFeatures: [],\n userAgent: navigator.userAgent,\n contextErrorMessage: errorMessage,\n driverBugs: {},\n };\n }\n\n const capabilities = new Capabilities();\n const compatibility = capabilities.init(context, undefined);\n compatibility.contextErrorMessage = errorMessage;\n\n if (hasMajorPerformanceCaveat && compatibility.status !== WebGLRenderCompatibilityStatus.MissingRequiredFeatures)\n compatibility.status = WebGLRenderCompatibilityStatus.MajorPerformanceCaveat;\n\n return compatibility;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"RenderCompatibility.js","sourceRoot":"","sources":["../../src/RenderCompatibility.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAO9C;;GAEG;AACH,MAAM,CAAN,IAAY,YAuBX;AAvBD,WAAY,YAAY;IACtB,2GAA2G;IAC3G,oDAAoC,CAAA;IACpC,wFAAwF;IACxF,oCAAoB,CAAA;IACpB,2FAA2F;IAC3F,uDAAuC,CAAA;IACvC,2JAA2J;IAC3J,kDAAkC,CAAA;IAClC,2FAA2F;IA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C","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 { Capabilities } from \"./Capabilities\";\r\n\r\n/** A type describing either a WebGL 1 or WebGL 2 rendering context.\r\n * @public\r\n */\r\nexport type WebGLContext = WebGLRenderingContext | WebGL2RenderingContext;\r\n\r\n/** Enumerates the required and optional WebGL features used by the [RenderSystem]($frontend).\r\n * @public\r\n */\r\nexport enum WebGLFeature {\r\n /** This feature allows transparent geometry to be rendered more efficiently, using 1 pass instead of 2. */\r\n MrtTransparency = \"mrt transparency\",\r\n /** This feature allows picking to occur more efficiently, using 1 pass instead of 3. */\r\n MrtPick = \"mrt pick\",\r\n /** This feature ensures large meshes (with more than 21,845 triangles) can be rendered. */\r\n UintElementIndex = \"uint element index\",\r\n /** This feature allows transparency to achieve the optimal quality. Without this feature, overlapping transparent geometry will \"wash out\" more easily. */\r\n FloatRendering = \"float rendering\",\r\n /** This feature allows for the display of non-3D classification data and solar shadows. */\r\n DepthTexture = \"depth texture\",\r\n /** This feature allows instancing of repeated geometry, which can reduce memory consumption. */\r\n Instancing = \"instancing\",\r\n /** This feature indicates that the system has enough texture units available for the shaders to run properly. */\r\n MinimalTextureUnits = \"minimal texture units\",\r\n /** Indicates that shadow maps are supported. Without this feature, shadows cannot be displayed. */\r\n ShadowMaps = \"shadow maps\",\r\n /** This feature allows a logarithmic depth buffer to be used. Without this feature, z-fighting will be much more likely to occur. */\r\n FragDepth = \"fragment depth\",\r\n /** This feature allows the renderer to achieve accurate contour lines for isoline and stepped delimiter modes of thematic display. */\r\n StandardDerivatives = \"standard derivatives\",\r\n /** This feature allows the renderer to smooth curved lines. */\r\n AntiAliasing = \"anti-aliasing\",\r\n}\r\n\r\n/** An enumeration that describes a general \"compatibility rating\" based on the contents of a [[WebGLRenderCompatibilityInfo]].\r\n * @public\r\n */\r\nexport enum WebGLRenderCompatibilityStatus {\r\n /**\r\n * Signifies that everything is ideal: context created successfully, all required and optional features are available,\r\n * and browser did not signal a major performance caveat.\r\n */\r\n AllOkay,\r\n /**\r\n * Signifies that the base requirements of compatibility are met but at least some optional features are missing.\r\n * Consult the contents of [[WebGLRenderCompatibilityInfo.missingOptionalFeatures]].\r\n */\r\n MissingOptionalFeatures,\r\n /**\r\n * Signifies that the base requirements of compatibility are met but WebGL reported a major performance caveat. The browser\r\n * has likely fallen back to software rendering due to lack of a usable GPU.\r\n * Consult [[WebGLRenderCompatibilityInfo.contextErrorMessage]] for a possible description of what went wrong.\r\n * There could also be some missing optional features; consult the contents of [[WebGLRenderCompatibilityInfo.missingOptionalFeatures]].\r\n */\r\n MajorPerformanceCaveat,\r\n /**\r\n * Signifies that the base requirements of compatibility are not met; rendering cannot occur.\r\n * Consult the contents of [[WebGLRenderCompatibilityInfo.missingRequiredFeatures]].\r\n */\r\n MissingRequiredFeatures,\r\n /**\r\n * Signifies an inability to create either a canvas or a WebGL rendering context; rendering cannot occur. Consult\r\n * [[WebGLRenderCompatibilityInfo.contextErrorMessage]] for a possible description of what went wrong.\r\n */\r\n CannotCreateContext,\r\n}\r\n\r\n/** Known bugs associated with specific graphics drivers for which iTwin.js can apply workarounds to produce correct visualization.\r\n * An instance of this object will exist on the [[WebGLRenderCompatibilityInfo]] object returned by [[queryRenderCompatibility]].\r\n * @see [[WebGLRenderCompatibilityInfo]]\r\n * @public\r\n */\r\nexport interface GraphicsDriverBugs {\r\n /** If true, the graphics driver inappropriately applies the \"early Z\" optimization when a fragment shader writes to the depth buffer.\r\n * Early Z elides execution of the fragment shader if the depth test fails; but if the fragment shader contains code that can alter the depth, it\r\n * must be executed. The primary symptom of this bug is transparent geometry appearing to be behind opaque geometry despite actually being in front of it.\r\n *\r\n * Affects Intel HD/UHD Graphics 620/630.\r\n *\r\n * The workaround for this bug has minimal impact on performance and no impact on visual fidelity.\r\n */\r\n fragDepthDoesNotDisableEarlyZ?: true;\r\n /** If true, the graphics driver will hang when applying MSAA to a viewport.\r\n *\r\n * Known to affect certain mobile Mali chipsets (G71 and G76). May affect more.\r\n *\r\n * The workaround for this bug means MSAA cannot be enabled on those devices.\r\n */\r\n msaaWillHang?: true;\r\n}\r\n\r\n/** Describes the level of compatibility of a client device/browser with the iTwin.js rendering system.\r\n * @public\r\n */\r\nexport interface WebGLRenderCompatibilityInfo {\r\n /** Describes the overall status of rendering compatibility. */\r\n status: WebGLRenderCompatibilityStatus;\r\n /** Features that are required by the rendering system but not supported by the client. */\r\n missingRequiredFeatures: WebGLFeature[];\r\n /** Optional features unsupported by this client that would provide improved performance or quality if present. */\r\n missingOptionalFeatures: WebGLFeature[];\r\n /** Known bugs associated with the client's graphics driver for which iTwin.js can apply workarounds. */\r\n driverBugs: GraphicsDriverBugs;\r\n /** The user agent as reported by the browser. */\r\n userAgent: string;\r\n /** The renderer string reported by this client's graphics driver. */\r\n unmaskedRenderer?: string;\r\n /** The vendor string reported by this client's graphics driver. */\r\n unmaskedVendor?: string;\r\n /** If true, there is a likelihood that integrated graphics are being used. This can be used to warn users on systems with both integrated graphics and dedicated graphics that they should try to switch to their dedicated graphics for better performance.\r\n * @note This property has the possibility of providing false positives and negatives. A user should use this property mainly as a hint and manually verify what graphics chip is being used.\r\n */\r\n usingIntegratedGraphics?: boolean;\r\n /** If WebGL context creation failed, an error message supplied by the browser. */\r\n contextErrorMessage?: string;\r\n /** The WebGL context created by the browser and used to generate the compatibility report. */\r\n createdContext?: WebGLContext;\r\n}\r\n\r\n/** A function that creates and returns a WebGLContext given an HTMLCanvasElement, a boolean specifying whether to use WebGL2, and a WebGLContextAttributes object describing the desired context attributes.\r\n * @public\r\n */\r\nexport type ContextCreator = (canvas: HTMLCanvasElement, useWebGL2: boolean, inputContextAttributes?: WebGLContextAttributes) => WebGLContext | undefined;\r\n\r\nfunction createDefaultContext(canvas: HTMLCanvasElement, useWebGL2: boolean = true, attributes?: WebGLContextAttributes): WebGLContext | undefined {\r\n let context = useWebGL2 ? canvas.getContext(\"webgl2\", attributes) : canvas.getContext(\"webgl\", attributes);\r\n if (context === null && useWebGL2)\r\n context = canvas.getContext(\"webgl\", attributes);\r\n return context ?? undefined;\r\n}\r\n\r\n/** This function returns information about the client system's level of compatibility with the iTwin.js rendering system, describing the client system's support for both optional and required features. It will also report if there is a major issue with the client system such as the browser falling back to software rendering or an inability to create a either a canvas or a WebGL rendering context.\r\n * @param useWebGL2 A boolean which will be passed to the createContext function in order to create the desired type of context; set this to `true` to use WebGL2, `false` to use WebGL1.\r\n * @param createContext A function of type [[ContextCreator]] that returns a WebGLContext. If not specified, this by default uses `canvas.getContext()` to create the WebGLContext.\r\n * @returns A [[WebGLRenderCompatibilityInfo]] object which contains a compatibility summary.\r\n * @see [[WebGLRenderCompatibilityInfo]]\r\n * @public\r\n */\r\nexport function queryRenderCompatibility(useWebGL2: boolean, createContext?: ContextCreator): WebGLRenderCompatibilityInfo {\r\n const canvas = document.createElement(\"canvas\");\r\n if (null === canvas)\r\n return { status: WebGLRenderCompatibilityStatus.CannotCreateContext, missingOptionalFeatures: [], missingRequiredFeatures: [], userAgent: navigator.userAgent, driverBugs: { } };\r\n\r\n let errorMessage: string | undefined;\r\n canvas.addEventListener(\"webglcontextcreationerror\", (event) => {\r\n errorMessage = (event as WebGLContextEvent).statusMessage || \"webglcontextcreationerror was triggered with no error provided\";\r\n }, false);\r\n\r\n if (undefined === createContext)\r\n createContext = createDefaultContext;\r\n\r\n let hasMajorPerformanceCaveat = false;\r\n let context = createContext(canvas, useWebGL2, { failIfMajorPerformanceCaveat: true });\r\n if (undefined === context) {\r\n hasMajorPerformanceCaveat = true;\r\n context = createContext(canvas, useWebGL2); // try to create context without black-listed GPU\r\n if (undefined === context)\r\n return {\r\n status: WebGLRenderCompatibilityStatus.CannotCreateContext,\r\n missingOptionalFeatures: [],\r\n missingRequiredFeatures: [],\r\n userAgent: navigator.userAgent,\r\n contextErrorMessage: errorMessage,\r\n driverBugs: {},\r\n };\r\n }\r\n\r\n const capabilities = new Capabilities();\r\n const compatibility = capabilities.init(context, undefined);\r\n compatibility.contextErrorMessage = errorMessage;\r\n\r\n if (hasMajorPerformanceCaveat && compatibility.status !== WebGLRenderCompatibilityStatus.MissingRequiredFeatures)\r\n compatibility.status = WebGLRenderCompatibilityStatus.MajorPerformanceCaveat;\r\n\r\n return compatibility;\r\n}\r\n"]}
|
|
@@ -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;;;;;GAKG;AAEH;;;GAGG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nexport * from \"./Capabilities\";\nexport * from \"./RenderCompatibility\";\n\n/** @docs-package-description\n * The webgl-compatibility package provides APIs for determining the level of compatibility of a browser and device with the iTwin.js rendering system.\n *\n * This package is used by the [iTwin.js Compatibility Checker website](https://itwinjscompatibility.bentley.com/) to evaluate whether\n * a user's browser and hardware meet the requirements for running iTwin.js applications.\n */\n\n/**\n * @docs-group-description Compatibility\n * APIs for evaluating compatibility with the iTwin.js rendering system.\n */\n"]}
|
|
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;;;;;GAKG;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 and device with the iTwin.js rendering system.\r\n *\r\n * This package is used by the [iTwin.js Compatibility Checker website](https://itwinjscompatibility.bentley.com/) to evaluate whether\r\n * a user's browser and hardware meet the requirements for running iTwin.js applications.\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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/webgl-compatibility",
|
|
3
|
-
"version": "5.5.0-dev.
|
|
3
|
+
"version": "5.5.0-dev.5",
|
|
4
4
|
"description": "APIs for determining the level of compatibility of a browser+device with the iTwin.js rendering system.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "lib/cjs/webgl-compatibility.js",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"url": "http://www.bentley.com"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@itwin/core-bentley": "5.5.0-dev.
|
|
27
|
+
"@itwin/core-bentley": "5.5.0-dev.5"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@itwin/eslint-plugin": "5.2.2-dev.2",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"source-map-loader": "^5.0.0",
|
|
41
41
|
"typescript": "~5.6.2",
|
|
42
42
|
"webpack": "^5.97.1",
|
|
43
|
-
"@itwin/
|
|
44
|
-
"@itwin/
|
|
43
|
+
"@itwin/certa": "5.5.0-dev.5",
|
|
44
|
+
"@itwin/build-tools": "5.5.0-dev.5"
|
|
45
45
|
},
|
|
46
46
|
"scripts": {
|
|
47
47
|
"build": "npm run -s build:cjs && npm run -s build:esm",
|