From 74788642ea3b1aa575c906552e4d868cb007a236 Mon Sep 17 00:00:00 2001 From: gaaclarke <30870216+gaaclarke@users.noreply.github.com> Date: Mon, 30 Sep 2024 12:19:08 -0700 Subject: [PATCH] Added metal validation for `impeller_unittests (flutter/engine#55527) This turns on Metal validation for launching impeller_unittests from the tests panel. This matches the default behavior of launching tests from XCode. Without these assertions errors in Metal are completely silent. In my case I just got a black screen until I tried running the tests through xcode. [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style --- engine/src/flutter/engine.code-workspace | 6 ++++++ .../flutter/tools/vscode_workspace/engine-workspace.yaml | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/engine/src/flutter/engine.code-workspace b/engine/src/flutter/engine.code-workspace index b7f56d9084..c285f6a083 100644 --- a/engine/src/flutter/engine.code-workspace +++ b/engine/src/flutter/engine.code-workspace @@ -145,6 +145,12 @@ "prependTestRunningArgs": [ "--enable_playground" ] + }, + "env": { + "MTL_DEBUG_LAYER": "1", + "MTL_DEBUG_LAYER_ERROR_MODE": "assert", + "MTL_DEBUG_LAYER_WARNING_MODE": "nslog", + "MTL_SHADER_VALIDATION": "1" } }, { diff --git a/engine/src/flutter/tools/vscode_workspace/engine-workspace.yaml b/engine/src/flutter/tools/vscode_workspace/engine-workspace.yaml index ed9f275d0f..a5cdde16b5 100644 --- a/engine/src/flutter/tools/vscode_workspace/engine-workspace.yaml +++ b/engine/src/flutter/tools/vscode_workspace/engine-workspace.yaml @@ -133,6 +133,11 @@ settings: gtest: prependTestRunningArgs: - --enable_playground + env: + MTL_DEBUG_LAYER: "1" + MTL_DEBUG_LAYER_ERROR_MODE: assert + MTL_DEBUG_LAYER_WARNING_MODE: nslog + MTL_SHADER_VALIDATION: "1" - name: display_list_unittests_arm64 pattern: ../out/host_debug_unopt_arm64/display_list_unittests runTask: