Skip to content

Commit

Permalink
Update with code in MetalANGLE's migration process to official repo.
Browse files Browse the repository at this point in the history
Change-Id: I1589ef3a38729bb67932cfb8e86195092f11f374
  • Loading branch information
kakashidinho committed Oct 12, 2019
1 parent 1476a9f commit 34c8ea3
Show file tree
Hide file tree
Showing 101 changed files with 16,229 additions and 8,130 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
/third_party/gles1_conform
/third_party/glmark2/src
/third_party/glslang/src
/third_party/spirv-cross/src
/third_party/googletest
/third_party/jsoncpp
/third_party/libjpeg_turbo
Expand All @@ -43,6 +42,7 @@
/third_party/qemu-linux-x64
/third_party/qemu-mac-x64
/third_party/rapidjson/src
/third_party/spirv-cross/src
/third_party/spirv-headers/src
/third_party/spirv-tools/src
/third_party/SwiftShader
Expand Down Expand Up @@ -76,3 +76,4 @@ Release_Win32/
Release_x64/
TestResults.qpa
.idea/
DerivedData/
2 changes: 1 addition & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This is the official list of The ANGLE Project Authors
# This is the official list of The ANGLE Project Authors
# for copyright purposes.
# This file is distinct from the CONTRIBUTORS files.
# See the latter for an explanation.
Expand Down
7 changes: 4 additions & 3 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -529,13 +529,14 @@ config("angle_backend_config") {
defines += [ "ANGLE_ENABLE_OPENGL_NULL" ]
}
}
if (angle_enable_metal) {
defines += [ "ANGLE_ENABLE_METAL" ]
}
if (angle_enable_null) {
defines += [ "ANGLE_ENABLE_NULL" ]
}

if (angle_enable_metal) {
configs = [ "src/libANGLE/renderer/metal:angle_metal_backend_config" ]
}

if (angle_enable_vulkan) {
configs = [ "src/libANGLE/renderer/vulkan:angle_vulkan_backend_config" ]
}
Expand Down
10 changes: 5 additions & 5 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,6 @@ deps = {
'condition': 'not build_with_chromium',
},

'{angle_root}/third_party/spirv-cross/src': {
'url': '{chromium_git}/external/github.com/KhronosGroup/SPIRV-Cross@{spirv_cross_revision}',
'condition': 'not build_with_chromium',
},

'{angle_root}/third_party/googletest': {
'url': '{chromium_git}/chromium/src/third_party/googletest@c721b68ddecc18bbc6b763b2fe8ab802c22f228a',
'condition': 'not build_with_chromium',
Expand Down Expand Up @@ -159,6 +154,11 @@ deps = {
'url': '{chromium_git}/external/github.com/Tencent/rapidjson@7484e06c589873e1ed80382d262087e4fa80fb63',
},

'{angle_root}/third_party/spirv-cross/src': {
'url': '{chromium_git}/external/github.com/KhronosGroup/SPIRV-Cross@{spirv_cross_revision}',
'condition': 'not build_with_chromium',
},

'{angle_root}/third_party/spirv-headers/src': {
'url': '{chromium_git}/external/github.com/KhronosGroup/SPIRV-Headers@{spirv_headers_revision}',
'condition': 'not build_with_chromium',
Expand Down
28 changes: 27 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,30 @@
# ANGLE - Almost Native Graphics Layer Engine
# MetalANGLE - OpenGL ES to Apple Metal API Translation Layer
This is a fork of Goolge's [ANGLE project](https://chromium.googlesource.com/angle/angle). It adds Metal API backend support.
Apple announced OpenGL (ES) deprecation in 2018. So the purpose of MetalANGLE is to allow OpenGL ES applications
to continue operate on Apple platforms by translating OpenGL ES draw calls to Metal draw calls under the hood.

### Current Metal backend implementation status
- MetalANGLE is being migrated into official ANGLE repo. So this repo might not get updated for a while.
- Almost all basic samples has been tested to work fine.
- Not all ANGLE tests passed yet.
- No `GL_TRIANGLE_FAN` & `GL_LINE_LOOP` support in draw calls yet.
- Metal doesn't allow buffer offset not being multiple of 4 bytes. Hence, draw calls that use unsupported offsets, strides,
and vertex formats will force MetalANGLE to do software conversions on CPU.
- MSAA is not supported yet.
- MetalANGLE only supports __MacOS 10.13+__ and __iOS 11.0+__.
#### TODO lists
- Make sure it passes all ANGLE's unit tests.
- Support `GL_TRIANGLE_FAN` & `GL_LINE_LOOP` by generating index buffer on the fly using Metal compute shader.
- Use compute shader to convert unsupported offsets, strides & vertex formats.
- Support MSAA.
- Support OpenGL ES 3.0.

## How to build Metal ANGLE for MacOS & iOS
View the [Metal backend's Dev setup instructions](src/libANGLE/renderer/metal/DevSetup.md).
Currently, for convenience, iOS version can be built using Xcode project provided in `ios/xcode` folder.

------
# Google's ANGLE - Almost Native Graphics Layer Engine

The goal of ANGLE is to allow users of multiple operating systems to seamlessly run WebGL and other
OpenGL ES content by translating OpenGL ES API calls to one of the hardware-supported APIs available
Expand Down
2 changes: 1 addition & 1 deletion build_overrides/angle.gni
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ angle_has_build = true

# Overrides for ANGLE's dependencies
angle_glslang_dir = "//third_party/glslang/src"
angle_spirv_cross_dir = "//third_party/spirv-cross"
angle_googletest_dir = "//third_party/googletest/src"
angle_libjpeg_turbo_dir = "//third_party/libjpeg_turbo"
angle_jsoncpp_dir = "//third_party/jsoncpp"
angle_libpng_dir = "//third_party/libpng"
angle_spirv_cross_dir = "//third_party/spirv-cross"
angle_spirv_tools_dir = "//third_party/spirv-tools/src"
5 changes: 2 additions & 3 deletions gni/angle.gni
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,8 @@ declare_args() {
angle_enable_essl = true
angle_enable_glsl = true

if (is_mac || is_ios) {
angle_enable_metal = false
}
# http://anglebug.com/2634
angle_enable_metal = is_mac
}

declare_args() {
Expand Down
4 changes: 2 additions & 2 deletions include/GLSLANG/ShaderLang.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

// Version number for shader translation API.
// It is incremented every time the API changes.
#define ANGLE_SH_VERSION 216
#define ANGLE_SH_VERSION 217

enum ShShaderSpec
{
Expand Down Expand Up @@ -72,7 +72,7 @@ enum ShShaderOutput

// Output specialized GLSL to be fed to glslang for Vulkan SPIR to be cross compiled to Metal
// later.
SH_GLSL_METAL_OUTPUT,
SH_GLSL_METAL_OUTPUT = 0x8B4C,
};

// Compile options.
Expand Down
22 changes: 22 additions & 0 deletions ios/xcode/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
</dict>
</plist>
Loading

0 comments on commit 34c8ea3

Please sign in to comment.