From 48f0096335f82a9dd92421fa81962aec18696e54 Mon Sep 17 00:00:00 2001 From: Paul Connelly <22944042+pmconne@users.noreply.github.com> Date: Tue, 31 May 2022 13:36:43 -0400 Subject: [PATCH] Revert "Add workarounds for Mali-G72 GPU. (#3701)" This reverts commit 2fb765f1311abfa4b3aeba7f5e5337d8616cfef7. --- ...-mali-g72-workaround_2022-05-30-15-45.json | 10 -- core/webgl-compatibility/src/Capabilities.ts | 5 +- .../src/test/Compatibility.test.ts | 8 -- tools/internal/scripts/rush/audit.js | 95 ------------------- 4 files changed, 1 insertion(+), 117 deletions(-) delete mode 100644 common/changes/@itwin/webgl-compatibility/pmc-mali-g72-workaround_2022-05-30-15-45.json delete mode 100644 tools/internal/scripts/rush/audit.js diff --git a/common/changes/@itwin/webgl-compatibility/pmc-mali-g72-workaround_2022-05-30-15-45.json b/common/changes/@itwin/webgl-compatibility/pmc-mali-g72-workaround_2022-05-30-15-45.json deleted file mode 100644 index 82c8eb7c5f21..000000000000 --- a/common/changes/@itwin/webgl-compatibility/pmc-mali-g72-workaround_2022-05-30-15-45.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "changes": [ - { - "packageName": "@itwin/webgl-compatibility", - "comment": "Apply a workaround for transparency and MSAA bugs on mobile devices using Mali-G72 graphics chips.", - "type": "none" - } - ], - "packageName": "@itwin/webgl-compatibility" -} diff --git a/core/webgl-compatibility/src/Capabilities.ts b/core/webgl-compatibility/src/Capabilities.ts index e99b455778dc..8a218371bb88 100644 --- a/core/webgl-compatibility/src/Capabilities.ts +++ b/core/webgl-compatibility/src/Capabilities.ts @@ -76,7 +76,6 @@ const buggyIntelMatchers = [ // Regexes to match Mali GPUs known to suffer from GraphicsDriverBugs.msaaWillHang. const buggyMaliMatchers = [ /Mali-G71/, - /Mali-G72/, /Mali-G76/, ]; @@ -249,7 +248,6 @@ export class Capabilities { this._driverBugs = {}; if (unmaskedRenderer && buggyIntelMatchers.some((x) => x.test(unmaskedRenderer))) this._driverBugs.fragDepthDoesNotDisableEarlyZ = true; - if (unmaskedRenderer && buggyMaliMatchers.some((x) => x.test(unmaskedRenderer))) this._driverBugs.msaaWillHang = true; @@ -296,8 +294,7 @@ export class Capabilities { && !ProcessDetector.isIOSBrowser // Samsung Galaxy Note 8 exhibits same issue as described above for iOS >= 15. // It uses specifically Mali-G71 MP20 but reports its renderer as follows. - // Samsung Galaxy A50 and S9 exhibits same issue; they use Mali-G72. - && unmaskedRenderer !== "Mali-G71" && unmaskedRenderer !== "Mali-G72"; + && unmaskedRenderer !== "Mali-G71"; if (allowFloatRender && undefined !== this.queryExtensionObject("EXT_float_blend") && this.isTextureRenderable(gl, gl.FLOAT)) { this._maxRenderType = RenderType.TextureFloat; diff --git a/core/webgl-compatibility/src/test/Compatibility.test.ts b/core/webgl-compatibility/src/test/Compatibility.test.ts index 551e93f17c06..f893ec1e00de 100644 --- a/core/webgl-compatibility/src/test/Compatibility.test.ts +++ b/core/webgl-compatibility/src/test/Compatibility.test.ts @@ -217,18 +217,10 @@ describe("Render Compatibility", () => { it("detects MSAA hang bug", () => { const renderers = [ -<<<<<<< HEAD ["Mali-G71", true], ["Mali-G76", true], ["ANGLE (Intel HD Graphics 620 Direct3D11 vs_5_0 ps_5_0)", false], ["Mali-G79", false], -======= - [ "Mali-G71", true ], - [ "Mali-G72", true ], - [ "Mali-G76", true ], - [ "ANGLE (Intel HD Graphics 620 Direct3D11 vs_5_0 ps_5_0)", false ], - [ "Mali-G79", false ], ->>>>>>> 67881e02f2 (Add workarounds for Mali-G72 GPU. (#3701)) ]; for (const renderer of renderers) { diff --git a/tools/internal/scripts/rush/audit.js b/tools/internal/scripts/rush/audit.js deleted file mode 100644 index 787a60ad4189..000000000000 --- a/tools/internal/scripts/rush/audit.js +++ /dev/null @@ -1,95 +0,0 @@ -/*--------------------------------------------------------------------------------------------- -* Copyright (c) Bentley Systems, Incorporated. All rights reserved. -* See LICENSE.md in the project root for license terms and full copyright notice. -*--------------------------------------------------------------------------------------------*/ - -const fs = require("fs"); -const path = require("path"); -const { spawn } = require("child_process"); -const { logBuildError, logBuildWarning, failBuild, throwAfterTimeout } = require("./utils"); - -const rushCommonDir = path.join(__dirname, "../../../../common/"); - -(async () => { - const commonTempDir = path.join(rushCommonDir, "config/rush"); - - // Npm audit will occasionally take minutes to respond - we believe this is just the npm registry being terrible and slow. - // We don't want this to slow down our builds though - we'd rather fail fast and try again later. So we'll just timeout after 30 seconds. - let jsonOut = {}; - try { - console.time("Audit time"); - jsonOut = await Promise.race([runPnpmAuditAsync(commonTempDir), throwAfterTimeout(180000, "Timed out contacting npm registry.")]); - console.timeEnd("Audit time"); - console.log(); - } catch (error) { - // We want to stop failing the build on transient failures and instead fail only on high/critical vulnerabilities. - logBuildWarning(error); - process.exit(); - } - - if (jsonOut.error) { - console.error(jsonOut.error.summary); - logBuildWarning("Rush audit failed. This may be caused by a problem with the npm audit server."); - } - - // A list of temporary advisories excluded from the High and Critical list. - // Warning this should only be used as a temporary measure to avoid build failures - // for development dependencies only. - // All security issues should be addressed asap. - const excludedAdvisories = [ - "GHSA-ww39-953v-wcq6", // https://github.com/advisories/GHSA-ww39-953v-wcq6 webpack@4>watchpack>watchpack-chokidar2>chokidar>glob-parent - "GHSA-rp65-9cf3-cjxr", // https://github.com/advisories/GHSA-rp65-9cf3-cjxr @bentley/react-scripts>@svgr/webpack>@svgr/plugin-svgo>svgo>css-select>nth-check - ]; - - let shouldFailBuild = false; - for (const action of jsonOut.actions) { - for (const issue of action.resolves) { - const advisory = jsonOut.advisories[issue.id]; - - // TODO: This path no longer resolves to a specific package in the repo. Need to figure out the best way to handle it - const mpath = issue.path; // .replace("@rush-temp", "@bentley"); - - const severity = advisory.severity.toUpperCase(); - const message = `${severity} Security Vulnerability: ${advisory.title} in ${advisory.module_name} (from ${mpath}). See ${advisory.url} for more info.`; - - // For now, we'll only treat CRITICAL and HIGH vulnerabilities as errors in CI builds. - if (!excludedAdvisories.includes(advisory.github_advisory_id) && (severity === "HIGH" || severity === "CRITICAL")) { - logBuildError(message); - shouldFailBuild = true; - } else if (excludedAdvisories.includes(advisory.github_advisory_id) || severity === "MODERATE") // Only warn on MODERATE severity items - logBuildWarning(message); - } - } - - // For some reason yarn audit can return the json without the vulnerabilities - if (undefined === jsonOut.metadata.vulnerabilities || shouldFailBuild) - failBuild(); - - process.exit(); -})(); - -function runPnpmAuditAsync(cwd) { - return new Promise((resolve, reject) => { - // pnpm audit requires a package.json file so we temporarily create one and - // then delete it later - fs.writeFileSync(path.join(rushCommonDir, "config/rush/package.json"), JSON.stringify("{}", null, 2)); - - console.log("Running audit"); - const pnpmPath = path.join(rushCommonDir, "temp/pnpm-local/node_modules/.bin/pnpm"); - const child = spawn(pnpmPath, ["audit", "--json"], { cwd, shell: true }); - - let stdout = ""; - child.stdout.on('data', (data) => { - stdout += data; - }); - - child.on('error', (data) => { - fs.unlinkSync(path.join(rushCommonDir, "config/rush/package.json")); - reject(data) - }); - child.on('close', () => { - fs.unlinkSync(path.join(rushCommonDir, "config/rush/package.json")); - resolve(JSON.parse(stdout.trim())); - }); - }); -}