This repository includes Khronos OpenGL / OpenGL ES CTS under `external/openglcts` directory.
For more information see [OpenGL / OpenGL ES CTS README](external/openglcts/README.md).
+
+ANGLE for Android
+--------------------------------
+
+ANGLE can be built for Android by following the instructions
+[here](https://chromium.googlesource.com/angle/angle.git/+/HEAD/doc/DevSetup.md#building-angle-for-android).
+
+The resulting ANGLE shared object libraries can be linked against and embedded into `dEQP.apk` with
+the `--angle-path` option. This will cause `dEQP.apk` to use the ANGLE libraries for OpenGL ES
+calls, rather than the native drivers.
+
+An ABI must be specified and the directory structure containing the ANGLE shared objects must match
+it so the build system can find the correct `*.so` files.
+
+Assuming ANGLE shared objects are generated into `~/chromium/src/out/Release/` and `dEQP.apk` will
+be generated with `--abis arm64-v8a`, issue the following commands:
+
+ cd ~/chromium/src/out/Release/
+ mkdir arm64-v8a && cd arm64-v8a
+ cp ../lib*_angle.so .
+
+The `--angle-path ~/chromium/src/out/Release/` option can then be used to link against and embed the
+ANGLE shared object files. The full command would be:
+
+ python scripts/android/build_apk.py --sdk <path to Android SDK> --ndk <path to Android NDK> --abis arm64-v8a --angle-path ~/chromium/src/out/Release/
\ No newline at end of file
self.ndk = ndk
class Configuration:
- def __init__(self, env, buildPath, abis, nativeApi, nativeBuildType, gtfTarget, verbose, layers):
+ def __init__(self, env, buildPath, abis, nativeApi, nativeBuildType, gtfTarget, verbose, layers, angle):
self.env = env
self.sourcePath = DEQP_DIR
self.buildPath = buildPath
self.gtfTarget = gtfTarget
self.verbose = verbose
self.layers = layers
+ self.angle = angle
self.cmakeGenerator = selectFirstAvailableGenerator([NINJA_GENERATOR, MAKEFILE_GENERATOR, NMAKE_GENERATOR])
def check (self):
return "r%d%s" % (version[0], minorVersionString)
def getBuildArgs (config, abiName):
- return ['-DDEQP_TARGET=android',
+ args = ['-DDEQP_TARGET=android',
'-DDEQP_TARGET_TOOLCHAIN=ndk-modern',
'-DCMAKE_C_FLAGS=-Werror',
'-DCMAKE_CXX_FLAGS=-Werror',
'-DDE_ANDROID_API=%s' % config.nativeApi,
'-DGLCTS_GTF_TARGET=%s' % config.gtfTarget]
+ if config.angle is not None:
+ args.append('-DANGLE_LIBS=%s' % os.path.join(config.angle, abiName))
+
+ return args
+
nativeBuildPath = getNativeBuildPath(config, abiName)
buildConfig = BuildConfig(nativeBuildPath, config.nativeBuildType, getBuildArgs(config, abiName))
libFiles.append(layerRelPath)
print "Adding layer binary: %s" % (layer,)
+ if config.angle:
+ angleGlob = os.path.join(config.angle, abi, "lib*_angle.so")
+ libAngle = glob.glob(angleGlob)
+ for lib in libAngle:
+ libFilename = os.path.basename(lib)
+ libRelPath = os.path.join("lib", abi, libFilename)
+ libAbsPath = os.path.join(pkgPath, libRelPath)
+ shutil.copyfile(lib, libAbsPath)
+ libFiles.append(libRelPath)
+ print "Adding ANGLE binary: %s" % (lib,)
+
shutil.copyfile(srcPath, dstPath)
addFilesToAPK(config, dstPath, pkgPath, libFiles)
dest='layers',
default=None,
required=False)
+ parser.add_argument('--angle-path',
+ dest='angle',
+ default=None,
+ required=False)
args = parser.parse_args()
buildPath = os.path.realpath(args.buildRoot)
env = Environment(sdk, ndk)
config = Configuration(env, buildPath, abis=args.abis, nativeApi=args.nativeApi, nativeBuildType=args.nativeBuildType, gtfTarget=args.gtfTarget, verbose=args.verbose,
- layers=args.layers)
+ layers=args.layers, angle=args.angle)
try:
config.check()
set(DEQP_TARGET_NAME "Android")
set(DEQP_SUPPORT_GLES1 ON)
+# Necessary for find_library() to search within ANGLE_LIBS
+set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY_OLD ${CMAKE_FIND_ROOT_PATH_MODE_LIBRARY})
+set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH)
+
# GLESv1 lib
-find_library(GLES1_LIBRARY GLESv1_CM PATHS /usr/lib)
+if (IS_DIRECTORY ${ANGLE_LIBS})
+ find_library(GLES1_LIBRARY NAMES GLESv1_CM_angle PATHS ${ANGLE_LIBS} NO_DEFAULT_PATH)
+
+else()
+ find_library(GLES1_LIBRARY GLESv1_CM PATHS /usr/lib)
+endif()
set(DEQP_GLES1_LIBRARIES ${GLES1_LIBRARY})
# GLESv2 lib
-find_library(GLES2_LIBRARY GLESv2 PATHS /usr/lib)
+if (IS_DIRECTORY ${ANGLE_LIBS})
+ find_library(GLES2_LIBRARY NAMES GLESv2_angle PATHS ${ANGLE_LIBS} NO_DEFAULT_PATH)
+else()
+ find_library(GLES2_LIBRARY GLESv2 PATHS /usr/lib)
+endif()
set(DEQP_GLES2_LIBRARIES ${GLES2_LIBRARY})
# EGL lib
-find_library(EGL_LIBRARY EGL PATHS /usr/lib)
+if (IS_DIRECTORY ${ANGLE_LIBS})
+ find_library(EGL_LIBRARY NAMES EGL_angle PATHS ${ANGLE_LIBS} NO_DEFAULT_PATH)
+else()
+ find_library(EGL_LIBRARY EGL PATHS /usr/lib)
+endif()
set(DEQP_EGL_LIBRARIES ${EGL_LIBRARY})
+set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ${CMAKE_FIND_ROOT_PATH_MODE_LIBRARY_OLD})
+
# Platform libs
find_library(LOG_LIBRARY NAMES log PATHS /usr/lib)
set(DEQP_PLATFORM_LIBRARIES ${DEQP_PLATFORM_LIBRARIES} ${LOG_LIBRARY})