xref: /aosp_15_r20/external/angle/doc/DebuggingTips.md (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
1# Debugging Tips
2
3There are many ways to debug ANGLE using generic or platform-dependent tools. Here is a list of tips
4on how to use them.
5
6## Running ANGLE under apitrace on Linux
7
8[Apitrace](http://apitrace.github.io/) captures traces of OpenGL commands for later analysis,
9allowing us to see how ANGLE translates OpenGL ES commands. In order to capture the trace, it
10inserts a driver shim using `LD_PRELOAD` that records the command and then forwards it to the OpenGL
11driver.
12
13The problem with ANGLE is that it exposes the same symbols as the OpenGL driver so apitrace captures
14the entry point calls intended for ANGLE and reroutes them to the OpenGL driver. In order to avoid
15this problem, use the following:
16
171. Link your application against the static ANGLE libraries (libGLESv2_static and libEGL_static) so
18   they don't get shadowed by apitrace's shim.
192. Ask apitrace to explicitly load the driver instead of using a dlsym on the current module.
20   Otherwise apitrace will use ANGLE's symbols as the OpenGL driver entrypoint (causing infinite
21   recursion). To do this you must point an environment variable to your GL driver.  For example:
22   `export TRACE_LIBGL=/usr/lib/libGL.so.1`. You can find your libGL with
23   `ldconfig -p | grep libGL`.
243. Link ANGLE against libGL instead of dlsyming the symbols at runtime; otherwise ANGLE won't use
25   the replaced driver entry points. This is done with the gn arg `angle_link_glx = true`.
26
27If you follow these steps, apitrace will work correctly aside from a few minor bugs like not being
28able to figure out what the default framebuffer size is if there is no glViewport command.
29
30For example, to trace a run of `hello_triangle`, assuming the apitrace executables are in `$PATH`:
31
32```
33gn args out/Debug # add "angle_link_glx = true"
34# edit samples/BUILD.gn and append "_static" to "angle_util", "libEGL", "libGLESv2"
35ninja -C out/Debug
36export TRACE_LIBGL="/usr/lib/libGL.so.1" # may require a different path
37apitrace trace -o mytrace ./out/Debug/hello_triangle
38qapitrace mytrace
39```
40
41## Enabling General Logging
42
43Normally, ANGLE only logs errors and warnings (e.g. to Android logcat).  General logging, or
44additional levels of "trace" messages will be logged when the following GN arg is set:
45```
46angle_enable_trace = true
47```
48
49To log all GLES and EGL commands submitted by an application, including the following flag:
50```
51angle_enable_trace_events = true
52```
53
54If you want to enable `INFO`-level logs (and up) without incuring the log spam
55of `angle_enable_trace`, you can instead use the following flag:
56```
57angle_always_log_info = true
58```
59
60## Debug Angle on Android
61
62Android is built as an Android APK, which makes it more difficult to debug an APK that is using ANGLE.  The following information can allow you to debug ANGLE with LLDB.
63* You need to build ANGLE with debug symbols enabled. Assume your build variant is called Debug. Make sure you have these lines in out/Debug/args.gn
64```
65is_component_build = false
66is_debug = true
67is_official_build = false
68symbol_level = 2
69strip_debug_info = false
70ignore_elf32_limitations = true
71angle_extract_native_libs = true
72```
73The following local patch may also be necessary:
74```
75diff --git a/build/config/compiler/compiler.gni b/build/config/compiler/compiler.gni
76index 96a18d91a3f6..ca7971fdfd48 100644
77--- a/build/config/compiler/compiler.gni
78+++ b/build/config/compiler/compiler.gni
79@@ -86,7 +86,8 @@ declare_args() {
80   # Whether an error should be raised on attempts to make debug builds with
81   # is_component_build=false. Very large debug symbols can have unwanted side
82   # effects so this is enforced by default for chromium.
83-  forbid_non_component_debug_builds = build_with_chromium
84+  forbid_non_component_debug_builds = false
85```
86
87Build/install/enable ANGLE apk for your application following other instructions.
88* Modify gdbclient.py script to let it find the ANGLE symbols.
89```
90diff --git a/scripts/gdbclient.py b/scripts/gdbclient.py
91index 61fac4000..1f43f4f64 100755
92--- a/scripts/gdbclient.py
93+++ b/scripts/gdbclient.py
94@@ -395,6 +395,8 @@ def generate_setup_script(debugger_path, sysroot, linker_search_dir, binary_file
95     vendor_paths = ["", "hw", "egl"]
96     solib_search_path += [os.path.join(symbols_dir, x) for x in symbols_paths]
97     solib_search_path += [os.path.join(vendor_dir, x) for x in vendor_paths]
98+    solib_search_path += ["/your_path_to_chromium_src/out/Debug/lib.unstripped/"]
99     if linker_search_dir is not None:
100         solib_search_path += [linker_search_dir]
101```
102* Start your lldbclient.py from `/your_path_to_chromium_src/out/Debug` folder. This adds the ANGLE source-file paths to what is visible to LLDB, which allows LLDB to show ANGLE's source files. Refer to https://source.android.com/devices/tech/debug/gdb for how to attach the app for debugging.
103* If you are debugging angle_perftests, you can use `--shard-timeout 100000000` to disable the timeout so that the test won't get killed while you are debugging. If the test runs too fast that you don't have time to attach, use `--delay-test-start=60` to give you extra time to attach.
104
105## Forcing GL vendor and renderer strings
106
107Some applications don't recognize ANGLE and lower their settings, refuse to start or even crash.
108In those scenarios, you can force them to be values matching other devices.
109
110On desktop:
111```
112ANGLE_GL_VENDOR="foo"
113ANGLE_GL_RENDERER="bar"
114```
115
116On Android:
117```
118adb shell setprop debug.angle.gl_vendor "foo"
119adb shell setprop debug.angle.gl_renderer "bar"
120```
121
122## Enabling Debug-Utils Markers
123
124ANGLE can emit debug-utils markers for every GLES API command that are visible to both Android GPU
125Inspector (AGI) and RenderDoc.  This support requires
126[enabling general logging](#enabling-general-logging) as well as setting the following additional
127GN arg:
128```
129angle_enable_annotator_run_time_checks = true
130```
131In addition, if the following GN arg is set, the API calls will output to Android's logcat:
132```
133angle_enable_trace_android_logcat = true
134```
135Once compiled, the markers need to be turned on.
136
137### Turning on Debug Markers on Android
138
139On Android, debug markers are turned on and off with an Android debug property that is
140automatically deleted at the next reboot:
141
142```
143adb shell setprop debug.angle.markers 1
144```
145
146* 0: Turned off/disabled (default)
147* 1: Turned on/enabled
148
149### Turning on Debug Markers on Desktop
150
151On desktop, debug markers are turned on and off with the ANGLE_ENABLE_DEBUG_MARKERS environment
152variable (set in OS-specific manner):
153
154* 0: Turned off/disabled (default)
155* 1: Turned on/enabled
156
157## Enable Vulkan Call Logging
158
159ANGLE can output Vulkan API call information including detailed parameter info and state. Vulkan
160call logging is available for ANGLE debug builds, builds with asserts enabled, or can be made
161available on any build by setting the following GN arg:
162```
163angle_enable_vulkan_api_dump_layer = true
164```
165
166By default Vulkan call logging goes to stdout, or logcat on Android. Vulkan call logging can be
167used with trace event and debug marker output as shown in [enabling general logging](#enabling-general-logging)
168 and [enabling Debug-Utils markers](#enabling-debug-utils-markers)
169
170### Vulkan Call Logging on Desktop
171
172To log Vulkan calls on desktop set the environment variable `ANGLE_ENABLE_VULKAN_API_DUMP_LAYER` to 1.
173
174For Vulkan call logging output to a file, set
175the environment variable `VK_APIDUMP_LOG_FILENAME` to the correct location.
176
177To show only Vulkan api calls without verbose parameter details set the environment variable
178`VK_APIDUMP_DETAILED` to `false`
179
180### Vulkan Call Logging on Android
181
182Activate Vulkan call logging on Android by setting this Android debug property  that is
183automatically deleted at the next reboot:
184```
185adb shell setprop debug.angle.enable_vulkan_api_dump_layer 1
186```
187
188For Vulkan call logging to a file on Android, specify the filename with an Android debug property that is
189automatically deleted at the next reboot:
190```
191adb shell setprop debug.apidump.log_filename /data/data/[PACKAGE_NAME, i.e., com.android.angle.test for angle_trace_tests]/api_dump.txt
192```
193
194Similarly, detailed parameter output can be controlled by the following Android debug properties:
195```
196adb shell setprop debug.apidump.detailed false
197```
198
199## Running ANGLE under GAPID on Linux
200
201[GAPID](https://github.com/google/gapid) can be used to capture trace of Vulkan commands on Linux.
202When capturing traces of gtest based tests built inside Chromium checkout, make sure to run the
203tests with `--single-process-tests` argument.
204
205## Running ANGLE under GAPID on Android
206
207[GAPID](https://github.com/google/gapid) can be used to capture a trace of the Vulkan or OpenGL ES
208command stream on Android.  For it to work, ANGLE's libraries must have different names from the
209system OpenGL libraries.  This is done with the gn arg:
210
211```
212angle_libs_suffix = "_ANGLE_DEV"
213```
214
215All
216[AngleNativeTest](https://chromium.googlesource.com/chromium/src/+/main/third_party/angle/src/tests/test_utils/runner/android/java/src/com/android/angle/test/AngleNativeTest.java)
217based tests share the same activity name, `com.android.angle.test.AngleUnitTestActivity`.
218Thus, prior to capturing your test trace, the specific test APK must be installed on the device.
219When you build the test, a test launcher is generated, for example,
220`./out/Release/bin/run_angle_end2end_tests`. The best way to install the APK is to run this test
221launcher once.
222
223In GAPID's "Capture Trace" dialog, "Package / Action:" should be:
224
225```
226android.intent.action.MAIN:com.android.angle.test/com.android.angle.test.AngleUnitTestActivity
227```
228
229The mandatory [extra intent
230argument](https://developer.android.com/studio/command-line/adb.html#IntentSpec) for starting the
231activity is `org.chromium.native_test.NativeTest.StdoutFile`. Without it the test APK crashes. Test
232filters can be specified via either the `org.chromium.native_test.NativeTest.CommandLineFlags` or
233the `org.chromium.native_test.NativeTest.GtestFilter` argument.  Example "Intent Arguments:" values in
234GAPID's "Capture Trace" dialog:
235
236```
237-e org.chromium.native_test.NativeTest.StdoutFile /sdcard/chromium_tests_root/out.txt -e org.chromium.native_test.NativeTest.CommandLineFlags "--gtest_filter=*ES2_VULKAN"
238```
239
240or
241
242```
243-e org.chromium.native_test.NativeTest.StdoutFile /sdcard/chromium_tests_root/out.txt --e org.chromium.native_test.NativeTest.GtestFilter RendererTest.SimpleOperation/ES2_VULKAN:SimpleOperationTest.DrawWithTexture/ES2_VULKAN
244```
245
246## Running ANGLE under RenderDoc
247
248An application running through ANGLE can confuse [RenderDoc](https://github.com/baldurk/renderdoc),
249as RenderDoc [hooks to EGL](https://github.com/baldurk/renderdoc/issues/1045) and ends up tracing
250the calls the application makes, instead of the calls ANGLE makes to its backend.  As ANGLE is a
251special case, there's little support for it by RenderDoc, though there are workarounds.
252
253### Windows
254
255On Windows, RenderDoc supports setting the environment variable `RENDERDOC_HOOK_EGL` to 0 to avoid
256this issue.
257
258### Linux
259
260On Linux, there is no supported workaround by RenderDoc.  See [this
261issue](https://github.com/baldurk/renderdoc/issues/1045#issuecomment-463999869).  To capture Vulkan
262traces, the workaround is to build RenderDoc without GL(ES) support.
263
264Building RenderDoc is straightforward.  However, here are a few instructions to keep in mind.
265
266```
267# Install dependencies based on RenderDoc document.  Here are some packages that are unlikely to be already installed:
268$ sudo apt install libxcb-keysyms1-dev python3-dev qt5-qmake libqt5svg5-dev libqt5x11extras5-dev
269
270# Inside the RenderDoc directory:
271$ cmake -DCMAKE_BUILD_TYPE=Release -Bbuild -H. -DENABLE_GLES=OFF -DENABLE_GL=OFF
272
273# QT_SELECT=5 is necessary if your distribution doesn't default to Qt5
274$ QT_SELECT=5 make -j -C build
275
276# Run RenderDoc from the build directory:
277$ ./build/bin/qrenderdoc
278```
279
280If your distribution does not provide a recent Vulkan SDK package, you would need to manually
281install that.  This script tries to perform this installation as safely as possible.  It would
282overwrite the system package's files, so follow at your own risk.  Place this script just above the
283extracted SDK directory.
284
285```
286#! /bin/bash
287
288if [ $# -lt 1 ]; then
289  echo "Usage: $0 <version>"
290  exit 1
291fi
292
293ver=$1
294
295if [ ! -d "$ver" ]; then
296  echo "$ver is not a directory"
297fi
298
299# Verify everything first
300echo "Verifying files..."
301echo "$ver"/x86_64/bin/vulkaninfo
302test -f "$ver"/x86_64/bin/vulkaninfo || exit 1
303echo "$ver"/x86_64/etc/explicit_layer.d/
304test -d "$ver"/x86_64/etc/explicit_layer.d || exit 1
305echo "$ver"/x86_64/lib/
306test -d "$ver"/x86_64/lib || exit 1
307
308echo "Verified. Performing copy..."
309
310echo sudo cp "$ver"/x86_64/bin/vulkaninfo /usr/bin/vulkaninfo
311sudo cp "$ver"/x86_64/bin/vulkaninfo /usr/bin/vulkaninfo
312echo sudo cp "$ver"/x86_64/etc/explicit_layer.d/* /etc/explicit_layer.d/
313sudo cp "$ver"/x86_64/etc/explicit_layer.d/* /etc/explicit_layer.d/
314echo sudo rm /usr/lib/x86_64-linux-gnu/libvulkan.so*
315sudo rm /usr/lib/x86_64-linux-gnu/libvulkan.so*
316echo sudo cp -P "$ver"/x86_64/lib/lib* /usr/lib/x86_64-linux-gnu/
317sudo cp -P "$ver"/x86_64/lib/lib* /usr/lib/x86_64-linux-gnu/
318
319echo "Done."
320```
321
322### Android
323#### Using Linux as a Local Machine
324
325If you are on Linux, make sure not to use the build done in the previous section.  The GL renderer
326disabled in the previous section is actually needed in this section.
327
328```
329# Inside the RenderDoc directory:
330# First delete the Cmake Cache in build/ directory
331rm build/CMakeCache.txt
332
333# Then build RenderDoc with cmake:
334cmake -DCMAKE_BUILD_TYPE=Release -Bbuild -H.
335QT_SELECT=5 make -j -C build
336```
337
338Follow
339[Android Dependencies on Linux](https://github.com/baldurk/renderdoc/blob/v1.x/docs/CONTRIBUTING/Dependencies.md#android-dependencies-on-linux)
340to download dependency files.
341
342Define the following environment variables, for example in `.bashrc` (values are examples):
343
344```
345export JAVA_HOME=<path_to_jdk_root>
346export ANDROID_SDK=<path_to_sdk_root>
347export ANDROID_NDK=<path_to_ndk_root>
348export ANDROID_NDK_HOME=<path_to_ndk_root>
349```
350
351In the renderdoc directory, create Android builds of RenderDoc:
352
353```
354mkdir build-android-arm32
355cd build-android-arm32/
356cmake -DBUILD_ANDROID=On -DANDROID_ABI=armeabi-v7a ..
357make -j
358cd ../
359
360mkdir build-android-arm64
361cd build-android-arm64/
362cmake -DBUILD_ANDROID=On -DANDROID_ABI=arm64-v8a ..
363make -j
364cd ../
365```
366
367Note that you need both arm32 and arm64 builds even if working with an arm64 device.  See
368[RenderDoc's documentation](https://github.com/baldurk/renderdoc/blob/v1.x/docs/CONTRIBUTING/Compiling.md#android)
369for more information.
370
371When you run RenderDoc, choose the "Replay Context" from the bottom-left part of the UI (defaults to
372Local).  When selecting the device, you should see the RenderDoc application running.
373
374In ANGLE itself, make sure you add a suffix for its names to be different from the system's.  Add
375this to gn args:
376
377```
378angle_libs_suffix = "_ANGLE_DEV"
379```
380
381Next, you need to install an ANGLE test APK.  When you build the test, a test launcher is generated,
382for example, `./out/Release/bin/run_angle_end2end_tests`. The best way to install the APK is to run
383this test launcher once.
384
385In RenderDoc, use `com.android.angle.test/com.android.angle.test.AngleUnitTestActivity` as the
386Executable Path, and provide the following arguments:
387
388```
389-e org.chromium.native_test.NativeTest.StdoutFile /sdcard/chromium_tests_root/out.txt -e org.chromium.native_test.NativeTest.CommandLineFlags "--gtest_filter=*ES2_VULKAN"
390```
391
392Note that in the above, only a single command line argument is supported with RenderDoc.  If testing
393dEQP on a non-default platform, the easiest way would be to modify `GetDefaultAPIName()` in
394`src/tests/deqp_support/angle_deqp_gtest.cpp` (and avoid `--use-angle=X`).
395
396
397#### Using Windows as a Local Machine
398You should be able to download the latest [RenderDoc on Windows](https://renderdoc.org/builds) and follow the
399[RenderDoc Official Documentation](https://renderdoc.org/docs/how/how_android_capture.html) for instructions on how to
400use RenderDoc on Android. If you would like to build RenderDoc for Android on Windows yourself, you can follow the
401[RenderDoc Officual Documentation](https://github.com/baldurk/renderdoc/blob/v1.x/docs/CONTRIBUTING/Compiling.md#android).
402We listed more detailed instructions below on how to set up the build on Windows.
403
404##### Install Android Dependencies
405
406On windows, we need to install dependencies to build android, as described in
407[RenderDoc Official Documentation](https://github.com/baldurk/renderdoc/blob/v1.x/docs/CONTRIBUTING/Dependencies.md#android)
4081. Install [Android SDK](https://developer.android.com/about/versions/12/setup-sdk#install-sdk).
409
410   Add a new system variable:
411
412   Variable: ANDROID_SDK
413
414   Value: path_to_sdk_directory (e.g. C:\Users\test\Appdata\Local\Android\Sdk)
4152. Install [Android NDK](https://developer.android.com/studio/projects/install-ndk).
416
417   Add a new system variable:
418
419   Variable: ANDROID_NDK
420
421   Value: path_to_ndk_directory (e.g. C:\Users\test\Appdata\Local\Android\Sdk\ndk\23.1.7779620)
422
4233. Install [Java 8](https://www.oracle.com/java/technologies/downloads/#java8).
424
425   Add a new system variable:
426
427   Variable: JAVA_HOME
428
429   Value: path_to_jdk1.8_directory (e.g. C:\Program Files\Java\jdk1.8.0_311)
430
4315. Install [Android Debug Bridge](https://developer.android.com/studio/releases/platform-tools).
432
433   Append android_sdk_platform-tools_directory to the Path system variable.
434
435   e.g. C:\Users\Test\AppData\Local\Android\Sdk\platform-tools
436
437
438##### Install Build Tools
439
4401. Install a bash shell. Git Bash comes with Git installation on Windows should work.
4412. Install [make](http://gnuwin32.sourceforge.net/packages/make.htm).
442   Add the path to bin folder of GnuWin32 to the Path system variable.
443
444
445##### Build RenderDoc Android APK on Windows
446
447If you are using the Git Bash that comes with MinGW generator, you can run below commands to build Android APK
448```
449mkdir build-android-arm32
450cd build-android-arm32/
451cmake -DBUILD_ANDROID=On -DANDROID_ABI=armeabi-v7a -G "MinGW Makefiles" ..
452make -j
453cd ../
454
455mkdir build-android-arm64
456cd build-android-arm64/
457cmake -DBUILD_ANDROID=On -DANDROID_ABI=arm64-v8a -G "MinGW Makefiles" ..
458make -j
459cd ../
460```
461If the generator type of the bash shell you are using is different from MinGW, replace the "MinGW" in the above cmake
462command with the generator
463type you are using, as described in
464[RenderDoc Official Documentation](https://github.com/baldurk/renderdoc/blob/v1.x/docs/CONTRIBUTING/Compiling.md#android).
465
466
467##### Build Errors And Resolutions
468
469* **cmake command errors**
470
471```
472Error: Failed to run MSBuild command:
473C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/MSBuild/Current/Bin/MSBuild.exe to get the value of
474VCTargetsPath:
475error : The BaseOutputPath/OutputPath property is not set for project 'VCTargetsPath.vcxproj'.
476Please check to make sure that you have specified a valid combination of Configuration and Platform for this project.
477Configuration='Debug'  Platform='x64'.
478```
479
480This is due to the cmake command is using Visual Studio as the generator type. Run the cmake command with the
481generator type "MinGW Makefiles" or "MSYS Makefiles".
482
483```Error: Does not match the generator used previously```
484
485
486
487Delete the CMakeCache file in build directories build-android-arm64/ or build-android-arm32/.
488
489
490* **make command errors**
491
492```
493-Djava.ext.dirs is not supported.
494Error: Could not create the Java Virtual Machine.
495Error: A fatal exception has occurred. Program will exit.
496
497```
498
499Downgrade Java JDK version to [Java 8](https://www.oracle.com/java/technologies/downloads/#java8).
500
501
502##### Steps to use the RenderDoc you just built
5031. Build arm32 and arm64 android packages. See [instructions](#build-renderdoc-android-apk-on-windows) in the above
504section.
505
5062. Uninstall the renderdoc package.
507
508This step is required if you have installed / used RenderDoc on the same Android device before. RenderDoc only pushes
509the renderdoccmd APK to the Android device if it finds the version of the existing APK on the device is different from
510the version of the APK we are going to install, and the version is dictated by the git hash it was built from. Therefore
511any local modifications in the RenderDoc codebase would not get picked up if we don't uninstall the old APK first.
512
513```
514adb uninstall org.renderdoc.renderdoccmd.arm64
515adb uninstall org.renderdoc.renderdoccmd.arm32
516```
5173. Build renderdoc on windows desktop by clicking "build solution" in visual studio.
5184. Launch renderdoc from visual studio, and push the android packages to android device by selecting the connected
519device at the bottom left corner.
520
521### Add SPIRV-to-GLSL Shader View Option
522RenderDoc allows us to add and configure customized shader processing tools:
523https://renderdoc.org/docs/window/settings_window.html#shader-processing-tools-config.
524
525To configure RenderDoc to display shader source code in GLSL, instead of spirv,
526follow the below steps:
527
528
5291. Get the SPIRV-Cross tool:
530
531Clone the SPIRV-Cross git repo: https://github.com/KhronosGroup/SPIRV-Cross:
532```
533git clone https://github.com/KhronosGroup/SPIRV-Cross.git
534```
535Compile the SPIRV-Cross:
536```
537# inside SPIRV-Cross directory
538make
539```
5402. Open Shader Viewer Settings window: RenderDoc -> Tools -> Settings, and select
541   Shader Viewer on the left.
5423. Click Add on the bottom to add a new tool, and fill the new tool details:
543
544| Item       | Value                               |
545|------------|-------------------------------------|
546| Name       | SPIRV-CROSS                         |
547| Tool Type  | SPIRV-Cross                         |
548| Executable | <spirv-cross-repo-root>/spirv-cross |
549
5505. Restart RenderDoc.
551
552## Testing with Chrome Canary
553
554Many of ANGLE's OpenGL ES entry points are exposed in Chromium as WebGL 1.0 and WebGL 2.0 APIs that
555are available via JavaScript. For testing purposes, custom ANGLE builds may be injected in Chrome
556Canary.
557
558### Setup
559
560#### Windows
561
5621. Download and install [Google Chrome Canary](https://www.google.com/chrome/canary/).
5632. Build ANGLE x64, Release.
5643. Run `python scripts\update_chrome_angle.py` to replace Canary's ANGLE with your custom ANGLE
565   (note: Canary must be closed).
566
567#### Linux
568
5691. Install Google Chrome Dev (via apt, or otherwise).  Expected installation directory is
570   `/opt/google/chrome-unstable`.
5712. Build ANGLE for the running platform.  `is_component_build = false` is suggested in the GN args.
5723. Run `python scripts/update_chrome_angle.py` to replace Dev's ANGLE with your custom ANGLE
5734. Add ANGLE's build path to the `LD_LIBRARY_PATH` environment variable.
574
575#### macOS
576
5771. Download and install [Google Chrome Canary](https://www.google.com/chrome/canary/).
5782. Build ANGLE for the running platform; GN args should contain `is_debug = false`.
5793. Run `./scripts/update_chrome_angle.py` to replace Canary's ANGLE with your custom ANGLE.
580
581### Usage
582
583Run Chrome:
584
585- On Windows: `%LOCALAPPDATA%\Google\Chrome SxS\chrome.exe`
586- On Linux: `/opt/google/chrome-unstable/google-chrome-unstable`
587- On macOS: `./Google\ Chrome\ Canary.app/Contents/MacOS/Google\ Chrome\ Canary`
588
589With the following command-line options:
590
591* `--use-cmd-decoder=passthrough --use-gl=angle` and one of
592  * `--use-angle=d3d9` (Direct3D 9 renderer, Windows only)
593  * `--use-angle=d3d11` (Direct3D 11 renderer, Windows only)
594  * `--use-angle=d3d11on12` (Direct3D 11on12 renderer, Windows only)
595  * `--use-angle=gl` (OpenGL renderer)
596  * `--use-angle=gles` (OpenGL ES renderer)
597  * `--use-angle=vulkan` (Vulkan renderer)
598  * `--use-angle=swiftshader` (SwiftShader renderer)
599  * `--use-angle=metal` (Metal renderer, macOS only)
600
601Additional useful options:
602
603* `--enable-logging`: To see logs
604* `--disable-gpu-watchdog`: To disable Chromium's watchdog, killing the GPU process when slow (due
605  to a debug build for example)
606* `--disable-gpu-sandbox`: To disable Chromium's sandboxing features, if it's getting in the way of
607  testing.
608* `--disable-gpu-compositing`: To make sure only the WebGL test being debugged is run through ANGLE,
609  not the entirety of Chromium.
610