Revert "Make SPIRV optional for Metal backend"
This reverts commit 29287e1fc7ad3dff0619736a89e64b3598af8659.
Reason for revert:
Possible root cause of Mac failures http://crbug.com/1320588
Original change's description:
> Make SPIRV optional for Metal backend
>
> This allows clients (ie Skia) to build ANGLE without needing
> all of the additional Vulkan dependencies. Developer builds
> will continue to include both the direct and SPIRV paths, for
> debugging purposes.
>
> Bug: angleproject:7155
> Change-Id: I1c38ee19e747df8b25fd2f8e8efa3b420a4d7766
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3605764
> Commit-Queue: Kenneth Russell <kbr@chromium.org>
> Reviewed-by: Kenneth Russell <kbr@chromium.org>
> Auto-Submit: Brian Osman <brianosman@google.com>
> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Bug: chromium:1320588
Change-Id: Id160118146dad1b8f1af40c60ddefd717516cd1d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3614527
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Commit-Queue: Kenneth Russell <kbr@chromium.org>
Auto-Submit: Cody Northrop <cnorthrop@google.com>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
diff --git a/BUILD.gn b/BUILD.gn
index 6e8a001..1b6c721 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -587,8 +587,7 @@
}
if (!invoker.gl_d3d_only) {
- if (angle_enable_vulkan || use_fuzzing_engine ||
- angle_enable_msl_through_spirv) {
+ if (angle_enable_vulkan || use_fuzzing_engine || angle_enable_metal) {
_needs_glsl_base = true
_needs_glsl_and_vulkan_base = true
_uses_spirv = true
@@ -603,10 +602,10 @@
if (angle_enable_metal) {
sources += angle_translator_lib_metal_sources
- defines += [ "ANGLE_ENABLE_METAL" ]
- if (angle_enable_msl_through_spirv) {
- defines += [ "ANGLE_ENABLE_METAL_SPIRV" ]
- }
+ defines += [
+ "ANGLE_ENABLE_METAL",
+ "ANGLE_ENABLE_METAL_SPIRV",
+ ]
}
}
diff --git a/gni/angle.gni b/gni/angle.gni
index ac02739..e4ca8d1 100644
--- a/gni/angle.gni
+++ b/gni/angle.gni
@@ -121,10 +121,6 @@
}
declare_args() {
- angle_enable_msl_through_spirv = is_mac && angle_debug_layers_enabled
-}
-
-declare_args() {
# By default, ANGLE is using a thread pool for parallel compilation.
# Activating the delegate worker results in posting the tasks using the
# embedder API. In Chromium code base, it results in sending tasks to the
@@ -147,7 +143,7 @@
((is_win && !angle_is_winuwp) ||
((is_linux || is_chromeos) &&
(angle_use_x11 || angle_use_wayland || angle_use_vulkan_display)) ||
- is_android || is_fuchsia || is_ggp || angle_enable_msl_through_spirv)
+ is_android || is_fuchsia || is_ggp || is_mac)
# When set to true, ANGLE will not use VK_KHR_surface and VK_KHR_swapchain
# extensions. Content can be rendered only off-screen.
@@ -204,7 +200,7 @@
# the SPIR-V generation path, but leave it disabled on release. It's still used by the metal
# backend nevertheless.
angle_enable_spirv_gen_through_glslang =
- is_debug || angle_assert_always_on || angle_enable_msl_through_spirv ||
+ is_debug || angle_assert_always_on || angle_enable_metal ||
angle_use_spirv_gen_through_glslang
# ISpriteVisual windows cannot be validated and can lead to crashes if an invalid window is
diff --git a/src/compiler/translator/tree_ops/vulkan/EarlyFragmentTestsOptimization.h b/src/compiler/translator/tree_ops/vulkan/EarlyFragmentTestsOptimization.h
index a588d6a..1d6a0b4 100644
--- a/src/compiler/translator/tree_ops/vulkan/EarlyFragmentTestsOptimization.h
+++ b/src/compiler/translator/tree_ops/vulkan/EarlyFragmentTestsOptimization.h
@@ -11,7 +11,6 @@
#define COMPILER_TRANSLATOR_TREEOPS_VULKAN_EARLYFRAGMENTTESTSOPTIMIZATION_H_
#include "common/angleutils.h"
-#include "common/debug.h"
namespace sh
{
diff --git a/src/libANGLE/renderer/metal/BUILD.gn b/src/libANGLE/renderer/metal/BUILD.gn
index 9f3aa91..93d1ca8 100644
--- a/src/libANGLE/renderer/metal/BUILD.gn
+++ b/src/libANGLE/renderer/metal/BUILD.gn
@@ -65,6 +65,8 @@
"mtl_format_utils.mm",
"mtl_glslang_mtl_utils.h",
"mtl_glslang_mtl_utils.mm",
+ "mtl_glslang_utils.h",
+ "mtl_glslang_utils.mm",
"mtl_occlusion_query_pool.h",
"mtl_occlusion_query_pool.mm",
"mtl_render_utils.h",
@@ -82,12 +84,11 @@
"shaders/rewrite_indices_shared.h",
]
-config("angle_metal_spirv_backend_config") {
- defines = [ "ANGLE_ENABLE_METAL_SPIRV" ]
-}
-
config("angle_metal_backend_config") {
- defines = [ "ANGLE_ENABLE_METAL" ]
+ defines = [
+ "ANGLE_ENABLE_METAL",
+ "ANGLE_ENABLE_METAL_SPIRV",
+ ]
ldflags = [
"-weak_framework",
"Metal",
@@ -115,14 +116,7 @@
"${angle_root}:translator",
]
- if (angle_enable_msl_through_spirv) {
- public_configs += [ ":angle_metal_spirv_backend_config" ]
- deps = [ "${angle_spirv_cross_dir}/gn:spirv_cross_sources" ]
- sources += [
- "mtl_glslang_utils.h",
- "mtl_glslang_utils.mm",
- ]
- }
+ deps = [ "${angle_spirv_cross_dir}/gn:spirv_cross_sources" ]
objc_flags = [
"-Wno-nullability-completeness",