Hash :
5a77200b
Author :
Date :
2023-02-08T17:10:28
Metal: Implement parallel shader linking. Update the Metal library cache to be thread safe. Change absl::flat_hash_map back to std::unordered_map because the value types now contain a mutex which must not move. Only generate async compilation tasks for shaders that were not already compiled and in the cache. Collapse some of the link methods in ProgramMtl that only had one call site. All linking is now done in ProgramMtl::link and ProgramMtl::load. Support disabling parallel linking using the new enableParallelMtlLibraryCompilation feature. Bug: chromium:1385510 Change-Id: I71ba71a34d994066729df7e4170911f88c89de4a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4234153 Reviewed-by: Quyen Le <lehoangquyen@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Geoff Lang <geofflang@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 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288
{
"description": [
"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.",
"",
"mtl_features.json: Optional features for the Metal renderer."
],
"features": [
{
"name": "has_base_vertex_instanced_draw",
"category": "Features",
"description": [
"The renderer supports base vertex instanced draw"
]
},
{
"name": "has_explicit_mem_barrier",
"category": "Features",
"description": [
"The renderer supports explicit memory barrier"
]
},
{
"name": "has_cheap_render_pass",
"category": "Features",
"description": [
"The renderer can cheaply break a render pass."
]
},
{
"name": "has_non_uniform_dispatch",
"category": "Features",
"description": [
"The renderer supports non uniform compute shader dispatch's group size"
]
},
{
"name": "has_shader_stencil_output",
"category": "Features",
"description": [
"The renderer supports stencil output from fragment shader"
]
},
{
"name": "has_texture_swizzle",
"category": "Features",
"description": [
"The renderer supports texture swizzle"
]
},
{
"name": "has_depth_auto_resolve",
"category": "Features",
"description": [
"The renderer supports MSAA depth auto resolve at the end of render pass"
]
},
{
"name": "has_stencil_auto_resolve",
"category": "Features",
"description": [
"The renderer supports MSAA stencil auto resolve at the end of render pass"
]
},
{
"name": "has_events",
"category": "Features",
"description": [
"The renderer supports MTL(Shared)Event"
]
},
{
"name": "allow_inline_const_vertex_data",
"category": "Features",
"description": [
"The renderer supports using inline constant data for small client vertex data"
]
},
{
"name": "allow_separate_depth_stencil_buffers",
"category": "Features",
"description": [
"Some Apple platforms such as iOS allows separate depth and stencil buffers, ",
"whereas others such as macOS don't"
]
},
{
"name": "allow_runtime_sampler_compare_mode",
"category": "Features",
"description": [
"The renderer supports changing sampler's compare mode outside shaders"
]
},
{
"name": "allow_sampler_compare_gradient",
"category": "Features",
"description": [
"The renderer supports sample_compare with gradients"
]
},
{
"name": "allow_sampler_compare_lod",
"category": "Features",
"description": [
"The renderer supports sample_compare with lod"
]
},
{
"name": "allow_buffer_read_write",
"category": "Features",
"description": [
"The renderer supports buffer read and write in the same shader"
]
},
{
"name": "allow_multisample_store_and_resolve",
"category": "Features",
"description": [
"The renderer supports MSAA store and resolve in the same pass"
]
},
{
"name": "allow_gen_multiple_mips_per_pass",
"category": "Features",
"description": [
"The renderer supports generating multiple mipmaps per pass"
]
},
{
"name": "force_D24S8_as_unsupported",
"category": "Features",
"description": [
"Force Depth24Stencil8 format as unsupported."
]
},
{
"name": "force_buffer_GPU_storage",
"category": "Features",
"description": [
"On systems that support both buffer' memory allocation on GPU and shared memory (such as ",
"macOS), force using GPU memory allocation for buffers everytime or not."
]
},
{
"name": "force_non_CS_base_mipmap_generation",
"category": "Features",
"description": [
"Turn this feature on to disallow Compute Shader based mipmap generation. Compute Shader ",
"based mipmap generation might cause GPU hang on some older iOS devices."
]
},
{
"name": "emulate_transform_feedback",
"category": "Features",
"description": [
"Turn this on to allow transform feedback in Metal using a 2-pass VS for GLES3."
]
},
{
"name": "rewrite_row_major_matrices",
"category": "Features",
"description": [
"Rewrite row major matrices in shaders as column major."
]
},
{
"name": "intel_explicit_bool_cast_workaround",
"category": "Workarounds",
"description": [
"Insert explicit casts for float/double/unsigned/signed int on macOS 10.15 with Intel ",
"driver"
]
},
{
"name": "intel_disable_fast_math",
"category": "Workarounds",
"description": [
"Disable fast math in atan and invariance cases when running below macOS 12.0"
]
},
{
"name": "allow_renderpass_without_attachment",
"category": "Features",
"description": [
"Allow creation of render passes without any attachments"
]
},
{
"name": "multisample_color_format_shader_read_workaround",
"category": "Workarounds",
"description": [
"Add shaderRead usage to some multisampled texture formats"
],
"issue": "http://anglebug.com/7049"
},
{
"name": "copy_IOSurface_to_non_IOSurface_for_read_optimization",
"category": "Workarounds",
"description": [
"some GPUs are faster to read an IOSurface texture by first copying the texture to a ",
"non-IOSurface texture"
],
"issue": "http://anglebug.com/7117 http://anglebug.com/7573"
},
{
"name": "copy_texture_to_buffer_for_read_optimization",
"category": "Workarounds",
"description": [
"some GPUs are faster to read a texture by first copying the texture to a buffer"
],
"issue": "http://anglebug.com/7117"
},
{
"name": "limit_max_draw_buffers_for_testing",
"category": "Features",
"description": [
"Used to check the backend works when the device's advertized limit is less than the code's limit"
],
"issue": "http://anglebug.com/7280"
},
{
"name": "limit_max_color_target_bits_for_testing",
"category": "Features",
"description": [
"Metal iOS has a limit on the number of color target bits per pixel."
],
"issue": "http://anglebug.com/7280"
},
{
"name": "preemptively_start_provoking_vertex_command_buffer",
"category": "Features",
"description": [
"AMD Metal Drivers appear to have a bug this works around"
],
"issue": "http://anglebug.com/7635"
},
{
"name": "upload_data_to_iosurfaces_with_staging_buffers",
"category": "Workarounds",
"description": [
"When uploading data to IOSurface-backed textures, use a staging buffer."
],
"issue": "http://anglebug.com/7573"
},
{
"name": "disable_programmable_blending",
"category": "Features",
"description": [
"Disable programmable blending in order to test read_write pixel local storage textures"
],
"issue": "http://anglebug.com/7279"
},
{
"name": "disable_r_w_texture_tier2_support",
"category": "Features",
"description": [
"Disable tier2 read_write textures in order to test tier1 support"
],
"issue": "http://anglebug.com/7279"
},
{
"name": "disable_raster_order_groups",
"category": "Features",
"description": [
"Disable raster order groups in order to test pixel local storage memory barriers"
],
"issue": "http://anglebug.com/7279"
},
{
"name": "enable_in_memory_mtl_library_cache",
"category": "Features",
"description": [
"Cache MTLLibrary objects in memory."
],
"issue": "http://crbug.com/1385510"
},
{
"name": "enable_parallel_mtl_library_compilation",
"category": "Features",
"description": [
"Compile MTLLibrary in multiple threads."
],
"issue": "http://crbug.com/1385510"
}
]
}