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