From 437053a1635bb700fb38c59c775bb691e4e22c95 Mon Sep 17 00:00:00 2001 From: Cody Northrop Date: Thu, 28 Apr 2022 09:05:43 -0600 Subject: [PATCH] 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 > Reviewed-by: Kenneth Russell > Auto-Submit: Brian Osman > Reviewed-by: Shahbaz Youssefi Bug: chromium:1320588 Change-Id: Id160118146dad1b8f1af40c60ddefd717516cd1d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3614527 Reviewed-by: Cody Northrop Commit-Queue: Kenneth Russell Auto-Submit: Cody Northrop Reviewed-by: Kenneth Russell --- BUILD.gn | 11 +++++----- gni/angle.gni | 8 ++------ .../vulkan/EarlyFragmentTestsOptimization.h | 1 - src/libANGLE/renderer/metal/BUILD.gn | 20 +++++++------------ 4 files changed, 14 insertions(+), 26 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index 6e8a001a1..1b6c721b3 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -587,8 +587,7 @@ template("translator_lib") { } 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 @@ template("translator_lib") { 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 ac0273979..e4ca8d10c 100644 --- a/gni/angle.gni +++ b/gni/angle.gni @@ -120,10 +120,6 @@ declare_args() { angle_has_frame_capture = angle_has_rapidjson } -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 @@ -147,7 +143,7 @@ declare_args() { ((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 @@ declare_args() { # 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 a588d6a0c..1d6a0b4b4 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 9f3aa91e7..93d1ca896 100644 --- a/src/libANGLE/renderer/metal/BUILD.gn +++ b/src/libANGLE/renderer/metal/BUILD.gn @@ -65,6 +65,8 @@ _metal_backend_sources = [ "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 @@ _metal_backend_sources = [ "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_source_set("angle_metal_backend") { "${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",