Remove the ANGLE submodule
ANGLE was added to the SwiftShader repo as a submodule to facilitate
building the 'SwANGLE' combination that replaces the legacy SwiftShader
OpenGL ES implementation. Now that both Chrome and Android have fully
integrated SwANGLE, we no longer need this for comparison or debugging
purposes.
Bug: b/147516027
Change-Id: If26b4dc7ef940815c0e6e1eea01e045668ee7bd6
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/60668
Reviewed-by: Alexis Hétu <sugoi@google.com>
Kokoro-Result: kokoro <noreply+kokoro@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
diff --git a/.gitmodules b/.gitmodules
index 1526a1c..3d9142e 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -19,9 +19,6 @@
[submodule "third_party/glslang"]
path = third_party/glslang
url = https://github.com/KhronosGroup/glslang.git
-[submodule "third_party/angle/angle"]
- path = third_party/angle/angle
- url = https://chromium.googlesource.com/angle/angle
[submodule "third_party/git-hooks"]
path = third_party/git-hooks
url = https://swiftshader.googlesource.com/git-hooks
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bfdf88d..1a0c312 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -154,7 +154,6 @@
option_if_not_defined(SWIFTSHADER_BUILD_WSI_D2D "Build the Direct-to-Display WSI support" FALSE)
option_if_not_defined(SWIFTSHADER_BUILD_PVR "Build the PowerVR examples" TRUE)
option_if_not_defined(SWIFTSHADER_GET_PVR "Check out the PowerVR submodule" FALSE)
-option_if_not_defined(SWIFTSHADER_BUILD_ANGLE "Build angle" FALSE)
option_if_not_defined(SWIFTSHADER_USE_GROUP_SOURCES "Group the source files in a folder tree for Visual Studio" TRUE)
@@ -279,10 +278,6 @@
InitSubmodule(cppdap ${THIRD_PARTY_DIR}/cppdap)
endif()
-if(SWIFTSHADER_BUILD_ANGLE)
- InitSubmodule(angle ${THIRD_PARTY_DIR}/angle/angle)
-endif()
-
###########################################################
# Convenience macros
###########################################################
@@ -544,8 +539,6 @@
set_cpp_flag("-DNDEBUG" RELEASE)
set_cpp_flag("-DNDEBUG" RELWITHDEBINFO)
- set_cpp_flag("-DANGLE_DISABLE_TRACE" RELEASE)
- set_cpp_flag("-DANGLE_DISABLE_TRACE" RELWITHDEBINFO)
# Put each variable and function in its own section so that when linking
# with -gc-sections unused functions and variables are removed.
@@ -857,16 +850,6 @@
endif()
-if(SWIFTSHADER_BUILD_ANGLE)
- add_subdirectory(${THIRD_PARTY_DIR}/angle)
-
- # Make angle depend on vk_swiftshader so we can test SWANGLE
- if (TARGET vk_swiftshader)
- add_dependencies(angle vk_swiftshader)
- endif()
-endif()
-
-
###########################################################
# Sample programs and tests
###########################################################
@@ -994,13 +977,6 @@
foreach(pvr_target ${PVR_TARGET_OTHER} ${PVR_VULKAN_TARGET_OTHER} ${PVR_GLES_TARGET_OTHER})
set_target_properties(${pvr_target} PROPERTIES FOLDER Samples/PowerVR-Build)
endforeach()
-
- # Make angle target depend on PowerVR GL examples
- if (TARGET angle)
- foreach(pvr_target ${PVR_GLES_TARGET})
- add_dependencies(angle ${pvr_target})
- endforeach()
- endif()
endif()
if(BUILD_VULKAN_WRAPPER)
diff --git a/docs/ANGLE.md b/docs/ANGLE.md
deleted file mode 100644
index d5510ee..0000000
--- a/docs/ANGLE.md
+++ /dev/null
@@ -1,47 +0,0 @@
-# ANGLE
-
-## About
-
-[ANGLE](https://chromium.googlesource.com/angle/angle/) is a driver implementation that translates OpenGL ES to native 3D backends depending on the target system. Such backends include D3D on Windows, OpenGL Desktop, and Vulkan.
-
-While SwiftShader initially offered a GLES frontend, this has been deprecated and replaced by a Vulkan frontend. In order to use SwiftShader for GLES, we now recommend using ANGLE on top of SwiftShader Vulkan.
-
-## Why use ANGLE instead of SwiftShader's GLES frontend?
-
-There are a few reasons why SwiftShader's GLES frontend has been deprecated, and that we now recommend using ANGLE:
-
-1. GLES 3.1 support - ANGLE supports GLES 3.1, while SwiftShader supports 3.0.
-
-2. [ANGLE's GLES 3.1](https://www.khronos.org/conformance/adopters/conformant-products/opengles#submission_907) implementation, along with [SwiftShader's Vulkan 1.1](https://www.khronos.org/conformance/adopters/conformant-products#submission_403) implementation, are both Khronos-certified conformant.
-
-3. ANGLE's GLES validation is more complete than SwiftShader's.
-
-4. Dropping support SwiftShader's GLES frontend allows our team to focus our efforts on implementing a solid and conformant Vulkan frontend instead.
-
-## How to use ANGLE with SwiftShader's Vulkan frontend
-
-In order to build ANGLE, you will need to install
-[depot_tools](https://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/depot_tools_tutorial.html#_setting_up).
-You will also need Python 2 installed. Note that ANGLE does not offer a CMake build at this time. Follow the official [dev setup](https://chromium.googlesource.com/angle/angle/+/HEAD/doc/DevSetup.md) to install all required tools, clone ANGLE and its dependencies, and build it. This will look something like:
-
-```
-cd angle
-gn gen out/Release
-autoninja -C out/Release
-```
-
-This will build all ANGLE targets into the `out/Release` directory, including:
-
-* `libEGL.so`
-* `libGLESv2.so`
-* `libvk_swiftshader.so`
-
-As long as your application uses ANGLE's `libEGL` and `libGLESv2`, ANGLE will take care of translating to a default 3D renderer for the current platform.
-
-There are multiple ways to have ANGLE use SwiftShader Vulkan as its backend:
-
-1. Set `ANGLE_DEFAULT_PLATFORM=swiftshader` environment variable. When running your GLES application, ANGLE will use `libvk_swiftshader` as its Vulkan driver.
-
-2. Set both `ANGLE_DEFAULT_PLATFORM=vulkan` and `VK_ICD_FILENAMES=path/to/angle/out/Debug/libvk_swiftshader_icd.json` environment variables. When running your GLES application, ANGLE will use it's Vulkan backend, and the Vulkan Loader will load `libvk_swiftshader` via the Vulkan Loader.
-
-3. Using the `EGL_ANGLE_platform_angle` extension. As described in [this section](https://chromium.googlesource.com/angle/angle/+/HEAD/doc/DevSetup.md#choosing-a-backend) of ANGLE's setup documentation, you can use the `EGL_ANGLE_platform_angle` extension to select the renderer to use at EGL initialization time. Use the `ANGLE_platform_angle_device_type_swiftshader` device type to select SwiftShader specifically (see [documentation here](https://chromium.googlesource.com/angle/angle/+/master/extensions/EGL_ANGLE_platform_angle_device_type_swiftshader.txt)).
diff --git a/docs/TestingWithSWANGLE.md b/docs/TestingWithSWANGLE.md
deleted file mode 100644
index 0f9c06b..0000000
--- a/docs/TestingWithSWANGLE.md
+++ /dev/null
@@ -1,80 +0,0 @@
-# Testing with ANGLE/SwiftShaderVK (SWANGLE)
-
-## About
-
-[ANGLE](https://chromium.googlesource.com/angle/angle/) is a driver that translates OpenGL ES to native 3D backends depending on the target system, such as Vulkan.
-
-SwiftShader includes ANGLE as an optional submodule, and using the [CMake build](../development/build-systems.md?cl=amaiorano%2F79#cmake-open-source), is able to install and build ANGLE, allowing us to test GL applications against ANGLE over SwiftShader Vulkan, a.k.a. _SWANGLE_.
-
-## Setup
-
-In order to build ANGLE, you will need to install [depot_tools](https://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/depot_tools_tutorial.html#_setting_up). You will also need Python 2 installed.
-
-To be useful, we will enable building the PowerVR examples along with ANGLE (this will also init the submodules if missing):
-
-```bash
-cd SwiftShader/build
-cmake -DSWIFTSHADER_GET_PVR=1 -DSWIFTSHADER_BUILD_PVR=1 -DSWIFTSHADER_BUILD_ANGLE=1 ..
-cmake --build . --target angle
-```
-
-Note that you don't have to explicitly build the `angle` target as it's part of the `ALL` target. Also note that the first time you build `angle`, it will run the `angle-setup` target, which can take some time.
-
-The `angle` target invokes Chromium-development tools, such as [gclient](https://www.chromium.org/developers/how-tos/depottools/gclient) and [ninja](https://ninja-build.org/), which are part of `depot_tools`.
-
-## Running PowerVR examples on SWANGLE
-
-Once the `angle` target is built, you can now go to the `bin-angle` directory under the CMake binary directory (e.g. `build`), set up the environment variables, and start running tests:
-
-```bash
-cd SwiftShader/build/bin-angle
-source export-swangle-env.sh
-./OpenGLESBumpmap
-```
-
-On Windows, the process is very similar:
-
-```bash
-cd SwiftShader\build\bin-angle
-export-swangle-env.bat
-.\Debug\OpenGLESBumpmap
-```
-
-If you're using Visual Studio's CMake integration, after enabling `SWIFTSHADER_BUILD_PVR` in the CMake settings, and building the `angle` target, open cmd.exe and follow similar steps:
-
-```bash
-cd SwiftShader\out\build\x64-Debug\bin-angle
-export-swangle-env.bat
-OpenGLESBumpmap
-```
-
-## Running gles-unittests on SWANGLE
-
-On Linux, we can set `LD_LIBRARY_PATH` to point at the folder containing ANGLE binaries when running `gles-unittests`:
-
-```bash
-cd SwiftShader\build
-cmake --build . --target gles-unittests
-source ./bin-angle/export-swangle-env.sh
-LD_LIBRARY_PATH=`realpath ./bin-angle` ./gles-unittests
-```
-
-On Windows, we need to copy `gles-unittests.exe` to the folder containing the ANGLE binaries, and run from there:
-
-```bash
-cd SwiftShader\build
-cmake --build . --target gles-unittests
-copy Debug\gles-unittests.exe bin-angle\
-cd bin-angle
-export-swangle-env.bat
-gles-unittests
-```
-
-## How it works
-
-The `angle-setup` target should run only once if the `.gclient` file does not exist, and the `angle` target will build if any source file under angle/src is modfied.
-
-The `angle` target builds libEGL and libGLESv2 into `${CMAKE_BINARY_DIR}/bin-angle`. If building PowerVR examples are enabled (`SWIFTSHADER_BUILD_PVR`), the PVR output folder, `${CMAKE_BINARY_DIR}/bin`,
-gets copied to `${CMAKE_BINARY_DIR}/bin-angle` first.
-
-Finally, a script named `export-swangle-env.bat/sh` also gets copied to `${CMAKE_BINARY_DIR}/bin-angle`, which sets environment variables so that the PowerVR examples will run on SWANGLE.
diff --git a/third_party/angle/CMakeLists.txt b/third_party/angle/CMakeLists.txt
deleted file mode 100644
index cd6b306..0000000
--- a/third_party/angle/CMakeLists.txt
+++ /dev/null
@@ -1,108 +0,0 @@
-# Copyright 2020 The SwiftShader Authors. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-# angle setup
-
-find_package(Python2 COMPONENTS Interpreter REQUIRED)
-
-# Depend on .gclient file. Setup only runs if this file doesn't exist in the angle
-# submodule checkout.
-set(ANGLE_SETUP_OUTPUT
- "${CMAKE_CURRENT_SOURCE_DIR}/angle/.gclient"
-)
-
-add_custom_command(
- COMMENT "Setting up angle"
- OUTPUT ${ANGLE_SETUP_OUTPUT}
- VERBATIM
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/angle
-
- COMMAND ${Python2_EXECUTABLE} scripts/bootstrap.py
- COMMAND gclient sync
-
- # On Linux, run install deps script
- COMMAND "$<IF:$<BOOL:1>,build/install-build-deps.sh,echo>"
-)
-add_custom_target(angle-setup DEPENDS
- ${ANGLE_SETUP_OUTPUT}
-)
-set_target_properties(angle-setup PROPERTIES FOLDER ANGLE)
-
-
-# angle build
-
-# Depend on all angle source files, even though most of these aren't used to build
-# the ouput files we want. Ninja will run very quickly anyway, and the output files
-# are always touched to make sure subsequent builds do nothing.
-file(GLOB_RECURSE ANGLE_SRC_FILES
- CONFIGURE_DEPENDS angle/src/*.cpp
-)
-
-set(ANGLE_BUILD_OUTPUT
- "${CMAKE_BINARY_DIR}/bin-angle/libEGL${CMAKE_SHARED_LIBRARY_SUFFIX}"
- "${CMAKE_BINARY_DIR}/bin-angle/libGLESv2${CMAKE_SHARED_LIBRARY_SUFFIX}"
-)
-
-# The root CMakeLists adds a dependency from angle onto the PowerVR GL example
-# targets. For angle, we copy the PVR output 'bin' folder to 'bin-angle' into
-# which we build the angle targets we want.
-set(PVR_OUTPUT_DIR "${CMAKE_BINARY_DIR}/bin")
-set(ANGLE_OUTPUT_DIR "${CMAKE_BINARY_DIR}/bin-angle")
-
-# For some reason, "gn gen" returns a non-zero code on Windows, despite completing correctly,
-# which makes the custom_command below not complete. For now, we work around this by wrapping
-# up the call in a generated batch script.
-if(WIN32)
- file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/run_gn.bat "gn %*")
- set(GN_COMMAND ${CMAKE_CURRENT_BINARY_DIR}/run_gn.bat)
-else()
- set(GN_COMMAND "gn")
-endif()
-
-add_custom_command(
- COMMENT "Building angle"
- OUTPUT ${ANGLE_BUILD_OUTPUT}
- DEPENDS ${ANGLE_SRC_FILES}
- VERBATIM
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/angle
-
- # Copy PowerVR's bin directory to bin-angle. Always create the bin folder in case PowerVR isn't being built.
- COMMAND ${CMAKE_COMMAND} -E make_directory ${PVR_OUTPUT_DIR}
- COMMAND ${CMAKE_COMMAND} -E copy_directory ${PVR_OUTPUT_DIR} ${ANGLE_OUTPUT_DIR}
- # Delete the output files that may have been copied over. These are the SwiftShader versions, and we want the ANGLE ones.
- COMMAND ${CMAKE_COMMAND} -E remove -f ${ANGLE_BUILD_OUTPUT}
-
- # gn build angle targets we want
- COMMAND ${GN_COMMAND} gen ${ANGLE_OUTPUT_DIR}
- COMMAND autoninja -C ${ANGLE_OUTPUT_DIR} libEGL libGLESv2
-
- # Always update time stamps of output files since dependencies of this command (${ANGLE_SRC_FILES})
- # include files that aren't actually used to build the output files.
- COMMAND ${CMAKE_COMMAND} -E touch_nocreate ${ANGLE_BUILD_OUTPUT}
-)
-add_custom_target(angle ALL DEPENDS
- angle-setup
- ${ANGLE_BUILD_OUTPUT}
-)
-set_target_properties(angle PROPERTIES FOLDER ANGLE)
-
-# Copy script to setup swangle environment to bin-angle
-if(WIN32)
- set(EXPORT_SWANGLE_ENV_SCRIPT "export-swangle-env.bat")
-else()
- set(EXPORT_SWANGLE_ENV_SCRIPT "export-swangle-env.sh")
-endif()
-configure_file(cmake/${EXPORT_SWANGLE_ENV_SCRIPT} ${ANGLE_OUTPUT_DIR}/${EXPORT_SWANGLE_ENV_SCRIPT})
-set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${ANGLE_OUTPUT_DIR}/${EXPORT_SWANGLE_ENV_SCRIPT}")
diff --git a/third_party/angle/angle b/third_party/angle/angle
deleted file mode 160000
index 5090cb2..0000000
--- a/third_party/angle/angle
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 5090cb22e9ce716623524dbf5098534c1a45642e
diff --git a/third_party/angle/cmake/export-swangle-env.bat b/third_party/angle/cmake/export-swangle-env.bat
deleted file mode 100644
index 0dd435e..0000000
--- a/third_party/angle/cmake/export-swangle-env.bat
+++ /dev/null
@@ -1,2 +0,0 @@
-set VK_ICD_FILENAMES=${CMAKE_BINARY_DIR}\${CMAKE_SYSTEM_NAME}\vk_swiftshader_icd.json
-set ANGLE_DEFAULT_PLATFORM=vulkan
diff --git a/third_party/angle/cmake/export-swangle-env.sh b/third_party/angle/cmake/export-swangle-env.sh
deleted file mode 100755
index 4879843..0000000
--- a/third_party/angle/cmake/export-swangle-env.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/usr/bin/env bash
-export VK_ICD_FILENAMES=set VK_ICD_FILENAMES=${CMAKE_BINARY_DIR}/${CMAKE_SYSTEM_NAME}/vk_swiftshader_icd.json
-export ANGLE_DEFAULT_PLATFORM="vulkan"