include/platform/mtl_features.json


Log

Author Commit Date CI Message
Kenneth Russell aea88562 2023-05-19T16:52:43 Reland "Metal: Optimized BufferSubData per device" This reverts commit ee64836f702332adaca58d9f452063a04b2da955 , relanding the patch stack described there. Between patchsets 1 and 5: - The shadow buffer allocation has been replaced with a multimap of precisely-sized buffers, rather than rounding up buffer sizes. - Garbage collection of shadow buffers is triggered in three situations: - A certain number of context switches have occurred; this number was hand-tuned to avoid GC every frame. - A certain number of command buffer submissions has occurred; this number was hand-tuned to GC no more often than every few seconds on representative workloads. - The total size of the allocated shadow buffers is more than 1 MB, and either more than twice the size at the last garbage collection, or 64 MB more than at the last garbage collection. In this case, aggressive GC is performed in order to reclaim shadow buffers more quickly. Performance before and after these changes appears identical on microbenchmarks. On one Figma test case, comparing GPU memory allocated inside the BufferManager, peak consumption is decreased by over 75%, and steady-state consumption decreases by over 88%. Patchset 6 adds a needed workaround for a bug in the AMDMTLBronzeDriver affecting uploads of client-side data, and therefore some dEQP tests. It also streamlines the aggressive GC. Bug: angleproject:7544 Change-Id: I81b061f0b33c27fa403527fa12d626f4e9c88ebe Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4497413 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang 6d3e5870 2023-05-17T16:42:47 Metal: Disable Metal support on NVIDIA GPUs NVIDIA GPUs are in a very small number of Macs and we don't have have adequate test coverage to properly support them. Add the disable_metal_on_nvidia feature to control support for NVIDIA at runtime. Also factor the support of GPU family 1 into a feature. Bug: angleproject:8170 Change-Id: I160036d710cc9e278eb77e351a483b9f5b69e8ce Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4544659 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Scott Violet b0f9c01e 2023-05-01T12:54:10 metal: adds feature that minimizes generated shader differences This adds a feature (enabled by default) that results in generating the same code regardless of whether emulateAlphaToCoverage is enabled or addExplicitBoolCasts. This is done to maximize cache sharing. Bug: chromium:1423136 Change-Id: Ia491f13469c750fc2c45aecf1f93fed53b782dc5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4496254 Reviewed-by: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Scott Violet <sky@chromium.org>
Scott Violet 3e281219 2023-04-27T14:52:18 Adds feature to output blob cache key and source for shader Bug: chromium:1423136 Change-Id: Ic03e1b9971b2f1417c0b2e95c8d3846f28a01572 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4480976 Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Scott Violet <sky@chromium.org>
Kimmo Kinnunen 20b6624a 2023-04-17T13:55:09 Metal: Support compiling on iOS without EAGL Makes EAGL and CGL compilation exclusive to each other. Catalyst would compile with both on ARM64, but only use EAGL. Remove use of GLSL generation in MSL. Generating GLSL for MSL compute and geometry shaders do not make sense. Remove compilation of RewriteRowMajorMatrices for Metal. It was removed from Metal in: b23bf47c9e999532a684beab9ac901552420b0b8 Reland "Metal: rewrite default uniforms and uniform blocks" Remove use of ANGLE_ENABLE_APPLE_WORKAROUNDS and gn variable angle_enable_apple_translator_workarounds. The workarounds are just unconditional business-as-usual implementation of ANGLE when ANGLE is compile for PLATFORM_APPLE. Fixed: angleproject:8129 Change-Id: I3af249708803fba816e2a7c92c35dddb84ce6946 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4428875 Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Kyle Piddington <kpiddington@apple.com> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Dan Glastonbury <djg@apple.com> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Scott Violet 65f4d2a4 2023-04-17T10:08:18 Adds features to enable loading/saving metallibs to blobcache CompileMetalShaders results in the appropriate command line tool being run to generate metallib blobs from shader source. DisableProgramCaching results in not saving programs to BlobCache LoadMetalShadersFromBlobCache results in trying to load metallibs from BlobCache. Bug: chromium:1423136 Change-Id: I01a4d7a5d60ed5ac978fb99db01b741e0f19e76b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4434293 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Scott Violet <sky@chromium.org>
Alexey Knyazev 7bc4b7e3 2023-03-27T00:00:00 Metal: Implement OES_sample_variables New ESSL built-ins are mapped to their Metal counterparts and tweaked to follow OpenGL ES semantics when needed. Fixed A2C interaction with sample coverage by emulating the former on non-Apple GPUs. Bug: angleproject:8097 Fixed: angleproject:5087 Change-Id: I5d28a941af5cbc14743a3930731529f11f55febd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4404896 Reviewed-by: Kenneth Russell <kbr@chromium.org> Reviewed-by: Kyle Piddington <kpiddington@apple.com> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Geoff Lang f1f80e1e 2023-03-22T12:54:08 Metal: Always prefer staged GPU uploads for textures. Uploading Metal texture data via MTLTexture::replaceRegion is a source of lots of CPU hangs and jank. There may be better heuristics to determine if we should do a CPU vs GPU upload but for now preferring GPU uploads has better overall performance. This also improves the MotionMark images test: - 40 -> 100 when using Metal. - 217 -> 235 when using Metal + https://chromium-review.googlesource.com/c/chromium/src/+/4091749 Bug: angleproject:8024, angleproject:8092, angleproject:8109 Change-Id: I36b5f585884391b4cc416365ae65f8542745beee Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4264963 Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Alexey Knyazev 4256c022 2023-03-01T00:00:00 Metal: Implement ANGLE_stencil_texturing Used texture views to sample stencil values from combined depth/stencil textures. Texture2DDepthStencilTestES3.TexSampleModes* tests were split into swizzled and non-swizzled variants to suppress only swizzled cases on some platforms. Added a new avoidStencilTextureSwizzle workaround to skip creating swizzled texture views of stencil-only textures on platforms that fail to sample from them. Fixed: angleproject:8051 Change-Id: I0b1148f8d30fc6459239efcdaeee6c0364633cc8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4304058 Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Kenneth Russell <kbr@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 5a77200b 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>
Kenneth Russell ee64836f 2023-02-11T17:56:06 Revert "Metal: Optimized BufferSubData per device" This reverts commit 968041b54770af8917001d8fe9b52a881cfed0b2. Includes the following patches: git revert -n 995db1f66bcf87fc9e47d908fb2a885e810d2567 \ 9a6c90c8f802b4d107a081bfccaf4be007e7af54 \ dbd47e378582ef86db52c7379cd220cf0b2c8193 \ 369b320f92f54774879e8b8faff834fc8db0793e \ 4abae6f97586448712e2dc1cced4a678b0901d7b \ 968041b54770af8917001d8fe9b52a881cfed0b2 Several conflicts with top-of-tree were resolved during this revert. The aim is to reland this with additional code which will reduce the amount of excess buffer memory allocated, and release the resources associated with temporary buffer allocations. Bug: angleproject:7544 Change-Id: Ib7a6bc2ab1c2f23cb43112cd980106e2898c3826 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4240556 Reviewed-by: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Gregg Tavares <gman@chromium.org> Commit-Queue: Kenneth Russell <kbr@chromium.org>
Geoff Lang 9b00af52 2023-02-01T11:10:32 Metal: Add an in-memory MTLLibrary cache. Add a small cache for (msl + compile parameters) -> MTLLibrary at the egl::Display level. In regular executions of Chrome, the same shaders (particularly vertex) are compiled multiple times in different programs. Tested for a regular Chrome startup + open wikipedia + motionmark 1.2: 112/282 (40%) cache hits. Several different caching methods were profiled (LinkProgram perf test) - struct key with std::map : 303309 - struct key with std::unordered_map : 308090 - binary blob key with std::map : 263595 - binary blob key with std::unordered_map : 286051 - struct key + is_transparent with std::unordered_map : 304877 - struct key + is_transparent with absl::flat_hash_map : 335686 Using is_transparent allows us to search the hash map without copying the shader source string to construct the key structure. Bug: chromium:1385510 Change-Id: Ieec4ba526fe286276a4af7114d89cde32a8f9e1d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4214012 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Dan Glastonbury bf5a007a 2022-06-16T14:21:08 Metal: Ensure render pass has at least one valid render target. Extend MTLRenderPipelineDescriptor validation to ensure that there is at least one valid render target set for the the render pipeline. This is required for certain families of metal devices to avoid a validation failure inside the metal framework. Moving the failure here will cause the app using ANGLE to return a GL error instead of crashing the process. Bug: angleproject:7436 Change-Id: I594d92492a22a61a720dbe7021843c8460b389b8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4109310 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Kimmo Kinnunen <kkinnunen@apple.com> Commit-Queue: Kyle Piddington <kpiddington@apple.com>
Chris Dalton a4db9477 2022-10-06T10:35:39 Implement pixel local storage with metal::read_write textures Metal's programmable blending feature isn't available on non-Apple Silicon, so on these devices we have to polyfill pixel local storage using read_write textures, which can also be coherent if raster_order_groups are supported. This change leverages the existing PLS transformation to images, and implements just enough shader image functionality in Metal to support the pixel local storage usecase. Missing shader image features are marked with UNIMPLEMENTED(). Bug: angleproject:7279 Bug: angleproject:7792 Bug: angleproject:7794 Bug: angleproject:7797 Bug: angleproject:7803 Change-Id: Ia96a714693d352d57351a1bae4f45437dde000e4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3993363 Reviewed-by: Kenneth Russell <kbr@chromium.org> Reviewed-by: Quyen Le <lehoangquyen@chromium.org> Commit-Queue: Chris Dalton <chris@rive.app> Reviewed-by: Kyle Piddington <kpiddington@apple.com>
Shahbaz Youssefi 5b218196 2022-11-06T11:39:23 Metal: Remove compilation through SPIR-V Direct metal generation is stable. Bug: angleproject:6081 Change-Id: If9e76f61ad38f2fc9963f0181dfd03c99ffa3e2b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4003675 Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Gregg Tavares 968041b5 2022-08-19T12:11:23 Metal: Optimized BufferSubData per device Adds a staging buffer path which means there are 4 paths for bufferSubData. 1. direct copy * get a pointer to the buffer * copy the new data to the buffer * if the buffer is managed, tell metal which part was updated 2. use a shadow copy * copy the data to a shadow copy * copy the entire shadow to a new buffer * start using the new buffer 3. use a new buffer * get a new buffer (or unused) * put the new data in the new buffer * blit any unchanged data from the old buffer to the new buffer * start using the new buffer 4. use a staging buffer * get a staging buffer * put the new data in the staging buffer * blit from the staging buffer to the existing buffer. Further, there are 3 types of memory storage modes. Managed, Staged, Private. Based on the GPU type different storage modes and different paths in different sitatutions are more performant. So, add feature flags to select paths by GPU. Bug: angleproject:7544 Change-Id: I741dd1874201043416374194bd2001ded8dbd9b4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3842641 Reviewed-by: Kyle Piddington <kpiddington@apple.com> Reviewed-by: Kenneth Russell <kbr@chromium.org> Reviewed-by: Quyen Le <lehoangquyen@chromium.org> Commit-Queue: Gregg Tavares <gman@chromium.org>
Geoff Lang 25bad36c 2022-09-23T13:23:57 Metal: Remove unpackLastRowSeparatelyForPaddingInclusion This speculative fix did not work. Bug: angleproject:7573 Change-Id: I345db1746f8725d82420aabffb37c8dd01230a34 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3915182 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Gregg Tavares <gman@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Geoff Lang 70e5e90f 2022-09-23T13:17:34 Metal: Avoid locking IOSurfaces in glReadPixels on AMD. The AMD driver tends to crash when locking IOSurfaces. Avoid this by using the copyIOSurfaceToNonIOSurfaceForReadOptimization feature to do a texture-texture copy before reading back data to the CPU. This is a *speculative* fix due to seeing crashes in the ClientLockIOSurface function in the AMD driver. Bug: angleproject:7573 Change-Id: Ia120f2a96eed65431b5f8a99cf1da7d7e85da639 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3915181 Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Gregg Tavares <gman@chromium.org>
Geoff Lang 2aa52da7 2022-09-23T13:15:44 Metal: Upload IOSurface data with staging buffers on AMD Crashes have been seen in the AMD driver when locking IOSurfaces. Avoid this by always using a staging buffer and doing a GPU-GPU copy for uploading client side data to IOSurfaces. Bug: angleproject:7573 Change-Id: I4d981a24554a755a7248199699b486d98cbad83d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3915180 Commit-Queue: Kenneth Russell <kbr@chromium.org> Reviewed-by: Gregg Tavares <gman@chromium.org>
Geoff Lang 09446a6b 2022-09-02T11:29:32 Metal: Upload the last texture row separately on AMD. Speculative fix for crashes seen when uploading texture data on AMD. Port of the unpackLastRowSeparatelyForPaddingInclusion workaround from the GL backend. Currently constrained to client data 2D uploads to non-compressed textures. Bug: angleproject:7573 Change-Id: Idd036b92619d309e5b2a8062043e8644f4d5b2e0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3870655 Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Gregg Tavares <gman@chromium.org>
Gregg Tavares 662226a3 2022-09-06T14:12:26 Metal: Preemptively Start Provoking Vertex CmdBuffer on AMD There seems to be a bug in older AMD drivers and this appears to work around it Bug: angleproject:7635 Change-Id: I1b22e4b7d5d1ce0d405e422d08d33eeeb731050a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3877666 Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Kenneth Russell <kbr@chromium.org>
Gregg Tavares 94320a83 2022-05-27T17:41:29 Metal: Validate total bits used in color attachments Metal has 2 limits for color attachments. 1 the number of attachments supported. 2 the total number of bits it can write per pixel. So for example Apple4 through Apple8 GPUs can have 8 attachments but only 512bits of output. That means you can attach 8 RGBA8 textures (256bits), but you can't attach 8 RGBA32UI textures (1024bits). If there are too many bits then return FRAMEBUFFER_UNSUPPORTED from checkFramebufferStatus and INVALID_FRAMEBUFFER_OPERATION from draws Bug: angleproject:7280 Change-Id: I935aebad4d57664f59a60be20a927d6b69afb4ff Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3674322 Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Gregg Tavares <gman@chromium.org>
Gregg Tavares 8a0351a5 2022-05-26T14:29:21 Metal:Dynamically choose max draw buffers. The code was hard coded to 4 which is lower than OpenGL's 8. This implementation keeps a hard coded array of size 8 in rx::mtl::RenderPassDesc and rx::mtl::RenderPipelineOutputDesc but only uses up to the display's limit. Bug: angleproject:7280 Bug: angleproject:5730 Change-Id: Idd7e64dc47697882b44540804159566158e1e924 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3671695 Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Gregg Tavares <gman@chromium.org>
Shahbaz Youssefi 4dc4c0f0 2022-05-02T11:03:57 Remove whitespace from features json files Bug: angleproject:6435 Change-Id: I7f653a9836180d0f2e0198302e11ae2b0ca49d3b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3621315 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Gregg Tavares 1a144edf 2022-04-13T17:15:29 Metal:ReadPixels AMD Copy Texture to Buffer optimization On AMD GPUs it's faster to copy a texture to a buffer for read back than to read via a texture. For reading from a normal texture 24-27ms -> 6-9ms For reading from a IOSurface texture 17-20ms -> 7-10ms Bug: angleproject:7117 Change-Id: I7c7f276a3121e87f5c52a1a4287d13203a6b1b37 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3584423 Reviewed-by: Kenneth Russell <kbr@chromium.org> Reviewed-by: Kyle Piddington <kpiddington@apple.com> Commit-Queue: Gregg Tavares <gman@chromium.org>
Shahbaz Youssefi fcec6904 2022-04-13T14:18:06 Generate feature variable names from display names The json file now only contains the feature display name. The variable name is automaticaly derived. For consistence with Chromium and other Chromium-based projects, the display name is now always snake_case, and that's what's specified in the json files. This also makes camelCase variable name generation trivial (as opposed to the other way around). Feature overrides now accept both snake_case and camelCase names to ensure compatibility with existing scripts. This is done by removing _ and comparing override names with feature names in lower case. Bug: angleproject:6435 Change-Id: I0b6ed2bbf5c312bc4f4be7b3c7d55dbaca2a9886 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3584630 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Gregg Tavares 87187835 2022-04-07T13:51:10 Metal: For readPixels copy IOSurface to non-IOSurface texture For intel GPU/Drivers, it's faster to copy an IOSurface texture to a non-IOSurface texture and read from the copy than it is to read directly from the IOSurface texture. Bug: angleproject:7117 Change-Id: I786009444480f75be6feb05f09f87fb45a3186b1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3573078 Reviewed-by: Kenneth Russell <kbr@chromium.org> Reviewed-by: Kyle Piddington <kpiddington@apple.com> Commit-Queue: Gregg Tavares <gman@chromium.org>
Shahbaz Youssefi 797e627e 2022-04-08T22:49:51 Autogenerate list of features as enum The WithX() and WithNoX() helpers are removed and replaced with enable() and disable() member functions that take the name of the feature (as a Feature::X enum constant). This has two benefits: - Adding tests that override a feature no longer requires additional helper functions to be written. - There's no mistaking the feature name. This change doesn't yet fix the main issue in anglebug.com/6435, but does fix the following helpers using an old feature name (so they were ineffective): - WithMetalForcedBufferGPUStorage - WithNoVulkanViewportFlip A follow up would remove the old way of overriding features in tests and replaces them with the new way. Bug: angleproject:6435 Change-Id: Ida02b26ec72bc40d7a8938c76a93815bb903ca05 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3580982 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi eeb39653 2022-04-08T16:09:48 Autogenerate features Features are now specified in a json file and autogenerated. This is in preparation for more autogeneration to support feature override in tests. This change doesn't yet fix the issues in anglebug.com/6435 and should be a no-op. Bug: angleproject:6435 Change-Id: Icdb63a94dc37b5fef0a356e0fc0b49937e083c8a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3579941 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>