forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Impeller] Update guidance on how to run with Metal validation withou…
…t Xcode. (flutter#44190) Fixes flutter/flutter#114202
- Loading branch information
1 parent
fe23695
commit 8fea19c
Showing
1 changed file
with
16 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
# Enable Metal Validation without Xcode. | ||
|
||
To enable validation of all Metal calls without using Xcode, add the following | ||
to your rc file. | ||
Metal validation can be enabled for command-line application using environment | ||
variables. | ||
|
||
These flags are not documented and have been reverse engineered from observing | ||
what Xcode does to enable these validation layers. | ||
Apple [documents these environment variables on their developer site](https://developer.apple.com/documentation/xcode/validating-your-apps-metal-api-usage#Enable-API-Validation-with-environment-variables). | ||
More documentation about these environment variables is also available via a man | ||
page entry: `man MetalValidation` | ||
|
||
To enable all relevant Metal API and shader validation without using Xcode, add | ||
the following to your `.rc` file. | ||
|
||
``` sh | ||
# Metal Validation Defaults | ||
export MTL_DEBUG_LAYER=1 | ||
export MTL_DEBUG_LAYER_ERROR_MODE=assert | ||
# Set this to assert for stricter runtime checks. Set to "ignore" if too chatty. | ||
export MTL_DEBUG_LAYER_WARNING_MODE=nslog | ||
export MTL_SHADER_VALIDATION=1 | ||
``` | ||
# Metal Tracing Defaults | ||
export DYLD_INSERT_LIBRARIES="/usr/lib/libMTLCapture.dylib:/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/GPUToolsPlatform/libMTLToolsDiagnostics.dylib" | ||
export METAL_DEBUG_ERROR_MODE=0 | ||
export METAL_DEVICE_FORCE_COMMAND_BUFFER_ENHANCED_ERRORS=1 | ||
export METAL_DEVICE_WRAPPER_TYPE=5 | ||
export METAL_DIAGNOSTICS_ENABLED=1 | ||
export METAL_LOAD_INTERPOSER=1 | ||
export MTL_FORCE_COMMAND_BUFFER_ENHANCED_ERRORS=1 | ||
export DYMTL_TOOLS_DYLIB_PATH="/usr/lib/libMTLCapture.dylib" | ||
``` | ||
|
||
|
||
These flags have been validated to work on macOS Monterey (12.0.1) | ||
These environment variable are good defaults but there are more validation | ||
related knobs and dials to turn. See `man MetalValidation`. |