Roll SwiftShader, ANGLE, use SwANGLE in test harnesses (#33814) Roll Swiftshader, ANGLE, and Vulkan deps. Updates license bot for new locations of licenses and new files in roll. Converts unit test harnesses to use SwANGLE, which is the supported way of using SwiftShader as a software backend for GLES. Updates goldens due to swiftshader changes. Fixes up include paths to avoid directly including third_party code by that name, which is unlikely to work in other build environments. Includes upstream patches to ANGLE and SwiftShader to build in our windows environments, as well as patches to Skia to support defining the location of VulkanMemoryAllocator and a patch to ANGLE to support opting into a newer version of VMA.
diff --git a/DEPS b/DEPS index 94e42b0..4925c8e 100644 --- a/DEPS +++ b/DEPS
@@ -111,7 +111,7 @@ ] deps = { - 'src': 'https://github.com/flutter/buildroot.git' + '@' + '09b25535a092e89d817a2808e7745c8d111c0be5', + 'src': 'https://github.com/flutter/buildroot.git' + '@' + '87d5dcb98983da54257f6f39d3beee2989cb0e47', # Fuchsia compatibility # @@ -137,26 +137,12 @@ 'src/third_party/shaderc': Var('github_git') + '/google/shaderc.git' + '@' + '948660cccfbbc303d2590c7f44a4cee40b66fdd6', - 'src/third_party/glslang': - Var('github_git') + '/KhronosGroup/glslang.git' + '@' + '9431c53c84c14fa9e9cd37678262ebba55c62c87', - - 'src/third_party/spirv_tools': - Var('github_git') + '/KhronosGroup/SPIRV-Tools.git' + '@' + '1020e394cb1267332d58497150d2b024371a8e41', - - 'src/third_party/spirv_headers': - Var('github_git') + '/KhronosGroup/SPIRV-Headers.git' + '@' + '85b7e00c7d785962ffe851a177c84353d037dcb6', - - 'src/third_party/spirv_cross': - Var('github_git') + '/KhronosGroup/SPIRV-Cross.git' + '@' + '418542eaefdb609f548d25a1e3962fb69d80da63', + 'src/third_party/vulkan-deps': + Var('chromium_git') + '/vulkan-deps' + '@' + '23b710f1a0b3c44d51035c6400a554415f95d9c6', 'src/third_party/flatbuffers': Var('github_git') + '/google/flatbuffers.git' + '@' + '967df08b1dbddc62f867464c2e0d58d8027438ad', - # Chromium-style - # - # As part of integrating with Fuchsia, we should eventually remove all these - # Chromium-style dependencies. - 'src/third_party/icu': Var('chromium_git') + '/chromium/deps/icu.git' + '@' + '12de966fcbe1d1a48dba310aee63807856ffeee8', @@ -472,26 +458,19 @@ 'src/third_party/pyyaml': Var('fuchsia_git') + '/third_party/pyyaml.git' + '@' + '25e97546488eee166b1abb229a27856cecd8b7ac', - # Upstream Khronos Vulkan Headers (v1.1.130) - 'src/third_party/vulkan-headers': - Var('github_git') + '/KhronosGroup/Vulkan-Headers.git' + '@' + '0e57fc1cfa56a203efe43e4dfb9b3c9e9b105593', - - # Skia VMA dependency. - 'src/third_party/externals/vulkanmemoryallocator': - Var('chromium_git') + '/external/github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator.git' + '@' + '7de5cc00de50e71a3aab22dea52fbb7ff4efceb6', - + # Upstream Khronos Vulkan Headers are part of vulkan-deps # Downstream Fuchsia Vulkan Headers (v1.2.198) 'src/third_party/fuchsia-vulkan': Var('fuchsia_git') + '/third_party/Vulkan-Headers.git' + '@' + '32640ad82ef648768c706c9bf828b77123a09bc2', 'src/third_party/swiftshader': - Var('swiftshader_git') + '/SwiftShader.git' + '@' + 'd4130e9ac3675dadbec8442dc2310a80ea4ddfb2', + Var('swiftshader_git') + '/SwiftShader.git' + '@' + 'bea8d2471bd912220ba59032e0738f3364632657', 'src/third_party/angle': - Var('github_git') + '/google/angle.git' + '@' + 'acdec48addfdff315efff293be0d5e2e37e8e560', + Var('chromium_git') + '/angle/angle.git' + '@' + '3faaded8234b31dea24c929e40e33089a34a9aa5', - 'src/third_party/angle/third_party/vulkan-deps/vulkan-headers/src': - Var('fuchsia_git') + '/third_party/Vulkan-Headers.git' + '@' + '5de4e8fab88ef0bd6994d9ddbcc864e3179b9e79', + 'src/third_party/vulkan_memory_allocator': + Var('chromium_git') + '/external/github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator' + '@' + '7de5cc00de50e71a3aab22dea52fbb7ff4efceb6', 'src/third_party/abseil-cpp': Var('chromium_git') + '/chromium/src/third_party/abseil-cpp.git' + '@' + '2d8c1340f0350828f1287c4eaeebefcf317bcfc9', @@ -687,6 +666,10 @@ }, } +recursedeps = [ + 'src/third_party/vulkan-deps', +] + hooks = [ { # Generate the Dart SDK's .dart_tool/package_confg.json file.
diff --git a/ci/licenses_golden/licenses_third_party b/ci/licenses_golden/licenses_third_party index 8f35c8a..da4fbd4 100644 --- a/ci/licenses_golden/licenses_third_party +++ b/ci/licenses_golden/licenses_third_party
@@ -1,4 +1,4 @@ -Signature: 26e1a7ec2e299fa57b5ef4ea950c9502 +Signature: 66371714f587d7b7751db0b42ddb833c UNUSED LICENSES: @@ -228,7 +228,7 @@ LIBRARY: khronos LIBRARY: libwebp LIBRARY: pkg -LIBRARY: vulkan-headers +LIBRARY: vulkan-deps LIBRARY: wuffs ORIGIN: ../../../flutter/third_party/txt/LICENSE TYPE: LicenseType.apache @@ -1739,28 +1739,42 @@ FILE: ../../../third_party/pkg/quiver/lib/src/time/util.dart FILE: ../../../third_party/pkg/quiver/lib/strings.dart FILE: ../../../third_party/pkg/quiver/lib/time.dart -FILE: ../../../third_party/vulkan-headers/cmake/cmake_uninstall.cmake.in -FILE: ../../../third_party/vulkan-headers/include/vulkan/vk_icd.h -FILE: ../../../third_party/vulkan-headers/include/vulkan/vk_layer.h -FILE: ../../../third_party/vulkan-headers/include/vulkan/vk_platform.h -FILE: ../../../third_party/vulkan-headers/include/vulkan/vk_sdk_platform.h -FILE: ../../../third_party/vulkan-headers/include/vulkan/vulkan.h -FILE: ../../../third_party/vulkan-headers/include/vulkan/vulkan.hpp -FILE: ../../../third_party/vulkan-headers/include/vulkan/vulkan_android.h -FILE: ../../../third_party/vulkan-headers/include/vulkan/vulkan_core.h -FILE: ../../../third_party/vulkan-headers/include/vulkan/vulkan_fuchsia.h -FILE: ../../../third_party/vulkan-headers/include/vulkan/vulkan_ggp.h -FILE: ../../../third_party/vulkan-headers/include/vulkan/vulkan_ios.h -FILE: ../../../third_party/vulkan-headers/include/vulkan/vulkan_macos.h -FILE: ../../../third_party/vulkan-headers/include/vulkan/vulkan_metal.h -FILE: ../../../third_party/vulkan-headers/include/vulkan/vulkan_vi.h -FILE: ../../../third_party/vulkan-headers/include/vulkan/vulkan_wayland.h -FILE: ../../../third_party/vulkan-headers/include/vulkan/vulkan_win32.h -FILE: ../../../third_party/vulkan-headers/include/vulkan/vulkan_xcb.h -FILE: ../../../third_party/vulkan-headers/include/vulkan/vulkan_xlib.h -FILE: ../../../third_party/vulkan-headers/include/vulkan/vulkan_xlib_xrandr.h -FILE: ../../../third_party/vulkan-headers/registry/validusage.json -FILE: ../../../third_party/vulkan-headers/registry/vk.xml +FILE: ../../../third_party/vulkan-deps/vulkan-headers/src/include/vk_video/vulkan_video_codec_h264std.h +FILE: ../../../third_party/vulkan-deps/vulkan-headers/src/include/vk_video/vulkan_video_codec_h264std_decode.h +FILE: ../../../third_party/vulkan-deps/vulkan-headers/src/include/vk_video/vulkan_video_codec_h264std_encode.h +FILE: ../../../third_party/vulkan-deps/vulkan-headers/src/include/vk_video/vulkan_video_codec_h265std.h +FILE: ../../../third_party/vulkan-deps/vulkan-headers/src/include/vk_video/vulkan_video_codec_h265std_decode.h +FILE: ../../../third_party/vulkan-deps/vulkan-headers/src/include/vk_video/vulkan_video_codec_h265std_encode.h +FILE: ../../../third_party/vulkan-deps/vulkan-headers/src/include/vk_video/vulkan_video_codecs_common.h +FILE: ../../../third_party/vulkan-deps/vulkan-headers/src/include/vulkan/vk_icd.h +FILE: ../../../third_party/vulkan-deps/vulkan-headers/src/include/vulkan/vk_layer.h +FILE: ../../../third_party/vulkan-deps/vulkan-headers/src/include/vulkan/vk_platform.h +FILE: ../../../third_party/vulkan-deps/vulkan-headers/src/include/vulkan/vk_sdk_platform.h +FILE: ../../../third_party/vulkan-deps/vulkan-headers/src/include/vulkan/vulkan.h +FILE: ../../../third_party/vulkan-deps/vulkan-headers/src/include/vulkan/vulkan.hpp +FILE: ../../../third_party/vulkan-deps/vulkan-headers/src/include/vulkan/vulkan_android.h +FILE: ../../../third_party/vulkan-deps/vulkan-headers/src/include/vulkan/vulkan_beta.h +FILE: ../../../third_party/vulkan-deps/vulkan-headers/src/include/vulkan/vulkan_core.h +FILE: ../../../third_party/vulkan-deps/vulkan-headers/src/include/vulkan/vulkan_directfb.h +FILE: ../../../third_party/vulkan-deps/vulkan-headers/src/include/vulkan/vulkan_enums.hpp +FILE: ../../../third_party/vulkan-deps/vulkan-headers/src/include/vulkan/vulkan_format_traits.hpp +FILE: ../../../third_party/vulkan-deps/vulkan-headers/src/include/vulkan/vulkan_fuchsia.h +FILE: ../../../third_party/vulkan-deps/vulkan-headers/src/include/vulkan/vulkan_funcs.hpp +FILE: ../../../third_party/vulkan-deps/vulkan-headers/src/include/vulkan/vulkan_ggp.h +FILE: ../../../third_party/vulkan-deps/vulkan-headers/src/include/vulkan/vulkan_handles.hpp +FILE: ../../../third_party/vulkan-deps/vulkan-headers/src/include/vulkan/vulkan_hash.hpp +FILE: ../../../third_party/vulkan-deps/vulkan-headers/src/include/vulkan/vulkan_ios.h +FILE: ../../../third_party/vulkan-deps/vulkan-headers/src/include/vulkan/vulkan_macos.h +FILE: ../../../third_party/vulkan-deps/vulkan-headers/src/include/vulkan/vulkan_metal.h +FILE: ../../../third_party/vulkan-deps/vulkan-headers/src/include/vulkan/vulkan_raii.hpp +FILE: ../../../third_party/vulkan-deps/vulkan-headers/src/include/vulkan/vulkan_screen.h +FILE: ../../../third_party/vulkan-deps/vulkan-headers/src/include/vulkan/vulkan_structs.hpp +FILE: ../../../third_party/vulkan-deps/vulkan-headers/src/include/vulkan/vulkan_vi.h +FILE: ../../../third_party/vulkan-deps/vulkan-headers/src/include/vulkan/vulkan_wayland.h +FILE: ../../../third_party/vulkan-deps/vulkan-headers/src/include/vulkan/vulkan_win32.h +FILE: ../../../third_party/vulkan-deps/vulkan-headers/src/include/vulkan/vulkan_xcb.h +FILE: ../../../third_party/vulkan-deps/vulkan-headers/src/include/vulkan/vulkan_xlib.h +FILE: ../../../third_party/vulkan-deps/vulkan-headers/src/include/vulkan/vulkan_xlib_xrandr.h FILE: ../../../third_party/wuffs/release/c/wuffs-v0.2.c FILE: ../../../third_party/wuffs/release/c/wuffs-v0.3.c ---------------------------------------------------------------------------------------------------- @@ -3046,6 +3060,7 @@ FILE: ../../../third_party/angle/scripts/extension_data/nvidia_1660_linux.json FILE: ../../../third_party/angle/scripts/extension_data/nvidia_1660_win10.json FILE: ../../../third_party/angle/scripts/extension_data/pixel_4_android_11.json +FILE: ../../../third_party/angle/scripts/extension_data/pixel_6_android_13.json FILE: ../../../third_party/angle/scripts/extension_data/swiftshader_linux.json FILE: ../../../third_party/angle/scripts/extension_data/swiftshader_win10.json FILE: ../../../third_party/angle/scripts/extension_data/swiftshader_win10_gles1.json @@ -3511,6 +3526,7 @@ FILE: ../../../third_party/angle/src/libOpenCL/dispatch.h FILE: ../../../third_party/angle/src/libOpenCL/libOpenCL_autogen.map FILE: ../../../third_party/angle/util/capture/frame_capture_test_utils.cpp +FILE: ../../../third_party/angle/util/capture/traces_export.h ---------------------------------------------------------------------------------------------------- Copyright 2021 The ANGLE Project Authors. All rights reserved. @@ -3809,6 +3825,10 @@ FILE: ../../../third_party/angle/src/libEGL/egl_loader_autogen.h FILE: ../../../third_party/angle/src/libGLESv1_CM/libGLESv1_CM.cpp FILE: ../../../third_party/angle/util/EGLPlatformParameters.h +FILE: ../../../third_party/angle/util/capture/trace_egl_loader_autogen.cpp +FILE: ../../../third_party/angle/util/capture/trace_egl_loader_autogen.h +FILE: ../../../third_party/angle/util/capture/trace_gles_loader_autogen.cpp +FILE: ../../../third_party/angle/util/capture/trace_gles_loader_autogen.h FILE: ../../../third_party/angle/util/egl_loader_autogen.cpp FILE: ../../../third_party/angle/util/egl_loader_autogen.h FILE: ../../../third_party/angle/util/gles_loader_autogen.cpp @@ -4398,13 +4418,13 @@ ==================================================================================================== LIBRARY: angle -ORIGIN: ../../../third_party/angle/include/platform/FeaturesD3D.h + ../../../third_party/angle/LICENSE +ORIGIN: ../../../third_party/angle/include/platform/FeaturesD3D_autogen.h + ../../../third_party/angle/LICENSE TYPE: LicenseType.bsd -FILE: ../../../third_party/angle/include/platform/FeaturesD3D.h -FILE: ../../../third_party/angle/include/platform/FeaturesGL.h -FILE: ../../../third_party/angle/include/platform/FeaturesMtl.h -FILE: ../../../third_party/angle/include/platform/FeaturesVk.h -FILE: ../../../third_party/angle/include/platform/FrontendFeatures.h +FILE: ../../../third_party/angle/include/platform/FeaturesD3D_autogen.h +FILE: ../../../third_party/angle/include/platform/FeaturesGL_autogen.h +FILE: ../../../third_party/angle/include/platform/FeaturesMtl_autogen.h +FILE: ../../../third_party/angle/include/platform/FeaturesVk_autogen.h +FILE: ../../../third_party/angle/include/platform/FrontendFeatures_autogen.h FILE: ../../../third_party/angle/include/platform/d3d_features.json FILE: ../../../third_party/angle/include/platform/frontend_features.json FILE: ../../../third_party/angle/include/platform/gl_features.json @@ -4414,16 +4434,29 @@ FILE: ../../../third_party/angle/src/compiler/translator/TranslatorMetalConstantNames.cpp FILE: ../../../third_party/angle/src/compiler/translator/TranslatorMetalDirect/GuardFragDepthWrite.cpp FILE: ../../../third_party/angle/src/compiler/translator/TranslatorMetalDirect/GuardFragDepthWrite.h +FILE: ../../../third_party/angle/src/compiler/translator/tree_ops/d3d/AggregateAssignArraysInSSBOs.cpp +FILE: ../../../third_party/angle/src/compiler/translator/tree_ops/d3d/AggregateAssignArraysInSSBOs.h +FILE: ../../../third_party/angle/src/compiler/translator/tree_ops/d3d/AggregateAssignStructsInSSBOs.cpp +FILE: ../../../third_party/angle/src/compiler/translator/tree_ops/d3d/AggregateAssignStructsInSSBOs.h FILE: ../../../third_party/angle/src/compiler/translator/tree_ops/vulkan/EmulateAdvancedBlendEquations.cpp FILE: ../../../third_party/angle/src/compiler/translator/tree_ops/vulkan/EmulateAdvancedBlendEquations.h FILE: ../../../third_party/angle/src/compiler/translator/tree_ops/vulkan/EmulateDithering.cpp FILE: ../../../third_party/angle/src/compiler/translator/tree_ops/vulkan/EmulateDithering.h +FILE: ../../../third_party/angle/src/compiler/translator/tree_ops/vulkan/EmulateYUVBuiltIns.cpp +FILE: ../../../third_party/angle/src/compiler/translator/tree_ops/vulkan/EmulateYUVBuiltIns.h FILE: ../../../third_party/angle/src/libANGLE/Overlay_font_autogen.cpp FILE: ../../../third_party/angle/src/libANGLE/Overlay_font_autogen.h +FILE: ../../../third_party/angle/src/libANGLE/capture/capture_egl.cpp +FILE: ../../../third_party/angle/src/libANGLE/capture/capture_egl.h +FILE: ../../../third_party/angle/src/libANGLE/renderer/vulkan/linux/gbm/DisplayVkGbm.cpp +FILE: ../../../third_party/angle/src/libANGLE/renderer/vulkan/linux/gbm/DisplayVkGbm.h FILE: ../../../third_party/angle/src/libANGLE/renderer/vulkan/shaders/src/OverlayDraw.frag FILE: ../../../third_party/angle/src/libANGLE/renderer/vulkan/shaders/src/OverlayDraw.vert FILE: ../../../third_party/angle/util/angle_features_autogen.cpp FILE: ../../../third_party/angle/util/angle_features_autogen.h +FILE: ../../../third_party/angle/util/linux/LinuxWindow.cpp +FILE: ../../../third_party/angle/util/linux/wayland/WaylandWindow.cpp +FILE: ../../../third_party/angle/util/linux/wayland/WaylandWindow.h ---------------------------------------------------------------------------------------------------- Copyright 2022 The ANGLE Project Authors. All rights reserved. @@ -4752,6 +4785,7 @@ FILE: ../../../third_party/angle/src/libGLESv2/libGLESv2_no_capture_autogen.def FILE: ../../../third_party/angle/src/libGLESv2/libGLESv2_with_capture_autogen.def FILE: ../../../third_party/angle/src/libOpenCL/libOpenCL_autogen.cpp +FILE: ../../../third_party/angle/util/capture/angle_trace_gl.h FILE: ../../../third_party/angle/util/capture/frame_capture_test_utils.h FILE: ../../../third_party/angle/util/display/DisplayPixmap.cpp FILE: ../../../third_party/angle/util/display/DisplayWindow.cpp @@ -4950,6 +4984,10 @@ FILE: ../../../third_party/angle/src/libANGLE/renderer/load_functions_table.h FILE: ../../../third_party/angle/src/libANGLE/validationEGL.h FILE: ../../../third_party/angle/util/OSPixmap.h +FILE: ../../../third_party/angle/util/linux/x11/X11Pixmap.cpp +FILE: ../../../third_party/angle/util/linux/x11/X11Pixmap.h +FILE: ../../../third_party/angle/util/linux/x11/X11Window.cpp +FILE: ../../../third_party/angle/util/linux/x11/X11Window.h FILE: ../../../third_party/angle/util/osx/OSXPixmap.h FILE: ../../../third_party/angle/util/osx/OSXPixmap.mm FILE: ../../../third_party/angle/util/osx/OSXWindow.h @@ -4957,10 +4995,6 @@ FILE: ../../../third_party/angle/util/posix/test_utils_posix.cpp FILE: ../../../third_party/angle/util/windows/win32/Win32Pixmap.cpp FILE: ../../../third_party/angle/util/windows/win32/Win32Pixmap.h -FILE: ../../../third_party/angle/util/x11/X11Pixmap.cpp -FILE: ../../../third_party/angle/util/x11/X11Pixmap.h -FILE: ../../../third_party/angle/util/x11/X11Window.cpp -FILE: ../../../third_party/angle/util/x11/X11Window.h ---------------------------------------------------------------------------------------------------- Copyright 2015 The ANGLE Project Authors. All rights reserved. @@ -5487,10 +5521,53 @@ ==================================================================================================== LIBRARY: angle +ORIGIN: ../../../third_party/angle/src/libANGLE/renderer/vulkan/linux/wayland/DisplayVkWayland.cpp + ../../../third_party/angle/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/angle/src/libANGLE/renderer/vulkan/linux/wayland/DisplayVkWayland.cpp +FILE: ../../../third_party/angle/src/libANGLE/renderer/vulkan/linux/wayland/DisplayVkWayland.h +FILE: ../../../third_party/angle/src/libANGLE/renderer/vulkan/linux/wayland/WindowSurfaceVkWayland.cpp +FILE: ../../../third_party/angle/src/libANGLE/renderer/vulkan/linux/wayland/WindowSurfaceVkWayland.h +---------------------------------------------------------------------------------------------------- +Copyright 2021-2022 The ANGLE Project Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + Neither the name of TransGaming Inc., Google Inc., 3DLabs Inc. + Ltd., nor the names of their contributors may be used to endorse + or promote products derived from this software without specific + prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: angle ORIGIN: ../../../third_party/angle/src/third_party/ceval/LICENSE TYPE: LicenseType.mit FILE: ../../../third_party/angle/src/third_party/ceval/ceval.h FILE: ../../../third_party/angle/src/third_party/ceval/package.json +FILE: ../../../third_party/angle/src/third_party/ceval/patches/0001-remove-sprintf.patch ---------------------------------------------------------------------------------------------------- MIT License @@ -14421,33 +14498,6 @@ ==================================================================================================== ==================================================================================================== -LIBRARY: externals -ORIGIN: ../../../third_party/externals/vulkanmemoryallocator/include/vk_mem_alloc.h -TYPE: LicenseType.mit -FILE: ../../../third_party/externals/vulkanmemoryallocator/include/vk_mem_alloc.h ----------------------------------------------------------------------------------------------------- -Copyright (c) 2017-2022 Advanced Micro Devices, Inc. All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -==================================================================================================== - -==================================================================================================== LIBRARY: ffx_spd ORIGIN: ../../../third_party/angle/src/libANGLE/renderer/vulkan/shaders/src/third_party/ffx_spd/ffx_a.h TYPE: LicenseType.mit @@ -19232,6 +19282,48 @@ ==================================================================================================== LIBRARY: icu +LIBRARY: vulkan-deps +ORIGIN: ../../../third_party/icu/scripts/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/icu/fuzzers/icu_unicode_string_codepage_create_fuzzer.cc +FILE: ../../../third_party/icu/scripts/accept_lang.list +FILE: ../../../third_party/icu/scripts/chrome_ui_languages.list +FILE: ../../../third_party/icu/scripts/currencies.list +FILE: ../../../third_party/vulkan-deps/.gitignore +FILE: ../../../third_party/vulkan-deps/DEPS +FILE: ../../../third_party/vulkan-deps/additional_readme_paths.json +---------------------------------------------------------------------------------------------------- +Copyright 2015 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: icu ORIGIN: ../../../third_party/dart/runtime/third_party/double-conversion/COPYING TYPE: LicenseType.bsd FILE: ../../../third_party/icu/DIR_METADATA @@ -20856,44 +20948,6 @@ ==================================================================================================== LIBRARY: icu -ORIGIN: ../../../third_party/icu/scripts/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/icu/fuzzers/icu_unicode_string_codepage_create_fuzzer.cc -FILE: ../../../third_party/icu/scripts/accept_lang.list -FILE: ../../../third_party/icu/scripts/chrome_ui_languages.list -FILE: ../../../third_party/icu/scripts/currencies.list ----------------------------------------------------------------------------------------------------- -Copyright 2015 The Chromium Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: icu ORIGIN: ../../../third_party/icu/source/common/unicode/appendable.h TYPE: LicenseType.icu FILE: ../../../third_party/icu/APIChangeReport.html @@ -26609,6 +26663,33 @@ ==================================================================================================== ==================================================================================================== +LIBRARY: vulkan_memory_allocator +ORIGIN: ../../../third_party/vulkan_memory_allocator/include/vk_mem_alloc.h +TYPE: LicenseType.mit +FILE: ../../../third_party/vulkan_memory_allocator/include/vk_mem_alloc.h +---------------------------------------------------------------------------------------------------- +Copyright (c) 2017-2022 Advanced Micro Devices, Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +==================================================================================================== + +==================================================================================================== LIBRARY: xxhash ORIGIN: ../../../third_party/angle/src/common/third_party/xxhash/xxhash.c TYPE: LicenseType.bsd @@ -27314,4 +27395,4 @@ misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. ==================================================================================================== -Total license count: 417 +Total license count: 418
diff --git a/ci/licenses_golden/tool_signature b/ci/licenses_golden/tool_signature index 3256ee9..4ee9f38 100644 --- a/ci/licenses_golden/tool_signature +++ b/ci/licenses_golden/tool_signature
@@ -1,2 +1,2 @@ -Signature: 62f85bbfe0c4ce501a865747f7bb099e +Signature: 0be7d6e5107b5c14bae7579aafdcbb7e
diff --git a/examples/vulkan_glfw/BUILD.gn b/examples/vulkan_glfw/BUILD.gn index ee3bf6b..7930eff 100644 --- a/examples/vulkan_glfw/BUILD.gn +++ b/examples/vulkan_glfw/BUILD.gn
@@ -12,5 +12,6 @@ deps = [ "//flutter/shell/platform/embedder:embedder", "//third_party/glfw", + "//third_party/vulkan-deps/vulkan-headers/src:vulkan_headers", ] }
diff --git a/impeller/compiler/BUILD.gn b/impeller/compiler/BUILD.gn index 4672912..54f2b85 100644 --- a/impeller/compiler/BUILD.gn +++ b/impeller/compiler/BUILD.gn
@@ -6,6 +6,8 @@ import("//flutter/shell/version/version.gni") impeller_component("compiler_lib") { + include_dirs = [ "//third_party/vulkan-deps/spirv-cross/src/" ] + sources = [ "code_gen_template.h", "compiler.cc", @@ -77,7 +79,7 @@ "", "### spirv_cross", "", - read_file("//third_party/spirv_cross/LICENSE", "string"), + read_file("//third_party/vulkan-deps/spirv-cross/src/LICENSE", "string"), ] }
diff --git a/impeller/compiler/compiler.h b/impeller/compiler/compiler.h index 635c778..6793096 100644 --- a/impeller/compiler/compiler.h +++ b/impeller/compiler/compiler.h
@@ -15,8 +15,8 @@ #include "impeller/compiler/source_options.h" #include "impeller/compiler/types.h" #include "shaderc/shaderc.hpp" -#include "third_party/spirv_cross/spirv_msl.hpp" -#include "third_party/spirv_cross/spirv_parser.hpp" +#include "spirv_msl.hpp" +#include "spirv_parser.hpp" namespace impeller { namespace compiler {
diff --git a/impeller/compiler/compiler_backend.h b/impeller/compiler/compiler_backend.h index e3c2789..a721093 100644 --- a/impeller/compiler/compiler_backend.h +++ b/impeller/compiler/compiler_backend.h
@@ -9,8 +9,8 @@ #include "flutter/fml/logging.h" #include "flutter/fml/macros.h" -#include "third_party/spirv_cross/spirv_glsl.hpp" -#include "third_party/spirv_cross/spirv_msl.hpp" +#include "spirv_glsl.hpp" +#include "spirv_msl.hpp" namespace impeller { namespace compiler {
diff --git a/impeller/compiler/reflector.h b/impeller/compiler/reflector.h index 895ad99..5a5be69 100644 --- a/impeller/compiler/reflector.h +++ b/impeller/compiler/reflector.h
@@ -12,8 +12,8 @@ #include "impeller/compiler/compiler_backend.h" #include "impeller/compiler/runtime_stage_data.h" #include "inja/inja.hpp" -#include "third_party/spirv_cross/spirv_msl.hpp" -#include "third_party/spirv_cross/spirv_parser.hpp" +#include "spirv_msl.hpp" +#include "spirv_parser.hpp" namespace impeller { namespace compiler {
diff --git a/impeller/compiler/runtime_stage_data.h b/impeller/compiler/runtime_stage_data.h index 405f99a..056a5ef 100644 --- a/impeller/compiler/runtime_stage_data.h +++ b/impeller/compiler/runtime_stage_data.h
@@ -10,7 +10,7 @@ #include "flutter/fml/macros.h" #include "flutter/fml/mapping.h" #include "impeller/compiler/types.h" -#include "third_party/spirv_cross/spirv_parser.hpp" +#include "spirv_parser.hpp" namespace impeller { namespace compiler {
diff --git a/impeller/compiler/types.h b/impeller/compiler/types.h index f25589b..3df651f 100644 --- a/impeller/compiler/types.h +++ b/impeller/compiler/types.h
@@ -10,8 +10,8 @@ #include "flutter/fml/macros.h" #include "shaderc/shaderc.hpp" -#include "third_party/spirv_cross/spirv_cross.hpp" -#include "third_party/spirv_cross/spirv_msl.hpp" +#include "spirv_cross.hpp" +#include "spirv_msl.hpp" namespace impeller { namespace compiler {
diff --git a/impeller/renderer/backend/gles/BUILD.gn b/impeller/renderer/backend/gles/BUILD.gn index 505cbaa..85f0a37 100644 --- a/impeller/renderer/backend/gles/BUILD.gn +++ b/impeller/renderer/backend/gles/BUILD.gn
@@ -57,7 +57,7 @@ "texture_gles.h", ] - if (!is_android) { + if (!is_android && !is_fuchsia) { public_configs = [ ":gles_config" ] sources += [ "//third_party/angle/include/GLES2/gl2.h",
diff --git a/lib/spirv/test/BUILD.gn b/lib/spirv/test/BUILD.gn index 421e1fd..522392c 100644 --- a/lib/spirv/test/BUILD.gn +++ b/lib/spirv/test/BUILD.gn
@@ -6,13 +6,16 @@ if (enable_unittests) { executable("spirv_assembler") { + include_dirs = [ "//third_party/vulkan-deps/spirv-tools/src/include/" ] + sources = [ "spirv_assembler.cc" ] - configs += [ "//third_party/swiftshader_flutter:spvtools_public_config" ] + configs += + [ "//third_party/vulkan-deps/spirv-tools/src:spvtools_public_config" ] deps = [ - "//third_party/swiftshader_flutter:spvtools", - "//third_party/swiftshader_flutter:spvtools_val", + "//third_party/vulkan-deps/spirv-tools/src:spvtools", + "//third_party/vulkan-deps/spirv-tools/src:spvtools_val", ] } }
diff --git a/lib/spirv/test/spirv_assembler.cc b/lib/spirv/test/spirv_assembler.cc index e6a11c9..da51aca 100644 --- a/lib/spirv/test/spirv_assembler.cc +++ b/lib/spirv/test/spirv_assembler.cc
@@ -8,7 +8,7 @@ #include <iostream> #include <vector> -#include "third_party/swiftshader/third_party/SPIRV-Tools/include/spirv-tools/libspirv.hpp" +#include "spirv-tools/libspirv.hpp" namespace fs = std::filesystem;
diff --git a/shell/common/BUILD.gn b/shell/common/BUILD.gn index bda5dd5..22bde21 100644 --- a/shell/common/BUILD.gn +++ b/shell/common/BUILD.gn
@@ -302,9 +302,9 @@ # TODO(63837): This test is hard-coded to use a TestGLSurface so it cannot run on fuchsia. sources += [ "shell_io_manager_unittests.cc" ] - # Swiftshader only supports x86/64. Only needed on non-Fuchsia platforms. - if (shell_enable_vulkan && (target_cpu == "x86" || target_cpu == "x64")) { - deps += [ "//third_party/swiftshader_flutter:swiftshader_vulkan" ] + # Swiftshader only needed on non-Fuchsia platforms. + if (shell_enable_vulkan) { + deps += [ "//third_party/swiftshader" ] } } }
diff --git a/shell/gpu/gpu_surface_vulkan.cc b/shell/gpu/gpu_surface_vulkan.cc index b63d41b..51b7b87 100644 --- a/shell/gpu/gpu_surface_vulkan.cc +++ b/shell/gpu/gpu_surface_vulkan.cc
@@ -8,7 +8,7 @@ #include "fml/trace_event.h" #include "include/core/SkColorSpace.h" #include "include/core/SkSize.h" -#include "third_party/swiftshader/include/vulkan/vulkan_core.h" +#include "vulkan/vulkan_core.h" namespace flutter {
diff --git a/shell/platform/embedder/BUILD.gn b/shell/platform/embedder/BUILD.gn index 45e2d14..2b6459e 100644 --- a/shell/platform/embedder/BUILD.gn +++ b/shell/platform/embedder/BUILD.gn
@@ -244,7 +244,10 @@ "tests/embedder_unittests_gl.cc", ] - deps += [ "//flutter/testing:opengl" ] + deps += [ + "//flutter/testing:opengl", + "//third_party/vulkan-deps/vulkan-headers/src:vulkan_headers", + ] } if (test_enable_metal) {
diff --git a/shell/platform/embedder/fixtures/dpr_noxform.png b/shell/platform/embedder/fixtures/dpr_noxform.png index 092591a..9fca30c 100644 --- a/shell/platform/embedder/fixtures/dpr_noxform.png +++ b/shell/platform/embedder/fixtures/dpr_noxform.png Binary files differ
diff --git a/shell/platform/embedder/fixtures/dpr_xform.png b/shell/platform/embedder/fixtures/dpr_xform.png index 3c6928c..823f217 100644 --- a/shell/platform/embedder/fixtures/dpr_xform.png +++ b/shell/platform/embedder/fixtures/dpr_xform.png Binary files differ
diff --git a/shell/platform/embedder/fixtures/gradient.png b/shell/platform/embedder/fixtures/gradient.png index 27b69ec..f2f75f1 100644 --- a/shell/platform/embedder/fixtures/gradient.png +++ b/shell/platform/embedder/fixtures/gradient.png Binary files differ
diff --git a/shell/platform/embedder/fixtures/gradient_xform.png b/shell/platform/embedder/fixtures/gradient_xform.png index 186b98e..f9ea3ad 100644 --- a/shell/platform/embedder/fixtures/gradient_xform.png +++ b/shell/platform/embedder/fixtures/gradient_xform.png Binary files differ
diff --git a/shell/platform/embedder/tests/embedder_config_builder.cc b/shell/platform/embedder/tests/embedder_config_builder.cc index d152283..ae7e32f 100644 --- a/shell/platform/embedder/tests/embedder_config_builder.cc +++ b/shell/platform/embedder/tests/embedder_config_builder.cc
@@ -8,7 +8,7 @@ #include "flutter/shell/platform/embedder/embedder.h" #include "tests/embedder_test_context.h" #include "third_party/skia/include/core/SkBitmap.h" -#include "third_party/swiftshader/include/vulkan/vulkan_core.h" +#include "vulkan/vulkan_core.h" #ifdef SHELL_ENABLE_GL #include "flutter/shell/platform/embedder/tests/embedder_test_compositor_gl.h"
diff --git a/testing/BUILD.gn b/testing/BUILD.gn index 25e6f7a..3416c67 100644 --- a/testing/BUILD.gn +++ b/testing/BUILD.gn
@@ -146,10 +146,9 @@ "//flutter/vulkan", ] - # SwiftShader only supports x86/x86_64 - if (target_cpu == "x86" || target_cpu == "x64") { - configs += [ "//third_party/swiftshader_flutter:swiftshader_config" ] - deps += [ "//third_party/swiftshader_flutter:swiftshader_vulkan" ] + if (!is_fuchsia) { + deps += [ "//third_party/swiftshader" ] + configs += [ "//third_party/swiftshader:swiftshader_config" ] } } @@ -215,10 +214,8 @@ } } -# We only use SwiftShader on unittests and -# SwiftShader only supports x86/x86_64 -use_swiftshader = - enable_unittests && (target_cpu == "x86" || target_cpu == "x64") +# We only use SwiftShader on unittests +use_swiftshader = enable_unittests && !is_fuchsia source_set("opengl") { testonly = true @@ -234,7 +231,16 @@ ] if (use_swiftshader) { - configs += [ "//third_party/swiftshader_flutter:swiftshader_config" ] - deps += [ "//third_party/swiftshader_flutter:swiftshader_gl" ] + configs -= [ "//build/config/clang:extra_warnings" ] + configs += [ + "//flutter/vulkan:vulkan_config", # for swiftshader + "//third_party/angle:gl_prototypes", + "//third_party/swiftshader:swiftshader_config", + ] + deps += [ + "//third_party/angle:libEGL_static", + "//third_party/angle:libGLESv2_static", + "//third_party/swiftshader", + ] } }
diff --git a/testing/lsan_suppressions.txt b/testing/lsan_suppressions.txt index 03eda3d..d6891ae 100644 --- a/testing/lsan_suppressions.txt +++ b/testing/lsan_suppressions.txt
@@ -63,3 +63,8 @@ # At the time of writing, this only amounts to 4 allocations totaling 512 bytes # worth of leaks. leak:g_realloc + + +# ANGLE's egl impelementation uses annotations that our LSAN setup does +# not respect. Ignore leaks from egl::* +leak:egl::*
diff --git a/testing/run_tests.py b/testing/run_tests.py index 607a0be..c87b2f5 100755 --- a/testing/run_tests.py +++ b/testing/run_tests.py
@@ -10,6 +10,7 @@ import argparse import glob +import errno import multiprocessing import os import re @@ -182,10 +183,20 @@ unstripped_exe = os.path.join(build_dir, 'exe.unstripped', executable_name) env = os.environ.copy() - # We cannot run the unstripped binaries directly when coverage is enabled. - if IsLinux() and os.path.exists(unstripped_exe) and not coverage: - # Some tests depend on the EGL/GLES libraries placed in the build directory. - env['LD_LIBRARY_PATH'] = os.path.join(build_dir, 'lib.unstripped') + if IsLinux(): + env['LD_LIBRARY_PATH'] = build_dir + env['VK_DRIVER_FILES'] = os.path.join(build_dir, 'vk_swiftshader_icd.json') + if os.path.exists(unstripped_exe): + try: + os.symlink( + os.path.join(build_dir, 'lib.unstripped', 'libvulkan.so.1'), + os.path.join(build_dir, 'exe.unstripped', 'libvulkan.so.1') + ) + except OSError as e: + if e.errno == errno.EEXIST: + pass + else: + raise elif IsMac(): env['DYLD_LIBRARY_PATH'] = build_dir else: @@ -879,7 +890,7 @@ if len(failures) > 0: print("The following commands failed:") for task, exn in failures: - print("%s\n" % str(task)) + print("%s\n%s\n" % (str(task), str(exn))) raise Exception() @@ -1000,7 +1011,7 @@ ] process = subprocess.Popen(command, stdout=subprocess.PIPE) for line in process.stdout: - key, _, value = line.decode('ascii').strip().partition("=") + key, _, value = line.decode('utf8').strip().partition("=") os.environ[key] = value process.communicate() # Avoid pipe deadlock while waiting for termination.
diff --git a/testing/sanitizer_suppressions.sh b/testing/sanitizer_suppressions.sh index 1da0c1b..ec5c4bc 100755 --- a/testing/sanitizer_suppressions.sh +++ b/testing/sanitizer_suppressions.sh
@@ -22,5 +22,5 @@ export UBSAN_OPTIONS="suppressions=${UBSAN_SUPPRESSIONS_FILE}" echo "Using Undefined Behavior suppressions in ${UBSAN_SUPPRESSIONS_FILE}" -export ASAN_OPTIONS="symbolize=1:detect_leaks=1" +export ASAN_OPTIONS="symbolize=1:detect_leaks=1:intercept_tls_get_addr=0" export ASAN_SYMBOLIZER_PATH="${BUILDTOOLS_DIRECTORY}/clang/bin/llvm-symbolizer"
diff --git a/testing/test_gl_surface.cc b/testing/test_gl_surface.cc index 8c240b3..6a3cc4d 100644 --- a/testing/test_gl_surface.cc +++ b/testing/test_gl_surface.cc
@@ -5,6 +5,8 @@ #include "flutter/testing/test_gl_surface.h" #include <EGL/egl.h> +#include <EGL/eglext.h> +#include <EGL/eglplatform.h> #include <GLES2/gl2.h> #include <sstream> @@ -81,12 +83,54 @@ return stream.str(); } +static bool HasExtension(const char* extensions, const char* name) { + const char* r = strstr(extensions, name); + auto len = strlen(name); + // check that the extension name is terminated by space or null terminator + return r != nullptr && (r[len] == ' ' || r[len] == 0); +} + +static void CheckSwanglekExtensions() { + const char* extensions = ::eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS); + FML_CHECK(HasExtension(extensions, "EGL_EXT_platform_base")) << extensions; + FML_CHECK(HasExtension(extensions, "EGL_ANGLE_platform_angle_vulkan")) + << extensions; + FML_CHECK(HasExtension(extensions, + "EGL_ANGLE_platform_angle_device_type_swiftshader")) + << extensions; +} + +static EGLDisplay CreateSwangleDisplay() { + CheckSwanglekExtensions(); + + PFNEGLGETPLATFORMDISPLAYEXTPROC egl_get_platform_display_EXT = + reinterpret_cast<PFNEGLGETPLATFORMDISPLAYEXTPROC>( + eglGetProcAddress("eglGetPlatformDisplayEXT")); + FML_CHECK(egl_get_platform_display_EXT) + << "eglGetPlatformDisplayEXT not available."; + + const EGLint display_config[] = { + EGL_PLATFORM_ANGLE_TYPE_ANGLE, + EGL_PLATFORM_ANGLE_TYPE_VULKAN_ANGLE, + EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE, + EGL_PLATFORM_ANGLE_DEVICE_TYPE_SWIFTSHADER_ANGLE, + EGL_PLATFORM_ANGLE_NATIVE_PLATFORM_TYPE_ANGLE, + EGL_PLATFORM_VULKAN_DISPLAY_MODE_HEADLESS_ANGLE, + EGL_NONE, + }; + + return egl_get_platform_display_EXT( + EGL_PLATFORM_ANGLE_ANGLE, + reinterpret_cast<EGLNativeDisplayType*>(EGL_DEFAULT_DISPLAY), + display_config); +} + TestGLSurface::TestGLSurface(SkISize surface_size) : surface_size_(surface_size) { - display_ = ::eglGetDisplay(EGL_DEFAULT_DISPLAY); + display_ = CreateSwangleDisplay(); FML_CHECK(display_ != EGL_NO_DISPLAY); - auto result = ::eglInitialize(display_, NULL, NULL); + auto result = ::eglInitialize(display_, nullptr, nullptr); FML_CHECK(result == EGL_TRUE) << GetEGLError(); EGLConfig config = {0};
diff --git a/tools/gn b/tools/gn index 0854928..84bbf4a 100755 --- a/tools/gn +++ b/tools/gn
@@ -426,19 +426,14 @@ # features can't work on these platforms. if args.target_os not in ['android', 'ios', 'wasm']: gn_args['skia_use_vulkan'] = True + gn_args['skia_vulkan_memory_allocator_dir' + ] = '//third_party/vulkan_memory_allocator' gn_args['shell_enable_vulkan'] = True # Disable VMA's use of std::shared_mutex in environments where the # standard library doesn't support it. if args.target_os == 'ios' or sys.platform.startswith(('cygwin', 'win')): gn_args['skia_disable_vma_stl_shared_mutex'] = True - if sys.platform.startswith(('cygwin', 'win')): - # The buildroot currently isn't set up to support Vulkan in the - # Windows ANGLE build, so disable it regardless of enable_vulkan's value. - gn_args['angle_enable_vulkan'] = False - # Don't build unnecessary portions of the ANGLE tree. - gn_args['angle_build_all'] = False - # We should not need a special case for x86, but this seems to introduce text relocations # even with -fPIC everywhere. # gn_args['enable_profiling'] = args.runtime_mode != 'release' and args.android_cpu != 'x86' @@ -535,6 +530,18 @@ if args.prebuilt_impellerc is not None: gn_args['impeller_use_prebuilt_impellerc'] = args.prebuilt_impellerc + # Do not build unnecessary parts of the ANGLE tree. + gn_args['angle_build_all'] = False + # Requires RTTI. We may want to build this in debug modes, punting on that + # for now. + gn_args['angle_enable_vulkan_validation_layers'] = False + gn_args['angle_vulkan_headers_dir' + ] = '//third_party/vulkan-deps/vulkan-headers/src' + gn_args['angle_vulkan_loader_dir' + ] = '//third_party/vulkan-deps/vulkan-loader/src' + gn_args['angle_vulkan_tools_dir' + ] = '//third_party/vulkan-deps/vulkan-tools/src' + return gn_args
diff --git a/tools/licenses/lib/main.dart b/tools/licenses/lib/main.dart index 3961bfb..7777e08 100644 --- a/tools/licenses/lib/main.dart +++ b/tools/licenses/lib/main.dart
@@ -1887,6 +1887,47 @@ } } +class _RepositoryVulkanDepsDirectory extends _RepositoryDirectory { + _RepositoryVulkanDepsDirectory(_RepositoryDirectory parent, fs.Directory io) : super(parent, io); + + @override + bool shouldRecurse(fs.IoNode entry) { + return entry.name != '.git' // source control + && entry.name != 'glslang' // only used on hosts for tests + && entry.name != 'spirv-cross' // Used by impellerc with separate license and host tests. See //flutter/impeller/compiler:impellerc_license + && entry.name != 'spirv-headers' // only used on hosts for tests + && entry.name != 'spirv-tools' // only used on hosts for tests + && entry.name != 'vulkan-loader' // on hosts for tests + && entry.name != 'vulkan-tools' // on hosts for tests + && entry.name != 'vulkan-validation-layers'; // on hosts for tests + } + + @override + _RepositoryDirectory createSubdirectory(fs.Directory entry) { + if (entry.name == 'vulkan-headers') { + return _RepositoryVulkanDepsSubDirectory(this, entry); + } + return super.createSubdirectory(entry); + } +} + +class _RepositoryVulkanDepsSubDirectory extends _RepositoryDirectory { + _RepositoryVulkanDepsSubDirectory(_RepositoryDirectory parent, fs.Directory io) : super(parent, io); + + @override + bool shouldRecurse(fs.IoNode entry) { + return entry.name == 'src'; + } + + @override + _RepositoryDirectory createSubdirectory(fs.Directory entry) { + if (entry.name == 'src') { + return _RepositoryVulkanDirectory(this, entry); + } + return super.createSubdirectory(entry); + } +} + class _RepositoryRootThirdPartyDirectory extends _RepositoryGenericThirdPartyDirectory { _RepositoryRootThirdPartyDirectory(_RepositoryDirectory parent, fs.Directory io) : super(parent, io); @@ -1917,10 +1958,6 @@ && entry.name != 'fontconfig' // not used in standard configurations && entry.name != 'swiftshader' // only used on hosts for tests && entry.name != 'shaderc' // Used by impellerc with separate license and host tests. See //flutter/impeller/compiler:impellerc_license - && entry.name != 'glslang' // only used on hosts for tests - && entry.name != 'spirv_tools' // only used on hosts for tests - && entry.name != 'spirv_headers' // only used on hosts for tests - && entry.name != 'spirv_cross' // Used by impellerc with separate license and host tests. See //flutter/impeller/compiler:impellerc_license && entry.name != 'ocmock' // only used for tests && entry.name != 'java' // only used for Android builds && entry.name != 'inja' // Only used by impellerc, which ships a separate license. See //flutter/impeller/compiler:impellerc_license @@ -1941,8 +1978,10 @@ return _RepositoryDartDirectory(this, entry); if (entry.name == 'expat') return _RepositoryExpatDirectory(this, entry); - if (entry.name == 'externals') - return _RepositoryThirdPartyExternalsDirectory(this, entry); + if (entry.name == 'vulkan_memory_allocator') + return _RepositoryVulkanMemoryAllocatorDirectory(this, entry); + if (entry.name == 'vulkan-deps') + return _RepositoryVulkanDepsDirectory(this, entry); if (entry.name == 'freetype-android') throw '//third_party/freetype-android is no longer part of this client: remove it'; if (entry.name == 'freetype2') @@ -1990,18 +2029,6 @@ } } -/// Corresponds to the `src/third_party/externals` directory -class _RepositoryThirdPartyExternalsDirectory extends _RepositoryDirectory { - _RepositoryThirdPartyExternalsDirectory(_RepositoryDirectory parent, fs.Directory io) : super(parent, io); - - @override - _RepositoryDirectory createSubdirectory(fs.Directory entry) { - if (entry.name == 'vulkanmemoryallocator') - return _RepositoryVulkanMemoryAllocatorDirectory(this, entry); - return super.createSubdirectory(entry); - } -} - class _RepositoryVulkanMemoryAllocatorDirectory extends _RepositoryDirectory { _RepositoryVulkanMemoryAllocatorDirectory(_RepositoryDirectory parent, fs.Directory io) : super(parent, io);
diff --git a/vulkan/BUILD.gn b/vulkan/BUILD.gn index 11ab1ef..3992b36 100644 --- a/vulkan/BUILD.gn +++ b/vulkan/BUILD.gn
@@ -5,13 +5,13 @@ import("//build/fuchsia/sdk.gni") config("vulkan_config") { - include_dirs = [] + include_dirs = [ "//third_party/vulkan_memory_allocator/include" ] defines = [ "VULKAN_HPP_NO_EXCEPTIONS=1" ] if (is_fuchsia) { include_dirs += [ "//third_party/fuchsia-vulkan/include" ] defines += [ "VK_USE_PLATFORM_FUCHSIA=1" ] } else { - include_dirs += [ "//third_party/vulkan-headers/include" ] + include_dirs += [ "//third_party/vulkan-deps/vulkan-headers/src/include" ] } } @@ -65,4 +65,7 @@ ":vulkan_config", "//flutter:config", ] + + public_deps = + [ "//third_party/vulkan-deps/vulkan-headers/src:vulkan_headers" ] }