From 9d091b6697a8fea2cfb302ccc8aa05c806c25de7 Mon Sep 17 00:00:00 2001 From: Alexey Knyazev Date: Thu, 25 Feb 2021 15:07:30 +0400 Subject: [PATCH] Add Chrome Canary ANGLE injection steps Bug: angleproject:1944 Change-Id: I89ade8230271378cd8b2a5a7cb58ad6c0e4f1fde Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2724271 Reviewed-by: Jamie Madill Reviewed-by: Kenneth Russell Commit-Queue: Jamie Madill --- doc/DebuggingTips.md | 45 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/doc/DebuggingTips.md b/doc/DebuggingTips.md index 4188c8242..d10069ca4 100644 --- a/doc/DebuggingTips.md +++ b/doc/DebuggingTips.md @@ -263,3 +263,48 @@ arguments: Note that in the above, only a single command line argument is supported with RenderDoc. If testing dEQP on a non-default platform, the easiest way would be to modify `GetDefaultAPIName()` in `src/tests/deqp_support/angle_deqp_gtest.cpp` (and avoid `--use-angle=X`). + +## Testing with Chrome Canary + +Many of ANGLE's OpenGL ES entry points are exposed in Chromium as WebGL 1.0 and WebGL 2.0 APIs that +are available via JavaScript. For testing purposes, custom ANGLE builds may be injected in Chrome +Canary. + +### Setup + +#### Windows + +1. Download and install [Google Chrome Canary](https://www.google.com/chrome/canary/). +2. Build ANGLE x64, Release. +3. Run `python scripts\update_canary_angle.py` to replace Canary's ANGLE with your custom ANGLE +(note: Canary must be closed). + +#### macOS + +1. Download and install [Google Chrome Canary](https://www.google.com/chrome/canary/). +2. Clear all attributes. + ``` + % xattr -cr /Applications/Google\ Chrome\ Canary.app + ``` +3. Build ANGLE x64 or arm64, Release. +4. Replace ANGLE libraries, adjusting paths if needed. + ``` + % cp angle/out/Release/{libEGL.dylib,libGLESv2.dylib} /Applications/Google\ Chrome\ Canary.app/Contents/Frameworks/Google\ Chrome\ Framework.framework/Libraries + ``` +5. Re-sign the application bundle. + ``` + % codesign --force --sign - --deep /Applications/Google\ Chrome\ Canary.app + ``` + +### Usage + +Run `%LOCALAPPDATA%\Google\Chrome SxS\chrome.exe` (Windows) or `./Google\ Chrome\ Canary.app/Contents/MacOS/Google\ Chrome\ Canary` (macOS) with the following command-line options: +* `--use-cmd-decoder=passthrough --use-gl=angle` and one of + * `--use-angle=d3d9` (Direct3D 9 renderer, Windows only) + * `--use-angle=d3d11` (Direct3D 11 renderer, Windows only) + * `--use-angle=d3d11on12` (Direct3D 11on12 renderer, Windows only) + * `--use-angle=gl` (OpenGL renderer) + * `--use-angle=gles` (OpenGL ES renderer) + * `--use-angle=vulkan` (Vulkan renderer) + * `--use-angle=swiftshader` (SwiftShader renderer) + * `--use-angle=metal` (Metal renderer, macOS only)