Hash :
ad4617f5
Author :
Date :
2023-11-03T22:46:41
Metal: Fix cross-compile build When cross-compiling for mac, prebuilt shaders are disabled as the Chromium Mac SDK does not include the necessary files. Bug: chromium:1385510 Change-Id: Ie13903681ece68e10f3b9fda42fcc6a8324d563e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5001921 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
# Copyright 2022 The ANGLE Project Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("../../../../gni/angle.gni")
metal_backend_sources = [
"BufferMtl.h",
"BufferMtl.mm",
"CompilerMtl.h",
"CompilerMtl.mm",
"ContextMtl.h",
"ContextMtl.mm",
"DeviceMtl.h",
"DeviceMtl.mm",
"DisplayMtl.h",
"DisplayMtl.mm",
"DisplayMtl_api.h",
"FrameBufferMtl.h",
"FrameBufferMtl.mm",
"IOSurfaceSurfaceMtl.h",
"IOSurfaceSurfaceMtl.mm",
"ImageMtl.h",
"ImageMtl.mm",
"ProgramExecutableMtl.h",
"ProgramExecutableMtl.mm",
"ProgramMtl.h",
"ProgramMtl.mm",
"ProvokingVertexHelper.h",
"ProvokingVertexHelper.mm",
"QueryMtl.h",
"QueryMtl.mm",
"RenderBufferMtl.h",
"RenderBufferMtl.mm",
"RenderTargetMtl.h",
"RenderTargetMtl.mm",
"SamplerMtl.h",
"SamplerMtl.mm",
"ShaderMtl.h",
"ShaderMtl.mm",
"SurfaceMtl.h",
"SurfaceMtl.mm",
"SyncMtl.h",
"SyncMtl.mm",
"TextureMtl.h",
"TextureMtl.mm",
"TransformFeedbackMtl.h",
"TransformFeedbackMtl.mm",
"VertexArrayMtl.h",
"VertexArrayMtl.mm",
"blocklayoutMetal.cpp",
"blocklayoutMetal.h",
"mtl_buffer_manager.h",
"mtl_buffer_manager.mm",
"mtl_buffer_pool.h",
"mtl_buffer_pool.mm",
"mtl_command_buffer.h",
"mtl_command_buffer.mm",
"mtl_common.h",
"mtl_common.mm",
"mtl_context_device.h",
"mtl_context_device.mm",
"mtl_format_table_autogen.mm",
"mtl_format_utils.h",
"mtl_format_utils.mm",
"mtl_library_cache.h",
"mtl_library_cache.mm",
"mtl_msl_utils.h",
"mtl_msl_utils.mm",
"mtl_occlusion_query_pool.h",
"mtl_occlusion_query_pool.mm",
"mtl_pipeline_cache.h",
"mtl_pipeline_cache.mm",
"mtl_render_utils.h",
"mtl_render_utils.mm",
"mtl_resource_spi.h",
"mtl_resources.h",
"mtl_resources.mm",
"mtl_state_cache.h",
"mtl_state_cache.mm",
"mtl_utils.h",
"mtl_utils.mm",
"process.cpp",
"process.h",
"renderermtl_utils.cpp",
"renderermtl_utils.h",
"shaders/constants.h",
"shaders/mtl_internal_shaders_src_autogen.h",
"shaders/rewrite_indices_shared.h",
]
# We can build the ANGLE internal shaders at build-time if we have access to the Mac SDK in the "build" dir.
# Building internal shaders for iOS is not supported. The Chromium Mac SDK does not have all the required files.
# This is also an issue when cross-compiling for mac.
metal_internal_shader_compilation_supported =
angle_has_build && !is_ios && target_os == host_os
metal_internal_shaders_header =
"$root_gen_dir/angle/mtl_internal_shaders_metallib.h"
if (metal_internal_shader_compilation_supported) {
metal_backend_sources += [ metal_internal_shaders_header ]
}