diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2024-04-30 23:02:00 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2024-04-30 23:02:00 +0000 |
commit | a192756af62badff0cd40b14d6980651626d006c (patch) | |
tree | 0a2f0428e3aa14808471a017de8d13020ad9cdb1 | |
parent | 2583363ce5c515cd039fc70ab6439f3621917a78 (diff) | |
parent | eca19b3307cd0a3a9cb7d85ba951e8db70d84f39 (diff) | |
download | angle-sdk-release.tar.gz |
Snap for 11785460 from eca19b3307cd0a3a9cb7d85ba951e8db70d84f39 to sdk-releasesdk-release
Change-Id: I125d7a71a60d552493579f5264bbd1e09bcfb0b8
178 files changed, 3193 insertions, 1592 deletions
diff --git a/Android.bp b/Android.bp index 384b9943b9..336f042006 100644 --- a/Android.bp +++ b/Android.bp @@ -58,7 +58,7 @@ cc_defaults { cflags: [ "-DANDROID", "-DANDROID_NDK_VERSION_ROLL=r26b_1", - "-DCR_CLANG_REVISION=\"llvmorg-19-init-8091-gab037c4f-26\"", + "-DCR_CLANG_REVISION=\"llvmorg-19-init-8943-gd8503a38-3\"", "-DDYNAMIC_ANNOTATIONS_ENABLED=0", "-DHAVE_SYS_UIO_H", "-DNDEBUG", @@ -4614,6 +4614,7 @@ cc_defaults { defaults: [ "angle_common_auto_cflags", "angle_common_library_cflags", + "third_party_abseil_cpp_absl_base_base_internal", "third_party_abseil_cpp_absl_base_config", "third_party_abseil_cpp_absl_base_core_headers", "third_party_abseil_cpp_absl_container_compressed_tuple", @@ -4807,6 +4808,32 @@ cc_defaults { } cc_defaults { + name: "third_party_abseil_cpp_absl_types_compare", + defaults: [ + "angle_common_auto_cflags", + "angle_common_library_cflags", + "third_party_abseil_cpp_absl_base_config", + "third_party_abseil_cpp_absl_base_core_headers", + "third_party_abseil_cpp_absl_meta_type_traits", + ], + local_include_dirs: [ + "", + "third_party/abseil-cpp/", + ], + cflags: [ + "-DABSL_ALLOCATOR_NOTHROW=1", + "-Wno-c++11-narrowing", + "-Wno-gcc-compat", + "-Wno-misleading-indentation", + "-Wno-unreachable-code-break", + "-Wno-unused-but-set-variable", + "-Wno-unused-variable", + ], + sdk_version: "28", + stl: "libc++_static", +} + +cc_defaults { name: "third_party_abseil_cpp_absl_numeric_bits", defaults: [ "angle_common_auto_cflags", @@ -4842,6 +4869,7 @@ cc_defaults { "third_party_abseil_cpp_absl_base_config", "third_party_abseil_cpp_absl_base_core_headers", "third_party_abseil_cpp_absl_numeric_bits", + "third_party_abseil_cpp_absl_types_compare", ], local_include_dirs: [ "", @@ -43,7 +43,7 @@ vars = { 'checkout_angle_mesa': False, # Version of Chromium our Chromium-based DEPS are mirrored from. - 'chromium_revision': '4433c533fffbd889d53c71347fc9b211fe0bfc17', + 'chromium_revision': '83c70f11490ddf939fee8e9096288c28d4cda227', # We never want to checkout chromium, # but need a dummy DEPS entry for the autoroller 'dummy_checkout_chromium': False, @@ -88,7 +88,7 @@ vars = { # Three lines of non-changing comments so that # the commit queue can handle CLs rolling catapult # and whatever else without interference from each other. - 'catapult_revision': '48216439d9883995da2edbf29ffa82740666c5c3', + 'catapult_revision': '835aa3e871f28f6d2635f1ec58e414f39b4d4049', # the commit queue can handle CLs rolling Fuchsia sdk # and whatever else without interference from each other. @@ -133,7 +133,7 @@ vars = { 'reclient_version': 're_client_version:0.138.0.e854224-gomaip', # siso CIPD package version. - 'siso_version': 'git_revision:366e623c64429778827e021672a260553c7bd068', + 'siso_version': 'git_revision:70d9e16bcc9dff0264905018f5a5652b37ed0e10', # 'magic' text to tell depot_tools that git submodules should be accepted but # but parity with DEPS file is expected. @@ -414,12 +414,12 @@ vars = { deps = { 'build': { - 'url': Var('chromium_git') + '/chromium/src/build.git@cd430bd4b263bce76a34122ebea05664ea72d797', + 'url': Var('chromium_git') + '/chromium/src/build.git@dc7e21c7b04270a6b5fae49a0f67e7065d310bb2', 'condition': 'not build_with_chromium', }, 'buildtools': { - 'url': Var('chromium_git') + '/chromium/src/buildtools.git@571c37f17dd4d1de37cc2efb6b32ff1032e47be2', + 'url': Var('chromium_git') + '/chromium/src/buildtools.git@d0f0285d02d788719edb53fa9dcec1584ff83875', 'condition': 'not build_with_chromium', }, @@ -432,7 +432,7 @@ deps = { 'packages': [ { 'package': 'gn/gn/linux-${{arch}}', - 'version': 'git_revision:155c53952ec2dc324b0438ce5b9bd4a286577d25', + 'version': 'git_revision:f284b6b47039a2d7edfcbfc51f52664f82b5a789', } ], 'dep_type': 'cipd', @@ -443,7 +443,7 @@ deps = { 'packages': [ { 'package': 'gn/gn/mac-${{arch}}', - 'version': 'git_revision:155c53952ec2dc324b0438ce5b9bd4a286577d25', + 'version': 'git_revision:f284b6b47039a2d7edfcbfc51f52664f82b5a789', } ], 'dep_type': 'cipd', @@ -465,7 +465,7 @@ deps = { 'packages': [ { 'package': 'gn/gn/windows-amd64', - 'version': 'git_revision:155c53952ec2dc324b0438ce5b9bd4a286577d25', + 'version': 'git_revision:f284b6b47039a2d7edfcbfc51f52664f82b5a789', } ], 'dep_type': 'cipd', @@ -473,12 +473,12 @@ deps = { }, 'testing': { - 'url': '{chromium_git}/chromium/src/testing@3070e96403c85d98bb72f0dc23c39fc906f7ac38', + 'url': '{chromium_git}/chromium/src/testing@79213704bc55aa472940085952d33d9b0025e607', 'condition': 'not build_with_chromium', }, 'third_party/abseil-cpp': { - 'url': Var('chromium_git') + '/chromium/src/third_party/abseil-cpp@ca84904bdcf82574ead079d6ce95b17f332642ca', + 'url': Var('chromium_git') + '/chromium/src/third_party/abseil-cpp@2c1ad970da6bd5837bcee6671da262eac0bd5397', 'condition': 'not build_with_chromium', }, @@ -524,7 +524,7 @@ deps = { 'packages': [ { 'package': 'chromium/third_party/android_build_tools/lint', - 'version': 'f5ptuXixKwddKw0rnCKuNjXY9E35_710E7SNxoOLNnMC', + 'version': 'O1UDDudkb1fHG2uMxzszPWctYiGgjyywsi7Lbkq7roYC', }, ], 'condition': 'checkout_android and not build_with_chromium', @@ -535,7 +535,7 @@ deps = { 'packages': [ { 'package': 'chromium/third_party/android_build_tools/manifest_merger', - 'version': 'Xef4nLhp0rWWjXJXt9CTFjQF8S6qRduSY7LZCcJi48QC', + 'version': 'wRnJA-ZlBBQipw_wjYJJemxCCPSZHenIFsWKi3GI_FUC', }, ], 'condition': 'checkout_android and not build_with_chromium', @@ -543,7 +543,7 @@ deps = { }, 'third_party/android_deps': { - 'url': Var('chromium_git') + '/chromium/src/third_party/android_deps@e70dca1b5096ba6ce6fcd5264d54ae5b27fe4a08', + 'url': Var('chromium_git') + '/chromium/src/third_party/android_deps@d64937aec71a4110715b07ce871be294d6e35071', 'condition': 'checkout_android and not build_with_chromium', }, @@ -564,7 +564,7 @@ deps = { }, 'third_party/android_sdk': { - 'url': Var('chromium_git') + '/chromium/src/third_party/android_sdk@bb9e0f87b948dc4e51ed8bb1ea716da856a5a206', + 'url': Var('chromium_git') + '/chromium/src/third_party/android_sdk@2d7b0a17b7ffad6ee60feb21a3a773907e37dcda', 'condition': 'checkout_android and not build_with_chromium', }, @@ -655,7 +655,7 @@ deps = { }, 'third_party/depot_tools': { - 'url': Var('chromium_git') + '/chromium/tools/depot_tools.git@3d170cb6cec304816d1f314be9861b5e121f6d76', + 'url': Var('chromium_git') + '/chromium/tools/depot_tools.git@2c87882a7bacebf523a3df6a76432d0bc47badf8', 'condition': 'not build_with_chromium', }, @@ -712,7 +712,7 @@ deps = { 'packages': [ { 'package': 'chromium/third_party/kotlin_stdlib', - 'version': 'E67atHdREsWLno-3b4Py3r87C4LB7gpVYDq3Q1z7t90C', + 'version': '05hzFgOi0AqRK3RxbSvGj2TWTFUNeLcwkJwVzwgLttUC', }, ], 'condition': 'checkout_android and not build_with_chromium', @@ -871,7 +871,7 @@ deps = { 'packages': [ { 'package': 'chromium/third_party/r8', - 'version': 'mhSwabeiU2ueQeYkj0X1JTg-6ZdtQgiVVXM1bo0yu4IC', + 'version': '7sVFkxumsokMdM4MavgTQKuAVJ2_MQLCkqc9uln8Gl0C', }, ], 'condition': 'checkout_android and not build_with_chromium', @@ -926,7 +926,7 @@ deps = { 'packages': [ { 'package': 'chromium/third_party/turbine', - 'version': 'agNIST7gEMTmrnvQLPzx2dduGa52uMmOx3fEWm9z5MEC', + 'version': 'fYpnoJAvh8-OaNB9k81XWGrwiODb_uTipTBEUeIFM98C', }, ], 'condition': 'checkout_android and not build_with_chromium', @@ -938,7 +938,7 @@ deps = { }, 'third_party/vulkan-deps': { - 'url': Var('chromium_git') + '/vulkan-deps@8ff7d8bf1899d36b2239b216ba45235baeaa7d1c', + 'url': Var('chromium_git') + '/vulkan-deps@74fe7976366424c2e7375c3520fc674cc365ce0b', 'condition': 'not build_with_chromium', }, @@ -958,12 +958,12 @@ deps = { }, 'tools/android': { - 'url': Var('chromium_git') + '/chromium/src/tools/android@e8280e634cded4049d109164bc61cf4963a2a810', + 'url': Var('chromium_git') + '/chromium/src/tools/android@2451d1d2b62c31416919f437f9aeb43a0ee7edcd', 'condition': 'checkout_android and not build_with_chromium', }, 'tools/clang': { - 'url': Var('chromium_git') + '/chromium/src/tools/clang.git@277a3849ebe4f41beb773614cc4bad839870cfcf', + 'url': Var('chromium_git') + '/chromium/src/tools/clang.git@cc8e1423f4ade8b4871bc33fa44f061826bff2ff', 'condition': 'not build_with_chromium', }, @@ -994,7 +994,7 @@ deps = { }, 'tools/mb': { - 'url': Var('chromium_git') + '/chromium/src/tools/mb@918fef0e469d158c691256dea091c5df4674fb1d', + 'url': Var('chromium_git') + '/chromium/src/tools/mb@880331b699ae470dbb88118f9155a238fe0d1b0f', 'condition': 'not build_with_chromium', }, @@ -1009,7 +1009,7 @@ deps = { }, 'tools/perf': { - 'url': Var('chromium_git') + '/chromium/src/tools/perf@3f41393fee08650dd70f699546cadb4dcddf2674', + 'url': Var('chromium_git') + '/chromium/src/tools/perf@6e4e92a394b0b138f01219ebd23102042991e3d4', 'condition': 'not build_with_chromium', }, @@ -1027,7 +1027,7 @@ deps = { 'packages': [ { 'package': 'skia/tools/goldctl/linux-amd64', - 'version': 'ZpyLtfuztdYI-RCkvm6kXlmx8ec1wYyrwXNI-lQEJKwC', + 'version': 'AJacKGh5nnjmNZk56j2ia4-QtIE8eEAFELw48t8XinEC', }, ], 'dep_type': 'cipd', @@ -1038,7 +1038,7 @@ deps = { 'packages': [ { 'package': 'skia/tools/goldctl/windows-amd64', - 'version': 'LT6gNudC207ke0t4qv9IW_s27hoPIafnwpcfrzR8FzMC', + 'version': '4bTyiie8-MG6hBk2yGEE9d8p3HWHGevaAouvGfKKwtQC', }, ], 'dep_type': 'cipd', @@ -1049,7 +1049,7 @@ deps = { 'packages': [ { 'package': 'skia/tools/goldctl/mac-amd64', - 'version': 'FpwpXsMPl8Mets8uet3zfFw8nNBpl69xJoTYESLUjl8C', + 'version': 'uJJWpJUp-FSzEXlwqzoUD41p5swLKyDhxXdJBLShbMsC', }, ], 'dep_type': 'cipd', @@ -1060,7 +1060,7 @@ deps = { 'packages': [ { 'package': 'skia/tools/goldctl/mac-arm64', - 'version': 'GuJOsvx5V5z8DvAM_HOVy6eBydQ0sO7dVso_p_L7KTgC', + 'version': 'ekRiJKPFBJKiZ3N4ev_vRuf2X13dgTDcZNXKYt2qZPoC', }, ], 'dep_type': 'cipd', @@ -4068,7 +4068,7 @@ deps = { 'packages': [ { 'package': 'chromium/third_party/android_deps/libs/com_google_android_gms_play_services_base', - 'version': 'version:2@18.1.0.cr1', + 'version': 'version:2@18.0.1.cr1', }, ], 'condition': 'checkout_android and not build_with_chromium', @@ -4229,28 +4229,6 @@ deps = { 'dep_type': 'cipd', }, - 'third_party/android_deps/libs/com_google_android_gms_play_services_tflite_impl': { - 'packages': [ - { - 'package': 'chromium/third_party/android_deps/libs/com_google_android_gms_play_services_tflite_impl', - 'version': 'version:2@16.0.1.cr1', - }, - ], - 'condition': 'checkout_android and not build_with_chromium', - 'dep_type': 'cipd', - }, - - 'third_party/android_deps/libs/com_google_android_gms_play_services_tflite_java': { - 'packages': [ - { - 'package': 'chromium/third_party/android_deps/libs/com_google_android_gms_play_services_tflite_java', - 'version': 'version:2@16.0.1.cr1', - }, - ], - 'condition': 'checkout_android and not build_with_chromium', - 'dep_type': 'cipd', - }, - 'third_party/android_deps/libs/com_google_android_gms_play_services_vision': { 'packages': [ { @@ -4893,7 +4871,7 @@ deps = { 'packages': [ { 'package': 'chromium/third_party/android_deps/libs/net_bytebuddy_byte_buddy', - 'version': 'version:2@1.14.10.cr1', + 'version': 'version:2@1.14.12.cr1', }, ], 'condition': 'checkout_android and not build_with_chromium', @@ -4904,7 +4882,7 @@ deps = { 'packages': [ { 'package': 'chromium/third_party/android_deps/libs/net_bytebuddy_byte_buddy_agent', - 'version': 'version:2@1.14.10.cr1', + 'version': 'version:2@1.14.12.cr1', }, ], 'condition': 'checkout_android and not build_with_chromium', @@ -5146,7 +5124,7 @@ deps = { 'packages': [ { 'package': 'chromium/third_party/android_deps/libs/org_mockito_mockito_android', - 'version': 'version:2@5.8.0.cr1', + 'version': 'version:2@5.11.0.cr1', }, ], 'condition': 'checkout_android and not build_with_chromium', @@ -5157,7 +5135,7 @@ deps = { 'packages': [ { 'package': 'chromium/third_party/android_deps/libs/org_mockito_mockito_core', - 'version': 'version:2@5.8.0.cr1', + 'version': 'version:2@5.11.0.cr1', }, ], 'condition': 'checkout_android and not build_with_chromium', @@ -5168,7 +5146,7 @@ deps = { 'packages': [ { 'package': 'chromium/third_party/android_deps/libs/org_mockito_mockito_subclass', - 'version': 'version:2@5.8.0.cr1', + 'version': 'version:2@5.11.0.cr1', }, ], 'condition': 'checkout_android and not build_with_chromium', @@ -5406,17 +5384,6 @@ deps = { 'dep_type': 'cipd', }, - 'third_party/android_deps/libs/org_tensorflow_tensorflow_lite_api': { - 'packages': [ - { - 'package': 'chromium/third_party/android_deps/libs/org_tensorflow_tensorflow_lite_api', - 'version': 'version:2@2.10.0.cr1', - }, - ], - 'condition': 'checkout_android and not build_with_chromium', - 'dep_type': 'cipd', - }, - # === ANDROID_DEPS Generated Code End === } diff --git a/build/android/PRESUBMIT.py b/build/android/PRESUBMIT.py index a583d7dbba..56e0168f57 100644 --- a/build/android/PRESUBMIT.py +++ b/build/android/PRESUBMIT.py @@ -116,6 +116,7 @@ def CommonChecks(input_api, output_api): J('pylib', 'utils', 'gold_utils_test.py'), J('pylib', 'utils', 'test_filter_test.py'), J('gyp', 'dex_test.py'), + J('gyp', 'gcc_preprocess_tests.py'), J('gyp', 'util', 'build_utils_test.py'), J('gyp', 'util', 'manifest_utils_test.py'), J('gyp', 'util', 'md5_check_test.py'), diff --git a/build/android/apk_operations.py b/build/android/apk_operations.py index 99545f5109..d34e24d69d 100755 --- a/build/android/apk_operations.py +++ b/build/android/apk_operations.py @@ -1333,7 +1333,7 @@ class _Command: logging.debug('App supports (filtered): %r', app_abis) if not app_abis: # The app does not have any native libs, so all devices can support it. - return devices, None + return devices, {} fully_supported = [] not_supported_reasons = {} for device in devices: @@ -1440,13 +1440,17 @@ class _Command: else: fully_supported, not_supported_reasons = self._FindSupportedDevices( available_devices) - if fully_supported: + reason_string = '\n'.join( + 'The device (serial={}) is not supported because {}'.format( + serial, reason) + for serial, reason in not_supported_reasons.items()) + if args.devices: + if reason_string: + logging.warning('Devices not supported: %s', reason_string) + self.devices = available_devices + elif fully_supported: self.devices = fully_supported else: - reason_string = '\n'.join( - 'The device (serial={}) is not supported because {}'.format( - serial, reason) - for serial, reason in not_supported_reasons.items()) raise Exception('Cannot find any supported devices for this app.\n\n' f'{reason_string}') diff --git a/build/android/gyp/create_app_bundle.py b/build/android/gyp/create_app_bundle.py index d821501035..10f9396d0c 100755 --- a/build/android/gyp/create_app_bundle.py +++ b/build/android/gyp/create_app_bundle.py @@ -572,7 +572,7 @@ def main(args): fail_on_output=options.warnings_as_errors) if options.validate_services: - # TODO(crbug.com/1126301): This step takes 0.4s locally for bundles with + # TODO(crbug.com/40148088): This step takes 0.4s locally for bundles with # isolated splits disabled and 2s for bundles with isolated splits # enabled. Consider making this run in parallel or move into a separate # step before enabling isolated splits by default. diff --git a/build/android/gyp/gcc_preprocess.py b/build/android/gyp/gcc_preprocess.py index 2e5b3b3b5d..0302c073a0 100755 --- a/build/android/gyp/gcc_preprocess.py +++ b/build/android/gyp/gcc_preprocess.py @@ -21,6 +21,24 @@ def _ParsePackageName(data): return m.group(1) if m else '' +def ProcessJavaFile(template, defines, include_dirs): + gcc_cmd = [ + 'gcc', + '-E', # stop after preprocessing. + '-DANDROID', # Specify ANDROID define for pre-processor. + '-x', + 'c-header', # treat sources as C header files + '-P', # disable line markers, i.e. '#line 309' + ] + gcc_cmd.extend('-D' + x for x in defines) + gcc_cmd.extend('-I' + x for x in include_dirs) + data = build_utils.CheckOutput(gcc_cmd + [template]) + package_name = _ParsePackageName(data) + if not package_name: + raise Exception('Could not find java package of ' + template) + return package_name, data + + def main(args): args = build_utils.ExpandFileArgs(args) @@ -36,25 +54,11 @@ def main(args): options.defines = action_helpers.parse_gn_list(options.defines) options.include_dirs = action_helpers.parse_gn_list(options.include_dirs) - - gcc_cmd = [ - 'gcc', - '-E', # stop after preprocessing. - '-DANDROID', # Specify ANDROID define for pre-processor. - '-x', - 'c-header', # treat sources as C header files - '-P', # disable line markers, i.e. '#line 309' - ] - gcc_cmd.extend('-D' + x for x in options.defines) - gcc_cmd.extend('-I' + x for x in options.include_dirs) - with action_helpers.atomic_output(options.output) as f: with zipfile.ZipFile(f, 'w') as z: for template in options.templates: - data = build_utils.CheckOutput(gcc_cmd + [template]) - package_name = _ParsePackageName(data) - if not package_name: - raise Exception('Could not find java package of ' + template) + package_name, data = ProcessJavaFile(template, options.defines, + options.include_dirs) zip_path = posixpath.join( package_name.replace('.', '/'), os.path.splitext(os.path.basename(template))[0]) + '.java' diff --git a/build/android/gyp/gcc_preprocess_tests.py b/build/android/gyp/gcc_preprocess_tests.py new file mode 100755 index 0000000000..3699575e02 --- /dev/null +++ b/build/android/gyp/gcc_preprocess_tests.py @@ -0,0 +1,111 @@ +#!/usr/bin/env python3 +# Copyright 2024 The Chromium Authors +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. +"""Tests for gcc_preprocess.py + +This test suite contains various tests for the 'java_cpp_template' build rule, +which uses the gcc preprocessor to turn a template into Java code. +""" + +import unittest +import tempfile + +import gcc_preprocess + + +class TestPreprocess(unittest.TestCase): + + def testParsePackageName(self): + with tempfile.NamedTemporaryFile(mode='w') as f: + template = f.name + f.file.write(""" +package org.chromium.fake; +public class Empty { +} +""") + f.file.flush() + package_name, data = gcc_preprocess.ProcessJavaFile(template, [], []) + self.assertEqual('org.chromium.fake', package_name) + self.assertEqual( + """ +package org.chromium.fake; +public class Empty { +} +""".strip(), data.strip()) + + def testMissingPackageName(self): + with tempfile.NamedTemporaryFile(mode='w') as f: + template = f.name + f.file.write(""" +public class Empty { +} +""") + f.file.flush() + with self.assertRaisesRegex(Exception, + r'Could not find java package of.*'): + gcc_preprocess.ProcessJavaFile(template, [], []) + + def testSinglePreprocessorEvaluation(self): + with tempfile.NamedTemporaryFile(mode='w') as f: + template = f.name + f.file.write(""" +package org.chromium.fake; +public class Sample { +#if defined(_ENABLE_ASSERTS) + public boolean ENABLE_ASSERTS = true; +#else + public boolean ENABLE_ASSERTS = false; +#endif +} +""") + f.file.flush() + defines = [ + '_ENABLE_ASSERTS', + ] + package_name, data = gcc_preprocess.ProcessJavaFile(template, defines, []) + self.assertEqual('org.chromium.fake', package_name) + self.assertEqual( + """ +package org.chromium.fake; +public class Sample { + public boolean ENABLE_ASSERTS = true; +} +""".strip(), data.strip()) + + def testNestedPreprocessorEvaluation(self): + with tempfile.NamedTemporaryFile(mode='w') as f: + template = f.name + f.file.write(""" +package org.chromium.fake; +#if defined(USE_FINAL) +#define MAYBE_FINAL final +#else +#define MAYBE_FINAL +#endif +public class Sample { +#if defined(_ENABLE_ASSERTS) + public MAYBE_FINAL boolean ENABLE_ASSERTS = true; +#else + public MAYBE_FINAL boolean ENABLE_ASSERTS = false; +#endif +} +""") + f.file.flush() + defines = [ + '_ENABLE_ASSERTS', + 'USE_FINAL', + ] + package_name, data = gcc_preprocess.ProcessJavaFile(template, defines, []) + self.assertEqual('org.chromium.fake', package_name) + self.assertEqual( + """ +package org.chromium.fake; +public class Sample { + public final boolean ENABLE_ASSERTS = true; +} +""".strip(), data.strip()) + + +if __name__ == '__main__': + unittest.main() diff --git a/build/android/gyp/java_cpp_enum.py b/build/android/gyp/java_cpp_enum.py index c49f017895..711e04ed21 100755 --- a/build/android/gyp/java_cpp_enum.py +++ b/build/android/gyp/java_cpp_enum.py @@ -177,6 +177,11 @@ class HeaderParser: multi_line_comment_start_re = re.compile(r'\s*/\*') enum_line_re = re.compile(r'^\s*(\w+)(\s*\=\s*([^,\n]+))?,?') enum_end_re = re.compile(r'^\s*}\s*;\.*$') + # Note: For now we only support a very specific `#if` statement to prevent the + # possibility of miscalculating whether lines should be ignored when building + # for Android. + if_buildflag_re = re.compile(r'^#if BUILDFLAG\((\w+)\)$') + if_buildflag_end_re = re.compile(r'^#endif.*$') generator_error_re = re.compile(r'^\s*//\s+GENERATED_JAVA_(\w+)\s*:\s*$') generator_directive_re = re.compile( r'^\s*//\s+GENERATED_JAVA_(\w+)\s*:\s*([\.\w]+)$') @@ -200,12 +205,22 @@ class HeaderParser: self._path = path self._enum_definitions = [] self._in_enum = False + # Indicates whether an #if block was encountered on a previous line (until + # an #endif block was seen). When True, `_in_buildflag_android` indicates + # whether the block was `#if BUILDFLAG(IS_ANDROID)` or not. + # Note: Currently only statements like `#if BUILDFLAG(IS_<PLATFORM>)` are + # supported. + self._in_preprocessor_block = False + self._in_buildflag_android = False self._current_definition = None self._current_comments = [] self._generator_directives = DirectiveSet() self._multi_line_generator_directive = None self._current_enum_entry = '' + def _ShouldIgnoreLine(self): + return self._in_preprocessor_block and not self._in_buildflag_android + def _ApplyGeneratorDirectives(self): self._generator_directives.UpdateDefinition(self._current_definition) self._generator_directives = DirectiveSet() @@ -216,12 +231,29 @@ class HeaderParser: return self._enum_definitions def _ParseLine(self, line): + if m := HeaderParser.if_buildflag_re.match(line): + if self._in_preprocessor_block: + raise Exception('Nested #if statements not supported. Found: ' + line) + self._in_preprocessor_block = True + self._in_buildflag_android = m.group(1) == "IS_ANDROID" + return + if HeaderParser.if_buildflag_end_re.match(line): + self._in_preprocessor_block = False + self._in_buildflag_android = False + return + + if self._ShouldIgnoreLine(): + return + if self._multi_line_generator_directive: self._ParseMultiLineDirectiveLine(line) - elif not self._in_enum: + return + + if not self._in_enum: self._ParseRegularLine(line) - else: - self._ParseEnumLine(line) + return + + self._ParseEnumLine(line) def _ParseEnumLine(self, line): if HeaderParser.multi_line_comment_start_re.match(line): diff --git a/build/android/gyp/java_cpp_enum_tests.py b/build/android/gyp/java_cpp_enum_tests.py index 6103b58399..9e9e4b5ccf 100755 --- a/build/android/gyp/java_cpp_enum_tests.py +++ b/build/android/gyp/java_cpp_enum_tests.py @@ -520,6 +520,60 @@ public @interface ClassName { ('MAX_VALUE', 'New enum values must go above here.') ]), definition.comments) + def testParseEnumWithConditionallyDefinedValues(self): + test_data = """ +// GENERATED_JAVA_ENUM_PACKAGE: test.namespace +// GENERATED_JAVA_PREFIX_TO_STRIP: TERMINATION_STATUS_ +enum TerminationStatus { + // Zero exit status. + TERMINATION_STATUS_NORMAL_TERMINATION = 0, + // Child hasn't exited yet. + TERMINATION_STATUS_STILL_RUNNING = 4, +#if BUILDFLAG(IS_CHROMEOS) + // OOM-killer killed the process on ChromeOS. + TERMINATION_STATUS_PROCESS_WAS_KILLED_BY_OOM = 5, +#endif +#if BUILDFLAG(IS_ANDROID) + // On Android processes are spawned from the system Zygote and we do not get + // the termination status. + TERMINATION_STATUS_OOM_PROTECTED = 6, +#endif + // Out of memory. + TERMINATION_STATUS_OOM = 8, +#if BUILDFLAG(IS_WIN) + // On Windows, the OS terminated process due to code integrity failure. + TERMINATION_STATUS_INTEGRITY_FAILURE = 9, +#endif +}; + """.split('\n') + definitions = HeaderParser(test_data).ParseDefinitions() + self.assertEqual(1, len(definitions)) + definition = definitions[0] + self.assertEqual('TerminationStatus', definition.class_name) + self.assertEqual('test.namespace', definition.enum_package) + self.assertEqual( + collections.OrderedDict([ + ('NORMAL_TERMINATION', '0'), + ('STILL_RUNNING', '4'), + # PROCESS_WAS_KILLED_BY_OOM value should not appear here. + # + # OOM_PROTECTED should appear because the script supports the case + # where '#if BUILDFLAG(IS_ANDROID)' is used. + ('OOM_PROTECTED', '6'), + ('OOM', '8'), + # INTEGRITY_FAILURE value should not appear here. + ]), + definition.entries) + self.assertEqual( + collections.OrderedDict([ + ('NORMAL_TERMINATION', 'Zero exit status.'), + ('STILL_RUNNING', 'Child hasn\'t exited yet.'), + ('OOM_PROTECTED', + 'On Android processes are spawned from the system Zygote and we ' + + 'do not get the termination status.'), + ('OOM', 'Out of memory.'), + ]), definition.comments) + def testParseEnumStruct(self): test_data = """ // GENERATED_JAVA_ENUM_PACKAGE: test.namespace diff --git a/build/android/gyp/lint.py b/build/android/gyp/lint.py index 9b2845e4c8..fb78de62cc 100755 --- a/build/android/gyp/lint.py +++ b/build/android/gyp/lint.py @@ -171,7 +171,7 @@ def _GenerateAndroidManifest(original_manifest_path, extra_manifest_paths, # Set minSdkVersion in the manifest to the correct value. doc, manifest, app_node = manifest_utils.ParseManifest(original_manifest_path) - # TODO(crbug.com/1126301): Should this be done using manifest merging? + # TODO(crbug.com/40148088): Should this be done using manifest merging? # Add anything in the application node of the extra manifests to the main # manifest to prevent unused resource errors. for path in extra_manifest_paths: diff --git a/build/android/gyp/system_image_apks.py b/build/android/gyp/system_image_apks.py index 0b6804b9af..a44c71816c 100755 --- a/build/android/gyp/system_image_apks.py +++ b/build/android/gyp/system_image_apks.py @@ -46,16 +46,14 @@ def main(): pathlib.Path(args.output).write_bytes(z.read('system/system.apk')) return - # Rename .apk files and remove toc.pb to make it clear that system apks - # should not be installed via bundletool. - with zipfile.ZipFile(tmp_file.name) as z_input, \ - zipfile.ZipFile(args.output, 'w') as z_output: - for info in z_input.infolist(): - if info.filename.endswith('.apk'): - data = z_input.read(info) - info.filename = (info.filename.replace('splits/', - '').replace('-master', '')) - z_output.writestr(info, data) + # A single .apk file means a bundle where we take only the base split. + if args.output.endswith('.apk'): + with zipfile.ZipFile(tmp_file.name) as z: + pathlib.Path(args.output).write_bytes(z.read('splits/base-master.apk')) + return + + # Use the full .apks. + shutil.copyfile(tmp_file.name, args.output) if __name__ == '__main__': diff --git a/build/android/pylib/base/environment.py b/build/android/pylib/base/environment.py index 0c4326a0b3..873504f244 100644 --- a/build/android/pylib/base/environment.py +++ b/build/android/pylib/base/environment.py @@ -3,8 +3,8 @@ # found in the LICENSE file. -# TODO(1262303): After Telemetry is supported by python3 we can remove -# object inheritance from this script. +# TODO(crbug.com/40799394): After Telemetry is supported by python3 we can +# remove object inheritance from this script. # pylint: disable=useless-object-inheritance class Environment(object): """An environment in which tests can be run. diff --git a/build/android/pylib/local/device/local_device_environment.py b/build/android/pylib/local/device/local_device_environment.py index 582e690c12..a096c7c2f0 100644 --- a/build/android/pylib/local/device/local_device_environment.py +++ b/build/android/pylib/local/device/local_device_environment.py @@ -86,8 +86,8 @@ def handle_shard_failures_with(on_failure): return decorator -# TODO(1262303): After Telemetry is supported by python3 we can re-add -# super without arguments in this script. +# TODO(crbug.com/40799394): After Telemetry is supported by python3 we can +# re-add super without arguments in this script. # pylint: disable=super-with-arguments class LocalDeviceEnvironment(environment.Environment): diff --git a/build/android/pylib/local/device/local_device_gtest_run.py b/build/android/pylib/local/device/local_device_gtest_run.py index 687f77487a..540c03aa7e 100644 --- a/build/android/pylib/local/device/local_device_gtest_run.py +++ b/build/android/pylib/local/device/local_device_gtest_run.py @@ -675,7 +675,7 @@ class LocalDeviceGtestRun(local_device_test_run.LocalDeviceTestRun): if not other_test in pre_tests: all_tests.append(other_test) - # TODO(crbug.com/1257820): Add logic to support grouping tests. + # TODO(crbug.com/40200835): Add logic to support grouping tests. # Once grouping logic is added, switch to 'append' from 'extend'. for _, test_list in pre_tests.items(): all_tests.extend(test_list) diff --git a/build/android/pylib/local/device/local_device_instrumentation_test_run.py b/build/android/pylib/local/device/local_device_instrumentation_test_run.py index 02d336300b..25aa42a43d 100644 --- a/build/android/pylib/local/device/local_device_instrumentation_test_run.py +++ b/build/android/pylib/local/device/local_device_instrumentation_test_run.py @@ -887,7 +887,7 @@ class LocalDeviceInstrumentationTestRun( ]) all_tests.extend(other_tests) # Sort all tests by hash. - # TODO(crbug.com/1257820): Add sorting logic back to _PartitionTests. + # TODO(crbug.com/40200835): Add sorting logic back to _PartitionTests. return self._SortTests(all_tests) #override diff --git a/build/android/pylib/local/device/local_device_test_run.py b/build/android/pylib/local/device/local_device_test_run.py index 218106ff94..fe631fff0a 100644 --- a/build/android/pylib/local/device/local_device_test_run.py +++ b/build/android/pylib/local/device/local_device_test_run.py @@ -263,7 +263,7 @@ class LocalDeviceTestRun(test_run.TestRun): sharded_tests = [] # Sort tests by hash. - # TODO(crbug.com/1257820): Add sorting logic back to _PartitionTests. + # TODO(crbug.com/40200835): Add sorting logic back to _PartitionTests. tests = self._SortTests(tests) # Group tests by tests that should run in the same test invocation - either @@ -321,8 +321,8 @@ class LocalDeviceTestRun(test_run.TestRun): # if the size of the test group is larger than the max partition size on # its own, just put the group in its own shard instead of splitting up the # group. - # TODO(crbug/1257820): Add logic to support PRE_ test recognition but it - # may hurt performance in most scenarios. Currently all PRE_ tests are + # TODO(crbug.com/40200835): Add logic to support PRE_ test recognition but + # it may hurt performance in most scenarios. Currently all PRE_ tests are # partitioned into the last shard. Unless the number of PRE_ tests are # larger than the partition size, the PRE_ test may get assigned into a # different shard and cause test failure. diff --git a/build/android/pylib/local/emulator/local_emulator_environment.py b/build/android/pylib/local/emulator/local_emulator_environment.py index 518f8e584c..322cb01666 100644 --- a/build/android/pylib/local/emulator/local_emulator_environment.py +++ b/build/android/pylib/local/emulator/local_emulator_environment.py @@ -17,8 +17,8 @@ from pylib.local.emulator import avd _MAX_ANDROID_EMULATORS = 16 -# TODO(1262303): After Telemetry is supported by python3 we can re-add -# super without arguments in this script. +# TODO(crbug.com/40799394): After Telemetry is supported by python3 we can +# re-add super without arguments in this script. # pylint: disable=super-with-arguments class LocalEmulatorEnvironment(local_device_environment.LocalDeviceEnvironment): @@ -43,6 +43,7 @@ class LocalEmulatorEnvironment(local_device_environment.LocalDeviceEnvironment): self._emulator_instances = [] self._device_serials = [] + self._emulator_start_timeout = 60 #override def SetUp(self): @@ -53,6 +54,10 @@ class LocalEmulatorEnvironment(local_device_environment.LocalDeviceEnvironment): for _ in range(self._emulator_count) ] + if 'car' in self._avd_config.avd_name or self._writable_system: + logging.info("Use longer timeout for AVD") + self._emulator_start_timeout = 120 + def start_emulator_instance(inst): def is_timeout_error(exc): return isinstance( @@ -72,12 +77,13 @@ class LocalEmulatorEnvironment(local_device_environment.LocalDeviceEnvironment): except base_error.BaseError as e: # Timeout error usually indicates the emulator is not responding. # In this case, we should stop it forcely. + logging.info("Force stop the emulator") inst.Stop(force=is_timeout_error(e)) raise return inst return timeout_retry.Run(impl, - timeout=120 if self._writable_system else 60, + timeout=self._emulator_start_timeout, retries=2, args=[inst], retry_if_func=is_timeout_error) diff --git a/build/apple/tweak_info_plist.py b/build/apple/tweak_info_plist.py index e6e8936fb3..66dfbdc63d 100755 --- a/build/apple/tweak_info_plist.py +++ b/build/apple/tweak_info_plist.py @@ -447,7 +447,7 @@ def Main(argv): if __name__ == '__main__': - # TODO(https://crbug.com/941669): Temporary workaround until all scripts use + # TODO(crbug.com/40618161): Temporary workaround until all scripts use # python3 by default. if sys.version_info[0] < 3: os.execvp('python3', ['python3'] + sys.argv) diff --git a/build/chromeos/test_runner.py b/build/chromeos/test_runner.py index 260b978603..f480086fcb 100755 --- a/build/chromeos/test_runner.py +++ b/build/chromeos/test_runner.py @@ -561,7 +561,8 @@ class GTestTest(RemoteTest): if not os.path.exists(vpython_path) or not os.path.exists(cpython_path): raise TestFormatError( '--vpython-dir must point to a dir with both ' - 'infra/3pp/tools/cpython3 and infra/tools/luci/vpython installed.') + 'infra/3pp/tools/cpython3 and infra/tools/luci/vpython3 ' + 'installed.') vpython_spec_path = os.path.relpath( os.path.join(CHROMIUM_SRC_PATH, '.vpython3'), self._path_to_outdir) # Initialize the vpython cache. This can take 10-20s, and some tests diff --git a/build/config/android/internal_rules.gni b/build/config/android/internal_rules.gni index fcfe27c092..6e7e68f7e4 100644 --- a/build/config/android/internal_rules.gni +++ b/build/config/android/internal_rules.gni @@ -3474,7 +3474,7 @@ if (enable_java_templates) { # generated wrapper script. # template("java_library_impl") { - # TODO(crbug.com/1042017): Remove. + # TODO(crbug.com/40114668): Remove. not_needed(invoker, [ "no_build_hooks" ]) forward_variables_from(invoker, [ "testonly" ]) @@ -4034,12 +4034,6 @@ if (enable_java_templates) { } } - if (_skip_header_jar) { - group(_header_target_name) { - public_deps = [ ":$_compile_java_target" ] - } - } - if (_enable_errorprone) { _compile_java_errorprone_target = "${_main_target_name}__errorprone" compile_java_helper(_compile_java_errorprone_target) { @@ -4216,6 +4210,12 @@ if (enable_java_templates) { _process_device_jar_deps = _unprocessed_jar_deps } + if (_skip_header_jar) { + group(_header_target_name) { + public_deps = [ ":$_process_device_jar_target_name" ] + } + } + _dex_target_name = "${target_name}__dex" dex(_dex_target_name) { forward_variables_from(invoker, diff --git a/build/config/android/rules.gni b/build/config/android/rules.gni index a5032f40eb..e633dcd764 100644 --- a/build/config/android/rules.gni +++ b/build/config/android/rules.gni @@ -1442,7 +1442,7 @@ if (is_robolectric) { # output = "$root_build_dir/MyLibrary.jar" # } template("dist_jar") { - # TODO(crbug.com/1042017): Remove. + # TODO(crbug.com/40114668): Remove. not_needed(invoker, [ "no_build_hooks" ]) forward_variables_from(invoker, TESTONLY_AND_VISIBILITY) _use_interface_jars = @@ -3207,7 +3207,7 @@ if (is_robolectric) { # ] # } template("android_apk") { - # TODO(crbug.com/1042017): Remove. + # TODO(crbug.com/40114668): Remove. not_needed(invoker, [ "no_build_hooks" ]) android_apk_or_module(target_name) { forward_variables_from( diff --git a/build/config/android/system_image.gni b/build/config/android/system_image.gni index 31a184c740..6706e078b0 100644 --- a/build/config/android/system_image.gni +++ b/build/config/android/system_image.gni @@ -42,7 +42,7 @@ template("system_image_stub_apk") { invoker.static_library_name, ] - # TODO(crbug.com/1408164): Make static_library_version mandatory. + # TODO(crbug.com/40253411): Make static_library_version mandatory. if (defined(invoker.static_library_version)) { args += [ "--static-library-version", @@ -143,7 +143,7 @@ template("system_image_stub_apk") { _version_code = invoker.version_code _version_name = invoker.version_name - # TODO(crbug.com/1408164): Make static_library_version mandatory. + # TODO(crbug.com/40253411): Make static_library_version mandatory. if (defined(invoker.static_library_version)) { assert(invoker.static_library_version == _version_code, "$invoker.static_library_version must equal $_version_code.") @@ -159,7 +159,7 @@ template("system_image_stub_apk") { _version_code = "@FileArg($_rebased_build_config:deps_info:version_code)" _version_name = "@FileArg($_rebased_build_config:deps_info:version_name)" - # TODO(crbug.com/1408164): Make static_library_version mandatory. + # TODO(crbug.com/40253411): Make static_library_version mandatory. # Pass this through to ensure that the version code in the build config is # the same as the static library version. if (defined(invoker.static_library_version)) { diff --git a/build/config/chromeos/rules.gni b/build/config/chromeos/rules.gni index 9d5cd4d177..7e74d17187 100644 --- a/build/config/chromeos/rules.gni +++ b/build/config/chromeos/rules.gni @@ -533,7 +533,7 @@ template("tast_test") { "//chromeos:cros_chrome_deploy", # Adds additional browser run-time deps. # Tools used to symbolize Chrome crash dumps. - # TODO(crbug.com/1156772): Remove these if/when all tests pick them up by + # TODO(crbug.com/40160552): Remove these if/when all tests pick them up by # default. "//third_party/breakpad:dump_syms", "//third_party/breakpad:minidump_dump", @@ -607,7 +607,7 @@ template("lacros_tast_tests") { "//chrome", # Builds the browser. # Tools used to symbolize Chrome crash dumps. - # TODO(crbug.com/1156772): Remove these if/when all tests pick them up by + # TODO(crbug.com/40160552): Remove these if/when all tests pick them up by # default. "//third_party/breakpad:dump_syms", "//third_party/breakpad:minidump_dump", diff --git a/build/config/clang/BUILD.gn b/build/config/clang/BUILD.gn index 8cbeb6e76e..df24b5f59e 100644 --- a/build/config/clang/BUILD.gn +++ b/build/config/clang/BUILD.gn @@ -3,6 +3,7 @@ # found in the LICENSE file. import("//build/buildflag_header.gni") +import("//build/config/pch.gni") import("//build/config/rust.gni") import("//build/toolchain/goma.gni") import("clang.gni") @@ -94,10 +95,17 @@ config("find_bad_constructs") { # # See //build/config/unsafe_buffers_paths.txt for an example file, this it the # file used by Chromium. +# +# This build configuration is not supported when `enable_precompiled_headers` +# is on because the pragmas that enable and disable unsafe-buffers warnings are +# not serialized to precompiled header files, and thus we get warnings that we +# should not. config("unsafe_buffers") { if (clang_use_chrome_plugins && clang_unsafe_buffers_paths != "" && - !use_goma) { + !use_goma && !enable_precompiled_headers) { cflags = [ + "-DUNSAFE_BUFFERS_BUILD", + "-Xclang", "-add-plugin", "-Xclang", diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn index f5b1d46068..d39de9bc56 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn @@ -67,10 +67,6 @@ declare_args() { # Requires profiling to be set to true. enable_full_stack_frames_for_profiling = false - # When we are going to use gold we need to find it. - # This is initialized below, after use_gold might have been overridden. - gold_path = "" - # Enable fatal linker warnings. Building Chromium with certain versions # of binutils can cause linker warning. fatal_linker_warnings = true @@ -208,19 +204,9 @@ declare_args() { declare_args() { # Set to true to use icf, Identical Code Folding. - # - # icf=all is broken in older golds, see - # https://sourceware.org/bugzilla/show_bug.cgi?id=17704 - # chromeos binutils has been patched with the fix, so always use icf there. - # The bug only affects x86 and x64, so we can still use ICF when targeting - # other architectures. - # - # lld doesn't have the bug. use_icf = (is_posix || is_fuchsia) && !is_debug && !using_sanitizer && !use_clang_coverage && current_os != "zos" && - !(is_android && use_order_profiling) && - (use_lld || (use_gold && (is_chromeos || !(current_cpu == "x86" || - current_cpu == "x64")))) + !(is_android && use_order_profiling) && use_lld } if (is_android) { @@ -515,35 +501,6 @@ config("compiler") { # Linux-specific compiler flags setup. # ------------------------------------ - if (use_gold) { - ldflags += [ "-fuse-ld=gold" ] - if (!is_android) { - # On Android, this isn't needed. gcc in the NDK knows to look next to - # it with -fuse-ld=gold, and clang gets a --gcc-toolchain flag passed - # above. - if (gold_path != "") { - ldflags += [ "-B$gold_path" ] - } - - ldflags += [ - # Experimentation found that using four linking threads - # saved ~20% of link time. - # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/281527606915bb36 - # Only apply this to the target linker, since the host - # linker might not be gold, but isn't used much anyway. - "-Wl,--threads", - "-Wl,--thread-count=4", - ] - } - - # TODO(thestig): Make this flag work with GN. - #if (!is_official_build && !is_chromeos && !(is_asan || is_lsan || is_tsan || is_msan)) { - # ldflags += [ - # "-Wl,--detect-odr-violations", - # ] - #} - } - if (use_icf && (!is_apple || use_lld)) { ldflags += [ "-Wl,--icf=all" ] } @@ -807,7 +764,9 @@ config("compiler") { # FIXME(inglorion): maybe tune these? # TODO(b/271459198): Revert limit on amd64 to 30 when fixed. import_instr_limit = 20 - } else if (is_android && optimize_for_size) { + } else if (is_android && (optimize_for_size || use_order_profiling)) { + # Reduce inlining for the orderfile instrumented build to mitigate + # crbug.com/330761384. # TODO(crbug.com/40219076): Investigate if we can get the > 6% perf win # of import_instr_limit 30 with a binary size hit smaller than ~2 MiB. import_instr_limit = 5 @@ -824,6 +783,21 @@ config("compiler") { ldflags += [ "-Wl,-mllvm,-disable-auto-upgrade-debug-info" ] } + # TODO(crbug.com/335365324): Enable on other platforms. + if (is_android && !optimize_for_size) { + # Ideally the compiler would handle this automatically with PGO (see + # comments at https://crrev.com/c/5440500). + # + # Android binary size impact (as of April 2024): The arm64 native code + # size increases by ~627KB (or 0.34%: the arm64 native code size in + # M124 is 178MB). + cflags += [ + "-mllvm", + "-inlinehint-threshold=360", + ] + ldflags += [ "-Wl,-mllvm,-inlinehint-threshold=360" ] + } + # TODO(crbug.com/40182783): investigate why this isn't effective on # arm32. if (!is_android || current_cpu == "arm64") { @@ -2372,7 +2346,7 @@ if (is_win) { common_optimize_on_ldflags += [ # Specifically tell the linker to perform optimizations. # See http://lwn.net/Articles/192624/ . - # -O2 enables string tail merge optimization in gold and lld. + # -O2 enables string tail merge optimization in lld. "-Wl,-O2", "-Wl,--gc-sections", ] @@ -2804,7 +2778,7 @@ config("symbols") { # sections" there. Maybe just a bug in nacl_switch_32.S. _enable_gdb_index = symbol_level == 2 && !is_apple && !is_nacl && current_cpu != "x86" && - current_os != "zos" && (use_gold || use_lld) && + current_os != "zos" && use_lld && # Disable on non-fission 32-bit Android because it pushes # libcomponents_unittests over the 4gb size limit. !(is_android && !use_debug_fission && current_cpu != "x64" && diff --git a/build/config/compiler/compiler.gni b/build/config/compiler/compiler.gni index 08bd265d24..dff295865e 100644 --- a/build/config/compiler/compiler.gni +++ b/build/config/compiler/compiler.gni @@ -78,6 +78,8 @@ declare_args() { # the default. This is necessary to delay the evaluation of the default # value expression until after its input values such as use_gold have # been set, e.g. by a toolchain_args() block. + # + # TODO(crbug.com/333645515): Remove the placeholder value and set directly. use_debug_fission = "default" # Enables support for ThinLTO, which links 3x-10x faster than full LTO. See @@ -236,15 +238,8 @@ enable_arm_cfi_table = is_android && !is_component_build && current_cpu == "arm" declare_args() { # Whether to use the gold linker from binutils instead of lld or bfd. - use_gold = !use_lld && !(is_castos && - (current_cpu == "arm" || current_cpu == "mipsel")) && - (((is_linux || is_chromeos_lacros) && - (current_cpu == "x64" || current_cpu == "x86" || - current_cpu == "arm" || current_cpu == "arm64" || - current_cpu == "mipsel" || current_cpu == "mips64el")) || - (is_android && (current_cpu == "x86" || current_cpu == "x64" || - current_cpu == "arm" || current_cpu == "arm64" || - current_cpu == "riscv64"))) + # TODO(crbug.com/333645515): Remove this variable. + use_gold = false } # Use relative paths for debug info. This is important to make the build @@ -276,7 +271,7 @@ assert( "Invalid use_debug_fission.") if (use_debug_fission == "default") { use_debug_fission = is_debug && !is_android && !is_fuchsia && !is_apple && - !is_win && (use_gold || use_lld) && cc_wrapper == "" + !is_win && use_lld && cc_wrapper == "" } # If it wasn't manually set, set to an appropriate default. diff --git a/build/config/ios/ios_sdk_overrides.gni b/build/config/ios/ios_sdk_overrides.gni index 0bb60c6d08..4e5d710394 100644 --- a/build/config/ios/ios_sdk_overrides.gni +++ b/build/config/ios/ios_sdk_overrides.gni @@ -12,13 +12,13 @@ declare_args() { if (use_blink) { ios_deployment_target = "17.4" } else { - ios_deployment_target = "15.0" + ios_deployment_target = "16.0" } } # Always assert that ios_deployment_target is used on non-iOS platforms to # prevent unused args warnings. if (!is_ios) { - assert(ios_deployment_target == "15.0" || ios_deployment_target == "17.4" || + assert(ios_deployment_target == "16.0" || ios_deployment_target == "17.4" || true) } diff --git a/build/config/rust.gni b/build/config/rust.gni index b6e0822b68..e99d7d08e1 100644 --- a/build/config/rust.gni +++ b/build/config/rust.gni @@ -154,7 +154,7 @@ if (enable_rust) { } } -# TODO(crbug.com/1278030): To build unit tests for Android we need to build +# TODO(crbug.com/40809974): To build unit tests for Android we need to build # them as a dylib and put them into an APK. We should reuse all the same logic # for gtests from the `//testing/test:test` template. can_build_rust_unit_tests = toolchain_has_rust && !is_android diff --git a/build/config/sanitizers/BUILD.gn b/build/config/sanitizers/BUILD.gn index 9ea312c5a3..c45cffedfe 100644 --- a/build/config/sanitizers/BUILD.gn +++ b/build/config/sanitizers/BUILD.gn @@ -218,7 +218,7 @@ config("default_sanitizer_ldflags") { if (use_libfuzzer) { ldflags += [ "-fsanitize=fuzzer-no-link" ] if (is_mac) { - # TODO(crbug.com/926588): on macOS, dead code stripping does not work + # TODO(crbug.com/40611636): on macOS, dead code stripping does not work # well with `pc-table` instrumentation enabled by `fuzzer-no-link`. ldflags += [ "-fno-sanitize-coverage=pc-table" ] } @@ -345,7 +345,7 @@ config("cfi_flags") { # sanitize=cfi implies -fsplit-lto-unit, and Rust needs to match # behaviour. Rust needs to know the linker will be doing LTO in this case # or it rejects the Zsplit-lto-unit flag. - # TODO(crbug.com/1442331): Add -Zsanitize=cfi instead. + # TODO(crbug.com/40266913): Add -Zsanitize=cfi instead. rustflags += [ "-Zsplit-lto-unit", "-Clinker-plugin-lto=yes", @@ -364,9 +364,9 @@ config("cfi_flags") { if (use_cfi_icall) { cflags += [ "-fsanitize=cfi-icall" ] - # TODO(crbug.com/1442331): Add cflags += [ + # TODO(crbug.com/40266913): Add cflags += [ # "-fsanitize-cfi-icall-experimental-normalize-integers" ] - # TODO(crbug.com/1442331): Add rustflags += [ + # TODO(crbug.com/40266913): Add rustflags += [ # "-Zsanitizer-cfi-normalize-integers" ]. } @@ -415,7 +415,7 @@ config("coverage_flags") { if (use_libfuzzer) { cflags += [ "-fsanitize=fuzzer-no-link" ] if (is_mac) { - # TODO(crbug.com/926588): on macOS, dead code stripping does not work + # TODO(crbug.com/40611636): on macOS, dead code stripping does not work # well with `pc-table` instrumentation enabled by `fuzzer-no-link`. cflags += [ "-fno-sanitize-coverage=pc-table" ] } diff --git a/build/config/sanitizers/sanitizers.gni b/build/config/sanitizers/sanitizers.gni index 100788c797..1202039097 100644 --- a/build/config/sanitizers/sanitizers.gni +++ b/build/config/sanitizers/sanitizers.gni @@ -322,7 +322,7 @@ assert(!is_win || !use_libfuzzer || is_asan, assert(!use_cfi_recover || use_cfi_diag, "Only use CFI recovery together with diagnostics.") -# TODO(crbug.com/753445): the use_sanitizer_coverage arg is currently +# TODO(crbug.com/40534102): the use_sanitizer_coverage arg is currently # not supported by the Chromium mac_clang_x64 toolchain on iOS distribution. # The coverage works with iOS toolchain but it is broken when the mac # toolchain is used as a secondary one on iOS distribution. E.g., it should be diff --git a/build/config/siso/clang_code_coverage_wrapper.star b/build/config/siso/clang_code_coverage_wrapper.star index 9eb1c1cdb2..a354d354a5 100644 --- a/build/config/siso/clang_code_coverage_wrapper.star +++ b/build/config/siso/clang_code_coverage_wrapper.star @@ -39,7 +39,7 @@ _COVERAGE_EXCLUSION_LIST_MAP = { "../../device/gamepad/dualshock4_controller.cc", ], "fuchsia": [ - # TODO(crbug.com/1174725): These files caused clang to crash while + # TODO(crbug.com/40167659): These files caused clang to crash while # compiling them. "../../base/allocator/partition_allocator/src/partition_alloc/pcscan.cc", "../../third_party/skia/src/core/SkOpts.cpp", @@ -49,7 +49,7 @@ _COVERAGE_EXCLUSION_LIST_MAP = { "linux": [ # These files caused a static initializer to be generated, which # shouldn't. - # TODO(crbug.com/990948): Remove when the bug is fixed. + # TODO(crbug.com/41474559): Remove when the bug is fixed. "../../chrome/browser/media/router/providers/cast/cast_internal_message_util.cc", #pylint: disable=line-too-long "../../components/media_router/common/providers/cast/channel/cast_channel_enum.cc", #pylint: disable=line-too-long "../../components/media_router/common/providers/cast/channel/cast_message_util.cc", #pylint: disable=line-too-long @@ -75,7 +75,7 @@ _COVERAGE_FORCE_LIST_MAP = { # be linked in. Therefore we force coverage for this file to ensure that # any target that includes it will also get the profiling runtime. "win": [r"..\..\base\test\clang_profiling.cc"], - # TODO(crbug.com/1141727) We're seeing runtime LLVM errors in mac-rel when + # TODO(crbug.com/40154378) We're seeing runtime LLVM errors in mac-rel when # no files are changed, so we suspect that this is similar to the other # problem with clang_profiling.cc on Windows. The TODO here is to force # coverage for this specific file on ALL platforms, if it turns out to fix diff --git a/build/config/siso/configure_siso.py b/build/config/siso/configure_siso.py index bcf79ca750..032fb23270 100755 --- a/build/config/siso/configure_siso.py +++ b/build/config/siso/configure_siso.py @@ -10,12 +10,39 @@ import sys THIS_DIR = os.path.abspath(os.path.dirname(__file__)) +SISO_PROJECT_CFG = "SISO_PROJECT" +SISO_ENV = os.path.join(THIS_DIR, ".sisoenv") + + +def ReadConfig(): + entries = {} + if not os.path.isfile(SISO_ENV): + print('The .sisoenv file has not been generated yet') + return entries + with open(SISO_ENV, 'r') as f: + for line in f: + parts = line.strip().split('=') + if len(parts) > 1: + entries[parts[0].strip()] = parts[1].strip() + return entries + def main(): parser = argparse.ArgumentParser(description="configure siso") parser.add_argument("--rbe_instance", help="RBE instance to use for Siso") + parser.add_argument("--get-siso-project", + help="Print the currently configured siso project to " + "stdout", + action="store_true") args = parser.parse_args() + if args.get_siso_project: + config = ReadConfig() + if not SISO_PROJECT_CFG in config: + return 1 + print(config[SISO_PROJECT_CFG]) + return 0 + project = None rbe_instance = args.rbe_instance if rbe_instance: @@ -24,10 +51,9 @@ def main(): project = elems[1] rbe_instance = elems[-1] - siso_env_path = os.path.join(THIS_DIR, ".sisoenv") - with open(siso_env_path, "w") as f: + with open(SISO_ENV, "w") as f: if project: - f.write("SISO_PROJECT=%s\n" % project) + f.write("%s=%s\n" % (SISO_PROJECT_CFG, project)) if rbe_instance: f.write("SISO_REAPI_INSTANCE=%s\n" % rbe_instance) return 0 diff --git a/build/config/siso/main.star b/build/config/siso/main.star index 3163973609..ed96f857dc 100644 --- a/build/config/siso/main.star +++ b/build/config/siso/main.star @@ -259,10 +259,29 @@ def __use_large_b289968566(ctx, step_config): "./obj/content/browser/browser/storage_partition_impl.o", "./obj/third_party/blink/renderer/core/core/local_frame_view.o", "./obj/third_party/blink/renderer/core/core_hot/document.o", + # Fallback happens with the following args.gn + # (android-build-perf-developer) + # is_component_build = true + # is_debug = true + # symbol_level = 2 + # target_cpu = "arm64" + # target_os = "android" + # use_siso = true + "./obj/third_party/sentencepiece/sentencepiece/unicode_script.o", ] if runtime.os == "windows": exit137_list = [obj.removesuffix(".o") + ".obj" for obj in exit137_list if obj.startswith("./obj/")] + # Fallback happens with the following args.gn + # (win-build-perf-developer) + # is_component_build = true + # is_debug = true + # symbol_level = 2 + # use_siso = true + exit137_list.extend([ + "./obj/third_party/blink/renderer/core/core/local_frame.obj", + ]) + new_rules = [] for rule in step_config["rules"]: if not rule["name"].endswith("/cxx"): diff --git a/build/config/siso/reproxy.star b/build/config/siso/reproxy.star index 5e0b374706..b670a5fd6d 100644 --- a/build/config/siso/reproxy.star +++ b/build/config/siso/reproxy.star @@ -7,6 +7,7 @@ load("@builtin//encoding.star", "json") load("@builtin//lib/gn.star", "gn") load("@builtin//path.star", "path") +load("@builtin//runtime.star", "runtime") load("@builtin//struct.star", "module") load("./clang_code_coverage_wrapper.star", "clang_code_coverage_wrapper") load("./config.star", "config") @@ -32,7 +33,7 @@ def __parse_rewrapper_cmdline(ctx, cmd): wrapped_command_pos = -1 cfg_file = None skip = "" - rw_ops = {} + rw_cmd_opts = {} for i, arg in enumerate(cmd.args): if i == 0: continue @@ -40,7 +41,7 @@ def __parse_rewrapper_cmdline(ctx, cmd): cfg_file = ctx.fs.canonpath(arg.removeprefix("-cfg=")) continue if arg.startswith("-inputs=") or skip == "-inputs": - rw_ops["inputs"] = arg.removeprefix("-inputs=").split(",") + rw_cmd_opts["inputs"] = arg.removeprefix("-inputs=").split(",") skip = "" continue if arg == "-inputs": @@ -50,14 +51,24 @@ def __parse_rewrapper_cmdline(ctx, cmd): wrapped_command_pos = i break if wrapped_command_pos < 1: - fail("couldn't find first non-arg passed to rewrapper for %s" % str(cmd.args)) + fail("couldn't find first non-arg passed to rewrapper from %s" % str(cmd.args)) if not cfg_file: - return cmd.args[wrapped_command_pos:], rw_ops, True - rw_cfg_opts = rewrapper_cfg.parse(ctx, cfg_file) + fail("couldn't find rewrapper cfg file from %s" % str(cmd.args)) - # Command line options have higher priority than the ones in the cfg file. - rw_cfg_opts.update(rw_ops) - return cmd.args[wrapped_command_pos:], rw_cfg_opts, True + # Config options are the lowest prioity. + rw_opts = rewrapper_cfg.parse(ctx, cfg_file) + + # TODO: Read RBE_* envvars. + if runtime.os == "windows": + # Experimenting if longer timeouts resolve slow Windows developer builds. b/335525655 + rw_opts.update({ + "exec_timeout": "4m", + "reclient_timeout": "8m", + }) + + # Command line options are the highest priority. + rw_opts.update(rw_cmd_opts) + return cmd.args[wrapped_command_pos:], rw_opts, True def __parse_cros_rewrapper_cmdline(ctx, cmd): # fix cros sdk clang command line and extract rewrapper cfg. diff --git a/build/config/unsafe_buffers_paths.txt b/build/config/unsafe_buffers_paths.txt index b7319dcb74..0c576c7e62 100644 --- a/build/config/unsafe_buffers_paths.txt +++ b/build/config/unsafe_buffers_paths.txt @@ -25,9 +25,9 @@ # the `+` line takes precedence and the file will be checked. # # To opt individual files out of checks, place `#pragma allow_unsafe_buffers` -# anywhere in the (source or header) file. These pragmas represent the -# technical debt and security risk present in the file through unsafe -# pointer usage. +# anywhere in the (source or header) file, guarded by +# `#ifdef UNSAFE_BUFFERS_BUILD`. These pragmas represent the technical debt and +# security risk present in the file through unsafe pointer usage. # # *** # Recommended process for removing a `-dir/` line from this file: @@ -37,7 +37,13 @@ # like `-dir/sub_dir/`. # 2. Add `#pragma allow_unsafe_buffers` to every file in the directory that now # has a compilation error, with a TODO to the tracking bug for the -# directory. +# directory: +# ``` +# #ifdef UNSAFE_BUFFERS_BUILD +# // TODO(crbug.com/ABC): Remove this and convert code to safer constructs. +# #pragma allow_unsafe_buffers +# #endif +# ``` # 3. Work through the files in the directory, converting pointers to spans, or # to owning containers like HeapArray and vector. Remove the pragmas from # the files when there is no unsafe pointer usage left in each one. @@ -47,14 +53,8 @@ -android_webview/ -apps/ -ash/ - --base/ -+base/containers/buffer_iterator_nocompile.nc -+base/containers/span.h -+base/strings/cstring_view -+base/unsafe_buffers_unittest.cc -+base/unsafe_buffers_nocompile.nc - +-base/allocator +-base/third_party -build/ -build_overrides/ -buildtools/ diff --git a/build/config/win/BUILD.gn b/build/config/win/BUILD.gn index 7b43e84646..9ecf8abdcd 100644 --- a/build/config/win/BUILD.gn +++ b/build/config/win/BUILD.gn @@ -415,6 +415,7 @@ config("delayloads") { "/DELAYLOAD:api-ms-win-core-winrt-l1-1-0.dll", "/DELAYLOAD:api-ms-win-core-winrt-string-l1-1-0.dll", "/DELAYLOAD:advapi32.dll", + "/DELAYLOAD:bcryptprimitives.dll", "/DELAYLOAD:comctl32.dll", "/DELAYLOAD:comdlg32.dll", "/DELAYLOAD:credui.dll", @@ -510,8 +511,9 @@ config("release_crt") { if (is_component_build) { cflags = [ "/MD" ] - # The - in front of crt-static turns the feature off. - rustflags = [ "-Ctarget-feature=-crt-static" ] + # /MD specifies msvcrt.lib as the CRT library, which is the dynamic+release + # version. Rust needs to agree, and its default mode is dynamic+release, so + # we do nothing here. See https://github.com/rust-lang/rust/issues/39016. if (use_custom_libcxx) { # On Windows, including libcpmt[d]/msvcprt[d] explicitly links the C++ @@ -520,6 +522,10 @@ config("release_crt") { } } else { cflags = [ "/MT" ] + + # /MT specifies libcmt.lib as the CRT library, which is the static+release + # version. Rust needs to agree, so we tell it to use the static+release CRT + # as well. See https://github.com/rust-lang/rust/issues/39016. rustflags = [ "-Ctarget-feature=+crt-static" ] if (use_custom_libcxx) { @@ -533,18 +539,13 @@ config("dynamic_crt") { # This pulls in the DLL debug CRT and defines _DEBUG cflags = [ "/MDd" ] - # /MDd specifies msvcrtd.lib as the CRT library. Rust needs to agree, so - # we specify it explicitly. - # Once https://github.com/rust-lang/rust/issues/39016 is resolved we should - # instead tell rustc which CRT to use (static/dynamic + release/debug). We - # can't support prebuilt stdlib in this path until then. - rustflags = [ "-Clink-arg=msvcrtd.lib" ] - - # Disable libraries rustc links implicitly; - # see https://github.com/rust-lang/rust/pull/122268 - rustflags += [ - "-Clink-arg=/nodefaultlib:libcmt.lib", + # /MDd specifies msvcrtd.lib as the CRT library. Rust needs to agree, so we + # specify it explicitly. Rust defaults to the dynamic+release library, which + # we remove here, and then replace. See + # https://github.com/rust-lang/rust/issues/39016. + rustflags = [ "-Clink-arg=/nodefaultlib:msvcrt.lib", + "-Clink-arg=msvcrtd.lib", ] if (use_custom_libcxx) { @@ -553,8 +554,9 @@ config("dynamic_crt") { } else { cflags = [ "/MD" ] - # The - in front of crt-static turns the feature off. - rustflags = [ "-Ctarget-feature=-crt-static" ] + # /MD specifies msvcrt.lib as the CRT library, which is the dynamic+release + # version. Rust needs to agree, and its default mode is dynamic+release, so + # we do nothing here. See https://github.com/rust-lang/rust/issues/39016. if (use_custom_libcxx) { ldflags = [ "/DEFAULTLIB:msvcprt.lib" ] @@ -567,18 +569,14 @@ config("static_crt") { # This pulls in the static debug CRT and defines _DEBUG cflags = [ "/MTd" ] - # /MTd specifies libcmtd.lib as the CRT library. Rust needs to agree, so - # we specify it explicitly. - # Once https://github.com/rust-lang/rust/issues/39016 is resolved we should - # instead tell rustc which CRT to use (static/dynamic + release/debug). We - # can't support prebuilt stdlib in this path until then. - rustflags = [ "-Clink-arg=libcmtd.lib" ] - - # Disable libraries rustc links implicitly; - # see https://github.com/rust-lang/rust/pull/122268 - rustflags += [ + # /MTd specifies libcmtd.lib as the CRT library. Rust needs to agree, so we + # specify it explicitly. We tell Rust that we're using the static CRT but + # remove the release library that it chooses, and replace with the debug + # library. See https://github.com/rust-lang/rust/issues/39016. + rustflags = [ + "-Ctarget-feature=+crt-static", "-Clink-arg=/nodefaultlib:libcmt.lib", - "-Clink-arg=/nodefaultlib:msvcrt.lib", + "-Clink-arg=libcmtd.lib", ] if (use_custom_libcxx) { @@ -586,6 +584,10 @@ config("static_crt") { } } else { cflags = [ "/MT" ] + + # /MT specifies libcmt.lib as the CRT library, which is the static+release + # version. Rust needs to agree, so we tell it to use the static+release CRT + # as well. See https://github.com/rust-lang/rust/issues/39016. rustflags = [ "-Ctarget-feature=+crt-static" ] if (use_custom_libcxx) { diff --git a/build/fuchsia/binary_size_differ_test.py b/build/fuchsia/binary_size_differ_test.py index 6192bf2d65..162194ab81 100755 --- a/build/fuchsia/binary_size_differ_test.py +++ b/build/fuchsia/binary_size_differ_test.py @@ -64,7 +64,7 @@ class BinarySizeDifferTest(unittest.TestCase): packages[name] = new_package def testComputePackageDiffs(self): - # TODO(1309977): Disabled on Windows because Windows doesn't allow opening a + # TODO(crbug.com/40219667): Disabled on Windows because Windows doesn't allow opening a # NamedTemporaryFile by name. if os.name == 'nt': return diff --git a/build/fuchsia/binary_sizes_test.py b/build/fuchsia/binary_sizes_test.py index 2f9dcf2177..0efce9d79a 100755 --- a/build/fuchsia/binary_sizes_test.py +++ b/build/fuchsia/binary_sizes_test.py @@ -61,7 +61,7 @@ class TestBinarySizes(unittest.TestCase): def testReadAndWritePackageBlobs(self): - # TODO(1309977): Disabled on Windows because Windows doesn't allow opening a + # TODO(crbug.com/40219667): Disabled on Windows because Windows doesn't allow opening a # NamedTemporaryFile by name. if os.name == 'nt': return @@ -82,7 +82,7 @@ class TestBinarySizes(unittest.TestCase): os.remove(tmp_package_file.name) def testReadAndWritePackageSizes(self): - # TODO(1309977): Disabled on Windows because Windows doesn't allow opening a + # TODO(crbug.com/40219667): Disabled on Windows because Windows doesn't allow opening a # NamedTemporaryFile by name. if os.name == 'nt': return @@ -101,7 +101,7 @@ class TestBinarySizes(unittest.TestCase): self.assertIn('web_engine', new_sizes) def testGetPackageSizesUsesBlobMerklesForCount(self): - # TODO(1309977): Disabled on Windows because Windows doesn't allow opening a + # TODO(crbug.com/40219667): Disabled on Windows because Windows doesn't allow opening a # NamedTemporaryFile by name. if os.name == 'nt': return diff --git a/build/fuchsia/test/compatible_utils.py b/build/fuchsia/test/compatible_utils.py index 46db6d4bab..0c2a0abd63 100644 --- a/build/fuchsia/test/compatible_utils.py +++ b/build/fuchsia/test/compatible_utils.py @@ -125,7 +125,7 @@ def map_filter_file_to_package_file(filter_file: str) -> str: return '/pkg/' + filter_file[filter_file.index(_FILTER_DIR):] -# TODO(crbug.com/1496426): Rename to get_product_version. +# TODO(crbug.com/40938340): Rename to get_product_version. def get_sdk_hash(system_image_dir: str) -> Tuple[str, str]: """Read version of hash in pre-installed package directory. Returns: diff --git a/build/fuchsia/test/serial_boot_device.py b/build/fuchsia/test/serial_boot_device.py index b4e04c7908..a48b51d96d 100755 --- a/build/fuchsia/test/serial_boot_device.py +++ b/build/fuchsia/test/serial_boot_device.py @@ -55,7 +55,7 @@ def boot_device(node_id: str, dependencies like serialio (for serial access) and fastboot, or the device cannot be found may also introduce the error. """ - #TODO(crbug.com/1490434): Remove the default values once the use in + #TODO(crbug.com/40935296): Remove the default values once the use in # flash_device has been migrated. if node_id is None: node_id = os.getenv('FUCHSIA_NODENAME') @@ -286,11 +286,11 @@ def main(action: str) -> int: logging.error('Cannot find fastboot serial number %s', serial_num) return 1 if action == 'server-version': - # TODO(crbug.com/1490434): Implement the server-version. + # TODO(crbug.com/40935296): Implement the server-version. print('chromium') return 0 if action == 'before-task': - # TODO(crbug.com/1490434): fuchsia.py requires IMAGE_MANIFEST_PATH and + # TODO(crbug.com/40935296): fuchsia.py requires IMAGE_MANIFEST_PATH and # BOOTSERVER_PATH to support before-task call. So the following # statement does not work as it should be. _shutdown_if_serial_is_unavailable(node_id) diff --git a/build/fuchsia/update_images.py b/build/fuchsia/update_images.py index 69a26db2af..f510fd2225 100755 --- a/build/fuchsia/update_images.py +++ b/build/fuchsia/update_images.py @@ -8,7 +8,7 @@ '-release' at the end of the image gcs file name to eliminate the difference between product bundle v2 and gce files.""" -# TODO(crbug.com/1496426): Remove this file. +# TODO(crbug.com/40938340): Remove this file. import argparse import itertools diff --git a/build/fuchsia/update_images_test.py b/build/fuchsia/update_images_test.py index 430c4bc11a..d16f870ace 100755 --- a/build/fuchsia/update_images_test.py +++ b/build/fuchsia/update_images_test.py @@ -3,7 +3,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -# TODO(crbug.com/1496426): Remove this file. +# TODO(crbug.com/40938340): Remove this file. import unittest from unittest import mock diff --git a/build/fuchsia/update_product_bundles.py b/build/fuchsia/update_product_bundles.py index f322f2f757..c771370c6a 100755 --- a/build/fuchsia/update_product_bundles.py +++ b/build/fuchsia/update_product_bundles.py @@ -20,16 +20,14 @@ import update_sdk from compatible_utils import running_unattended -# TODO(crbug/1361089): Remove when the old scripts have been deprecated. +# TODO(crbug.com/40863468): Remove when the old scripts have been deprecated. _IMAGE_TO_PRODUCT_BUNDLE = { - 'qemu.arm64': - 'terminal.qemu-arm64', - 'qemu.x64': - 'terminal.x64', + 'qemu.arm64': 'terminal.qemu-arm64', + 'qemu.x64': 'terminal.x64', } -# TODO(crbug/1361089): Remove when the old scripts have been deprecated. +# TODO(crbug.com/40863468): Remove when the old scripts have been deprecated. def convert_to_products(images_list): """Convert image names in the SDK to product bundle names.""" @@ -171,7 +169,7 @@ def main(): # src-internal. Likely we can download two copies for a smooth # transition, but it would be easier to keep it as-is during the ffx # product v2 migration. - # TODO(crbug.com/1496426): Migrate the image download folder away from the + # TODO(crbug.com/40938340): Migrate the image download folder away from the # following hack. prod, board = board + '-release', prod if args.internal: diff --git a/build/install-build-deps.py b/build/install-build-deps.py index 4d954122f6..b321fffec0 100755 --- a/build/install-build-deps.py +++ b/build/install-build-deps.py @@ -377,8 +377,8 @@ def lib_list(): "libxrender1", "libxtst6", "x11-utils", - "xserver-xorg-core", # TODO(crbug.com/1417069): Experimental. - "xserver-xorg-video-dummy", # TODO(crbug.com/1417069): Experimental. + "xserver-xorg-core", # TODO(crbug.com/40257169): Experimental. + "xserver-xorg-video-dummy", # TODO(crbug.com/40257169): Experimental. "xvfb", "zlib1g", ] diff --git a/build/ios/update_bundle_filelist.py b/build/ios/update_bundle_filelist.py index 2e21205c30..f8d8f12cc3 100755 --- a/build/ios/update_bundle_filelist.py +++ b/build/ios/update_bundle_filelist.py @@ -82,8 +82,13 @@ def get_git_command_name(): def get_tracked_files(directory, globroot, repository_root_relative, verbose): try: - git_cmd = get_git_command_name() - with subprocess.Popen([git_cmd, 'ls-files', '--error-unmatch', directory], + if os.getcwd().startswith('/google/cog/cloud'): + files = [] + for root, _, filenames in os.walk(directory): + files.extend([os.path.join(root, f) for f in filenames]) + return set(files) + cmd = [get_git_command_name(), 'ls-files', '--error-unmatch', directory] + with subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=globroot) as p: diff --git a/build/rust/rs_bindings_from_cc.gni b/build/rust/rs_bindings_from_cc.gni index 463bd6136f..54775ea111 100644 --- a/build/rust/rs_bindings_from_cc.gni +++ b/build/rust/rs_bindings_from_cc.gni @@ -31,7 +31,7 @@ import("//build/rust/mixed_static_library.gni") # `bindings_target`, because typically only a *subset* of headers provides # the *public* API that bindings are needed for. # -# TODO(crbug.com/1329611): Internal headers should still to be included in +# TODO(crbug.com/40226863): Internal headers should still to be included in # the targets_and_args metadata... # # deps: @@ -139,7 +139,7 @@ template("rs_bindings_from_cc") { # Optional parameter: deps. # - # TODO(crbug.com/1329611): Can we somehow assert that `_deps` only contains + # TODO(crbug.com/40226863): Can we somehow assert that `_deps` only contains # some "..._rs_api" targets crated via # `mixed_static_library($_lib_target_name)` below? foreach(dep, _deps) { # assert something } diff --git a/build/rust/run_rs_bindings_from_cc.py b/build/rust/run_rs_bindings_from_cc.py index bf3dd13ff3..41c2228ad9 100755 --- a/build/rust/run_rs_bindings_from_cc.py +++ b/build/rust/run_rs_bindings_from_cc.py @@ -103,7 +103,7 @@ def main(): # error: unable to find plugin 'find-bad-constructs' clang_args = [] clang_args.extend(filter_clang_args(args.clang_args)) - # TODO(crbug.com/1329611): This warning needs to be suppressed, because + # TODO(crbug.com/40226863): This warning needs to be suppressed, because # otherwise Crubit/Clang complains as follows: # error: .../third_party/rust-toolchain/bin/rs_bindings_from_cc: # 'linker' input unused [-Werror,-Wunused-command-line-argument] @@ -118,7 +118,7 @@ def main(): pretty_cmdline = format_cmdline(cmdline) print(f"CRUBIT_DEBUG: CMDLINE: {pretty_cmdline}", file=sys.stderr) - # TODO(crbug.com/1329611): run_bindgen.py removes the outputs when the tool + # TODO(crbug.com/40226863): run_bindgen.py removes the outputs when the tool # fails. Maybe we need to do something similar here? OTOH in most failure # modes Crubit will fail *before* generating its outputs... return subprocess.run(cmdline).returncode diff --git a/build/rust/rust_target.gni b/build/rust/rust_target.gni index 439a8e98ef..1ca1af2d91 100644 --- a/build/rust/rust_target.gni +++ b/build/rust/rust_target.gni @@ -199,7 +199,7 @@ template("rust_target") { # not a requirement for rustc. The reason is to ensure that tools # such as `gn deps` give the correct answer, and thus we trigger # the right test suites etc. on code change. - # TODO(crbug.com/1256930) - verify this is correct + # TODO(crbug.com/40200431) - verify this is correct assert(defined(invoker.sources), "sources must be listed") if (invoker.target_type == "rust_proc_macro" && diff --git a/build/rust/rust_unit_test.gni b/build/rust/rust_unit_test.gni index 4e108677b5..b6cf3b2181 100644 --- a/build/rust/rust_unit_test.gni +++ b/build/rust/rust_unit_test.gni @@ -69,7 +69,7 @@ template("rust_unit_test") { # not a requirement for rustc. The reason is to ensure that tools # such as `gn deps` give the correct answer, and thus we trigger # the right test suites etc. on code change. - # TODO(crbug.com/1256930) - verify this is correct + # TODO(crbug.com/40200431) - verify this is correct assert(defined(invoker.sources), "sources must be listed") _exe_target_name = target_name + "_exe" diff --git a/build/rust/std/BUILD.gn b/build/rust/std/BUILD.gn index b6d570d3b8..86fb3da8d4 100644 --- a/build/rust/std/BUILD.gn +++ b/build/rust/std/BUILD.gn @@ -26,7 +26,7 @@ if (toolchain_has_rust) { sources = [ # `alias.*`, `compiler_specific.h`, and `immediate_crash.*` have been # copied from `//base`. - # TODO(https://crbug.com/1475734): Avoid duplication / reuse code. + # TODO(crbug.com/40279749): Avoid duplication / reuse code. "alias.cc", "alias.h", "compiler_specific.h", @@ -97,7 +97,7 @@ if (toolchain_has_rust) { ] config("stdlib_dependent_libs") { - # TODO(crbug.com/1434092): These should really be `libs`, however that + # TODO(crbug.com/40264561): These should really be `libs`, however that # breaks. Normally, we specify lib files with the `.lib` suffix but # then when rustc links an EXE, it invokes lld-link with `.lib.lib` # instead. @@ -116,7 +116,7 @@ if (toolchain_has_rust) { } } config("stdlib_public_dependent_libs") { - # TODO(crbug.com/1434092): These should really be `libs`, however that + # TODO(crbug.com/40264561): These should really be `libs`, however that # breaks. Normally, we specify lib files with the `.lib` suffix but # then when rustc links an EXE, it invokes lld-link with `.lib.lib` # instead. diff --git a/build/rust/std/alias.cc b/build/rust/std/alias.cc index f0ea031157..42febac3ed 100644 --- a/build/rust/std/alias.cc +++ b/build/rust/std/alias.cc @@ -5,7 +5,7 @@ // This file has been copied from //base/debug/alias.cc ( additionally the APIs // were moved into the `build_rust_std` namespace). // -// TODO(https://crbug.com/1475734): Avoid code duplication / reuse code. +// TODO(crbug.com/40279749): Avoid code duplication / reuse code. #include "build/rust/std/alias.h" diff --git a/build/rust/std/alias.h b/build/rust/std/alias.h index 068e440b4f..0eaba67661 100644 --- a/build/rust/std/alias.h +++ b/build/rust/std/alias.h @@ -6,7 +6,7 @@ // the APIs / macros needed by //build/rust/std; additionally the APIs were // moved into the `build_rust_std` namespace). // -// TODO(https://crbug.com/1475734): Avoid code duplication / reuse code. +// TODO(crbug.com/40279749): Avoid code duplication / reuse code. #ifndef BUILD_RUST_STD_ALIAS_H_ #define BUILD_RUST_STD_ALIAS_H_ diff --git a/build/rust/std/compiler_specific.h b/build/rust/std/compiler_specific.h index 47c3e29926..ea79a7a8dc 100644 --- a/build/rust/std/compiler_specific.h +++ b/build/rust/std/compiler_specific.h @@ -5,7 +5,7 @@ // This file has been copied from //base/compiler_specific.h (and then // significantly trimmed to just the APIs / macros needed by //build/rust/std). // -// TODO(https://crbug.com/1475734): Avoid code duplication / reuse code. +// TODO(crbug.com/40279749): Avoid code duplication / reuse code. #ifndef BUILD_RUST_STD_COMPILER_SPECIFIC_H_ #define BUILD_RUST_STD_COMPILER_SPECIFIC_H_ diff --git a/build/rust/std/gnrt_config.toml b/build/rust/std/gnrt_config.toml index 44f727a0a7..537a5feeed 100644 --- a/build/rust/std/gnrt_config.toml +++ b/build/rust/std/gnrt_config.toml @@ -64,9 +64,7 @@ remove_deps = ['allocator-api2'] [crate.libc] # This target is #[no_core] when included by std, which is incompatible with # profiling. -# -# Suppress link directives since we specify the deps in GN configs. -extra_kv = { include_coverage = false, no_link_directives = true } +extra_kv = { include_coverage = false } [crate.profiler_builtins] # The build script is used to compile a profiler-rt library, but we get diff --git a/build/rust/std/immediate_crash.h b/build/rust/std/immediate_crash.h index 7c13eb6ae4..e4fd5a09d9 100644 --- a/build/rust/std/immediate_crash.h +++ b/build/rust/std/immediate_crash.h @@ -3,7 +3,7 @@ // found in the LICENSE file. // This file has been copied from //base/immediate_crash.h. -// TODO(https://crbug.com/1475734): Avoid code duplication / reuse code. +// TODO(crbug.com/40279749): Avoid code duplication / reuse code. #ifndef BUILD_RUST_STD_IMMEDIATE_CRASH_H_ #define BUILD_RUST_STD_IMMEDIATE_CRASH_H_ @@ -52,7 +52,7 @@ #elif defined(ARCH_CPU_X86_FAMILY) -// TODO(https://crbug.com/958675): In theory, it should be possible to use just +// TODO(crbug.com/40625592): In theory, it should be possible to use just // int3. However, there are a number of crashes with SIGILL as the exception // code, so it seems likely that there's a signal handler that allows execution // to continue after SIGTRAP. @@ -72,14 +72,14 @@ // as a 32 bit userspace app on arm64. There doesn't seem to be any way to // cause a SIGTRAP from userspace without using a syscall (which would be a // problem for sandboxing). -// TODO(https://crbug.com/958675): Remove bkpt from this sequence. +// TODO(crbug.com/40625592): Remove bkpt from this sequence. #define TRAP_SEQUENCE1_() asm volatile("bkpt #0") #define TRAP_SEQUENCE2_() asm volatile("udf #0") #elif defined(ARCH_CPU_ARM64) // This will always generate a SIGTRAP on arm64. -// TODO(https://crbug.com/958675): Remove brk from this sequence. +// TODO(crbug.com/40625592): Remove brk from this sequence. #define TRAP_SEQUENCE1_() asm volatile("brk #0") #define TRAP_SEQUENCE2_() asm volatile("hlt #0") diff --git a/build/rust/std/rules/BUILD.gn b/build/rust/std/rules/BUILD.gn index 96072f9fc7..bfb2fd4337 100644 --- a/build/rust/std/rules/BUILD.gn +++ b/build/rust/std/rules/BUILD.gn @@ -262,175 +262,176 @@ cargo_crate("cfg_if") { } cargo_crate("compiler_builtins") { crate_type = "rlib" - crate_root = "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/lib.rs" + crate_root = "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/lib.rs" sources = [ - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/aarch64.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/aarch64_linux.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/arm.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/arm_linux.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/float/add.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/float/cmp.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/float/conv.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/float/div.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/float/extend.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/float/mod.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/float/mul.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/float/pow.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/float/sub.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/float/trunc.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/hexagon.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/int/addsub.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/int/leading_zeros.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/int/mod.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/int/mul.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/int/sdiv.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/int/shift.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/int/specialized_div_rem/asymmetric.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/int/specialized_div_rem/binary_long.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/int/specialized_div_rem/delegate.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/int/specialized_div_rem/mod.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/int/specialized_div_rem/norm_shift.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/int/specialized_div_rem/trifecta.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/int/udiv.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/lib.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/macros.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/math.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/mem/impls.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/mem/mod.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/mem/x86_64.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/probestack.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/riscv.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/x86.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/x86_64.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/aarch64.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/aarch64_linux.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/arm.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/arm_linux.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/float/add.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/float/cmp.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/float/conv.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/float/div.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/float/extend.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/float/mod.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/float/mul.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/float/pow.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/float/sub.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/float/trunc.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/hexagon.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/int/addsub.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/int/leading_zeros.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/int/mod.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/int/mul.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/int/sdiv.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/int/shift.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/int/specialized_div_rem/asymmetric.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/int/specialized_div_rem/binary_long.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/int/specialized_div_rem/delegate.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/int/specialized_div_rem/mod.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/int/specialized_div_rem/norm_shift.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/int/specialized_div_rem/trifecta.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/int/udiv.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/lib.miri.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/lib.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/macros.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/math.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/mem/impls.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/mem/mod.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/mem/x86_64.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/probestack.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/riscv.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/x86.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/x86_64.rs", ] inputs = [ - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/acos.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/acosf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/acosh.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/acoshf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/asin.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/asinf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/asinh.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/asinhf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/atan.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/atan2.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/atan2f.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/atanf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/atanh.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/atanhf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/cbrt.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/cbrtf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/ceil.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/ceilf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/copysign.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/copysignf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/cos.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/cosf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/cosh.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/coshf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/erf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/erff.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/exp.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/exp10.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/exp10f.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/exp2.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/exp2f.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/expf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/expm1.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/expm1f.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/expo2.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/fabs.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/fabsf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/fdim.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/fdimf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/fenv.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/floor.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/floorf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/fma.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/fmaf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/fmax.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/fmaxf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/fmin.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/fminf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/fmod.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/fmodf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/frexp.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/frexpf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/hypot.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/hypotf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/ilogb.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/ilogbf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/j0.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/j0f.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/j1.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/j1f.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/jn.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/jnf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/k_cos.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/k_cosf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/k_expo2.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/k_expo2f.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/k_sin.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/k_sinf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/k_tan.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/k_tanf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/ldexp.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/ldexpf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/lgamma.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/lgamma_r.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/lgammaf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/lgammaf_r.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/log.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/log10.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/log10f.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/log1p.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/log1pf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/log2.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/log2f.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/logf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/mod.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/modf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/modff.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/nextafter.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/nextafterf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/pow.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/powf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/rem_pio2.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/rem_pio2_large.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/rem_pio2f.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/remainder.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/remainderf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/remquo.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/remquof.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/rint.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/rintf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/round.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/roundf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/scalbn.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/scalbnf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/sin.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/sincos.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/sincosf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/sinf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/sinh.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/sinhf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/sqrt.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/sqrtf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/tan.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/tanf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/tanh.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/tanhf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/tgamma.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/tgammaf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/trunc.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/src/../libm/src/math/truncf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/acos.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/acosf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/acosh.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/acoshf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/asin.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/asinf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/asinh.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/asinhf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/atan.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/atan2.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/atan2f.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/atanf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/atanh.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/atanhf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/cbrt.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/cbrtf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/ceil.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/ceilf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/copysign.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/copysignf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/cos.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/cosf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/cosh.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/coshf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/erf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/erff.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/exp.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/exp10.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/exp10f.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/exp2.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/exp2f.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/expf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/expm1.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/expm1f.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/expo2.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/fabs.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/fabsf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/fdim.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/fdimf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/fenv.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/floor.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/floorf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/fma.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/fmaf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/fmax.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/fmaxf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/fmin.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/fminf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/fmod.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/fmodf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/frexp.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/frexpf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/hypot.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/hypotf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/ilogb.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/ilogbf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/j0.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/j0f.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/j1.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/j1f.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/jn.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/jnf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/k_cos.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/k_cosf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/k_expo2.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/k_expo2f.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/k_sin.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/k_sinf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/k_tan.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/k_tanf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/ldexp.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/ldexpf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/lgamma.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/lgamma_r.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/lgammaf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/lgammaf_r.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/log.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/log10.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/log10f.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/log1p.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/log1pf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/log2.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/log2f.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/logf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/mod.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/modf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/modff.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/nextafter.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/nextafterf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/pow.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/powf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/rem_pio2.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/rem_pio2_large.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/rem_pio2f.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/remainder.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/remainderf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/remquo.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/remquof.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/rint.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/rintf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/round.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/roundf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/scalbn.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/scalbnf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/sin.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/sincos.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/sincosf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/sinf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/sinh.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/sinhf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/sqrt.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/sqrtf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/tan.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/tanf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/tanh.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/tanhf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/tgamma.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/tgammaf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/trunc.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/src/../libm/src/math/truncf.rs", ] no_std = true # Unit tests skipped. Generate with --with-tests to include them. build_native_rust_unit_tests = false edition = "2018" - cargo_pkg_version = "0.1.108" + cargo_pkg_version = "0.1.109" cargo_pkg_authors = "Jorge Aparicio <japaricious@gmail.com>" cargo_pkg_name = "compiler_builtins" cargo_pkg_description = "Compiler intrinsics used by the Rust compiler. Also available for other targets if necessary!" @@ -454,8 +455,8 @@ cargo_crate("compiler_builtins") { "rustc-dep-of-std", "weak-intrinsics", ] - build_root = "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/build.rs" - build_sources = [ "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.108/build.rs" ] + build_root = "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/build.rs" + build_sources = [ "//third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-0.1.109/build.rs" ] rustenv = [ "CFG_DISABLE_UNSTABLE_FEATURES=0", "STD_ENV_ARCH=$rust_target_arch", @@ -516,6 +517,7 @@ cargo_crate("core") { "//third_party/rust-toolchain/lib/rustlib/src/rust/library/core/src/fmt/nofloat.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/core/src/fmt/num.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/core/src/fmt/rt.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/core/src/future/async_drop.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/core/src/future/future.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/core/src/future/into_future.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/core/src/future/join.rs", @@ -1441,7 +1443,6 @@ cargo_crate("libc") { rustflags = [ "--cfg=backtrace_in_libstd", "-Zforce-unstable-if-unmarked", - "-Zlink-directives=false", ] output_dir = "$root_out_dir/local_rustc_sysroot/lib/rustlib/$rust_abi_target/lib/" @@ -1742,10 +1743,12 @@ cargo_crate("panic_abort") { ":cfg_if", ":compiler_builtins", ":core", - ":libc", "//build/rust/std:profiler_builtins_group", "//build/rust/std:std_build_deps", ] + if (!is_win) { + deps += [ ":libc" ] + } rustenv = [ "CFG_DISABLE_UNSTABLE_FEATURES=0", "STD_ENV_ARCH=$rust_target_arch", @@ -1787,11 +1790,13 @@ cargo_crate("panic_unwind") { ":cfg_if", ":compiler_builtins", ":core", - ":libc", ":unwind", "//build/rust/std:profiler_builtins_group", "//build/rust/std:std_build_deps", ] + if (!is_win) { + deps += [ ":libc" ] + } rustenv = [ "CFG_DISABLE_UNSTABLE_FEATURES=0", "STD_ENV_ARCH=$rust_target_arch", @@ -2354,6 +2359,7 @@ cargo_crate("std") { "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/sgx/args.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/sgx/env.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/sgx/fd.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/sgx/libunwind_integration.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/sgx/mod.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/sgx/net.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/sgx/os.rs", @@ -2571,12 +2577,8 @@ cargo_crate("std") { "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/sync/rwlock/mod.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/sync/rwlock/no_threads.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/sync/rwlock/queue.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/sync/rwlock/sgx.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/sync/rwlock/sgx/tests.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/sync/rwlock/solid.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/sync/rwlock/teeos.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/sync/rwlock/windows7.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/sync/rwlock/xous.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/thread_local/fast_local.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/thread_local/mod.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/thread_local/os_local.rs", @@ -2590,7 +2592,6 @@ cargo_crate("std") { "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys_common/net/tests.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys_common/process.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys_common/tests.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys_common/thread.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys_common/thread_local_dtor.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys_common/thread_local_key.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys_common/thread_local_key/tests.rs", @@ -2687,7 +2688,6 @@ cargo_crate("std") { ":compiler_builtins", ":core", ":hashbrown", - ":libc", ":panic_abort", ":panic_unwind", ":rustc_demangle", @@ -2699,6 +2699,7 @@ cargo_crate("std") { if (!is_win) { deps += [ ":addr2line", + ":libc", ":miniz_oxide", ":object", ] @@ -2789,12 +2790,14 @@ cargo_crate("std_detect") { deps = [ ":cfg_if", ":compiler_builtins", - ":libc", ":rustc_std_workspace_alloc", ":rustc_std_workspace_core", "//build/rust/std:profiler_builtins_group", "//build/rust/std:std_build_deps", ] + if (!is_win) { + deps += [ ":libc" ] + } aliased_deps = { alloc = ":rustc_std_workspace_alloc" core = ":rustc_std_workspace_core" @@ -2869,13 +2872,15 @@ cargo_crate("test") { deps = [ ":core", ":getopts", - ":libc", ":panic_abort", ":panic_unwind", ":std", "//build/rust/std:profiler_builtins_group", "//build/rust/std:std_build_deps", ] + if (!is_win) { + deps += [ ":libc" ] + } rustenv = [ "CFG_DISABLE_UNSTABLE_FEATURES=0", "STD_ENV_ARCH=$rust_target_arch", @@ -2963,10 +2968,12 @@ cargo_crate("unwind") { ":cfg_if", ":compiler_builtins", ":core", - ":libc", "//build/rust/std:profiler_builtins_group", "//build/rust/std:std_build_deps", ] + if (!is_win) { + deps += [ ":libc" ] + } rustenv = [ "CFG_DISABLE_UNSTABLE_FEATURES=0", "STD_ENV_ARCH=$rust_target_arch", diff --git a/build/rust/tests/BUILD.gn b/build/rust/tests/BUILD.gn index e31ae7dfe4..b71bf98083 100644 --- a/build/rust/tests/BUILD.gn +++ b/build/rust/tests/BUILD.gn @@ -37,7 +37,7 @@ group("deps") { "//build/rust/tests/test_rust_multiple_dep_versions_exe", "//build/rust/tests/test_simple_rust_exe", - # TODO(https://crbug.com/1329611): Enable the additional target below + # TODO(crbug.com/40226863): Enable the additional target below # once `rs_bindings_from_cc` is distributed via `gclient sync`. In the # meantime see the instructions in # `//build/rust/run_rs_bindings_from_cc.py`. @@ -73,7 +73,7 @@ group("deps") { "//build/rust/tests/test_rust_multiple_dep_versions_exe/v2:test_lib_v2_unittests", "//build/rust/tests/test_rust_static_library_non_standard_arrangement:foo_tests", - # TODO(https://crbug.com/1329611): Enable the additional target below + # TODO(crbug.com/40226863): Enable the additional target below # once `rs_bindings_from_cc` is distributed via `gclient sync`. In the # meantime see the instructions in # `//build/rust/run_rs_bindings_from_cc.py`. diff --git a/build/rust/tests/test_rs_bindings_from_cc/BUILD.gn b/build/rust/tests/test_rs_bindings_from_cc/BUILD.gn index 525faa38d9..09830f7472 100644 --- a/build/rust/tests/test_rs_bindings_from_cc/BUILD.gn +++ b/build/rust/tests/test_rs_bindings_from_cc/BUILD.gn @@ -41,13 +41,13 @@ rs_bindings_from_cc("target_depending_on_another_rs_api") { # Lists public headers from `sources` of `target_depending_on_another`. # - # TODO(crbug.com/1297592): Is there something we can do (a convention?) to + # TODO(crbug.com/40215214): Is there something we can do (a convention?) to # avoid this duplication/repetition? public_headers = [ "target_depending_on_another.h" ] # Parallels `public_deps` of `target_depending_on_another` # - # TODO(crbug.com/1297592): Is there something we can do (a convention?) to + # TODO(crbug.com/40215214): Is there something we can do (a convention?) to # avoid this duplication/repetition? deps = [ ":self_contained_target_rs_api" ] } diff --git a/build/rust/tests/test_serde_json_lenient/BUILD.gn b/build/rust/tests/test_serde_json_lenient/BUILD.gn index 494528a523..83284dfb35 100644 --- a/build/rust/tests/test_serde_json_lenient/BUILD.gn +++ b/build/rust/tests/test_serde_json_lenient/BUILD.gn @@ -13,7 +13,7 @@ rust_static_library("test_serde_json_lenient_rs") { deps = [ "//third_party/rust/serde_json_lenient/v0_2:lib" ] } -# TODO(https://crbug.com/1278030) - convert to a pure- +# TODO(crbug.com/40809974) - convert to a pure- # Rust unit test when that's supported on all platforms. test("test_serde_json_lenient") { sources = [ "unittests.cc" ] diff --git a/build/sanitizers/asan_suppressions.cc b/build/sanitizers/asan_suppressions.cc index 314fc24f4a..65271e6281 100644 --- a/build/sanitizers/asan_suppressions.cc +++ b/build/sanitizers/asan_suppressions.cc @@ -20,6 +20,7 @@ char kASanDefaultSuppressions[] = "odr_violation:^object::\n" "odr_violation:^std::io::\n" "odr_violation:^std::panicking::\n" + "odr_violation:^std::thread::Builder::\n" "odr_violation:^read_fonts::tables::\n" "odr_violation:^std_detect::detect::cache::\n" diff --git a/build/toolchain/apple/toolchain.gni b/build/toolchain/apple/toolchain.gni index 0c0c8d9b11..fc4d1c7276 100644 --- a/build/toolchain/apple/toolchain.gni +++ b/build/toolchain/apple/toolchain.gni @@ -16,7 +16,7 @@ import("//build/toolchain/rbe.gni") import("//build/toolchain/toolchain.gni") import("//build_overrides/build.gni") -# TODO(crbug.com/1370527): This import is required to detect whether the +# TODO(crbug.com/40869822): This import is required to detect whether the # build is for the catalyst environment in order to disable the hermetic # swift compiler (as it does not include support for catalyst). Remove it # once the support is available. @@ -44,7 +44,7 @@ declare_args() { swift_toolchain_path = -1 } -# TODO(crbug.com/1370527): Remove this and replace with `build_with_chromium` +# TODO(crbug.com/40869822): Remove this and replace with `build_with_chromium` # once the support for catalyst is available in the hermetic swift compiler. _can_use_hermetic_swift = build_with_chromium && is_ios && target_environment != "catalyst" diff --git a/build/toolchain/clang_code_coverage_wrapper.py b/build/toolchain/clang_code_coverage_wrapper.py index 28b9539662..51653f5a2c 100755 --- a/build/toolchain/clang_code_coverage_wrapper.py +++ b/build/toolchain/clang_code_coverage_wrapper.py @@ -85,7 +85,7 @@ _COVERAGE_EXCLUSION_LIST_MAP = { '../../device/gamepad/dualshock4_controller.cc', ], 'fuchsia': [ - # TODO(crbug.com/1174725): These files caused clang to crash while + # TODO(crbug.com/40167659): These files caused clang to crash while # compiling them. '../../base/allocator/partition_allocator/src/partition_alloc/pcscan.cc', '../../third_party/skia/src/core/SkOpts.cpp', @@ -95,7 +95,7 @@ _COVERAGE_EXCLUSION_LIST_MAP = { 'linux': [ # These files caused a static initializer to be generated, which # shouldn't. - # TODO(crbug.com/990948): Remove when the bug is fixed. + # TODO(crbug.com/41474559): Remove when the bug is fixed. '../../chrome/browser/media/router/providers/cast/cast_internal_message_util.cc', #pylint: disable=line-too-long '../../components/media_router/common/providers/cast/channel/cast_channel_enum.cc', #pylint: disable=line-too-long '../../components/media_router/common/providers/cast/channel/cast_message_util.cc', #pylint: disable=line-too-long @@ -121,7 +121,7 @@ _COVERAGE_FORCE_LIST_MAP = { # be linked in. Therefore we force coverage for this file to ensure that # any target that includes it will also get the profiling runtime. 'win': [r'..\..\base\test\clang_profiling.cc'], - # TODO(crbug.com/1141727) We're seeing runtime LLVM errors in mac-rel when + # TODO(crbug.com/40154378) We're seeing runtime LLVM errors in mac-rel when # no files are changed, so we suspect that this is similar to the other # problem with clang_profiling.cc on Windows. The TODO here is to force # coverage for this specific file on ALL platforms, if it turns out to fix diff --git a/build/toolchain/gcc_toolchain.gni b/build/toolchain/gcc_toolchain.gni index 7b589b39e5..154369f1ff 100644 --- a/build/toolchain/gcc_toolchain.gni +++ b/build/toolchain/gcc_toolchain.gni @@ -875,8 +875,7 @@ template("gcc_toolchain") { # be specified by the invoker, and optionally toolprefix if it's a # cross-compile case. Note that for a cross-compile case this toolchain # requires a config to pass the appropriate -target option, or else it will -# actually just be doing a native compile. The invoker can optionally override -# use_gold too. +# actually just be doing a native compile. template("clang_toolchain") { gcc_toolchain(target_name) { _path = "$clang_base_path/bin" diff --git a/build/toolchain/mac/BUILD.gn b/build/toolchain/mac/BUILD.gn index ce3a31ad14..d8543c4f2e 100644 --- a/build/toolchain/mac/BUILD.gn +++ b/build/toolchain/mac/BUILD.gn @@ -39,7 +39,7 @@ template("mac_toolchain") { use_allocator_shim = true } - # TODO(crbug.com/753445): the use_sanitizer_coverage arg is currently + # TODO(crbug.com/40534102): the use_sanitizer_coverage arg is currently # not supported by the Chromium mac_clang_x64 toolchain on iOS # distribution. use_sanitizer_coverage = false diff --git a/build/util/LASTCHANGE b/build/util/LASTCHANGE index 48541021f5..00eee97690 100644 --- a/build/util/LASTCHANGE +++ b/build/util/LASTCHANGE @@ -1,2 +1,2 @@ -LASTCHANGE=cd430bd4b263bce76a34122ebea05664ea72d797-refs/heads/main@{#1291648} +LASTCHANGE=dc7e21c7b04270a6b5fae49a0f67e7065d310bb2-refs/heads/main@{#1294160} LASTCHANGE_YEAR=2024 diff --git a/build/util/LASTCHANGE.committime b/build/util/LASTCHANGE.committime index 0659d49bc8..6e0108eeaf 100644 --- a/build/util/LASTCHANGE.committime +++ b/build/util/LASTCHANGE.committime @@ -1 +1 @@ -1713922584
\ No newline at end of file +1714452551
\ No newline at end of file diff --git a/build/util/lib/common/chrome_test_server_spawner.py b/build/util/lib/common/chrome_test_server_spawner.py index 9c00e07c49..e1700cf2db 100644 --- a/build/util/lib/common/chrome_test_server_spawner.py +++ b/build/util/lib/common/chrome_test_server_spawner.py @@ -214,13 +214,13 @@ class TestServerThread(threading.Thread): # Set up a pipe for the server to report when it has started. pipe_in, pipe_out = os.pipe() - # TODO(crbug.com/941669): Remove if condition after python3 migration. + # TODO(crbug.com/40618161): Remove if condition after python3 migration. if hasattr(os, 'set_inheritable'): os.set_inheritable(pipe_out, True) try: self._GenerateCommandLineArguments(pipe_out) - # TODO(crbug.com/941669): When this script is ported to Python 3, replace + # TODO(crbug.com/40618161): When this script is ported to Python 3, replace # 'vpython3' below with sys.executable. command = [ 'vpython3', diff --git a/doc/ContributingCode.md b/doc/ContributingCode.md index 80744a19bc..8d66de85ba 100644 --- a/doc/ContributingCode.md +++ b/doc/ContributingCode.md @@ -103,7 +103,7 @@ fill out the [Corporate Contributor License Agreement][Corporate-CLA] and send it to Google as described on that page. 2. Once you've submitted the CLA, please email the following information (as entered on the CLA) to - `shannonwoods at chromium dot org` for record keeping purposes: + `geofflang at chromium dot org` for record keeping purposes: * Full Name: * Email: * Company (If applicable): diff --git a/extensions/EGL_ANGLE_metal_texture_client_buffer.txt b/extensions/EGL_ANGLE_metal_texture_client_buffer.txt index cfbecd614e..7ee75d6147 100644 --- a/extensions/EGL_ANGLE_metal_texture_client_buffer.txt +++ b/extensions/EGL_ANGLE_metal_texture_client_buffer.txt @@ -9,18 +9,20 @@ Name Strings Contributors Le Hoang Quyen + Dan Glastonbury Contacts Jamie Madill, Google (jmadill 'at' google 'dot' com) Le Hoang Quyen (lehoangq 'at' gmail.com) + Dan Glastonbury, Apple (djg 'at' apple 'dot' com) Status Draft Version - Version 1, Jul 19, 2020 + Version 3, Feb 20, 2024 Number @@ -31,6 +33,8 @@ Dependencies This extension is written against the wording of the EGL 1.4 Specification. + References the EGL_ANGLE_iosurface_client_buffer extension. + Overview This extension allows creating EGL images from external metal texture objects. @@ -83,6 +87,9 @@ Additions to Chapter 2 of the EGL 1.2 Specification (EGL Operation) | EGL_METAL_TEXTURE_ARRAY_SLICE_ANGLE | Select which 2d texture | EGL_METAL_TEXTURE_ANGLE | 0 | | | array slice to use | | | +-------------------------------------+-------------------------+-------------------------+---------------+ + | EGL_TEXTURE_INTERNAL_FORMAT_ANGLE | Override the intended | EGL_METAL_TEXTURE_ANGLE | GL_NONE | + | | internal format | | | + +-------------------------------------+-------------------------+-------------------------+---------------+ Table bbb. Legal attributes for eglCreateImageKHR <attrib_list> parameter If <target> is EGL_METAL_TEXTURE_ANGLE, <dpy> must be a valid display, <ctx> @@ -98,6 +105,11 @@ Additions to Chapter 2 of the EGL 1.2 Specification (EGL Operation) is generated. In case the target MTLTexture textureType property is not MTLTextureType2DArray, value other than 0 generates EGL_BAD_ATTRIBUTE. + If EGL_TEXTURE_INTERNAL_FORMAT_ANGLE is specified, it is used to interpret + <buffer> according to the provided internal format. If the MTLPixelFormat for + the internal format is incompatible with that of the texture <buffer>, an + EGL_BAD_PARAMETER error is generated. + If the EGL_ANGLE_device_metal extension is present, the provided Metal texture object must have been created by the same Metal device queried from the display. If these requirements are not met, an EGL_BAD_PARAMETER error is @@ -107,4 +119,5 @@ Revision History Version 1, 2020-07-19 - First draft Version 2, 2024-02-12 - Add EGL_METAL_TEXTURE_ARRAY_SLICE_ANGLE + Version 3, 2024-02-20 - Add EGL_TEXTURE_INTERNAL_FORMAT_ANGLE diff --git a/include/platform/autogen/FeaturesVk_autogen.h b/include/platform/autogen/FeaturesVk_autogen.h index 200f0f021f..896fa7435e 100644 --- a/include/platform/autogen/FeaturesVk_autogen.h +++ b/include/platform/autogen/FeaturesVk_autogen.h @@ -1366,6 +1366,71 @@ struct FeaturesVk : FeatureSetBase &members, "http://anglebug.com/8549" }; + FeatureInfo combineAllShadersInPipelineLibrary = { + "combineAllShadersInPipelineLibrary", + FeatureCategory::VulkanFeatures, + "For Vulkan ICDs that support VK_EXT_graphics_pipeline_library the shaders subset of the pipeline" + "can either be combined into a single pipeline or can be decoupled into separate pipelines. This feature" + "is enabled when the former is the case.", + &members, "http://anglebug.com/8601" + }; + + FeatureInfo supports8BitStorageBuffer = { + "supports8BitStorageBuffer", + FeatureCategory::VulkanFeatures, + "VkDevice supports the VK_KHR_8bit_storage extension and has the storageBuffer8BitAccess feature", + &members, "http://anglebug.com/8676" + }; + + FeatureInfo supports8BitUniformAndStorageBuffer = { + "supports8BitUniformAndStorageBuffer", + FeatureCategory::VulkanFeatures, + "VkDevice supports the VK_KHR_8bit_storage extension and has the uniformAndStorageBuffer8BitAccess feature", + &members, "http://anglebug.com/8676" + }; + + FeatureInfo supports8BitPushConstant = { + "supports8BitPushConstant", + FeatureCategory::VulkanFeatures, + "VkDevice supports the VK_KHR_8bit_storage extension and has the storagePushConstant8 feature", + &members, "http://anglebug.com/8676" + }; + + FeatureInfo supports16BitStorageBuffer = { + "supports16BitStorageBuffer", + FeatureCategory::VulkanFeatures, + "VkDevice supports the VK_KHR_16bit_storage extension and has the storageBuffer16BitAccess feature", + &members, "http://anglebug.com/8676" + }; + + FeatureInfo supports16BitUniformAndStorageBuffer = { + "supports16BitUniformAndStorageBuffer", + FeatureCategory::VulkanFeatures, + "VkDevice supports the VK_KHR_16bit_storage extension and has the uniformAndStorageBuffer16BitAccess feature", + &members, "http://anglebug.com/8676" + }; + + FeatureInfo supports16BitPushConstant = { + "supports16BitPushConstant", + FeatureCategory::VulkanFeatures, + "VkDevice supports the VK_KHR_16bit_storage extension and has the storagePushConstant16 feature", + &members, "http://anglebug.com/8676" + }; + + FeatureInfo supports16BitInputOutput = { + "supports16BitInputOutput", + FeatureCategory::VulkanFeatures, + "VkDevice supports the VK_KHR_16bit_storage extension and has the storageInputOutput16 feature", + &members, "http://anglebug.com/8676" + }; + + FeatureInfo useVkEventForImageBarrier = { + "useVkEventForImageBarrier", + FeatureCategory::VulkanFeatures, + "Uses VkEvent instead of VkCmdPipelineBarrier for image barriers", + &members, "https://issuetracker.google.com/336844257" + }; + }; inline FeaturesVk::FeaturesVk() = default; diff --git a/include/platform/vk_features.json b/include/platform/vk_features.json index 0315ffbc9c..a915735d87 100644 --- a/include/platform/vk_features.json +++ b/include/platform/vk_features.json @@ -1488,6 +1488,80 @@ "Enable non-semantic info inside shader module via VK_KHR_shader_non_semantic_info extension" ], "issue": "http://anglebug.com/8549" + }, + { + "name": "combine_all_shaders_in_pipeline_library", + "category": "Features", + "description": [ + "For Vulkan ICDs that support VK_EXT_graphics_pipeline_library the shaders subset of the pipeline", + "can either be combined into a single pipeline or can be decoupled into separate pipelines. This feature", + "is enabled when the former is the case." + ], + "issue": "http://anglebug.com/8601" + }, + { + "name": "supports_8_bit_storage_buffer", + "category": "Features", + "description": [ + "VkDevice supports the VK_KHR_8bit_storage extension and has the storageBuffer8BitAccess feature" + ], + "issue": "http://anglebug.com/8676" + }, + { + "name": "supports_8_bit_uniform_and_storage_buffer", + "category": "Features", + "description": [ + "VkDevice supports the VK_KHR_8bit_storage extension and has the uniformAndStorageBuffer8BitAccess feature" + ], + "issue": "http://anglebug.com/8676" + }, + { + "name": "supports_8_bit_push_constant", + "category": "Features", + "description": [ + "VkDevice supports the VK_KHR_8bit_storage extension and has the storagePushConstant8 feature" + ], + "issue": "http://anglebug.com/8676" + }, + { + "name": "supports_16_bit_storage_buffer", + "category": "Features", + "description": [ + "VkDevice supports the VK_KHR_16bit_storage extension and has the storageBuffer16BitAccess feature" + ], + "issue": "http://anglebug.com/8676" + }, + { + "name": "supports_16_bit_uniform_and_storage_buffer", + "category": "Features", + "description": [ + "VkDevice supports the VK_KHR_16bit_storage extension and has the uniformAndStorageBuffer16BitAccess feature" + ], + "issue": "http://anglebug.com/8676" + }, + { + "name": "supports_16_bit_push_constant", + "category": "Features", + "description": [ + "VkDevice supports the VK_KHR_16bit_storage extension and has the storagePushConstant16 feature" + ], + "issue": "http://anglebug.com/8676" + }, + { + "name": "supports_16_bit_input_output", + "category": "Features", + "description": [ + "VkDevice supports the VK_KHR_16bit_storage extension and has the storageInputOutput16 feature" + ], + "issue": "http://anglebug.com/8676" + }, + { + "name": "use_vkEvent_for_image_barrier", + "category": "Features", + "description": [ + "Uses VkEvent instead of VkCmdPipelineBarrier for image barriers" + ], + "issue": "https://issuetracker.google.com/336844257" } ] -}
\ No newline at end of file +} diff --git a/infra/config/generated/luci-milo.cfg b/infra/config/generated/luci-milo.cfg index 635178b2c4..0d6ca0f8a5 100644 --- a/infra/config/generated/luci-milo.cfg +++ b/infra/config/generated/luci-milo.cfg @@ -86,11 +86,6 @@ consoles { short_name: "dbg" } builders { - name: "buildbucket/luci.angle.ci/win-exp-test" - category: "test|win|x64" - short_name: "exp" - } - builders { name: "buildbucket/luci.angle.ci/win-msvc-compile" category: "compile|win-msvc|x64" short_name: "rel" @@ -188,6 +183,9 @@ consoles { builders { name: "buildbucket/luci.angle.ci/linux-exp-tsan-test" } + builders { + name: "buildbucket/luci.angle.ci/win-exp-test" + } builder_view_only: true } consoles { diff --git a/infra/config/generated/project.cfg b/infra/config/generated/project.cfg index 15ab63229f..5fd0843b73 100644 --- a/infra/config/generated/project.cfg +++ b/infra/config/generated/project.cfg @@ -7,7 +7,7 @@ name: "angle" access: "group:all" lucicfg { - version: "1.43.5" + version: "1.43.6" package_dir: ".." config_dir: "generated" entry_point: "main.star" diff --git a/infra/config/main.star b/infra/config/main.star index c84ba17d55..cd94109820 100755 --- a/infra/config/main.star +++ b/infra/config/main.star @@ -323,7 +323,6 @@ def angle_builder(name, cpu): "android-arm64-exp-test", "android-arm64-exp-s22-test", "mac-exp-test", - "win-exp-test", ] if (not is_exp) or (name in active_experimental_builders): diff --git a/infra/specs/angle.json b/infra/specs/angle.json index 43545309d9..560f08d5a5 100644 --- a/infra/specs/angle.json +++ b/infra/specs/angle.json @@ -5947,7 +5947,7 @@ "cpu": "x86-64", "display_attached": "1", "gpu": "8086:3e9b", - "os": "Mac-13.5" + "os": "Mac-13.5|Mac-14.4.1" }, "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, @@ -5969,7 +5969,7 @@ "cpu": "x86-64", "display_attached": "1", "gpu": "8086:3e9b", - "os": "Mac-13.5" + "os": "Mac-13.5|Mac-14.4.1" }, "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, @@ -5992,7 +5992,7 @@ "cpu": "x86-64", "display_attached": "1", "gpu": "8086:3e9b", - "os": "Mac-13.5" + "os": "Mac-13.5|Mac-14.4.1" }, "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, @@ -6015,7 +6015,7 @@ "cpu": "x86-64", "display_attached": "1", "gpu": "8086:3e9b", - "os": "Mac-13.5" + "os": "Mac-13.5|Mac-14.4.1" }, "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, @@ -6038,7 +6038,7 @@ "cpu": "x86-64", "display_attached": "1", "gpu": "8086:3e9b", - "os": "Mac-13.5" + "os": "Mac-13.5|Mac-14.4.1" }, "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", "shards": 2 @@ -6062,7 +6062,7 @@ "cpu": "x86-64", "display_attached": "1", "gpu": "8086:3e9b", - "os": "Mac-13.5" + "os": "Mac-13.5|Mac-14.4.1" }, "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", "shards": 2 @@ -6086,7 +6086,7 @@ "cpu": "x86-64", "display_attached": "1", "gpu": "8086:3e9b", - "os": "Mac-13.5" + "os": "Mac-13.5|Mac-14.4.1" }, "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", "shards": 2 @@ -6106,7 +6106,7 @@ "cpu": "x86-64", "display_attached": "1", "gpu": "8086:3e9b", - "os": "Mac-13.5" + "os": "Mac-13.5|Mac-14.4.1" }, "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, @@ -6167,7 +6167,8 @@ } ] }, - "win10-x64-exp-intel": { + "win10-x64-exp-intel": {}, + "win10-x64-intel": { "gtest_tests": [ { "args": [ @@ -6450,289 +6451,6 @@ } ] }, - "win10-x64-intel": { - "gtest_tests": [ - { - "args": [ - "--use-angle=d3d11" - ], - "merge": { - "script": "//scripts/angle_deqp_test_merge.py" - }, - "name": "angle_deqp_gles2_d3d11_tests", - "swarming": { - "containment_type": "AUTO", - "dimensions": { - "display_attached": "1", - "gpu": "8086:9bc5-31.0.101.2111|8086:9bc5-31.0.101.2127", - "os": "Windows-10", - "pool": "chromium.tests.gpu" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "angle_deqp_gles2_tests", - "test_id_prefix": "ninja://src/tests:angle_deqp_gles2_tests/", - "use_isolated_scripts_api": true - }, - { - "args": [ - "--gtest_filter=-*Vulkan_SwiftShader*", - "--max-processes=1" - ], - "merge": { - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "angle_end2end_tests", - "swarming": { - "containment_type": "AUTO", - "dimensions": { - "display_attached": "1", - "gpu": "8086:9bc5-31.0.101.2111|8086:9bc5-31.0.101.2127", - "os": "Windows-10", - "pool": "chromium.tests.gpu" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 2 - }, - "test": "angle_end2end_tests", - "test_id_prefix": "ninja://src/tests:angle_end2end_tests/", - "use_isolated_scripts_api": true - }, - { - "args": [ - "--test-timeout=300", - "--batch-size=10" - ], - "merge": { - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "angle_gles1_conformance_tests", - "swarming": { - "containment_type": "AUTO", - "dimensions": { - "display_attached": "1", - "gpu": "8086:9bc5-31.0.101.2111|8086:9bc5-31.0.101.2127", - "os": "Windows-10", - "pool": "chromium.tests.gpu" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "angle_gles1_conformance_tests", - "test_id_prefix": "ninja://src/tests:angle_gles1_conformance_tests/", - "use_isolated_scripts_api": true - }, - { - "merge": { - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "angle_unittests", - "swarming": { - "containment_type": "AUTO", - "dimensions": { - "display_attached": "1", - "gpu": "8086:9bc5-31.0.101.2111|8086:9bc5-31.0.101.2127", - "os": "Windows-10", - "pool": "chromium.tests.gpu" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "angle_unittests", - "test_id_prefix": "ninja://src/tests:angle_unittests/", - "use_isolated_scripts_api": true - }, - { - "args": [ - "--max-processes=1" - ], - "merge": { - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "angle_white_box_tests", - "swarming": { - "containment_type": "AUTO", - "dimensions": { - "display_attached": "1", - "gpu": "8086:9bc5-31.0.101.2111|8086:9bc5-31.0.101.2127", - "os": "Windows-10", - "pool": "chromium.tests.gpu" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "angle_white_box_tests", - "test_id_prefix": "ninja://src/tests:angle_white_box_tests/", - "use_isolated_scripts_api": true - } - ], - "isolated_scripts": [ - { - "args": [ - "--log=debug" - ], - "merge": { - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "angle_capture_tests", - "swarming": { - "containment_type": "AUTO", - "dimensions": { - "display_attached": "1", - "gpu": "8086:9bc5-31.0.101.2111|8086:9bc5-31.0.101.2127", - "os": "Windows-10", - "pool": "chromium.tests.gpu" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "angle_capture_tests", - "test_id_prefix": "ninja://src/tests:angle_capture_tests/" - }, - { - "args": [ - "--log=debug", - "--smoke-test-mode", - "--show-test-stdout" - ], - "merge": { - "args": [ - "--smoke-test-mode" - ], - "script": "//scripts/process_angle_perf_results.py" - }, - "name": "angle_perftests", - "swarming": { - "containment_type": "AUTO", - "dimensions": { - "display_attached": "1", - "gpu": "8086:9bc5-31.0.101.2111|8086:9bc5-31.0.101.2127", - "os": "Windows-10", - "pool": "chromium.tests.gpu" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 2 - }, - "test": "angle_perftests", - "test_id_prefix": "ninja://src/tests:angle_perftests/" - }, - { - "args": [ - "--test-machine-name", - "${buildername}", - "--trace-interpreter=gz", - "--filter=fishdom:geometry_dash:merge_dragons:minecraft_bedrock:new_legend_of_the_condor_heroes:street_fighter_duel:teslagrad:vainglory", - "--git-revision=${got_angle_revision}" - ], - "merge": { - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "angle_restricted_trace_gold_interpreted_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}", - "--use-permissive-pixel-comparison=${use_permissive_angle_pixel_comparison}" - ], - "swarming": { - "containment_type": "AUTO", - "dimensions": { - "display_attached": "1", - "gpu": "8086:9bc5-31.0.101.2111|8086:9bc5-31.0.101.2127", - "os": "Windows-10", - "pool": "chromium.tests.gpu" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "angle_restricted_trace_gold_tests", - "test_id_prefix": "ninja://src/tests/restricted_traces:angle_restricted_trace_gold_tests/" - }, - { - "args": [ - "--test-machine-name", - "${buildername}", - "--git-revision=${got_angle_revision}", - "--flaky-retries=1" - ], - "merge": { - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "angle_restricted_trace_gold_tests", - "precommit_args": [ - "--gerrit-issue=${patch_issue}", - "--gerrit-patchset=${patch_set}", - "--buildbucket-id=${buildbucket_build_id}", - "--use-permissive-pixel-comparison=${use_permissive_angle_pixel_comparison}" - ], - "swarming": { - "containment_type": "AUTO", - "dimensions": { - "display_attached": "1", - "gpu": "8086:9bc5-31.0.101.2111|8086:9bc5-31.0.101.2127", - "os": "Windows-10", - "pool": "chromium.tests.gpu" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "angle_restricted_trace_gold_tests", - "test_id_prefix": "ninja://src/tests/restricted_traces:angle_restricted_trace_gold_tests/" - }, - { - "args": [ - "--log=debug", - "--smoke-test-mode", - "--show-test-stdout", - "--use-gl=native", - "--trace-tests" - ], - "merge": { - "args": [ - "--smoke-test-mode" - ], - "script": "//scripts/process_angle_perf_results.py" - }, - "name": "angle_trace_perf_native_tests", - "swarming": { - "containment_type": "AUTO", - "dimensions": { - "display_attached": "1", - "gpu": "8086:9bc5-31.0.101.2111|8086:9bc5-31.0.101.2127", - "os": "Windows-10", - "pool": "chromium.tests.gpu" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 2 - }, - "test": "angle_trace_perf_tests", - "test_id_prefix": "ninja://src/tests:angle_trace_perf_tests/" - }, - { - "args": [ - "--log=debug", - "--smoke-test-mode", - "--show-test-stdout", - "--use-angle=vulkan", - "--trace-tests" - ], - "merge": { - "args": [ - "--smoke-test-mode" - ], - "script": "//scripts/process_angle_perf_results.py" - }, - "name": "angle_trace_perf_vulkan_tests", - "swarming": { - "containment_type": "AUTO", - "dimensions": { - "display_attached": "1", - "gpu": "8086:9bc5-31.0.101.2111|8086:9bc5-31.0.101.2127", - "os": "Windows-10", - "pool": "chromium.tests.gpu" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 2 - }, - "test": "angle_trace_perf_tests", - "test_id_prefix": "ninja://src/tests:angle_trace_perf_tests/" - } - ] - }, "win10-x64-intel-perf": { "isolated_scripts": [ { @@ -6749,7 +6467,7 @@ "containment_type": "AUTO", "dimensions": { "display_attached": "1", - "gpu": "8086:9bc5-31.0.101.2111|8086:9bc5-31.0.101.2127", + "gpu": "8086:9bc5-31.0.101.2127", "os": "Windows-10", "pool": "chromium.tests.gpu" }, @@ -6777,7 +6495,7 @@ "containment_type": "AUTO", "dimensions": { "display_attached": "1", - "gpu": "8086:9bc5-31.0.101.2111|8086:9bc5-31.0.101.2127", + "gpu": "8086:9bc5-31.0.101.2127", "os": "Windows-10", "pool": "chromium.tests.gpu" }, @@ -6805,7 +6523,7 @@ "containment_type": "AUTO", "dimensions": { "display_attached": "1", - "gpu": "8086:9bc5-31.0.101.2111|8086:9bc5-31.0.101.2127", + "gpu": "8086:9bc5-31.0.101.2127", "os": "Windows-10", "pool": "chromium.tests.gpu" }, diff --git a/infra/specs/mixins.pyl b/infra/specs/mixins.pyl index 9daa31bb95..2b6c0c6722 100644 --- a/infra/specs/mixins.pyl +++ b/infra/specs/mixins.pyl @@ -44,7 +44,7 @@ 'mac_mini_intel_gpu_stable': { 'swarming': { 'dimensions': { 'cpu': 'x86-64', 'display_attached': '1', 'gpu': '8086:3e9b', - 'os': 'Mac-13.5'}}}, + 'os': 'Mac-13.5|Mac-14.4.1'}}}, 'mac_retina_amd_gpu_experimental': { 'swarming': { 'dimensions': { 'cpu': 'x86-64', 'display_attached': '1', 'gpu': '1002:67ef', @@ -88,7 +88,7 @@ 'os': 'Windows-10', 'pool': 'chromium.tests.gpu'}}}, 'win10_intel_uhd_630_stable': { 'swarming': { 'dimensions': { 'display_attached': '1', - 'gpu': '8086:9bc5-31.0.101.2111|8086:9bc5-31.0.101.2127', + 'gpu': '8086:9bc5-31.0.101.2127', 'os': 'Windows-10', 'pool': 'chromium.tests.gpu'}}}, 'win10_nvidia_gtx_1660_stable': { 'swarming': { 'dimensions': { 'display_attached': '1', diff --git a/infra/specs/waterfalls.pyl b/infra/specs/waterfalls.pyl index 7f32529246..717f8f263b 100644 --- a/infra/specs/waterfalls.pyl +++ b/infra/specs/waterfalls.pyl @@ -283,8 +283,6 @@ 'win10_intel_uhd_630_experimental', ], 'test_suites': { - 'gtest_tests': 'win10_intel_gtests', - 'isolated_scripts': 'isolated_scripts_group_common', }, }, 'win10-x64-intel': { diff --git a/scripts/code_generation_hashes/GL_EGL_entry_points.json b/scripts/code_generation_hashes/GL_EGL_entry_points.json index 9d018b3bd0..7a619c02ad 100644 --- a/scripts/code_generation_hashes/GL_EGL_entry_points.json +++ b/scripts/code_generation_hashes/GL_EGL_entry_points.json @@ -6,7 +6,7 @@ "scripts/entry_point_packed_gl_enums.json": "57a3a729fd25032bc336f4b6a55bc238", "scripts/generate_entry_points.py": - "07f568a7df66934387bf05759110c934", + "359649efbbc776d91eb29bc1d78c737c", "scripts/gl_angle_ext.xml": "197e07a917d5bba6dfa2840fb1b58e7e", "scripts/registry_xml.py": @@ -130,11 +130,11 @@ "src/libGLESv2/entry_points_cl_autogen.h": "dde2f94c3004874a7da995dae69da811", "src/libGLESv2/entry_points_egl_autogen.cpp": - "753e22c68aa2f60c02c9bda707b554e7", + "8348d52dadf5ad12208a4d93864000c3", "src/libGLESv2/entry_points_egl_autogen.h": "3bc7a8df9deadd7cfd615d0cfad0c6a8", "src/libGLESv2/entry_points_egl_ext_autogen.cpp": - "8fd59c97c30cd561cdecdceaeca065e1", + "0409df0bdbbc0fb32a88d5f23a2cb7a5", "src/libGLESv2/entry_points_egl_ext_autogen.h": "2d005f4cb16dcdd61e08cfec97a12f86", "src/libGLESv2/entry_points_gl_1_autogen.cpp": diff --git a/scripts/generate_entry_points.py b/scripts/generate_entry_points.py index 59d62d8bd8..31f54940e7 100755 --- a/scripts/generate_entry_points.py +++ b/scripts/generate_entry_points.py @@ -1607,7 +1607,9 @@ def is_context_private_state_command(api, name): def is_lockless_egl_entry_point(cmd_name): - if cmd_name in ["eglGetError"]: + if cmd_name in [ + "eglGetError", "eglGetCurrentContext", "eglGetCurrentSurface", "eglGetCurrentDisplay" + ]: return True return False @@ -3109,10 +3111,11 @@ def get_unlocked_tail_call(api, cmd_name): # - eglPrepareSwapBuffersANGLE -> Calls vkAcquireNextImageKHR in tail call # # - eglSwapBuffers, eglSwapBuffersWithDamageKHR and - # eglSwapBuffersWithFrameTokenANGLE -> May throttle the CPU in tail call + # eglSwapBuffersWithFrameTokenANGLE -> May throttle the CPU in tail call or + # calls native EGL function # # - eglClientWaitSyncKHR, eglClientWaitSync, glClientWaitSync, - # glFinishFenceNV -> May wait on fence in tail call + # glFinishFenceNV -> May wait on fence in tail call or call native EGL function # # - glTexImage2D, glTexImage3D, glTexSubImage2D, glTexSubImage3D, # glCompressedTexImage2D, glCompressedTexImage3D, @@ -3122,10 +3125,13 @@ def get_unlocked_tail_call(api, cmd_name): # - glCompileShader and glLinkProgram -> May perform the compilation / link # in tail call # + # - eglCreateSync, eglCreateImage, eglDestroySync, eglDestroyImage -> Calls + # native EGL function in tail call + # if (cmd_name in [ - 'eglDestroySurface', 'eglMakeCurrent', 'eglReleaseThread', 'eglCreateWindowSurface', - 'eglCreatePlatformWindowSurface', 'eglCreatePlatformWindowSurfaceEXT', - 'eglPrepareSwapBuffersANGLE', 'eglSwapBuffers', 'eglSwapBuffersWithDamageKHR', + 'eglCreateSyncKHR', 'eglDestroySurface', 'eglMakeCurrent', 'eglReleaseThread', + 'eglCreateWindowSurface', 'eglCreatePlatformWindowSurface', + 'eglCreatePlatformWindowSurfaceEXT', 'eglPrepareSwapBuffersANGLE', 'eglSwapBuffersWithFrameTokenANGLE', 'glFinishFenceNV', 'glCompileShader', 'glLinkProgram' ] or cmd_name.startswith('glTexImage2D') or cmd_name.startswith('glTexImage3D') or @@ -3136,7 +3142,21 @@ def get_unlocked_tail_call(api, cmd_name): cmd_name.startswith('glCompressedTexSubImage3D')): return 'egl::Display::GetCurrentThreadUnlockedTailCall()->run(nullptr);' - if cmd_name in ['eglClientWaitSyncKHR', 'eglClientWaitSync', 'glClientWaitSync']: + if cmd_name in [ + 'eglClientWaitSyncKHR', + 'eglClientWaitSync', + 'eglCreateImageKHR', + 'eglCreateImage', + 'eglCreateSyncKHR', + 'eglCreateSync', + 'eglDestroySyncKHR', + 'eglDestroySync', + 'eglSwapBuffers', + 'eglSwapBuffersWithDamageKHR', + 'eglWaitSyncKHR', + 'eglWaitSync', + 'glClientWaitSync', + ]: return 'egl::Display::GetCurrentThreadUnlockedTailCall()->run(&returnValue);' # Otherwise assert that no tail calls where generated diff --git a/scripts/roll_aosp.sh b/scripts/roll_aosp.sh index 25fda1ff2b..8170f3eaf5 100755 --- a/scripts/roll_aosp.sh +++ b/scripts/roll_aosp.sh @@ -148,7 +148,7 @@ for removal_dir in "${extra_third_party_removal_patterns[@]}"; do done # Sync all of ANGLE's deps so that 'gn gen' works -python scripts/bootstrap.py +python3 scripts/bootstrap.py gclient sync --reset --force --delete_unversioned_trees # Delete outdir to ensure a clean gn run. diff --git a/src/compiler/translator/glsl/BuiltInFunctionEmulatorGLSL.cpp b/src/compiler/translator/glsl/BuiltInFunctionEmulatorGLSL.cpp index 622566d542..8835dc311f 100644 --- a/src/compiler/translator/glsl/BuiltInFunctionEmulatorGLSL.cpp +++ b/src/compiler/translator/glsl/BuiltInFunctionEmulatorGLSL.cpp @@ -80,33 +80,28 @@ void InitBuiltInAtanFunctionEmulatorForGLSLWorkarounds(BuiltInFunctionEmulator * " else if (x < 0.0 && y < 0.0) return atan(y / x) - 3.14159265;\n" " else return 1.57079632 * sign(y);\n" "}\n"); - static const std::array<TSymbolUniqueId, 4> ids = { - BuiltInId::atan_Float1_Float1, - BuiltInId::atan_Float2_Float2, - BuiltInId::atan_Float3_Float3, - BuiltInId::atan_Float4_Float4, - }; - for (int dim = 2; dim <= 4; ++dim) - { - std::stringstream ss = sh::InitializeStream<std::stringstream>(); - ss << "emu_precision vec" << dim << " atan_emu(emu_precision vec" << dim - << " y, emu_precision vec" << dim << " x)\n" - << "{\n" - " return vec" - << dim << "("; - for (int i = 0; i < dim; ++i) - { - ss << "atan_emu(y[" << i << "], x[" << i << "])"; - if (i < dim - 1) - { - ss << ", "; - } - } - ss << ");\n" - "}\n"; - emu->addEmulatedFunctionWithDependency(BuiltInId::atan_Float1_Float1, ids[dim - 1], - ss.str().c_str()); - } + + emu->addEmulatedFunctionWithDependency( + BuiltInId::atan_Float1_Float1, BuiltInId::atan_Float2_Float2, + "emu_precision vec2 atan_emu(emu_precision vec2 y, emu_precision vec2 x)\n" + "{\n" + " return vec2(atan_emu(y[0], x[0]), atan_emu(y[1], x[1]));\n" + "}\n"); + + emu->addEmulatedFunctionWithDependency( + BuiltInId::atan_Float1_Float1, BuiltInId::atan_Float3_Float3, + "emu_precision vec3 atan_emu(emu_precision vec3 y, emu_precision vec3 x)\n" + "{\n" + " return vec3(atan_emu(y[0], x[0]), atan_emu(y[1], x[1]), atan_emu(y[2], x[2]));\n" + "}\n"); + + emu->addEmulatedFunctionWithDependency( + BuiltInId::atan_Float1_Float1, BuiltInId::atan_Float4_Float4, + "emu_precision vec4 atan_emu(emu_precision vec4 y, emu_precision vec4 x)\n" + "{\n" + " return vec4(atan_emu(y[0], x[0]), atan_emu(y[1], x[1]), atan_emu(y[2], x[2]), " + "atan_emu(y[3], x[3]))\n;" + "}\n"); } // Emulate built-in functions missing from GLSL 1.30 and higher diff --git a/src/libANGLE/Framebuffer.cpp b/src/libANGLE/Framebuffer.cpp index 40829f00b7..a7a1cc0016 100644 --- a/src/libANGLE/Framebuffer.cpp +++ b/src/libANGLE/Framebuffer.cpp @@ -2505,7 +2505,9 @@ angle::Result Framebuffer::ensureClearAttachmentsInitialized(const Context *cont // If the impl encounters an error during a a full (non-partial) clear, the attachments will // still be marked initialized. This simplifies design, allowing this method to be called before // the clear. - markDrawAttachmentsInitialized(color, depth, stencil); + DrawBufferMask clearedColorAttachments = + color ? mState.getEnabledDrawBuffers() : DrawBufferMask(); + markAttachmentsInitialized(clearedColorAttachments, depth, stencil); return angle::Result::Continue; } @@ -2516,20 +2518,67 @@ angle::Result Framebuffer::ensureClearBufferAttachmentsInitialized(const Context { if (!context->isRobustResourceInitEnabled() || context->getState().isRasterizerDiscardEnabled() || - context->isClearBufferMaskedOut(buffer, drawbuffer)) + context->isClearBufferMaskedOut(buffer, drawbuffer) || mState.mResourceNeedsInit.none()) { return angle::Result::Continue; } - if (partialBufferClearNeedsInit(context, buffer)) + DrawBufferMask clearColorAttachments; + bool clearDepth = false; + bool clearStencil = false; + + switch (buffer) { - ANGLE_TRY(ensureBufferInitialized(context, buffer, drawbuffer)); + case GL_COLOR: + { + ASSERT(drawbuffer < static_cast<GLint>(mState.mColorAttachments.size())); + if (mState.mResourceNeedsInit[drawbuffer]) + { + clearColorAttachments.set(drawbuffer); + } + break; + } + case GL_DEPTH: + { + if (mState.mResourceNeedsInit[DIRTY_BIT_DEPTH_ATTACHMENT]) + { + clearDepth = true; + } + break; + } + case GL_STENCIL: + { + if (mState.mResourceNeedsInit[DIRTY_BIT_STENCIL_ATTACHMENT]) + { + clearStencil = true; + } + break; + } + case GL_DEPTH_STENCIL: + { + if (mState.mResourceNeedsInit[DIRTY_BIT_DEPTH_ATTACHMENT]) + { + clearDepth = true; + } + if (mState.mResourceNeedsInit[DIRTY_BIT_STENCIL_ATTACHMENT]) + { + clearStencil = true; + } + break; + } + default: + UNREACHABLE(); + break; } - // If the impl encounters an error during a a full (non-partial) clear, the attachments will - // still be marked initialized. This simplifies design, allowing this method to be called before - // the clear. - markBufferInitialized(buffer, drawbuffer); + if (partialBufferClearNeedsInit(context, buffer) && + (clearColorAttachments.any() || clearDepth || clearStencil)) + { + ANGLE_TRY(mImpl->ensureAttachmentsInitialized(context, clearColorAttachments, clearDepth, + clearStencil)); + } + + markAttachmentsInitialized(clearColorAttachments, clearDepth, clearStencil); return angle::Result::Continue; } @@ -2541,24 +2590,34 @@ angle::Result Framebuffer::ensureDrawAttachmentsInitialized(const Context *conte return angle::Result::Continue; } + DrawBufferMask clearColorAttachments; + bool clearDepth = false; + bool clearStencil = false; + // Note: we don't actually filter by the draw attachment enum. Just init everything. for (size_t bit : mState.mResourceNeedsInit) { switch (bit) { case DIRTY_BIT_DEPTH_ATTACHMENT: - ANGLE_TRY(InitAttachment(context, &mState.mDepthAttachment)); + clearDepth = true; break; case DIRTY_BIT_STENCIL_ATTACHMENT: - ANGLE_TRY(InitAttachment(context, &mState.mStencilAttachment)); + clearStencil = true; break; default: - ANGLE_TRY(InitAttachment(context, &mState.mColorAttachments[bit])); + clearColorAttachments[bit] = true; break; } } - mState.mResourceNeedsInit.reset(); + if (clearColorAttachments.any() || clearDepth || clearStencil) + { + ANGLE_TRY(mImpl->ensureAttachmentsInitialized(context, clearColorAttachments, clearDepth, + clearStencil)); + markAttachmentsInitialized(clearColorAttachments, clearDepth, clearStencil); + } + return angle::Result::Continue; } @@ -2571,6 +2630,10 @@ angle::Result Framebuffer::ensureReadAttachmentsInitialized(const Context *conte return angle::Result::Continue; } + DrawBufferMask clearColorAttachments; + bool clearDepth = false; + bool clearStencil = false; + if (mState.mReadBufferState != GL_NONE) { if (isDefault()) @@ -2586,47 +2649,42 @@ angle::Result Framebuffer::ensureReadAttachmentsInitialized(const Context *conte size_t readIndex = mState.getReadIndex(); if (mState.mResourceNeedsInit[readIndex]) { - ANGLE_TRY(InitAttachment(context, &mState.mColorAttachments[readIndex])); - mState.mResourceNeedsInit.reset(readIndex); + clearColorAttachments[readIndex] = true; } } } // Conservatively init depth since it can be read by BlitFramebuffer. - if (hasDepth()) + if (hasDepth() && mState.mResourceNeedsInit[DIRTY_BIT_DEPTH_ATTACHMENT]) { - if (mState.mResourceNeedsInit[DIRTY_BIT_DEPTH_ATTACHMENT]) - { - ANGLE_TRY(InitAttachment(context, &mState.mDepthAttachment)); - mState.mResourceNeedsInit.reset(DIRTY_BIT_DEPTH_ATTACHMENT); - } + clearDepth = true; } // Conservatively init stencil since it can be read by BlitFramebuffer. - if (hasStencil()) + if (hasStencil() && mState.mResourceNeedsInit[DIRTY_BIT_STENCIL_ATTACHMENT]) { - if (mState.mResourceNeedsInit[DIRTY_BIT_STENCIL_ATTACHMENT]) - { - ANGLE_TRY(InitAttachment(context, &mState.mStencilAttachment)); - mState.mResourceNeedsInit.reset(DIRTY_BIT_STENCIL_ATTACHMENT); - } + clearStencil = true; + } + + if (clearColorAttachments.any() || clearDepth || clearStencil) + { + ANGLE_TRY(mImpl->ensureAttachmentsInitialized(context, clearColorAttachments, clearDepth, + clearStencil)); + markAttachmentsInitialized(clearColorAttachments, clearDepth, clearStencil); } return angle::Result::Continue; } -void Framebuffer::markDrawAttachmentsInitialized(bool color, bool depth, bool stencil) +void Framebuffer::markAttachmentsInitialized(const DrawBufferMask &color, bool depth, bool stencil) { // Mark attachments as initialized. - if (color) + for (auto colorIndex : color) { - for (auto colorIndex : mState.mEnabledDrawBuffers) - { - auto &colorAttachment = mState.mColorAttachments[colorIndex]; - ASSERT(colorAttachment.isAttached()); - colorAttachment.setInitState(InitState::Initialized); - mState.mResourceNeedsInit.reset(colorIndex); - } + auto &colorAttachment = mState.mColorAttachments[colorIndex]; + ASSERT(colorAttachment.isAttached()); + colorAttachment.setInitState(InitState::Initialized); + mState.mResourceNeedsInit.reset(colorIndex); } if (depth && mState.mDepthAttachment.isAttached()) @@ -2642,58 +2700,6 @@ void Framebuffer::markDrawAttachmentsInitialized(bool color, bool depth, bool st } } -void Framebuffer::markBufferInitialized(GLenum bufferType, GLint bufferIndex) -{ - switch (bufferType) - { - case GL_COLOR: - { - ASSERT(bufferIndex < static_cast<GLint>(mState.mColorAttachments.size())); - if (mState.mColorAttachments[bufferIndex].isAttached()) - { - mState.mColorAttachments[bufferIndex].setInitState(InitState::Initialized); - mState.mResourceNeedsInit.reset(bufferIndex); - } - break; - } - case GL_DEPTH: - { - if (mState.mDepthAttachment.isAttached()) - { - mState.mDepthAttachment.setInitState(InitState::Initialized); - mState.mResourceNeedsInit.reset(DIRTY_BIT_DEPTH_ATTACHMENT); - } - break; - } - case GL_STENCIL: - { - if (mState.mStencilAttachment.isAttached()) - { - mState.mStencilAttachment.setInitState(InitState::Initialized); - mState.mResourceNeedsInit.reset(DIRTY_BIT_STENCIL_ATTACHMENT); - } - break; - } - case GL_DEPTH_STENCIL: - { - if (mState.mDepthAttachment.isAttached()) - { - mState.mDepthAttachment.setInitState(InitState::Initialized); - mState.mResourceNeedsInit.reset(DIRTY_BIT_DEPTH_ATTACHMENT); - } - if (mState.mStencilAttachment.isAttached()) - { - mState.mStencilAttachment.setInitState(InitState::Initialized); - mState.mResourceNeedsInit.reset(DIRTY_BIT_STENCIL_ATTACHMENT); - } - break; - } - default: - UNREACHABLE(); - break; - } -} - Box Framebuffer::getDimensions() const { return mState.getDimensions(); @@ -2760,69 +2766,6 @@ GLuint Framebuffer::getSupportedFoveationFeatures() const return mState.mFoveationState.getSupportedFoveationFeatures(); } -angle::Result Framebuffer::ensureBufferInitialized(const Context *context, - GLenum bufferType, - GLint bufferIndex) -{ - ASSERT(context->isRobustResourceInitEnabled()); - - if (mState.mResourceNeedsInit.none()) - { - return angle::Result::Continue; - } - - switch (bufferType) - { - case GL_COLOR: - { - ASSERT(bufferIndex < static_cast<GLint>(mState.mColorAttachments.size())); - if (mState.mResourceNeedsInit[bufferIndex]) - { - ANGLE_TRY(InitAttachment(context, &mState.mColorAttachments[bufferIndex])); - mState.mResourceNeedsInit.reset(bufferIndex); - } - break; - } - case GL_DEPTH: - { - if (mState.mResourceNeedsInit[DIRTY_BIT_DEPTH_ATTACHMENT]) - { - ANGLE_TRY(InitAttachment(context, &mState.mDepthAttachment)); - mState.mResourceNeedsInit.reset(DIRTY_BIT_DEPTH_ATTACHMENT); - } - break; - } - case GL_STENCIL: - { - if (mState.mResourceNeedsInit[DIRTY_BIT_STENCIL_ATTACHMENT]) - { - ANGLE_TRY(InitAttachment(context, &mState.mStencilAttachment)); - mState.mResourceNeedsInit.reset(DIRTY_BIT_STENCIL_ATTACHMENT); - } - break; - } - case GL_DEPTH_STENCIL: - { - if (mState.mResourceNeedsInit[DIRTY_BIT_DEPTH_ATTACHMENT]) - { - ANGLE_TRY(InitAttachment(context, &mState.mDepthAttachment)); - mState.mResourceNeedsInit.reset(DIRTY_BIT_DEPTH_ATTACHMENT); - } - if (mState.mResourceNeedsInit[DIRTY_BIT_STENCIL_ATTACHMENT]) - { - ANGLE_TRY(InitAttachment(context, &mState.mStencilAttachment)); - mState.mResourceNeedsInit.reset(DIRTY_BIT_STENCIL_ATTACHMENT); - } - break; - } - default: - UNREACHABLE(); - break; - } - - return angle::Result::Continue; -} - bool Framebuffer::partialBufferClearNeedsInit(const Context *context, GLenum bufferType) { if (!context->isRobustResourceInitEnabled() || mState.mResourceNeedsInit.none()) diff --git a/src/libANGLE/Framebuffer.h b/src/libANGLE/Framebuffer.h index ebadf88af5..f690cf4932 100644 --- a/src/libANGLE/Framebuffer.h +++ b/src/libANGLE/Framebuffer.h @@ -521,11 +521,7 @@ class Framebuffer final : public angle::ObserverInterface, bool isMultiview, GLsizei samples); - void markDrawAttachmentsInitialized(bool color, bool depth, bool stencil); - void markBufferInitialized(GLenum bufferType, GLint bufferIndex); - angle::Result ensureBufferInitialized(const Context *context, - GLenum bufferType, - GLint bufferIndex); + void markAttachmentsInitialized(const DrawBufferMask &color, bool depth, bool stencil); // Checks that we have a partially masked clear: // * some color channels are masked out diff --git a/src/libANGLE/FramebufferAttachment.cpp b/src/libANGLE/FramebufferAttachment.cpp index 04650e9f46..e8e75428a6 100644 --- a/src/libANGLE/FramebufferAttachment.cpp +++ b/src/libANGLE/FramebufferAttachment.cpp @@ -293,7 +293,7 @@ InitState FramebufferAttachment::initState() const : InitState::Initialized; } -angle::Result FramebufferAttachment::initializeContents(const Context *context) +angle::Result FramebufferAttachment::initializeContents(const Context *context) const { ASSERT(mResource); ANGLE_TRY(mResource->initializeContents(context, mTarget.binding(), mTarget.textureIndex())); diff --git a/src/libANGLE/FramebufferAttachment.h b/src/libANGLE/FramebufferAttachment.h index d21095005f..4c1537547a 100644 --- a/src/libANGLE/FramebufferAttachment.h +++ b/src/libANGLE/FramebufferAttachment.h @@ -151,7 +151,7 @@ class FramebufferAttachment final const egl::Surface *getSurface() const; FramebufferAttachmentObject *getResource() const; InitState initState() const; - angle::Result initializeContents(const Context *context); + angle::Result initializeContents(const Context *context) const; void setInitState(InitState initState) const; // "T" must be static_castable from FramebufferAttachmentRenderTarget diff --git a/src/libANGLE/State.cpp b/src/libANGLE/State.cpp index 1f3de17a0d..24169c0663 100644 --- a/src/libANGLE/State.cpp +++ b/src/libANGLE/State.cpp @@ -3966,6 +3966,4 @@ void State::initializeForCapture(const Context *context) initialize(mutableContext); } -constexpr State::DirtyObjectHandler State::kDirtyObjectHandlers[state::DIRTY_OBJECT_MAX]; - } // namespace gl diff --git a/src/libANGLE/State.h b/src/libANGLE/State.h index b2aa674906..fa61701b30 100644 --- a/src/libANGLE/State.h +++ b/src/libANGLE/State.h @@ -1448,13 +1448,40 @@ class State : angle::NonCopyable using DirtyObjectHandler = angle::Result (State::*)(const Context *context, Command command); - static constexpr DirtyObjectHandler kDirtyObjectHandlers[state::DIRTY_OBJECT_MAX] = { - &State::syncActiveTextures, &State::syncTexturesInit, - &State::syncImagesInit, &State::syncReadAttachments, - &State::syncDrawAttachments, &State::syncReadFramebuffer, - &State::syncDrawFramebuffer, &State::syncVertexArray, - &State::syncTextures, &State::syncImages, - &State::syncSamplers, &State::syncProgramPipelineObject}; + static constexpr std::array<DirtyObjectHandler, state::DIRTY_OBJECT_MAX> kDirtyObjectHandlers = + []() { + // Work around C++'s lack of array element support in designated initializers + std::array<DirtyObjectHandler, state::DIRTY_OBJECT_MAX> handlers{}; + + handlers[state::DIRTY_OBJECT_ACTIVE_TEXTURES] = &State::syncActiveTextures; + handlers[state::DIRTY_OBJECT_TEXTURES_INIT] = &State::syncTexturesInit; + handlers[state::DIRTY_OBJECT_IMAGES_INIT] = &State::syncImagesInit; + handlers[state::DIRTY_OBJECT_READ_ATTACHMENTS] = &State::syncReadAttachments; + handlers[state::DIRTY_OBJECT_DRAW_ATTACHMENTS] = &State::syncDrawAttachments; + handlers[state::DIRTY_OBJECT_READ_FRAMEBUFFER] = &State::syncReadFramebuffer; + handlers[state::DIRTY_OBJECT_DRAW_FRAMEBUFFER] = &State::syncDrawFramebuffer; + handlers[state::DIRTY_OBJECT_VERTEX_ARRAY] = &State::syncVertexArray; + handlers[state::DIRTY_OBJECT_TEXTURES] = &State::syncTextures; + handlers[state::DIRTY_OBJECT_IMAGES] = &State::syncImages; + handlers[state::DIRTY_OBJECT_SAMPLERS] = &State::syncSamplers; + handlers[state::DIRTY_OBJECT_PROGRAM_PIPELINE_OBJECT] = + &State::syncProgramPipelineObject; + + return handlers; + }(); + + static_assert( + []() { + for (auto handler : kDirtyObjectHandlers) + { + if (handler == nullptr) + { + return false; + } + } + return true; + }(), + "kDirtyObjectHandlers missing a handler"); // Robust init must happen before Framebuffer init for the Vulkan back-end. static_assert(state::DIRTY_OBJECT_ACTIVE_TEXTURES < state::DIRTY_OBJECT_TEXTURES_INIT, @@ -1468,25 +1495,6 @@ class State : angle::NonCopyable static_assert(state::DIRTY_OBJECT_READ_ATTACHMENTS < state::DIRTY_OBJECT_READ_FRAMEBUFFER, "init order"); - static_assert(state::DIRTY_OBJECT_ACTIVE_TEXTURES == 0, - "check DIRTY_OBJECT_ACTIVE_TEXTURES index"); - static_assert(state::DIRTY_OBJECT_TEXTURES_INIT == 1, "check DIRTY_OBJECT_TEXTURES_INIT index"); - static_assert(state::DIRTY_OBJECT_IMAGES_INIT == 2, "check DIRTY_OBJECT_IMAGES_INIT index"); - static_assert(state::DIRTY_OBJECT_READ_ATTACHMENTS == 3, - "check DIRTY_OBJECT_READ_ATTACHMENTS index"); - static_assert(state::DIRTY_OBJECT_DRAW_ATTACHMENTS == 4, - "check DIRTY_OBJECT_DRAW_ATTACHMENTS index"); - static_assert(state::DIRTY_OBJECT_READ_FRAMEBUFFER == 5, - "check DIRTY_OBJECT_READ_FRAMEBUFFER index"); - static_assert(state::DIRTY_OBJECT_DRAW_FRAMEBUFFER == 6, - "check DIRTY_OBJECT_DRAW_FRAMEBUFFER index"); - static_assert(state::DIRTY_OBJECT_VERTEX_ARRAY == 7, "check DIRTY_OBJECT_VERTEX_ARRAY index"); - static_assert(state::DIRTY_OBJECT_TEXTURES == 8, "check DIRTY_OBJECT_TEXTURES index"); - static_assert(state::DIRTY_OBJECT_IMAGES == 9, "check DIRTY_OBJECT_IMAGES index"); - static_assert(state::DIRTY_OBJECT_SAMPLERS == 10, "check DIRTY_OBJECT_SAMPLERS index"); - static_assert(state::DIRTY_OBJECT_PROGRAM_PIPELINE_OBJECT == 11, - "check DIRTY_OBJECT_PROGRAM_PIPELINE_OBJECT index"); - // Dispatch table for buffer update functions. static const angle::PackedEnumMap<BufferBinding, BufferBindingSetter> kBufferSetters; diff --git a/src/libANGLE/capture/FrameCapture.cpp b/src/libANGLE/capture/FrameCapture.cpp index 8d3bc5f394..44a46c0607 100644 --- a/src/libANGLE/capture/FrameCapture.cpp +++ b/src/libANGLE/capture/FrameCapture.cpp @@ -1554,13 +1554,13 @@ void CaptureUpdateCurrentProgram(const CallCapture &call, callsOut->emplace_back("UpdateCurrentProgram", std::move(paramBuffer)); } -bool ProgramNeedsReset(const gl::ContextID contextID, +bool ProgramNeedsReset(const gl::Context *context, ResourceTracker *resourceTracker, gl::ShaderProgramID programID) { // Check whether the program is listed in programs to regen or restore TrackedResource &trackedShaderPrograms = - resourceTracker->getTrackedResource(contextID, ResourceIDType::ShaderProgram); + resourceTracker->getTrackedResource(context->id(), ResourceIDType::ShaderProgram); ResourceSet &shaderProgramsToRegen = trackedShaderPrograms.getResourcesToRegen(); if (shaderProgramsToRegen.count(programID.value) != 0) @@ -1574,6 +1574,13 @@ bool ProgramNeedsReset(const gl::ContextID contextID, return true; } + // Deferred linked programs will also update their own uniforms + FrameCaptureShared *frameCaptureShared = context->getShareGroup()->getFrameCaptureShared(); + if (frameCaptureShared->isDeferredLinkProgram(programID)) + { + return true; + } + return false; } @@ -1593,7 +1600,7 @@ void MaybeResetDefaultUniforms(std::stringstream &out, gl::ShaderProgramID programID = uniformIter.first; const DefaultUniformLocationsSet &locations = uniformIter.second; - if (ProgramNeedsReset(context->id(), resourceTracker, programID)) + if (ProgramNeedsReset(context, resourceTracker, programID)) { // Skip programs marked for reset as they will update their own uniforms return; @@ -4649,24 +4656,34 @@ void CaptureShareGroupMidExecutionSetup( // Capture Program binary state. gl::ShaderProgramID tempShaderStartID = {resourceTracker->getMaxShaderPrograms()}; + std::map<gl::ShaderProgramID, std::vector<gl::ShaderProgramID>> deferredAttachCalls; for (const auto &programIter : programs) { gl::ShaderProgramID id = {programIter.first}; gl::Program *program = programIter.second; - // Unlinked programs don't have an executable. Thus they don't need to be captured. + // Unlinked programs don't have an executable so track in case linking is deferred // Programs are shared by contexts in the share group and only need to be captured once. if (!program->isLinked()) { - continue; + frameCaptureShared->setDeferredLinkProgram(id); + + // Deferred attachment of shaders is not yet supported + ASSERT(program->getAttachedShadersCount()); + + // AttachShader calls will be generated at shader-handling time + for (gl::ShaderType shaderType : gl::AllShaderTypes()) + { + gl::Shader *shader = program->getAttachedShader(shaderType); + if (shader != nullptr) + { + deferredAttachCalls[shader->getHandle()].push_back(id); + } + } } size_t programSetupStart = setupCalls->size(); - // Get last linked shader source. - const ProgramSources &linkedSources = - context->getShareGroup()->getFrameCaptureShared()->getProgramSources(id); - // Create two lists for program regen calls ResourceCalls &shaderProgramRegenCalls = trackedShaderPrograms.getResourceRegenCalls(); CallVector programRegenCalls({setupCalls, &shaderProgramRegenCalls[id.value]}); @@ -4677,21 +4694,29 @@ void CaptureShareGroupMidExecutionSetup( CaptureCustomShaderProgram("CreateProgram", createProgram, *calls); } - // Create two lists for program restore calls - ResourceCalls &shaderProgramRestoreCalls = trackedShaderPrograms.getResourceRestoreCalls(); - CallVector programRestoreCalls({setupCalls, &shaderProgramRestoreCalls[id.value]}); - - for (std::vector<CallCapture> *calls : programRestoreCalls) + if (program->isLinked()) { - GenerateLinkedProgram(context, replayState, resourceTracker, calls, program, id, - tempShaderStartID, linkedSources); - } + // Get last linked shader source. + const ProgramSources &linkedSources = + context->getShareGroup()->getFrameCaptureShared()->getProgramSources(id); - // Update the program in replayState - if (!replayState.getProgram() || replayState.getProgram()->id() != program->id()) - { - // Note: We don't do this in GenerateLinkedProgram because it can't modify state - (void)replayState.setProgram(context, program); + // Create two lists for program restore calls + ResourceCalls &shaderProgramRestoreCalls = + trackedShaderPrograms.getResourceRestoreCalls(); + CallVector programRestoreCalls({setupCalls, &shaderProgramRestoreCalls[id.value]}); + + for (std::vector<CallCapture> *calls : programRestoreCalls) + { + GenerateLinkedProgram(context, replayState, resourceTracker, calls, program, id, + tempShaderStartID, linkedSources); + } + + // Update the program in replayState + if (!replayState.getProgram() || replayState.getProgram()->id() != program->id()) + { + // Note: We don't do this in GenerateLinkedProgram because it can't modify state + (void)replayState.setProgram(context, program); + } } resourceTracker->getTrackedResource(context->id(), ResourceIDType::ShaderProgram) @@ -4699,12 +4724,17 @@ void CaptureShareGroupMidExecutionSetup( .insert(id.value); resourceTracker->setShaderProgramType(id, ShaderProgramType::ProgramType); - size_t programSetupEnd = setupCalls->size(); + // Mark linked programs/shaders as inactive, leaving deferred-linked programs/shaders marked + // as active + if (!frameCaptureShared->isDeferredLinkProgram(id)) + { + size_t programSetupEnd = setupCalls->size(); - // Mark the range of calls used to setup this program - frameCaptureShared->markResourceSetupCallsInactive( - setupCalls, ResourceIDType::ShaderProgram, id.value, - gl::Range<size_t>(programSetupStart, programSetupEnd)); + // Mark the range of calls used to setup this program + frameCaptureShared->markResourceSetupCallsInactive( + setupCalls, ResourceIDType::ShaderProgram, id.value, + gl::Range<size_t>(programSetupStart, programSetupEnd)); + } } // Handle shaders. @@ -4731,6 +4761,15 @@ void CaptureShareGroupMidExecutionSetup( CallCapture createShader = CaptureCreateShader(replayState, true, shader->getType(), id.value); CaptureCustomShaderProgram("CreateShader", createShader, *calls); + + // If unlinked programs have been created which reference this shader emit corresponding + // attach calls + for (const auto deferredAttachedProgramID : deferredAttachCalls[id]) + { + CallCapture attachShader = + CaptureAttachShader(replayState, true, deferredAttachedProgramID, id); + calls->emplace_back(std::move(attachShader)); + } } std::string shaderSource = shader->getSourceString(); @@ -4740,8 +4779,8 @@ void CaptureShareGroupMidExecutionSetup( ResourceCalls &shaderProgramRestoreCalls = trackedShaderPrograms.getResourceRestoreCalls(); CallVector shaderRestoreCalls({setupCalls, &shaderProgramRestoreCalls[id.value]}); - // This does not handle some more tricky situations like attaching shaders to a non-linked - // program. Or attaching uncompiled shaders. Or attaching and then deleting a shader. + // This does not handle some more tricky situations like attaching and then deleting a + // shader. // TODO(jmadill): Handle trickier program uses. http://anglebug.com/3662 if (shader->isCompiled(context)) { @@ -4771,10 +4810,14 @@ void CaptureShareGroupMidExecutionSetup( } } - // Mark the range of calls used to setup this shader - frameCaptureShared->markResourceSetupCallsInactive( - setupCalls, ResourceIDType::ShaderProgram, id.value, - gl::Range<size_t>(shaderSetupStart, setupCalls->size())); + // Deferred-linked programs/shaders must be left marked as active + if (deferredAttachCalls[id].empty()) + { + // Mark the range of calls used to setup this shader + frameCaptureShared->markResourceSetupCallsInactive( + setupCalls, ResourceIDType::ShaderProgram, id.value, + gl::Range<size_t>(shaderSetupStart, setupCalls->size())); + } resourceTracker->getTrackedResource(context->id(), ResourceIDType::ShaderProgram) .getStartingResources() diff --git a/src/libANGLE/capture/FrameCapture.h b/src/libANGLE/capture/FrameCapture.h index 74b3a17055..7f3f26b4a4 100644 --- a/src/libANGLE/capture/FrameCapture.h +++ b/src/libANGLE/capture/FrameCapture.h @@ -711,6 +711,15 @@ class FrameCaptureShared final : angle::NonCopyable std::mutex &getFrameCaptureMutex() { return mFrameCaptureMutex; } + void setDeferredLinkProgram(gl::ShaderProgramID programID) + { + mDeferredLinkPrograms.emplace(programID); + } + bool isDeferredLinkProgram(gl::ShaderProgramID programID) + { + return (mDeferredLinkPrograms.find(programID) != mDeferredLinkPrograms.end()); + } + private: void writeJSON(const gl::Context *context); void writeCppReplayIndexFiles(const gl::Context *context, bool writeResetContextCall); @@ -804,6 +813,9 @@ class FrameCaptureShared final : angle::NonCopyable ShaderSourceMap mCachedShaderSource; ProgramSourceMap mCachedProgramSources; + // Set of programs which were created but not linked before capture was started + std::set<gl::ShaderProgramID> mDeferredLinkPrograms; + gl::ContextID mWindowSurfaceContextID; std::vector<CallCapture> mShareGroupSetupCalls; diff --git a/src/libANGLE/renderer/FramebufferImpl.cpp b/src/libANGLE/renderer/FramebufferImpl.cpp index 1cef167d9d..90ab66aa15 100644 --- a/src/libANGLE/renderer/FramebufferImpl.cpp +++ b/src/libANGLE/renderer/FramebufferImpl.cpp @@ -10,9 +10,49 @@ namespace rx { +namespace +{ +angle::Result InitAttachment(const gl::Context *context, + const gl::FramebufferAttachment *attachment) +{ + ASSERT(attachment->isAttached()); + if (attachment->initState() == gl::InitState::MayNeedInit) + { + ANGLE_TRY(attachment->initializeContents(context)); + } + return angle::Result::Continue; +} +} // namespace + angle::Result FramebufferImpl::onLabelUpdate(const gl::Context *context) { return angle::Result::Continue; } +angle::Result FramebufferImpl::ensureAttachmentsInitialized( + const gl::Context *context, + const gl::DrawBufferMask &colorAttachments, + bool depth, + bool stencil) +{ + // Default implementation iterates over the attachments and individually initializes them + + for (auto colorIndex : colorAttachments) + { + ANGLE_TRY(InitAttachment(context, mState.getColorAttachment(colorIndex))); + } + + if (depth) + { + ANGLE_TRY(InitAttachment(context, mState.getDepthAttachment())); + } + + if (stencil) + { + ANGLE_TRY(InitAttachment(context, mState.getStencilAttachment())); + } + + return angle::Result::Continue; +} + } // namespace rx diff --git a/src/libANGLE/renderer/FramebufferImpl.h b/src/libANGLE/renderer/FramebufferImpl.h index 0ecfaba4f2..dbace39b76 100644 --- a/src/libANGLE/renderer/FramebufferImpl.h +++ b/src/libANGLE/renderer/FramebufferImpl.h @@ -83,6 +83,11 @@ class FramebufferImpl : angle::NonCopyable virtual gl::FramebufferStatus checkStatus(const gl::Context *context) const = 0; + virtual angle::Result ensureAttachmentsInitialized(const gl::Context *context, + const gl::DrawBufferMask &colorAttachments, + bool depth, + bool stencil); + virtual angle::Result syncState(const gl::Context *context, GLenum binding, const gl::Framebuffer::DirtyBits &dirtyBits, diff --git a/src/libANGLE/renderer/gl/BlitGL.cpp b/src/libANGLE/renderer/gl/BlitGL.cpp index c8b08e7d5a..5e60cae617 100644 --- a/src/libANGLE/renderer/gl/BlitGL.cpp +++ b/src/libANGLE/renderer/gl/BlitGL.cpp @@ -232,6 +232,32 @@ angle::Result UnbindAttachments(const gl::Context *context, return angle::Result::Continue; } +angle::Result CheckIfAttachmentNeedsClearing(const gl::Context *context, + const gl::FramebufferAttachment *attachment, + bool *needsClearInit) +{ + if (attachment->initState() == gl::InitState::Initialized) + { + *needsClearInit = false; + return angle::Result::Continue; + } + + // Special case for 2D array and 3D textures. The init state tracks initialization for all + // layers but only one will be cleared by a clear call. Initialize those entire textures + // here. + if (attachment->type() == GL_TEXTURE && + (attachment->getTextureImageIndex().getTarget() == gl::TextureTarget::_2DArray || + attachment->getTextureImageIndex().getTarget() == gl::TextureTarget::_3D)) + { + ANGLE_TRY(attachment->initializeContents(context)); + *needsClearInit = false; + return angle::Result::Continue; + } + + *needsClearInit = true; + return angle::Result::Continue; +} + } // anonymous namespace BlitGL::BlitGL(const FunctionsGL *functions, @@ -1052,19 +1078,113 @@ angle::Result BlitGL::clearRenderbuffer(const gl::Context *context, } angle::Result BlitGL::clearFramebuffer(const gl::Context *context, - bool colorClear, + const gl::DrawBufferMask &colorAttachments, bool depthClear, bool stencilClear, FramebufferGL *source) { // initializeResources skipped because no local state is used + bool hasIntegerColorAttachments = false; + + // Filter the color attachments for ones that actually have an init state of uninitialized. + gl::DrawBufferMask uninitializedColorAttachments; + for (size_t colorAttachmentIdx : colorAttachments) + { + bool needsInit = false; + const gl::FramebufferAttachment *attachment = + source->getState().getColorAttachment(colorAttachmentIdx); + ANGLE_TRY(CheckIfAttachmentNeedsClearing(context, attachment, &needsInit)); + uninitializedColorAttachments[colorAttachmentIdx] = needsInit; + if (needsInit && (attachment->getComponentType() == GL_INT || + attachment->getComponentType() == GL_UNSIGNED_INT)) + { + hasIntegerColorAttachments = true; + } + } + + bool depthNeedsInit = false; + if (depthClear) + { + ANGLE_TRY(CheckIfAttachmentNeedsClearing(context, source->getState().getDepthAttachment(), + &depthNeedsInit)); + } + + bool stencilNeedsInit = false; + if (stencilClear) + { + ANGLE_TRY(CheckIfAttachmentNeedsClearing(context, source->getState().getStencilAttachment(), + &stencilNeedsInit)); + } + // Clear all attachments GLbitfield clearMask = 0; - ANGLE_TRY(SetClearState(mStateManager, colorClear, depthClear, stencilClear, &clearMask)); + ANGLE_TRY(SetClearState(mStateManager, uninitializedColorAttachments.any(), depthNeedsInit, + stencilNeedsInit, &clearMask)); mStateManager->bindFramebuffer(GL_FRAMEBUFFER, source->getFramebufferID()); - ANGLE_GL_TRY(context, mFunctions->clear(clearMask)); + + // If we're not clearing all attached color attachments, we need to clear them individually with + // glClearBuffer* + if ((clearMask & GL_COLOR_BUFFER_BIT) && + (uninitializedColorAttachments != source->getState().getColorAttachmentsMask() || + uninitializedColorAttachments != source->getState().getEnabledDrawBuffers() || + hasIntegerColorAttachments)) + { + for (size_t colorAttachmentIdx : uninitializedColorAttachments) + { + const gl::FramebufferAttachment *attachment = + source->getState().getColorAttachment(colorAttachmentIdx); + if (attachment->initState() == gl::InitState::Initialized) + { + continue; + } + + switch (attachment->getComponentType()) + { + case GL_UNSIGNED_NORMALIZED: + case GL_SIGNED_NORMALIZED: + case GL_FLOAT: + { + constexpr GLfloat clearValue[] = {0, 0, 0, 0}; + ANGLE_GL_TRY(context, + mFunctions->clearBufferfv( + GL_COLOR, static_cast<GLint>(colorAttachmentIdx), clearValue)); + } + break; + + case GL_INT: + { + constexpr GLint clearValue[] = {0, 0, 0, 0}; + ANGLE_GL_TRY(context, + mFunctions->clearBufferiv( + GL_COLOR, static_cast<GLint>(colorAttachmentIdx), clearValue)); + } + break; + + case GL_UNSIGNED_INT: + { + constexpr GLuint clearValue[] = {0, 0, 0, 0}; + ANGLE_GL_TRY(context, + mFunctions->clearBufferuiv( + GL_COLOR, static_cast<GLint>(colorAttachmentIdx), clearValue)); + } + break; + + default: + UNREACHABLE(); + break; + } + } + + // Remove color buffer bit and clear the rest of the attachments with glClear + clearMask = clearMask & ~GL_COLOR_BUFFER_BIT; + } + + if (clearMask != 0) + { + ANGLE_GL_TRY(context, mFunctions->clear(clearMask)); + } return angle::Result::Continue; } diff --git a/src/libANGLE/renderer/gl/BlitGL.h b/src/libANGLE/renderer/gl/BlitGL.h index 4229488f86..632d3a8bf0 100644 --- a/src/libANGLE/renderer/gl/BlitGL.h +++ b/src/libANGLE/renderer/gl/BlitGL.h @@ -151,7 +151,7 @@ class BlitGL : angle::NonCopyable GLenum sizedInternalFormat); angle::Result clearFramebuffer(const gl::Context *context, - bool colorClear, + const gl::DrawBufferMask &colorAttachments, bool depthClear, bool stencilClear, FramebufferGL *source); diff --git a/src/libANGLE/renderer/gl/FramebufferGL.cpp b/src/libANGLE/renderer/gl/FramebufferGL.cpp index 6fe40a0408..8374185892 100644 --- a/src/libANGLE/renderer/gl/FramebufferGL.cpp +++ b/src/libANGLE/renderer/gl/FramebufferGL.cpp @@ -1303,6 +1303,24 @@ gl::FramebufferStatus FramebufferGL::checkStatus(const gl::Context *context) con return gl::FramebufferStatus::Complete(); } +angle::Result FramebufferGL::ensureAttachmentsInitialized( + const gl::Context *context, + const gl::DrawBufferMask &colorAttachments, + bool depth, + bool stencil) +{ + if (colorAttachments != getState().getEnabledDrawBuffers()) + { + // Fall back to the default implementation when there are gaps in the enabled draw buffers + // to avoid modifying the draw buffer state. + return FramebufferImpl::ensureAttachmentsInitialized(context, colorAttachments, depth, + stencil); + } + + BlitGL *blitter = GetBlitGL(context); + return blitter->clearFramebuffer(context, colorAttachments, depth, stencil, this); +} + angle::Result FramebufferGL::syncState(const gl::Context *context, GLenum binding, const gl::Framebuffer::DirtyBits &dirtyBits, diff --git a/src/libANGLE/renderer/gl/FramebufferGL.h b/src/libANGLE/renderer/gl/FramebufferGL.h index 48a1877201..d2f7c17680 100644 --- a/src/libANGLE/renderer/gl/FramebufferGL.h +++ b/src/libANGLE/renderer/gl/FramebufferGL.h @@ -81,6 +81,11 @@ class FramebufferGL : public FramebufferImpl gl::FramebufferStatus checkStatus(const gl::Context *context) const override; + angle::Result ensureAttachmentsInitialized(const gl::Context *context, + const gl::DrawBufferMask &colorAttachments, + bool depth, + bool stencil) override; + angle::Result syncState(const gl::Context *context, GLenum binding, const gl::Framebuffer::DirtyBits &dirtyBits, diff --git a/src/libANGLE/renderer/gl/SurfaceGL.cpp b/src/libANGLE/renderer/gl/SurfaceGL.cpp index 36dc8347ff..deabd7eb80 100644 --- a/src/libANGLE/renderer/gl/SurfaceGL.cpp +++ b/src/libANGLE/renderer/gl/SurfaceGL.cpp @@ -46,12 +46,17 @@ angle::Result SurfaceGL::initializeContents(const gl::Context *context, switch (binding) { case GL_BACK: - ANGLE_TRY(blitter->clearFramebuffer(context, true, false, false, framebufferGL)); - break; + { + gl::DrawBufferMask colorAttachments{0}; + ANGLE_TRY( + blitter->clearFramebuffer(context, colorAttachments, false, false, framebufferGL)); + } + break; case GL_DEPTH: case GL_STENCIL: - ANGLE_TRY(blitter->clearFramebuffer(context, false, true, true, framebufferGL)); + ANGLE_TRY(blitter->clearFramebuffer(context, gl::DrawBufferMask(), true, true, + framebufferGL)); break; default: diff --git a/src/libANGLE/renderer/gl/egl/ImageEGL.cpp b/src/libANGLE/renderer/gl/egl/ImageEGL.cpp index 8357845197..be70e7dc16 100644 --- a/src/libANGLE/renderer/gl/egl/ImageEGL.cpp +++ b/src/libANGLE/renderer/gl/egl/ImageEGL.cpp @@ -10,6 +10,7 @@ #include "common/utilities.h" #include "libANGLE/Context.h" +#include "libANGLE/Display.h" #include "libANGLE/renderer/gl/FunctionsGL.h" #include "libANGLE/renderer/gl/RenderbufferGL.h" #include "libANGLE/renderer/gl/StateManagerGL.h" @@ -99,11 +100,19 @@ egl::Error ImageEGL::initialize(const egl::Display *display) attributes.push_back(EGL_NONE); - mImage = mEGL->createImageKHR(mContext, mTarget, buffer, attributes.data()); - if (mImage == EGL_NO_IMAGE) - { - return egl::EglBadAlloc() << "eglCreateImage failed with " << egl::Error(mEGL->getError()); - } + egl::Display::GetCurrentThreadUnlockedTailCall()->add([egl = mEGL, &image = mImage, + context = mContext, target = mTarget, + buffer, attributes](void *resultOut) { + image = egl->createImageKHR(context, target, buffer, attributes.data()); + + // If image creation failed, force the return value of eglCreateImage to EGL_NO_IMAGE. This + // won't delete this image object but a driver error is unexpected at this point. + if (image == EGL_NO_IMAGE) + { + ERR() << "eglCreateImage failed with " << gl::FmtHex(egl->getError()); + *static_cast<EGLImage *>(resultOut) = EGL_NO_IMAGE; + } + }); return egl::NoError(); } diff --git a/src/libANGLE/renderer/gl/egl/SurfaceEGL.cpp b/src/libANGLE/renderer/gl/egl/SurfaceEGL.cpp index 0be9a2caf8..f7cbffc2f3 100644 --- a/src/libANGLE/renderer/gl/egl/SurfaceEGL.cpp +++ b/src/libANGLE/renderer/gl/egl/SurfaceEGL.cpp @@ -9,6 +9,7 @@ #include "libANGLE/renderer/gl/egl/SurfaceEGL.h" #include "common/debug.h" +#include "libANGLE/Display.h" namespace rx { @@ -38,11 +39,12 @@ egl::Error SurfaceEGL::makeCurrent(const gl::Context *context) egl::Error SurfaceEGL::swap(const gl::Context *context) { - EGLBoolean success = mEGL->swapBuffers(mSurface); - if (success == EGL_FALSE) - { - return egl::Error(mEGL->getError(), "eglSwapBuffers failed"); - } + egl::Display::GetCurrentThreadUnlockedTailCall()->add( + [egl = mEGL, surface = mSurface](void *resultOut) { + ANGLE_UNUSED_VARIABLE(resultOut); + *static_cast<EGLBoolean *>(resultOut) = egl->swapBuffers(surface); + }); + return egl::NoError(); } @@ -50,19 +52,24 @@ egl::Error SurfaceEGL::swapWithDamage(const gl::Context *context, const EGLint *rects, EGLint n_rects) { - EGLBoolean success; if (mHasSwapBuffersWithDamage) { - success = mEGL->swapBuffersWithDamageKHR(mSurface, rects, n_rects); + egl::Display::GetCurrentThreadUnlockedTailCall()->add( + [egl = mEGL, surface = mSurface, rects, n_rects](void *resultOut) { + ANGLE_UNUSED_VARIABLE(resultOut); + *static_cast<EGLBoolean *>(resultOut) = + egl->swapBuffersWithDamageKHR(surface, rects, n_rects); + }); } else { - success = mEGL->swapBuffers(mSurface); - } - if (success == EGL_FALSE) - { - return egl::Error(mEGL->getError(), "eglSwapBuffersWithDamageKHR failed"); + egl::Display::GetCurrentThreadUnlockedTailCall()->add( + [egl = mEGL, surface = mSurface](void *resultOut) { + ANGLE_UNUSED_VARIABLE(resultOut); + *static_cast<EGLBoolean *>(resultOut) = egl->swapBuffers(surface); + }); } + return egl::NoError(); } diff --git a/src/libANGLE/renderer/gl/egl/SyncEGL.cpp b/src/libANGLE/renderer/gl/egl/SyncEGL.cpp index b4a19dce32..93e3151eaf 100644 --- a/src/libANGLE/renderer/gl/egl/SyncEGL.cpp +++ b/src/libANGLE/renderer/gl/egl/SyncEGL.cpp @@ -26,7 +26,10 @@ void SyncEGL::onDestroy(const egl::Display *display) { if (mSync != EGL_NO_SYNC_KHR) { - mEGL->destroySyncKHR(mSync); + egl::Display::GetCurrentThreadUnlockedTailCall()->add( + [egl = mEGL, sync = mSync](void *resultOut) { + *static_cast<EGLBoolean *>(resultOut) = egl->destroySyncKHR(sync); + }); mSync = EGL_NO_SYNC_KHR; } } @@ -49,11 +52,18 @@ egl::Error SyncEGL::initialize(const egl::Display *display, } nativeAttribs.push_back(EGL_NONE); - mSync = mEGL->createSyncKHR(type, nativeAttribs.data()); - if (mSync == EGL_NO_SYNC_KHR) - { - return egl::Error(mEGL->getError(), "eglCreateSync failed to create sync object"); - } + egl::Display::GetCurrentThreadUnlockedTailCall()->add( + [egl = mEGL, &sync = mSync, type, attribs = nativeAttribs](void *resultOut) { + sync = egl->createSyncKHR(type, attribs.data()); + + // If sync creation failed, force the return value of eglCreateSync to EGL_NO_SYNC. This + // won't delete this sync object but a driver error is unexpected at this point. + if (sync == EGL_NO_SYNC_KHR) + { + ERR() << "eglCreateSync failed with " << gl::FmtHex(egl->getError()); + *static_cast<EGLSync *>(resultOut) = EGL_NO_SYNC_KHR; + } + }); return egl::NoError(); } @@ -65,14 +75,14 @@ egl::Error SyncEGL::clientWait(const egl::Display *display, EGLint *outResult) { ASSERT(mSync != EGL_NO_SYNC_KHR); - EGLint result = mEGL->clientWaitSyncKHR(mSync, flags, timeout); - if (result == EGL_FALSE) - { - return egl::Error(mEGL->getError(), "eglClientWaitSync failed"); - } + // If we need to perform a CPU wait don't set the resultOut parameter passed into the + // method, instead set the parameter passed into the unlocked tail call. + egl::Display::GetCurrentThreadUnlockedTailCall()->add( + [egl = mEGL, sync = mSync, flags, timeout](void *resultOut) { + *static_cast<EGLint *>(resultOut) = egl->clientWaitSyncKHR(sync, flags, timeout); + }); - *outResult = result; return egl::NoError(); } @@ -81,12 +91,11 @@ egl::Error SyncEGL::serverWait(const egl::Display *display, EGLint flags) { ASSERT(mSync != EGL_NO_SYNC_KHR); - EGLint result = mEGL->waitSyncKHR(mSync, flags); - if (result == EGL_FALSE) - { - return egl::Error(mEGL->getError(), "eglWaitSync failed"); - } + egl::Display::GetCurrentThreadUnlockedTailCall()->add( + [egl = mEGL, sync = mSync, flags](void *resultOut) { + *static_cast<EGLBoolean *>(resultOut) = egl->waitSyncKHR(sync, flags); + }); return egl::NoError(); } diff --git a/src/libANGLE/renderer/metal/ImageMtl.mm b/src/libANGLE/renderer/metal/ImageMtl.mm index 902a38b4d4..a2ae3387a9 100644 --- a/src/libANGLE/renderer/metal/ImageMtl.mm +++ b/src/libANGLE/renderer/metal/ImageMtl.mm @@ -20,6 +20,40 @@ namespace rx { +namespace +{ +angle::FormatID intendedFormatForMTLTexture(id<MTLTexture> texture, + const egl::AttributeMap &attribs) +{ + angle::FormatID angleFormatId = mtl::Format::MetalToAngleFormatID(texture.pixelFormat); + if (angleFormatId == angle::FormatID::NONE) + { + return angle::FormatID::NONE; + } + + const angle::Format *textureAngleFormat = &angle::Format::Get(angleFormatId); + ASSERT(textureAngleFormat); + + GLenum sizedInternalFormat = textureAngleFormat->glInternalFormat; + + if (attribs.contains(EGL_TEXTURE_INTERNAL_FORMAT_ANGLE)) + { + const GLenum internalFormat = + static_cast<GLenum>(attribs.get(EGL_TEXTURE_INTERNAL_FORMAT_ANGLE)); + GLenum type = gl::GetSizedInternalFormatInfo(sizedInternalFormat).type; + const auto format = gl::Format(internalFormat, type); + if (!format.valid()) + { + return angle::FormatID::NONE; + } + + sizedInternalFormat = format.info->sizedInternalFormat; + } + + return angle::Format::InternalFormatToID(sizedInternalFormat); +} +} // anonymous namespace + // TextureImageSiblingMtl implementation TextureImageSiblingMtl::TextureImageSiblingMtl(EGLClientBuffer buffer, const egl::AttributeMap &attribs) @@ -45,12 +79,18 @@ egl::Error TextureImageSiblingMtl::ValidateClientBuffer(const DisplayMtl *displa return egl::EglBadAttribute(); } - angle::FormatID angleFormatId = mtl::Format::MetalToAngleFormatID(texture.pixelFormat); + angle::FormatID angleFormatId = intendedFormatForMTLTexture(texture, attribs); const mtl::Format &format = display->getPixelFormat(angleFormatId); if (!format.valid()) { return egl::EglBadAttribute() << "Unrecognized format"; } + + if (format.metalFormat != texture.pixelFormat) + { + return egl::EglBadAttribute() << "Incompatible format"; + } + unsigned textureArraySlice = static_cast<unsigned>(attribs.getAsInt(EGL_METAL_TEXTURE_ARRAY_SLICE_ANGLE, 0)); if (texture.textureType != MTLTextureType2DArray && textureArraySlice > 0) @@ -89,9 +129,8 @@ angle::Result TextureImageSiblingMtl::initImpl(DisplayMtl *displayMtl) baseTexture->createSliceMipView(textureArraySlice, mtl::kZeroNativeMipLevel); } - angle::FormatID angleFormatId = - mtl::Format::MetalToAngleFormatID(mNativeTexture->pixelFormat()); - mFormat = displayMtl->getPixelFormat(angleFormatId); + angle::FormatID angleFormatId = intendedFormatForMTLTexture(mNativeTexture->get(), mAttribs); + mFormat = displayMtl->getPixelFormat(angleFormatId); if (mNativeTexture) { diff --git a/src/libANGLE/renderer/vulkan/CLCommandQueueVk.cpp b/src/libANGLE/renderer/vulkan/CLCommandQueueVk.cpp index f461da52f3..a448fb2a48 100644 --- a/src/libANGLE/renderer/vulkan/CLCommandQueueVk.cpp +++ b/src/libANGLE/renderer/vulkan/CLCommandQueueVk.cpp @@ -111,8 +111,60 @@ angle::Result CLCommandQueueVk::enqueueReadBuffer(const cl::Buffer &buffer, const cl::EventPtrs &waitEvents, CLEventImpl::CreateFunc *eventCreateFunc) { - UNIMPLEMENTED(); - ANGLE_CL_RETURN_ERROR(CL_OUT_OF_RESOURCES); + std::scoped_lock<std::mutex> sl(mCommandQueueMutex); + + ANGLE_TRY(processWaitlist(waitEvents)); + + if (blocking) + { + ANGLE_TRY(finishInternal()); + auto bufferVk = &buffer.getImpl<CLBufferVk>(); + ANGLE_TRY(bufferVk->copyTo(ptr, offset, size)); + } + else + { + CLBufferVk &bufferVk = buffer.getImpl<CLBufferVk>(); + + // Reached transfer buffer creation limit/heuristic, finish this current batch + if (mHostBufferUpdateList.size() >= kMaxHostBufferUpdateListSize) + { + ANGLE_TRY(finishInternal()); + } + + // Create a transfer buffer and push it in update list + mHostBufferUpdateList.emplace_back( + cl::Buffer::Cast(this->mContext->getFrontendObject().createBuffer( + nullptr, cl::MemFlags{buffer.getFlags().get() | CL_MEM_USE_HOST_PTR}, + buffer.getSize(), ptr))); + if (mHostBufferUpdateList.back() == nullptr) + { + ANGLE_CL_RETURN_ERROR(CL_OUT_OF_RESOURCES); + } + CLBufferVk &transferBufferVk = mHostBufferUpdateList.back()->getImpl<CLBufferVk>(); + // Release initialization reference, lifetime controlled by RefPointer. + mHostBufferUpdateList.back()->release(); + + const VkBufferCopy copyRegion = {offset, offset, size}; + + // We need an execution barrier if buffer can be written to by kernel + if (!mComputePassCommands->getCommandBuffer().empty() && bufferVk.isWritable()) + { + VkMemoryBarrier memoryBarrier = { + VK_STRUCTURE_TYPE_MEMORY_BARRIER, nullptr, VK_ACCESS_SHADER_WRITE_BIT, + VK_ACCESS_MEMORY_READ_BIT | VK_ACCESS_MEMORY_WRITE_BIT}; + mComputePassCommands->getCommandBuffer().pipelineBarrier( + VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0, 1, + &memoryBarrier, 0, nullptr, 0, nullptr); + } + + mComputePassCommands->getCommandBuffer().copyBuffer( + bufferVk.getBuffer().getBuffer(), transferBufferVk.getBuffer().getBuffer(), 1, + ©Region); + } + + ANGLE_TRY(createEvent(eventCreateFunc)); + + return angle::Result::Continue; } angle::Result CLCommandQueueVk::enqueueWriteBuffer(const cl::Buffer &buffer, @@ -123,8 +175,20 @@ angle::Result CLCommandQueueVk::enqueueWriteBuffer(const cl::Buffer &buffer, const cl::EventPtrs &waitEvents, CLEventImpl::CreateFunc *eventCreateFunc) { - UNIMPLEMENTED(); - ANGLE_CL_RETURN_ERROR(CL_OUT_OF_RESOURCES); + std::scoped_lock<std::mutex> sl(mCommandQueueMutex); + + ANGLE_TRY(processWaitlist(waitEvents)); + + auto bufferVk = &buffer.getImpl<CLBufferVk>(); + ANGLE_TRY(bufferVk->copyFrom(ptr, offset, size)); + if (blocking) + { + ANGLE_TRY(finishInternal()); + } + + ANGLE_TRY(createEvent(eventCreateFunc)); + + return angle::Result::Continue; } angle::Result CLCommandQueueVk::enqueueReadBufferRect(const cl::Buffer &buffer, @@ -379,33 +443,80 @@ angle::Result CLCommandQueueVk::enqueueNativeKernel(cl::UserFunc userFunc, angle::Result CLCommandQueueVk::enqueueMarkerWithWaitList(const cl::EventPtrs &waitEvents, CLEventImpl::CreateFunc *eventCreateFunc) { - UNIMPLEMENTED(); - ANGLE_CL_RETURN_ERROR(CL_OUT_OF_RESOURCES); + std::scoped_lock<std::mutex> sl(mCommandQueueMutex); + + ANGLE_TRY(processWaitlist(waitEvents)); + ANGLE_TRY(createEvent(eventCreateFunc)); + + return angle::Result::Continue; } angle::Result CLCommandQueueVk::enqueueMarker(CLEventImpl::CreateFunc &eventCreateFunc) { - UNIMPLEMENTED(); - ANGLE_CL_RETURN_ERROR(CL_OUT_OF_RESOURCES); + std::scoped_lock<std::mutex> sl(mCommandQueueMutex); + + // This deprecated API is essentially a super-set of clEnqueueBarrier, where we also return an + // event object (i.e. marker) since clEnqueueBarrier does not provide this + VkMemoryBarrier memoryBarrier = {VK_STRUCTURE_TYPE_MEMORY_BARRIER, nullptr, + VK_ACCESS_SHADER_WRITE_BIT, + VK_ACCESS_MEMORY_READ_BIT | VK_ACCESS_MEMORY_WRITE_BIT}; + mComputePassCommands->getCommandBuffer().pipelineBarrier( + VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0, 1, + &memoryBarrier, 0, nullptr, 0, nullptr); + + ANGLE_TRY(createEvent(&eventCreateFunc)); + + return angle::Result::Continue; } angle::Result CLCommandQueueVk::enqueueWaitForEvents(const cl::EventPtrs &events) { - UNIMPLEMENTED(); - ANGLE_CL_RETURN_ERROR(CL_OUT_OF_RESOURCES); + std::scoped_lock<std::mutex> sl(mCommandQueueMutex); + + // Unlike clWaitForEvents, this routine is non-blocking + ANGLE_TRY(processWaitlist(events)); + + return angle::Result::Continue; } angle::Result CLCommandQueueVk::enqueueBarrierWithWaitList(const cl::EventPtrs &waitEvents, CLEventImpl::CreateFunc *eventCreateFunc) { - UNIMPLEMENTED(); - ANGLE_CL_RETURN_ERROR(CL_OUT_OF_RESOURCES); + std::scoped_lock<std::mutex> sl(mCommandQueueMutex); + + // The barrier command either waits for a list of events to complete, or if the list is empty it + // waits for all commands previously enqueued in command_queue to complete before it completes + if (waitEvents.empty()) + { + VkMemoryBarrier memoryBarrier = {VK_STRUCTURE_TYPE_MEMORY_BARRIER, nullptr, + VK_ACCESS_SHADER_WRITE_BIT, + VK_ACCESS_MEMORY_READ_BIT | VK_ACCESS_MEMORY_WRITE_BIT}; + mComputePassCommands->getCommandBuffer().pipelineBarrier( + VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0, 1, + &memoryBarrier, 0, nullptr, 0, nullptr); + } + else + { + ANGLE_TRY(processWaitlist(waitEvents)); + } + + ANGLE_TRY(createEvent(eventCreateFunc)); + + return angle::Result::Continue; } angle::Result CLCommandQueueVk::enqueueBarrier() { - UNIMPLEMENTED(); - ANGLE_CL_RETURN_ERROR(CL_OUT_OF_RESOURCES); + std::scoped_lock<std::mutex> sl(mCommandQueueMutex); + + VkMemoryBarrier memoryBarrier = {VK_STRUCTURE_TYPE_MEMORY_BARRIER, nullptr, + VK_ACCESS_SHADER_WRITE_BIT, + VK_ACCESS_MEMORY_READ_BIT | VK_ACCESS_MEMORY_WRITE_BIT}; + mComputePassCommands->getCommandBuffer().pipelineBarrier( + VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0, 1, + &memoryBarrier, 0, nullptr, 0, nullptr); + + return angle::Result::Continue; } angle::Result CLCommandQueueVk::flush() @@ -432,6 +543,20 @@ angle::Result CLCommandQueueVk::finish() return finishInternal(); } +angle::Result CLCommandQueueVk::syncHostBuffers() +{ + for (const cl::MemoryPtr &memoryPtr : mHostBufferUpdateList) + { + ASSERT(memoryPtr->getHostPtr() != nullptr); + CLBufferVk &bufferVk = memoryPtr->getImpl<CLBufferVk>(); + ANGLE_TRY( + bufferVk.copyTo(memoryPtr->getHostPtr(), memoryPtr->getOffset(), memoryPtr->getSize())); + } + mHostBufferUpdateList.clear(); + + return angle::Result::Continue; +} + angle::Result CLCommandQueueVk::processKernelResources(CLKernelVk &kernelVk, const cl::NDRange &ndrange) { @@ -704,6 +829,9 @@ angle::Result CLCommandQueueVk::finishInternal() // Submit and wait for fence ANGLE_TRY(submitCommands()); ANGLE_TRY(mContext->getRenderer()->finishQueueSerial(mContext, mLastSubmittedQueueSerial)); + + // Ensure any resources are synced back to host on GPU completion + ANGLE_TRY(syncHostBuffers()); } for (cl::EventPtr event : mAssociatedEvents) diff --git a/src/libANGLE/renderer/vulkan/CLCommandQueueVk.h b/src/libANGLE/renderer/vulkan/CLCommandQueueVk.h index 44a387b278..68191ef166 100644 --- a/src/libANGLE/renderer/vulkan/CLCommandQueueVk.h +++ b/src/libANGLE/renderer/vulkan/CLCommandQueueVk.h @@ -14,6 +14,7 @@ #include "libANGLE/renderer/vulkan/CLContextVk.h" #include "libANGLE/renderer/vulkan/CLEventVk.h" #include "libANGLE/renderer/vulkan/CLKernelVk.h" +#include "libANGLE/renderer/vulkan/CLMemoryVk.h" #include "libANGLE/renderer/vulkan/DisplayVk.h" #include "libANGLE/renderer/vulkan/ShareGroupVk.h" #include "libANGLE/renderer/vulkan/cl_types.h" @@ -225,7 +226,8 @@ class CLCommandQueueVk : public CLCommandQueueImpl CLPlatformVk *getPlatform() { return mContext->getPlatform(); } private: - static constexpr size_t kMaxDependencyTrackerSize = 64; + static constexpr size_t kMaxDependencyTrackerSize = 64; + static constexpr size_t kMaxHostBufferUpdateListSize = 16; vk::ProtectionType getProtectionType() const { return vk::ProtectionType::Unprotected; } @@ -235,6 +237,7 @@ class CLCommandQueueVk : public CLCommandQueueImpl angle::Result submitCommands(); angle::Result finishInternal(); + angle::Result syncHostBuffers(); angle::Result flushComputePassCommands(); angle::Result processWaitlist(const cl::EventPtrs &waitEvents); angle::Result createEvent(CLEventImpl::CreateFunc *createFunc); @@ -264,6 +267,9 @@ class CLCommandQueueVk : public CLCommandQueueImpl // Check to see if flush/finish can be skipped bool mHasAnyCommandsPendingSubmission; + + // List of buffer refs that need host syncing + cl::MemoryPtrs mHostBufferUpdateList; }; } // namespace rx diff --git a/src/libANGLE/renderer/vulkan/CLContextVk.cpp b/src/libANGLE/renderer/vulkan/CLContextVk.cpp index bac0ba4bb0..5acd9a1a8a 100644 --- a/src/libANGLE/renderer/vulkan/CLContextVk.cpp +++ b/src/libANGLE/renderer/vulkan/CLContextVk.cpp @@ -15,6 +15,7 @@ #include "libANGLE/CLBuffer.h" #include "libANGLE/CLContext.h" +#include "libANGLE/CLEvent.h" #include "libANGLE/CLProgram.h" #include "libANGLE/cl_utils.h" @@ -251,8 +252,23 @@ angle::Result CLContextVk::createUserEvent(const cl::Event &event, CLEventImpl:: angle::Result CLContextVk::waitForEvents(const cl::EventPtrs &events) { - UNIMPLEMENTED(); - ANGLE_CL_RETURN_ERROR(CL_OUT_OF_RESOURCES); + for (auto &event : events) + { + CLEventVk *eventVk = &event.get()->getImpl<CLEventVk>(); + if (eventVk->isUserEvent()) + { + ANGLE_TRY(eventVk->waitForUserEventStatus()); + } + else + { + // TODO rework this to instead (flush w/ ResourceUse serial wait) once we move away from + // spawning a submit-thread/Task for flush routine + // https://anglebug.com/8669 + ANGLE_TRY(event->getCommandQueue()->finish()); + } + } + + return angle::Result::Continue; } } // namespace rx diff --git a/src/libANGLE/renderer/vulkan/CLContextVk.h b/src/libANGLE/renderer/vulkan/CLContextVk.h index a4d85a775c..87e2615799 100644 --- a/src/libANGLE/renderer/vulkan/CLContextVk.h +++ b/src/libANGLE/renderer/vulkan/CLContextVk.h @@ -91,6 +91,8 @@ class CLContextVk : public CLContextImpl, public vk::Context CLPlatformVk *getPlatform() { return &mContext.getPlatform().getImpl<CLPlatformVk>(); } + cl::Context &getFrontendObject() { return const_cast<cl::Context &>(mContext); } + private: void handleDeviceLost() const; diff --git a/src/libANGLE/renderer/vulkan/CLMemoryVk.h b/src/libANGLE/renderer/vulkan/CLMemoryVk.h index 4a859b9944..4decd44b00 100644 --- a/src/libANGLE/renderer/vulkan/CLMemoryVk.h +++ b/src/libANGLE/renderer/vulkan/CLMemoryVk.h @@ -41,6 +41,13 @@ class CLMemoryVk : public CLMemoryImpl angle::Result copyTo(CLMemoryVk *dst, size_t srcOffset, size_t dstOffset, size_t size); angle::Result copyFrom(const void *ptr, size_t offset, size_t size); + bool isWritable() + { + constexpr VkBufferUsageFlags kWritableUsage = + VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT; + return (getVkUsageFlags() & kWritableUsage) != 0; + } + virtual bool isCurrentlyInUse() const = 0; virtual size_t getSize() const = 0; @@ -71,6 +78,7 @@ class CLBufferVk : public CLMemoryVk CLBufferVk *getParent() { return static_cast<CLBufferVk *>(mParent); } angle::Result create(void *hostPtr); + bool isSubBuffer() const { return mParent != nullptr; } angle::Result map() override; diff --git a/src/libANGLE/renderer/vulkan/CommandProcessor.cpp b/src/libANGLE/renderer/vulkan/CommandProcessor.cpp index 143f89eb03..a8df7b38a8 100644 --- a/src/libANGLE/renderer/vulkan/CommandProcessor.cpp +++ b/src/libANGLE/renderer/vulkan/CommandProcessor.cpp @@ -184,14 +184,14 @@ VkResult SharedFence::wait(VkDevice device, uint64_t timeout) const // FenceRecycler implementation void FenceRecycler::destroy(Context *context) { - std::lock_guard<std::mutex> lock(mMutex); + std::lock_guard<angle::SimpleMutex> lock(mMutex); mRecyler.destroy(context->getDevice()); } void FenceRecycler::fetch(VkDevice device, Fence *fenceOut) { ASSERT(fenceOut != nullptr && !fenceOut->valid()); - std::lock_guard<std::mutex> lock(mMutex); + std::lock_guard<angle::SimpleMutex> lock(mMutex); if (!mRecyler.empty()) { mRecyler.fetch(fenceOut); @@ -201,7 +201,7 @@ void FenceRecycler::fetch(VkDevice device, Fence *fenceOut) void FenceRecycler::recycle(Fence &&fence) { - std::lock_guard<std::mutex> lock(mMutex); + std::lock_guard<angle::SimpleMutex> lock(mMutex); mRecyler.recycle(std::move(fence)); } @@ -500,7 +500,7 @@ VkResult CommandBatch::waitFence(VkDevice device, uint64_t timeout) const VkResult CommandBatch::waitFenceUnlocked(VkDevice device, uint64_t timeout, - std::unique_lock<std::mutex> *lock) const + std::unique_lock<angle::SimpleMutex> *lock) const { ASSERT(hasFence()); VkResult status; @@ -541,7 +541,7 @@ void CommandProcessor::handleError(VkResult errorCode, handleDeviceLost(mRenderer); } - std::lock_guard<std::mutex> queueLock(mErrorMutex); + std::lock_guard<angle::SimpleMutex> queueLock(mErrorMutex); Error error = {errorCode, file, function, line}; mErrors.emplace(error); } @@ -553,7 +553,7 @@ CommandProcessor::CommandProcessor(vk::Renderer *renderer, CommandQueue *command mTaskThreadShouldExit(false), mNeedCommandsAndGarbageCleanup(false) { - std::lock_guard<std::mutex> queueLock(mErrorMutex); + std::lock_guard<angle::SimpleMutex> queueLock(mErrorMutex); while (!mErrors.empty()) { mErrors.pop(); @@ -564,7 +564,7 @@ CommandProcessor::~CommandProcessor() = default; angle::Result CommandProcessor::checkAndPopPendingError(Context *errorHandlingContext) { - std::lock_guard<std::mutex> queueLock(mErrorMutex); + std::lock_guard<angle::SimpleMutex> queueLock(mErrorMutex); if (mErrors.empty()) { return angle::Result::Continue; @@ -586,7 +586,7 @@ angle::Result CommandProcessor::queueCommand(CommandProcessorTask &&task) std::unique_lock<std::mutex> enqueueLock(mTaskEnqueueMutex); if (mTaskQueue.full()) { - std::lock_guard<std::mutex> dequeueLock(mTaskDequeueMutex); + std::lock_guard<angle::SimpleMutex> dequeueLock(mTaskDequeueMutex); // Check mTasks again in case someone just drained the mTasks. if (mTaskQueue.full()) { @@ -658,7 +658,7 @@ angle::Result CommandProcessor::processTasksImpl(bool *exitThread) enqueueLock.unlock(); // Take submission lock to ensure the submission is in the same order as we received. - std::lock_guard<std::mutex> dequeueLock(mTaskDequeueMutex); + std::lock_guard<angle::SimpleMutex> dequeueLock(mTaskDequeueMutex); if (!mTaskQueue.empty()) { CommandProcessorTask task(std::move(mTaskQueue.front())); @@ -789,7 +789,7 @@ angle::Result CommandProcessor::waitForAllWorkToBeSubmitted(Context *context) // Take mWorkerMutex lock so that no one is able to enqueue more work while we drain it // and handle device lost. std::lock_guard<std::mutex> enqueueLock(mTaskEnqueueMutex); - std::lock_guard<std::mutex> dequeueLock(mTaskDequeueMutex); + std::lock_guard<angle::SimpleMutex> dequeueLock(mTaskDequeueMutex); // Sync any errors to the context // Do this inside the mutex to prevent new errors adding to the list. ANGLE_TRY(checkAndPopPendingError(context)); @@ -1012,7 +1012,7 @@ angle::Result CommandProcessor::waitForResourceUseToBeSubmitted(Context *context { // We do not hold mTaskEnqueueMutex lock, so that we still allow other context to enqueue // work while we are processing them. - std::lock_guard<std::mutex> dequeueLock(mTaskDequeueMutex); + std::lock_guard<angle::SimpleMutex> dequeueLock(mTaskDequeueMutex); // Do this inside the mutex to prevent new errors adding to the list. ANGLE_TRY(checkAndPopPendingError(context)); @@ -1037,7 +1037,7 @@ angle::Result CommandProcessor::waitForPresentToBeSubmitted(SwapchainStatus *swa return angle::Result::Continue; } - std::lock_guard<std::mutex> dequeueLock(mTaskDequeueMutex); + std::lock_guard<angle::SimpleMutex> dequeueLock(mTaskDequeueMutex); size_t maxTaskCount = mTaskQueue.size(); size_t taskCount = 0; while (taskCount < maxTaskCount && swapchainStatus->isPending) @@ -1063,8 +1063,8 @@ CommandQueue::~CommandQueue() = default; void CommandQueue::destroy(Context *context) { - std::lock_guard<std::mutex> lock(mMutex); - std::lock_guard<std::mutex> enqueuelock(mQueueSubmitMutex); + std::lock_guard<angle::SimpleMutex> lock(mMutex); + std::lock_guard<angle::SimpleMutex> enqueuelock(mQueueSubmitMutex); // Force all commands to finish by flushing all queues. for (VkQueue queue : mQueueMap) { @@ -1103,7 +1103,7 @@ void CommandQueue::destroy(Context *context) angle::Result CommandQueue::init(Context *context, const DeviceQueueMap &queueMap) { - std::lock_guard<std::mutex> lock(mMutex); + std::lock_guard<angle::SimpleMutex> lock(mMutex); // In case Renderer gets re-initialized, we can't rely on constructor to do initialization. mLastSubmittedSerials.fill(kZeroSerial); mLastCompletedSerials.fill(kZeroSerial); @@ -1126,8 +1126,8 @@ void CommandQueue::handleDeviceLost(vk::Renderer *renderer) ANGLE_TRACE_EVENT0("gpu.angle", "CommandQueue::handleDeviceLost"); VkDevice device = renderer->getDevice(); // Hold both locks while clean up mInFlightCommands. - std::lock_guard<std::mutex> dequeuelock(mMutex); - std::lock_guard<std::mutex> enqueuelock(mQueueSubmitMutex); + std::lock_guard<angle::SimpleMutex> dequeuelock(mMutex); + std::lock_guard<angle::SimpleMutex> enqueuelock(mQueueSubmitMutex); while (!mInFlightCommands.empty()) { @@ -1170,7 +1170,7 @@ angle::Result CommandQueue::postSubmitCheck(Context *context) // destroyed. This is important to keep peak memory usage at check when game launched and a // lot of staging buffers used for textures upload and then gets released. But if there is // only one command buffer in flight, we do not wait here to ensure we keep GPU busy. - std::unique_lock<std::mutex> lock(mMutex); + std::unique_lock<angle::SimpleMutex> lock(mMutex); while (suballocationGarbageSize > kMaxBufferSuballocationGarbageSize && mInFlightCommands.size() > 1) { @@ -1195,7 +1195,7 @@ angle::Result CommandQueue::finishResourceUse(Context *context, VkDevice device = context->getDevice(); { - std::unique_lock<std::mutex> lock(mMutex); + std::unique_lock<angle::SimpleMutex> lock(mMutex); while (!mInFlightCommands.empty() && !hasResourceUseFinished(use)) { bool finished; @@ -1232,7 +1232,7 @@ angle::Result CommandQueue::waitIdle(Context *context, uint64_t timeout) // Fill the local variable with lock vk::ResourceUse use; { - std::lock_guard<std::mutex> lock(mMutex); + std::lock_guard<angle::SimpleMutex> lock(mMutex); if (mInFlightCommands.empty()) { return angle::Result::Continue; @@ -1259,7 +1259,7 @@ angle::Result CommandQueue::waitForResourceUseToFinishWithUserTimeout(Context *c VkDevice device = context->getDevice(); size_t finishedCount = 0; { - std::unique_lock<std::mutex> lock(mMutex); + std::unique_lock<angle::SimpleMutex> lock(mMutex); *result = hasResourceUseFinished(use) ? VK_SUCCESS : VK_NOT_READY; while (!mInFlightCommands.empty() && !hasResourceUseFinished(use)) { @@ -1317,7 +1317,7 @@ void CommandQueue::flushWaitSemaphores(ProtectionType protectionType, { ASSERT(!waitSemaphores.empty()); ASSERT(waitSemaphores.size() == waitSemaphoreStageMasks.size()); - std::lock_guard<std::mutex> lock(mMutex); + std::lock_guard<angle::SimpleMutex> lock(mMutex); CommandsState &state = mCommandsStateMap[priority][protectionType]; @@ -1337,7 +1337,7 @@ angle::Result CommandQueue::flushOutsideRPCommands( egl::ContextPriority priority, OutsideRenderPassCommandBufferHelper **outsideRPCommands) { - std::lock_guard<std::mutex> lock(mMutex); + std::lock_guard<angle::SimpleMutex> lock(mMutex); ANGLE_TRY(ensurePrimaryCommandBufferValid(context, protectionType, priority)); CommandsState &state = mCommandsStateMap[priority][protectionType]; return (*outsideRPCommands)->flushToPrimary(context, &state); @@ -1351,7 +1351,7 @@ angle::Result CommandQueue::flushRenderPassCommands( VkFramebuffer framebufferOverride, RenderPassCommandBufferHelper **renderPassCommands) { - std::lock_guard<std::mutex> lock(mMutex); + std::lock_guard<angle::SimpleMutex> lock(mMutex); ANGLE_TRY(ensurePrimaryCommandBufferValid(context, protectionType, priority)); CommandsState &state = mCommandsStateMap[priority][protectionType]; return (*renderPassCommands)->flushToPrimary(context, &state, renderPass, framebufferOverride); @@ -1365,7 +1365,7 @@ angle::Result CommandQueue::submitCommands(Context *context, const QueueSerial &submitQueueSerial) { ANGLE_TRACE_EVENT0("gpu.angle", "CommandQueue::submitCommands"); - std::unique_lock<std::mutex> lock(mMutex); + std::unique_lock<angle::SimpleMutex> lock(mMutex); vk::Renderer *renderer = context->getRenderer(); VkDevice device = renderer->getDevice(); @@ -1452,7 +1452,7 @@ angle::Result CommandQueue::queueSubmitOneOff(Context *context, SubmitPolicy submitPolicy, const QueueSerial &submitQueueSerial) { - std::unique_lock<std::mutex> lock(mMutex); + std::unique_lock<angle::SimpleMutex> lock(mMutex); DeviceScoped<CommandBatch> scopedBatch(context->getDevice()); CommandBatch &batch = scopedBatch.get(); batch.queueSerial = submitQueueSerial; @@ -1496,7 +1496,7 @@ angle::Result CommandQueue::queueSubmitOneOff(Context *context, } angle::Result CommandQueue::queueSubmit(Context *context, - std::unique_lock<std::mutex> &&dequeueLock, + std::unique_lock<angle::SimpleMutex> &&dequeueLock, egl::ContextPriority contextPriority, const VkSubmitInfo &submitInfo, DeviceScoped<CommandBatch> &commandBatch, @@ -1509,7 +1509,7 @@ angle::Result CommandQueue::queueSubmit(Context *context, // order. This lock relay (first take mMutex and then mQueueSubmitMutex, and then release // mMutex) ensures we always have a lock covering the entire call which ensures the strict // submission order. - std::lock_guard<std::mutex> queueSubmitLock(mQueueSubmitMutex); + std::lock_guard<angle::SimpleMutex> queueSubmitLock(mQueueSubmitMutex); // CPU should be throttled to avoid mInFlightCommands from growing too fast. Important for // off-screen scenarios. if (mInFlightCommands.full()) @@ -1556,20 +1556,20 @@ void CommandQueue::queuePresent(egl::ContextPriority contextPriority, const VkPresentInfoKHR &presentInfo, SwapchainStatus *swapchainStatus) { - std::lock_guard<std::mutex> queueSubmitLock(mQueueSubmitMutex); + std::lock_guard<angle::SimpleMutex> queueSubmitLock(mQueueSubmitMutex); VkQueue queue = getQueue(contextPriority); swapchainStatus->lastPresentResult = vkQueuePresentKHR(queue, &presentInfo); } const angle::VulkanPerfCounters CommandQueue::getPerfCounters() const { - std::lock_guard<std::mutex> lock(mMutex); + std::lock_guard<angle::SimpleMutex> lock(mMutex); return mPerfCounters; } void CommandQueue::resetPerFramePerfCounters() { - std::lock_guard<std::mutex> lock(mMutex); + std::lock_guard<angle::SimpleMutex> lock(mMutex); mPerfCounters.commandQueueSubmitCallsPerFrame = 0; mPerfCounters.vkQueueSubmitCallsPerFrame = 0; } @@ -1624,7 +1624,7 @@ angle::Result CommandQueue::finishOneCommandBatchAndCleanup(Context *context, uint64_t timeout, bool *anyFinished) { - std::lock_guard<std::mutex> lock(mMutex); + std::lock_guard<angle::SimpleMutex> lock(mMutex); // If there are in-flight submissions in the queue, they can be finished. *anyFinished = false; diff --git a/src/libANGLE/renderer/vulkan/CommandProcessor.h b/src/libANGLE/renderer/vulkan/CommandProcessor.h index 1d7fbeb95f..e4290f8cdc 100644 --- a/src/libANGLE/renderer/vulkan/CommandProcessor.h +++ b/src/libANGLE/renderer/vulkan/CommandProcessor.h @@ -17,6 +17,7 @@ #include <thread> #include "common/FixedQueue.h" +#include "common/SimpleMutex.h" #include "common/vulkan/vk_headers.h" #include "libANGLE/renderer/vulkan/PersistentCommandPool.h" #include "libANGLE/renderer/vulkan/vk_helpers.h" @@ -97,7 +98,7 @@ class FenceRecycler void recycle(Fence &&fence); private: - std::mutex mMutex; + angle::SimpleMutex mMutex; Recycler<Fence> mRecyler; }; @@ -274,7 +275,7 @@ struct CommandBatch final : angle::NonCopyable VkResult waitFence(VkDevice device, uint64_t timeout) const; VkResult waitFenceUnlocked(VkDevice device, uint64_t timeout, - std::unique_lock<std::mutex> *lock) const; + std::unique_lock<angle::SimpleMutex> *lock) const; PrimaryCommandBuffer primaryCommands; SecondaryCommandBufferCollector secondaryCommands; @@ -428,7 +429,7 @@ class CommandQueue : angle::NonCopyable angle::Result checkCompletedCommands(Context *context) { - std::lock_guard<std::mutex> lock(mMutex); + std::lock_guard<angle::SimpleMutex> lock(mMutex); return checkCompletedCommandsLocked(context); } @@ -469,7 +470,7 @@ class CommandQueue : angle::NonCopyable angle::Result retireFinishedCommandsAndCleanupGarbage(Context *context); angle::Result retireFinishedCommands(Context *context) { - std::lock_guard<std::mutex> lock(mMutex); + std::lock_guard<angle::SimpleMutex> lock(mMutex); return retireFinishedCommandsLocked(context); } angle::Result postSubmitCheck(Context *context); @@ -494,7 +495,7 @@ class CommandQueue : angle::NonCopyable angle::Result checkCompletedCommandsLocked(Context *context); angle::Result queueSubmit(Context *context, - std::unique_lock<std::mutex> &&dequeueLock, + std::unique_lock<angle::SimpleMutex> &&dequeueLock, egl::ContextPriority contextPriority, const VkSubmitInfo &submitInfo, DeviceScoped<CommandBatch> &commandBatch, @@ -516,11 +517,11 @@ class CommandQueue : angle::NonCopyable } // Protect multi-thread access to mInFlightCommands.pop and ensure ordering of submission. - mutable std::mutex mMutex; + mutable angle::SimpleMutex mMutex; // Protect multi-thread access to mInFlightCommands.push as well as does lock relay for mMutex // so that we can release mMutex while doing potential lengthy vkQueueSubmit and vkQueuePresent // call. - std::mutex mQueueSubmitMutex; + angle::SimpleMutex mQueueSubmitMutex; CommandBatchQueue mInFlightCommands; // Temporary storage for finished command batches that should be reset. CommandBatchQueue mFinishedCommandBatches; @@ -638,7 +639,7 @@ class CommandProcessor : public Context private: bool hasPendingError() const { - std::lock_guard<std::mutex> queueLock(mErrorMutex); + std::lock_guard<angle::SimpleMutex> queueLock(mErrorMutex); return !mErrors.empty(); } angle::Result checkAndPopPendingError(Context *errorHandlingContext); @@ -664,7 +665,7 @@ class CommandProcessor : public Context // The mutex lock that serializes dequeue from mTask and submit to mCommandQueue so that only // one mTaskQueue consumer at a time - std::mutex mTaskDequeueMutex; + angle::SimpleMutex mTaskDequeueMutex; CommandProcessorTaskQueue mTaskQueue; mutable std::mutex mTaskEnqueueMutex; @@ -677,7 +678,7 @@ class CommandProcessor : public Context // CommandProcessor to CommandQueue occur in a separate thread. AtomicQueueSerialFixedArray mLastEnqueuedSerials; - mutable std::mutex mErrorMutex; + mutable angle::SimpleMutex mErrorMutex; std::queue<Error> mErrors; // Command queue worker thread. diff --git a/src/libANGLE/renderer/vulkan/ContextVk.cpp b/src/libANGLE/renderer/vulkan/ContextVk.cpp index e8cd9d6590..bd27717cf0 100644 --- a/src/libANGLE/renderer/vulkan/ContextVk.cpp +++ b/src/libANGLE/renderer/vulkan/ContextVk.cpp @@ -7970,7 +7970,7 @@ angle::Result ContextVk::flushCommandsAndEndRenderPassWithoutSubmit(RenderPassCl if (vk::CommandBufferHelperCommon::kEnableCommandStreamDiagnostics) { - mRenderPassCommands->addCommandDiagnostics(this); + addCommandBufferDiagnostics(mRenderPassCommands->getCommandDiagnostics()); } const vk::RenderPass *renderPass = nullptr; @@ -8254,7 +8254,7 @@ angle::Result ContextVk::flushOutsideRenderPassCommands() if (vk::CommandBufferHelperCommon::kEnableCommandStreamDiagnostics) { - mOutsideRenderPassCommands->addCommandDiagnostics(this); + addCommandBufferDiagnostics(mOutsideRenderPassCommands->getCommandDiagnostics()); } flushDescriptorSetUpdates(); diff --git a/src/libANGLE/renderer/vulkan/ProgramExecutableVk.cpp b/src/libANGLE/renderer/vulkan/ProgramExecutableVk.cpp index db3568f467..9c901d84bd 100644 --- a/src/libANGLE/renderer/vulkan/ProgramExecutableVk.cpp +++ b/src/libANGLE/renderer/vulkan/ProgramExecutableVk.cpp @@ -303,8 +303,9 @@ void ReadFromDefaultUniformBlock(int componentCount, memcpy(dst, readPtr, elementSize); } } +} // namespace -class WarmUpTaskCommon : public vk::Context, public LinkSubTask +class ProgramExecutableVk::WarmUpTaskCommon : public vk::Context, public LinkSubTask { public: WarmUpTaskCommon(vk::Renderer *renderer) : vk::Context(renderer) {} @@ -377,7 +378,7 @@ class WarmUpTaskCommon : public vk::Context, public LinkSubTask unsigned int mErrorLine = 0; }; -class WarmUpComputeTask : public WarmUpTaskCommon +class ProgramExecutableVk::WarmUpComputeTask : public WarmUpTaskCommon { public: WarmUpComputeTask(vk::Renderer *renderer, @@ -399,7 +400,7 @@ class WarmUpComputeTask : public WarmUpTaskCommon }; using SharedRenderPass = vk::AtomicRefCounted<vk::RenderPass>; -class WarmUpGraphicsTask : public WarmUpTaskCommon +class ProgramExecutableVk::WarmUpGraphicsTask : public WarmUpTaskCommon { public: WarmUpGraphicsTask(vk::Renderer *renderer, @@ -452,7 +453,6 @@ class WarmUpGraphicsTask : public WarmUpTaskCommon // Temporary objects to clean up at the end SharedRenderPass *mCompatibleRenderPass; }; -} // namespace DefaultUniformBlockVk::DefaultUniformBlockVk() = default; @@ -828,7 +828,7 @@ angle::Result ProgramExecutableVk::getPipelineCacheWarmUpTasks( vk::GraphicsPipelineDesc *graphicsPipelineDesc = nullptr; vk::RenderPass compatibleRenderPass; - rx::WarmUpTaskCommon prepForWarmUpContext(renderer); + WarmUpTaskCommon prepForWarmUpContext(renderer); ANGLE_TRY(prepareForWarmUpPipelineCache( &prepForWarmUpContext, pipelineRobustness, pipelineProtectedAccess, subset, &isCompute, &surfaceRotationVariations, &graphicsPipelineDesc, &compatibleRenderPass)); @@ -838,7 +838,7 @@ angle::Result ProgramExecutableVk::getPipelineCacheWarmUpTasks( { ASSERT(!compatibleRenderPass.valid()); - warmUpSubTasks.push_back(std::make_shared<rx::WarmUpComputeTask>( + warmUpSubTasks.push_back(std::make_shared<WarmUpComputeTask>( renderer, this, pipelineRobustness, pipelineProtectedAccess)); } else @@ -863,7 +863,7 @@ angle::Result ProgramExecutableVk::getPipelineCacheWarmUpTasks( pipelines.populate(mWarmUpGraphicsPipelineDesc, vk::Pipeline(), &pipelineHelper); } - warmUpSubTasks.push_back(std::make_shared<rx::WarmUpGraphicsTask>( + warmUpSubTasks.push_back(std::make_shared<WarmUpGraphicsTask>( renderer, this, pipelineRobustness, pipelineProtectedAccess, subset, surfaceRotation, *graphicsPipelineDesc, sharedRenderPass, pipelineHelper)); } @@ -1040,7 +1040,7 @@ void ProgramExecutableVk::waitForPostLinkTasksImpl(ContextVk *contextVk) // Get results and clean up for (const std::shared_ptr<rx::LinkSubTask> &task : postLinkSubTasks) { - rx::WarmUpTaskCommon *warmUpTask = static_cast<rx::WarmUpTaskCommon *>(task.get()); + WarmUpTaskCommon *warmUpTask = static_cast<WarmUpTaskCommon *>(task.get()); // As these tasks can be run post-link, their results are ignored. Failure is harmless, but // more importantly the error (effectively due to a link event) may not be allowed through diff --git a/src/libANGLE/renderer/vulkan/ProgramExecutableVk.h b/src/libANGLE/renderer/vulkan/ProgramExecutableVk.h index 01ada98554..0e6600ac12 100644 --- a/src/libANGLE/renderer/vulkan/ProgramExecutableVk.h +++ b/src/libANGLE/renderer/vulkan/ProgramExecutableVk.h @@ -106,13 +106,6 @@ struct DefaultUniformBlockVk final : private angle::NonCopyable std::vector<sh::BlockMemberInfo> uniformLayout; }; -namespace -{ -class WarmUpTaskCommon; -class WarmUpComputeTask; -class WarmUpGraphicsTask; -} // namespace - // Performance and resource counters. using DescriptorSetCountList = angle::PackedEnumMap<DescriptorSetIndex, uint32_t>; using ImmutableSamplerIndexMap = angle::HashMap<vk::YcbcrConversionDesc, uint32_t>; @@ -378,6 +371,9 @@ class ProgramExecutableVk : public ProgramExecutableImpl } private: + class WarmUpTaskCommon; + class WarmUpComputeTask; + class WarmUpGraphicsTask; friend class ProgramVk; friend class ProgramPipelineVk; friend class WarmUpComputeTask; diff --git a/src/libANGLE/renderer/vulkan/vk_cache_utils.cpp b/src/libANGLE/renderer/vulkan/vk_cache_utils.cpp index 3061a76631..46c259230c 100644 --- a/src/libANGLE/renderer/vulkan/vk_cache_utils.cpp +++ b/src/libANGLE/renderer/vulkan/vk_cache_utils.cpp @@ -7468,6 +7468,18 @@ angle::Result DescriptorSetLayoutCache::getDescriptorSetLayout( return angle::Result::Continue; } + // Descriptor set layout handle is allowed to be VK_NULL_HANDLE iff + // VK_EXT_graphics_pipeline_library is supported and pre-rasterization and fragment shader + // subsets can be independently compiled. + if (!context->getFeatures().combineAllShadersInPipelineLibrary.enabled && desc.empty()) + { + auto insertedItem = mPayload.emplace(desc, vk::DescriptorSetLayout()); + vk::RefCountedDescriptorSetLayout &insertedLayout = insertedItem.first->second; + descriptorSetLayoutOut->set(&insertedLayout); + + return angle::Result::Continue; + } + mCacheStats.missAndIncrementSize(); // We must unpack the descriptor set layout description. vk::DescriptorSetLayoutBindingVector bindingVector; @@ -7538,10 +7550,9 @@ angle::Result PipelineLayoutCache::getPipelineLayout( if (layoutPtr.valid()) { VkDescriptorSetLayout setLayout = layoutPtr.get().getHandle(); - if (setLayout != VK_NULL_HANDLE) - { - setLayoutHandles.push_back(setLayout); - } + ASSERT(setLayout != VK_NULL_HANDLE || + !context->getFeatures().combineAllShadersInPipelineLibrary.enabled); + setLayoutHandles.push_back(setLayout); } } diff --git a/src/libANGLE/renderer/vulkan/vk_helpers.cpp b/src/libANGLE/renderer/vulkan/vk_helpers.cpp index c9b393b03d..7f9e90fed3 100644 --- a/src/libANGLE/renderer/vulkan/vk_helpers.cpp +++ b/src/libANGLE/renderer/vulkan/vk_helpers.cpp @@ -1689,18 +1689,18 @@ void CommandBufferHelperCommon::bufferReadImpl(VkAccessFlags readAccessType, ASSERT(!usesBufferForWrite(*buffer)); } -void CommandBufferHelperCommon::imageReadImpl(ContextVk *contextVk, +void CommandBufferHelperCommon::imageReadImpl(Context *context, VkImageAspectFlags aspectFlags, ImageLayout imageLayout, ImageHelper *image) { if (image->isReadBarrierNecessary(imageLayout)) { - updateImageLayoutAndBarrier(contextVk, image, aspectFlags, imageLayout); + updateImageLayoutAndBarrier(context, image, aspectFlags, imageLayout); } } -void CommandBufferHelperCommon::imageWriteImpl(ContextVk *contextVk, +void CommandBufferHelperCommon::imageWriteImpl(Context *context, gl::LevelIndex level, uint32_t layerStart, uint32_t layerCount, @@ -1711,7 +1711,7 @@ void CommandBufferHelperCommon::imageWriteImpl(ContextVk *contextVk, image->onWrite(level, 1, layerStart, layerCount, aspectFlags); if (image->isWriteBarrierNecessary(imageLayout, level, 1, layerStart, layerCount)) { - updateImageLayoutAndBarrier(contextVk, image, aspectFlags, imageLayout); + updateImageLayoutAndBarrier(context, image, aspectFlags, imageLayout); } } @@ -1911,13 +1911,14 @@ void OutsideRenderPassCommandBufferHelper::assertCanBeRecycled() assertCanBeRecycledImpl<OutsideRenderPassCommandBufferHelper>(); } -void OutsideRenderPassCommandBufferHelper::addCommandDiagnostics(ContextVk *contextVk) +std::string OutsideRenderPassCommandBufferHelper::getCommandDiagnostics() { std::ostringstream out; addCommandDiagnosticsCommon(&out); out << mCommandBuffer.dumpCommands("\\l"); - contextVk->addCommandBufferDiagnostics(out.str()); + + return out.str(); } // RenderPassFramebuffer implementation. @@ -3003,7 +3004,7 @@ void RenderPassCommandBufferHelper::assertCanBeRecycled() assertCanBeRecycledImpl<RenderPassCommandBufferHelper>(); } -void RenderPassCommandBufferHelper::addCommandDiagnostics(ContextVk *contextVk) +std::string RenderPassCommandBufferHelper::getCommandDiagnostics() { std::ostringstream out; addCommandDiagnosticsCommon(&out); @@ -3062,7 +3063,8 @@ void RenderPassCommandBufferHelper::addCommandDiagnostics(ContextVk *contextVk) } out << mCommandBuffers[subpass].dumpCommands("\\l"); } - contextVk->addCommandBufferDiagnostics(out.str()); + + return out.str(); } // CommandBufferRecycler implementation. @@ -6862,7 +6864,7 @@ void ImageHelper::changeLayoutAndQueue(Context *context, ASSERT(acquireNextImageSemaphore == VK_NULL_HANDLE); } -void ImageHelper::acquireFromExternal(ContextVk *contextVk, +void ImageHelper::acquireFromExternal(Context *context, uint32_t externalQueueFamilyIndex, uint32_t rendererQueueFamilyIndex, ImageLayout currentLayout, @@ -6882,7 +6884,7 @@ void ImageHelper::acquireFromExternal(ContextVk *contextVk, // leave it to transition out as the image is used later. if (currentLayout != ImageLayout::Undefined) { - changeLayoutAndQueue(contextVk, getAspectFlags(), mCurrentLayout, rendererQueueFamilyIndex, + changeLayoutAndQueue(context, getAspectFlags(), mCurrentLayout, rendererQueueFamilyIndex, commandBuffer); } @@ -6898,7 +6900,7 @@ void ImageHelper::acquireFromExternal(ContextVk *contextVk, } } -void ImageHelper::releaseToExternal(ContextVk *contextVk, +void ImageHelper::releaseToExternal(Context *context, uint32_t rendererQueueFamilyIndex, uint32_t externalQueueFamilyIndex, ImageLayout desiredLayout, @@ -6910,7 +6912,7 @@ void ImageHelper::releaseToExternal(ContextVk *contextVk, // GL! if (mCurrentQueueFamilyIndex != externalQueueFamilyIndex || mCurrentLayout != desiredLayout) { - changeLayoutAndQueue(contextVk, getAspectFlags(), desiredLayout, externalQueueFamilyIndex, + changeLayoutAndQueue(context, getAspectFlags(), desiredLayout, externalQueueFamilyIndex, commandBuffer); } diff --git a/src/libANGLE/renderer/vulkan/vk_helpers.h b/src/libANGLE/renderer/vulkan/vk_helpers.h index 7a4c4466a4..18bdb01305 100644 --- a/src/libANGLE/renderer/vulkan/vk_helpers.h +++ b/src/libANGLE/renderer/vulkan/vk_helpers.h @@ -61,6 +61,112 @@ using ImageLayerWriteMask = std::bitset<kMaxParallelLayerWrites using StagingBufferOffsetArray = std::array<VkDeviceSize, 2>; +// Imagine an image going through a few layout transitions: +// +// srcStage 1 dstStage 2 srcStage 2 dstStage 3 +// Layout 1 ------Transition 1-----> Layout 2 ------Transition 2------> Layout 3 +// srcAccess 1 dstAccess 2 srcAccess 2 dstAccess 3 +// \_________________ ___________________/ +// \/ +// A transition +// +// Every transition requires 6 pieces of information: from/to layouts, src/dst stage masks and +// src/dst access masks. At the moment we decide to transition the image to Layout 2 (i.e. +// Transition 1), we need to have Layout 1, srcStage 1 and srcAccess 1 stored as history of the +// image. To perform the transition, we need to know Layout 2, dstStage 2 and dstAccess 2. +// Additionally, we need to know srcStage 2 and srcAccess 2 to retain them for the next transition. +// +// That is, with the history kept, on every new transition we need 5 pieces of new information: +// layout/dstStage/dstAccess to transition into the layout, and srcStage/srcAccess for the future +// transition out from it. Given the small number of possible combinations of these values, an +// enum is used were each value encapsulates these 5 pieces of information: +// +// +--------------------------------+ +// srcStage 1 | dstStage 2 srcStage 2 | dstStage 3 +// Layout 1 ------Transition 1-----> Layout 2 ------Transition 2------> Layout 3 +// srcAccess 1 |dstAccess 2 srcAccess 2| dstAccess 3 +// +--------------- ---------------+ +// \/ +// One enum value +// +// Note that, while generally dstStage for the to-transition and srcStage for the from-transition +// are the same, they may occasionally be BOTTOM_OF_PIPE and TOP_OF_PIPE respectively. +enum class ImageLayout +{ + Undefined = 0, + // Framebuffer attachment layouts are placed first, so they can fit in fewer bits in + // PackedAttachmentOpsDesc. + + // Color (Write): + ColorWrite, + MSRTTEmulationColorUnresolveAndResolve, + + // Depth (Write), Stencil (Write) + DepthWriteStencilWrite, + + // Depth (Write), Stencil (Read) + DepthWriteStencilRead, + DepthWriteStencilReadFragmentShaderStencilRead, + DepthWriteStencilReadAllShadersStencilRead, + + // Depth (Read), Stencil (Write) + DepthReadStencilWrite, + DepthReadStencilWriteFragmentShaderDepthRead, + DepthReadStencilWriteAllShadersDepthRead, + + // Depth (Read), Stencil (Read) + DepthReadStencilRead, + DepthReadStencilReadFragmentShaderRead, + DepthReadStencilReadAllShadersRead, + + // The GENERAL layout is used when there's a feedback loop. For depth/stencil it does't matter + // which aspect is participating in feedback and whether the other aspect is read-only. + ColorWriteFragmentShaderFeedback, + ColorWriteAllShadersFeedback, + DepthStencilFragmentShaderFeedback, + DepthStencilAllShadersFeedback, + + // Depth/stencil resolve is special because it uses the _color_ output stage and mask + DepthStencilResolve, + MSRTTEmulationDepthStencilUnresolveAndResolve, + + Present, + SharedPresent, + // The rest of the layouts. + ExternalPreInitialized, + ExternalShadersReadOnly, + ExternalShadersWrite, + TransferSrc, + TransferDst, + TransferSrcDst, + // Used when the image is transitioned on the host for use by host image copy + HostCopy, + VertexShaderReadOnly, + VertexShaderWrite, + // PreFragment == Vertex, Tessellation and Geometry stages + PreFragmentShadersReadOnly, + PreFragmentShadersWrite, + FragmentShadingRateAttachmentReadOnly, + FragmentShaderReadOnly, + FragmentShaderWrite, + ComputeShaderReadOnly, + ComputeShaderWrite, + AllGraphicsShadersReadOnly, + AllGraphicsShadersWrite, + TransferDstAndComputeWrite, + + InvalidEnum, + EnumCount = InvalidEnum, +}; + +VkImageCreateFlags GetImageCreateFlags(gl::TextureType textureType); + +ImageLayout GetImageLayoutFromGLImageLayout(Context *context, GLenum layout); + +GLenum ConvertImageLayoutToGLImageLayout(ImageLayout imageLayout); + +VkImageLayout ConvertImageLayoutToVkImageLayout(Context *context, ImageLayout imageLayout); + // A dynamic buffer is conceptually an infinitely long buffer. Each time you write to the buffer, // you will always write to a previously unused portion. After a series of writes, you must flush // the buffer data to the device. Buffer lifetime currently assumes that each new allocation will @@ -1232,11 +1338,11 @@ class CommandBufferHelperCommon : angle::NonCopyable bufferReadImpl(readAccessType, readStage, buffer); } } - void imageReadImpl(ContextVk *contextVk, + void imageReadImpl(Context *context, VkImageAspectFlags aspectFlags, ImageLayout imageLayout, ImageHelper *image); - void imageWriteImpl(ContextVk *contextVk, + void imageWriteImpl(Context *context, gl::LevelIndex level, uint32_t layerStart, uint32_t layerCount, @@ -1353,7 +1459,7 @@ class OutsideRenderPassCommandBufferHelper final : public CommandBufferHelperCom } } - void addCommandDiagnostics(ContextVk *contextVk); + std::string getCommandDiagnostics(); void setQueueSerial(SerialIndex index, Serial serial) { @@ -1683,7 +1789,7 @@ class RenderPassCommandBufferHelper final : public CommandBufferHelperCommon mHasGLMemoryBarrierIssued = true; } } - void addCommandDiagnostics(ContextVk *contextVk); + std::string getCommandDiagnostics(); // Readonly depth stencil mode and feedback loop mode void updateDepthReadOnlyMode(RenderPassUsageFlags dsUsageFlags); @@ -1799,112 +1905,6 @@ class CommandBufferRecycler std::vector<CommandBufferHelperT *> mCommandBufferHelperFreeList; }; -// Imagine an image going through a few layout transitions: -// -// srcStage 1 dstStage 2 srcStage 2 dstStage 3 -// Layout 1 ------Transition 1-----> Layout 2 ------Transition 2------> Layout 3 -// srcAccess 1 dstAccess 2 srcAccess 2 dstAccess 3 -// \_________________ ___________________/ -// \/ -// A transition -// -// Every transition requires 6 pieces of information: from/to layouts, src/dst stage masks and -// src/dst access masks. At the moment we decide to transition the image to Layout 2 (i.e. -// Transition 1), we need to have Layout 1, srcStage 1 and srcAccess 1 stored as history of the -// image. To perform the transition, we need to know Layout 2, dstStage 2 and dstAccess 2. -// Additionally, we need to know srcStage 2 and srcAccess 2 to retain them for the next transition. -// -// That is, with the history kept, on every new transition we need 5 pieces of new information: -// layout/dstStage/dstAccess to transition into the layout, and srcStage/srcAccess for the future -// transition out from it. Given the small number of possible combinations of these values, an -// enum is used were each value encapsulates these 5 pieces of information: -// -// +--------------------------------+ -// srcStage 1 | dstStage 2 srcStage 2 | dstStage 3 -// Layout 1 ------Transition 1-----> Layout 2 ------Transition 2------> Layout 3 -// srcAccess 1 |dstAccess 2 srcAccess 2| dstAccess 3 -// +--------------- ---------------+ -// \/ -// One enum value -// -// Note that, while generally dstStage for the to-transition and srcStage for the from-transition -// are the same, they may occasionally be BOTTOM_OF_PIPE and TOP_OF_PIPE respectively. -enum class ImageLayout -{ - Undefined = 0, - // Framebuffer attachment layouts are placed first, so they can fit in fewer bits in - // PackedAttachmentOpsDesc. - - // Color (Write): - ColorWrite, - MSRTTEmulationColorUnresolveAndResolve, - - // Depth (Write), Stencil (Write) - DepthWriteStencilWrite, - - // Depth (Write), Stencil (Read) - DepthWriteStencilRead, - DepthWriteStencilReadFragmentShaderStencilRead, - DepthWriteStencilReadAllShadersStencilRead, - - // Depth (Read), Stencil (Write) - DepthReadStencilWrite, - DepthReadStencilWriteFragmentShaderDepthRead, - DepthReadStencilWriteAllShadersDepthRead, - - // Depth (Read), Stencil (Read) - DepthReadStencilRead, - DepthReadStencilReadFragmentShaderRead, - DepthReadStencilReadAllShadersRead, - - // The GENERAL layout is used when there's a feedback loop. For depth/stencil it does't matter - // which aspect is participating in feedback and whether the other aspect is read-only. - ColorWriteFragmentShaderFeedback, - ColorWriteAllShadersFeedback, - DepthStencilFragmentShaderFeedback, - DepthStencilAllShadersFeedback, - - // Depth/stencil resolve is special because it uses the _color_ output stage and mask - DepthStencilResolve, - MSRTTEmulationDepthStencilUnresolveAndResolve, - - Present, - SharedPresent, - // The rest of the layouts. - ExternalPreInitialized, - ExternalShadersReadOnly, - ExternalShadersWrite, - TransferSrc, - TransferDst, - TransferSrcDst, - // Used when the image is transitioned on the host for use by host image copy - HostCopy, - VertexShaderReadOnly, - VertexShaderWrite, - // PreFragment == Vertex, Tessellation and Geometry stages - PreFragmentShadersReadOnly, - PreFragmentShadersWrite, - FragmentShadingRateAttachmentReadOnly, - FragmentShaderReadOnly, - FragmentShaderWrite, - ComputeShaderReadOnly, - ComputeShaderWrite, - AllGraphicsShadersReadOnly, - AllGraphicsShadersWrite, - TransferDstAndComputeWrite, - - InvalidEnum, - EnumCount = InvalidEnum, -}; - -VkImageCreateFlags GetImageCreateFlags(gl::TextureType textureType); - -ImageLayout GetImageLayoutFromGLImageLayout(Context *context, GLenum layout); - -GLenum ConvertImageLayoutToGLImageLayout(ImageLayout imageLayout); - -VkImageLayout ConvertImageLayoutToVkImageLayout(Context *context, ImageLayout imageLayout); - // The source of update to an ImageHelper enum class UpdateSource { @@ -2477,14 +2477,14 @@ class ImageHelper final : public Resource, public angle::Subject VkSemaphore *semaphoreOut); // Performs an ownership transfer from an external instance or API. - void acquireFromExternal(ContextVk *contextVk, + void acquireFromExternal(Context *context, uint32_t externalQueueFamilyIndex, uint32_t rendererQueueFamilyIndex, ImageLayout currentLayout, OutsideRenderPassCommandBuffer *commandBuffer); // Performs an ownership transfer to an external instance or API. - void releaseToExternal(ContextVk *contextVk, + void releaseToExternal(Context *context, uint32_t rendererQueueFamilyIndex, uint32_t externalQueueFamilyIndex, ImageLayout desiredLayout, diff --git a/src/libANGLE/renderer/vulkan/vk_renderer.cpp b/src/libANGLE/renderer/vulkan/vk_renderer.cpp index 4794abf480..6ab2a187e9 100644 --- a/src/libANGLE/renderer/vulkan/vk_renderer.cpp +++ b/src/libANGLE/renderer/vulkan/vk_renderer.cpp @@ -281,6 +281,9 @@ constexpr const char *kSkippedMessages[] = { "Undefined-Value-ShaderFragmentOutputMismatch", // https://issuetracker.google.com/336652255 "UNASSIGNED-CoreValidation-DrawState-InvalidImageLayout", + // https://issuetracker.google.com/336847261 + "VUID-VkImageCreateInfo-pNext-02397", + "VUID-vkCmdDraw-None-06550", }; // Validation messages that should be ignored only when VK_EXT_primitive_topology_list_restart is @@ -2392,6 +2395,10 @@ void Renderer::appendDeviceExtensionFeaturesNotPromoted( // - VK_KHR_sampler_ycbcr_conversion: samplerYcbcrConversion (feature) // - VK_KHR_multiview: multiview (feature), // maxMultiviewViewCount (property) +// - VK_KHR_16bit_storage storageBuffer16BitAccess (feature) +// uniformAndStorageBuffer16BitAccess (feature) +// storagePushConstant16 (feature) +// storageInputOutput16 (feature) // // // Note that subgroup and protected memory features and properties came from unpublished extensions @@ -2415,6 +2422,10 @@ void Renderer::appendDeviceExtensionFeaturesPromotedTo11( vk::AddToPNextChain(deviceFeatures, &mMultiviewFeatures); vk::AddToPNextChain(deviceProperties, &mMultiviewProperties); } + if (ExtensionFound(VK_KHR_16BIT_STORAGE_EXTENSION_NAME, deviceExtensionNames)) + { + vk::AddToPNextChain(deviceFeatures, &m16BitStorageFeatures); + } } // The following features and properties used by ANGLE have been promoted to Vulkan 1.2: @@ -2428,6 +2439,9 @@ void Renderer::appendDeviceExtensionFeaturesPromotedTo11( // - VK_EXT_host_query_reset: hostQueryReset (feature) // - VK_KHR_imageless_framebuffer: imagelessFramebuffer (feature) // - VK_KHR_timeline_semaphore: timelineSemaphore (feature) +// - VK_KHR_8bit_storage storageBuffer8BitAccess (feature) +// uniformAndStorageBuffer8BitAccess (feature) +// storagePushConstant8 (feature) // // Note that supportedDepthResolveModes is used just to check if the property struct is populated. // ANGLE always uses VK_RESOLVE_MODE_SAMPLE_ZERO_BIT for both depth and stencil, and support for @@ -2472,6 +2486,11 @@ void Renderer::appendDeviceExtensionFeaturesPromotedTo12( { vk::AddToPNextChain(deviceFeatures, &mTimelineSemaphoreFeatures); } + + if (ExtensionFound(VK_KHR_8BIT_STORAGE_EXTENSION_NAME, deviceExtensionNames)) + { + vk::AddToPNextChain(deviceFeatures, &m8BitStorageFeatures); + } } // The following features and properties used by ANGLE have been promoted to Vulkan 1.3: @@ -2672,6 +2691,12 @@ void Renderer::queryDeviceExtensionFeatures(const vk::ExtensionNameList &deviceE mHostImageCopyProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_PROPERTIES_EXT; + m8BitStorageFeatures = {}; + m8BitStorageFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES_KHR; + + m16BitStorageFeatures = {}; + m16BitStorageFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES_KHR; + #if defined(ANGLE_PLATFORM_ANDROID) mExternalFormatResolveFeatures = {}; mExternalFormatResolveFeatures.sType = @@ -2746,6 +2771,8 @@ void Renderer::queryDeviceExtensionFeatures(const vk::ExtensionNameList &deviceE mTimelineSemaphoreFeatures.pNext = nullptr; mHostImageCopyFeatures.pNext = nullptr; mHostImageCopyProperties.pNext = nullptr; + m8BitStorageFeatures.pNext = nullptr; + m16BitStorageFeatures.pNext = nullptr; #if defined(ANGLE_PLATFORM_ANDROID) mExternalFormatResolveFeatures.pNext = nullptr; mExternalFormatResolveProperties.pNext = nullptr; @@ -3106,6 +3133,14 @@ void Renderer::enableDeviceExtensionsPromotedTo11(const vk::ExtensionNameList &d { vk::AddToPNextChain(&mEnabledFeatures, &mProtectedMemoryFeatures); } + + if (mFeatures.supports16BitStorageBuffer.enabled || + mFeatures.supports16BitUniformAndStorageBuffer.enabled || + mFeatures.supports16BitPushConstant.enabled || mFeatures.supports16BitInputOutput.enabled) + { + mEnabledDeviceExtensions.push_back(VK_KHR_16BIT_STORAGE_EXTENSION_NAME); + vk::AddToPNextChain(&mEnabledFeatures, &m16BitStorageFeatures); + } } // See comment above appendDeviceExtensionFeaturesPromotedTo12. Additional extensions are enabled @@ -3166,6 +3201,14 @@ void Renderer::enableDeviceExtensionsPromotedTo12(const vk::ExtensionNameList &d mEnabledDeviceExtensions.push_back(VK_KHR_TIMELINE_SEMAPHORE_EXTENSION_NAME); vk::AddToPNextChain(&mEnabledFeatures, &mTimelineSemaphoreFeatures); } + + if (mFeatures.supports8BitStorageBuffer.enabled || + mFeatures.supports8BitUniformAndStorageBuffer.enabled || + mFeatures.supports8BitPushConstant.enabled) + { + mEnabledDeviceExtensions.push_back(VK_KHR_8BIT_STORAGE_EXTENSION_NAME); + vk::AddToPNextChain(&mEnabledFeatures, &m8BitStorageFeatures); + } } // See comment above appendDeviceExtensionFeaturesPromotedTo13. @@ -4675,7 +4718,12 @@ void Renderer::initFeatures(const vk::ExtensionNameList &deviceExtensionNames, // http://issuetracker.google.com/287318431 // // On Pixel devices, the issues have been fixed since r44, but on others since r44p1. - const bool isArm44OrLess = isARM && armDriverVersion < ARMDriverVersion(44, 1, 0); + // + // Regressions have been detected using r46 on older architectures though + // http://issuetracker.google.com/336411904 + const bool isExtendedDynamicStateBuggy = + (isARM && armDriverVersion < ARMDriverVersion(44, 1, 0)) || + (isMaliJobManagerBasedGPU && armDriverVersion >= ARMDriverVersion(46, 0, 0)); // Vertex input binding stride is buggy for Windows/Intel drivers before 100.9684. const bool isVertexInputBindingStrideBuggy = @@ -4687,9 +4735,9 @@ void Renderer::initFeatures(const vk::ExtensionNameList &deviceExtensionNames, mVertexInputDynamicStateFeatures.vertexInputDynamicState == VK_TRUE && !(IsWindows() && isIntel)); - ANGLE_FEATURE_CONDITION( - &mFeatures, supportsExtendedDynamicState, - mExtendedDynamicStateFeatures.extendedDynamicState == VK_TRUE && !isArm44OrLess); + ANGLE_FEATURE_CONDITION(&mFeatures, supportsExtendedDynamicState, + mExtendedDynamicStateFeatures.extendedDynamicState == VK_TRUE && + !isExtendedDynamicStateBuggy); // VK_EXT_vertex_input_dynamic_state enables dynamic state for the full vertex input state. As // such, when available use supportsVertexInputDynamicState instead of @@ -4697,15 +4745,17 @@ void Renderer::initFeatures(const vk::ExtensionNameList &deviceExtensionNames, ANGLE_FEATURE_CONDITION(&mFeatures, useVertexInputBindingStrideDynamicState, mFeatures.supportsExtendedDynamicState.enabled && !mFeatures.supportsVertexInputDynamicState.enabled && - !isArm44OrLess && !isVertexInputBindingStrideBuggy); - ANGLE_FEATURE_CONDITION(&mFeatures, useCullModeDynamicState, - mFeatures.supportsExtendedDynamicState.enabled && !isArm44OrLess); + !isExtendedDynamicStateBuggy && !isVertexInputBindingStrideBuggy); + ANGLE_FEATURE_CONDITION( + &mFeatures, useCullModeDynamicState, + mFeatures.supportsExtendedDynamicState.enabled && !isExtendedDynamicStateBuggy); ANGLE_FEATURE_CONDITION(&mFeatures, useDepthCompareOpDynamicState, mFeatures.supportsExtendedDynamicState.enabled); ANGLE_FEATURE_CONDITION(&mFeatures, useDepthTestEnableDynamicState, mFeatures.supportsExtendedDynamicState.enabled); - ANGLE_FEATURE_CONDITION(&mFeatures, useDepthWriteEnableDynamicState, - mFeatures.supportsExtendedDynamicState.enabled && !isArm44OrLess); + ANGLE_FEATURE_CONDITION( + &mFeatures, useDepthWriteEnableDynamicState, + mFeatures.supportsExtendedDynamicState.enabled && !isExtendedDynamicStateBuggy); ANGLE_FEATURE_CONDITION(&mFeatures, useFrontFaceDynamicState, mFeatures.supportsExtendedDynamicState.enabled); ANGLE_FEATURE_CONDITION(&mFeatures, useStencilOpDynamicState, @@ -4713,12 +4763,13 @@ void Renderer::initFeatures(const vk::ExtensionNameList &deviceExtensionNames, ANGLE_FEATURE_CONDITION(&mFeatures, useStencilTestEnableDynamicState, mFeatures.supportsExtendedDynamicState.enabled); - ANGLE_FEATURE_CONDITION( - &mFeatures, supportsExtendedDynamicState2, - mExtendedDynamicState2Features.extendedDynamicState2 == VK_TRUE && !isArm44OrLess); + ANGLE_FEATURE_CONDITION(&mFeatures, supportsExtendedDynamicState2, + mExtendedDynamicState2Features.extendedDynamicState2 == VK_TRUE && + !isExtendedDynamicStateBuggy); - ANGLE_FEATURE_CONDITION(&mFeatures, usePrimitiveRestartEnableDynamicState, - mFeatures.supportsExtendedDynamicState2.enabled && !isArm44OrLess); + ANGLE_FEATURE_CONDITION( + &mFeatures, usePrimitiveRestartEnableDynamicState, + mFeatures.supportsExtendedDynamicState2.enabled && !isExtendedDynamicStateBuggy); ANGLE_FEATURE_CONDITION(&mFeatures, useRasterizerDiscardEnableDynamicState, mFeatures.supportsExtendedDynamicState2.enabled); ANGLE_FEATURE_CONDITION(&mFeatures, useDepthBiasEnableDynamicState, @@ -4784,6 +4835,9 @@ void Renderer::initFeatures(const vk::ExtensionNameList &deviceExtensionNames, mGraphicsPipelineLibraryFeatures.graphicsPipelineLibrary == VK_TRUE && (!isNvidia || nvidiaVersion.major >= 531) && !isRADV); + // By default all shaders are compiled into the same pipeline library + ANGLE_FEATURE_CONDITION(&mFeatures, combineAllShadersInPipelineLibrary, true); + // The following drivers are known to key the pipeline cache blobs with vertex input and // fragment output state, causing draw-time pipeline creation to miss the cache regardless of // warmup: @@ -4973,6 +5027,29 @@ void Renderer::initFeatures(const vk::ExtensionNameList &deviceExtensionNames, ANGLE_FEATURE_CONDITION(&mFeatures, supportsTimelineSemaphore, mTimelineSemaphoreFeatures.timelineSemaphore == VK_TRUE); + // 8bit storage features + ANGLE_FEATURE_CONDITION(&mFeatures, supports8BitStorageBuffer, + m8BitStorageFeatures.storageBuffer8BitAccess == VK_TRUE); + + ANGLE_FEATURE_CONDITION(&mFeatures, supports8BitUniformAndStorageBuffer, + m8BitStorageFeatures.uniformAndStorageBuffer8BitAccess == VK_TRUE); + + ANGLE_FEATURE_CONDITION(&mFeatures, supports8BitPushConstant, + m8BitStorageFeatures.storagePushConstant8 == VK_TRUE); + + // 16bit storage features + ANGLE_FEATURE_CONDITION(&mFeatures, supports16BitStorageBuffer, + m16BitStorageFeatures.storageBuffer16BitAccess == VK_TRUE); + + ANGLE_FEATURE_CONDITION(&mFeatures, supports16BitUniformAndStorageBuffer, + m16BitStorageFeatures.uniformAndStorageBuffer16BitAccess == VK_TRUE); + + ANGLE_FEATURE_CONDITION(&mFeatures, supports16BitPushConstant, + m16BitStorageFeatures.storagePushConstant16 == VK_TRUE); + + ANGLE_FEATURE_CONDITION(&mFeatures, supports16BitInputOutput, + m16BitStorageFeatures.storageInputOutput16 == VK_TRUE); + #if defined(ANGLE_PLATFORM_ANDROID) ANGLE_FEATURE_CONDITION(&mFeatures, supportsExternalFormatResolve, mExternalFormatResolveFeatures.externalFormatResolve == VK_TRUE); @@ -4980,6 +5057,10 @@ void Renderer::initFeatures(const vk::ExtensionNameList &deviceExtensionNames, ANGLE_FEATURE_CONDITION(&mFeatures, supportsExternalFormatResolve, false); #endif + // Disable use of VkCmdWaitEvent for image barriers for now. + // https://issuetracker.google.com/336844257 + ANGLE_FEATURE_CONDITION(&mFeatures, useVkEventForImageBarrier, false); + // Disable memory report feature overrides if extension is not supported. if ((mFeatures.logMemoryReportCallbacks.enabled || mFeatures.logMemoryReportStats.enabled) && !mMemoryReportFeatures.deviceMemoryReport) diff --git a/src/libANGLE/renderer/vulkan/vk_renderer.h b/src/libANGLE/renderer/vulkan/vk_renderer.h index b1516a68db..b0ba85ef8e 100644 --- a/src/libANGLE/renderer/vulkan/vk_renderer.h +++ b/src/libANGLE/renderer/vulkan/vk_renderer.h @@ -925,6 +925,8 @@ class Renderer : angle::NonCopyable VkPhysicalDeviceExternalFormatResolveFeaturesANDROID mExternalFormatResolveFeatures; VkPhysicalDeviceExternalFormatResolvePropertiesANDROID mExternalFormatResolveProperties; #endif + VkPhysicalDevice8BitStorageFeatures m8BitStorageFeatures; + VkPhysicalDevice16BitStorageFeatures m16BitStorageFeatures; angle::PackedEnumBitSet<gl::ShadingRate, uint8_t> mSupportedFragmentShadingRates; angle::PackedEnumMap<gl::ShadingRate, VkSampleCountFlags> diff --git a/src/libANGLE/validationEGL.cpp b/src/libANGLE/validationEGL.cpp index e598b74be6..f56f90d32b 100644 --- a/src/libANGLE/validationEGL.cpp +++ b/src/libANGLE/validationEGL.cpp @@ -3483,12 +3483,13 @@ bool ValidateCreateImage(const ValidationContext *val, break; case EGL_TEXTURE_INTERNAL_FORMAT_ANGLE: - if (!displayExtensions.imageD3D11Texture && !displayExtensions.vulkanImageANGLE) + if (!displayExtensions.imageD3D11Texture && !displayExtensions.vulkanImageANGLE && + !displayExtensions.mtlTextureClientBuffer) { - val->setError( - EGL_BAD_PARAMETER, - "EGL_TEXTURE_INTERNAL_FORMAT_ANGLE cannot be used without " - "EGL_ANGLE_image_d3d11_texture or EGL_ANGLE_vulkan_image support."); + val->setError(EGL_BAD_PARAMETER, + "EGL_TEXTURE_INTERNAL_FORMAT_ANGLE cannot be used without " + "EGL_ANGLE_image_d3d11_texture, EGL_ANGLE_vulkan_image, or " + "EGL_ANGLE_metal_texture_client_buffer support."); return false; } break; diff --git a/src/libGLESv2/entry_points_egl_autogen.cpp b/src/libGLESv2/entry_points_egl_autogen.cpp index e4b20fd4bf..4325d1dc5d 100644 --- a/src/libGLESv2/entry_points_egl_autogen.cpp +++ b/src/libGLESv2/entry_points_egl_autogen.cpp @@ -355,19 +355,15 @@ EGLDisplay EGLAPIENTRY EGL_GetCurrentDisplay() Thread *thread = egl::GetCurrentThread(); EGLDisplay returnValue; - { - ANGLE_SCOPED_GLOBAL_LOCK(); - EGL_EVENT(GetCurrentDisplay, ""); - { - ANGLE_EGL_SCOPED_CONTEXT_LOCK(GetCurrentDisplay, thread); - ANGLE_EGL_VALIDATE(thread, GetCurrentDisplay, nullptr, EGLDisplay); + EGL_EVENT(GetCurrentDisplay, ""); - returnValue = GetCurrentDisplay(thread); - } + ANGLE_EGL_VALIDATE(thread, GetCurrentDisplay, nullptr, EGLDisplay); + + returnValue = GetCurrentDisplay(thread); + + ANGLE_CAPTURE_EGL(GetCurrentDisplay, true, thread, returnValue); - ANGLE_CAPTURE_EGL(GetCurrentDisplay, true, thread, returnValue); - } ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any()); return returnValue; } @@ -377,19 +373,15 @@ EGLSurface EGLAPIENTRY EGL_GetCurrentSurface(EGLint readdraw) Thread *thread = egl::GetCurrentThread(); EGLSurface returnValue; - { - ANGLE_SCOPED_GLOBAL_LOCK(); - EGL_EVENT(GetCurrentSurface, "readdraw = %d", readdraw); - { - ANGLE_EGL_SCOPED_CONTEXT_LOCK(GetCurrentSurface, thread); - ANGLE_EGL_VALIDATE(thread, GetCurrentSurface, nullptr, EGLSurface, readdraw); + EGL_EVENT(GetCurrentSurface, "readdraw = %d", readdraw); - returnValue = GetCurrentSurface(thread, readdraw); - } + ANGLE_EGL_VALIDATE(thread, GetCurrentSurface, nullptr, EGLSurface, readdraw); + + returnValue = GetCurrentSurface(thread, readdraw); + + ANGLE_CAPTURE_EGL(GetCurrentSurface, true, thread, readdraw, returnValue); - ANGLE_CAPTURE_EGL(GetCurrentSurface, true, thread, readdraw, returnValue); - } ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any()); return returnValue; } @@ -636,7 +628,7 @@ EGLBoolean EGLAPIENTRY EGL_SwapBuffers(EGLDisplay dpy, EGLSurface surface) ANGLE_CAPTURE_EGL(SwapBuffers, true, thread, dpyPacked, surfacePacked, returnValue); } - egl::Display::GetCurrentThreadUnlockedTailCall()->run(nullptr); + egl::Display::GetCurrentThreadUnlockedTailCall()->run(&returnValue); return returnValue; } @@ -958,19 +950,15 @@ EGLContext EGLAPIENTRY EGL_GetCurrentContext() Thread *thread = egl::GetCurrentThread(); EGLContext returnValue; - { - ANGLE_SCOPED_GLOBAL_LOCK(); - EGL_EVENT(GetCurrentContext, ""); - { - ANGLE_EGL_SCOPED_CONTEXT_LOCK(GetCurrentContext, thread); - ANGLE_EGL_VALIDATE(thread, GetCurrentContext, nullptr, EGLContext); + EGL_EVENT(GetCurrentContext, ""); - returnValue = GetCurrentContext(thread); - } + ANGLE_EGL_VALIDATE(thread, GetCurrentContext, nullptr, EGLContext); + + returnValue = GetCurrentContext(thread); + + ANGLE_CAPTURE_EGL(GetCurrentContext, true, thread, returnValue); - ANGLE_CAPTURE_EGL(GetCurrentContext, true, thread, returnValue); - } ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any()); return returnValue; } @@ -1038,7 +1026,7 @@ EGLImage EGLAPIENTRY EGL_CreateImage(EGLDisplay dpy, ANGLE_CAPTURE_EGL(CreateImage, true, thread, dpyPacked, ctxPacked, target, buffer, attrib_listPacked, returnValue); } - ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any()); + egl::Display::GetCurrentThreadUnlockedTailCall()->run(&returnValue); return returnValue; } @@ -1141,7 +1129,7 @@ EGLSync EGLAPIENTRY EGL_CreateSync(EGLDisplay dpy, EGLenum type, const EGLAttrib ANGLE_CAPTURE_EGL(CreateSync, true, thread, dpyPacked, type, attrib_listPacked, returnValue); } - ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any()); + egl::Display::GetCurrentThreadUnlockedTailCall()->run(&returnValue); return returnValue; } @@ -1195,7 +1183,7 @@ EGLBoolean EGLAPIENTRY EGL_DestroySync(EGLDisplay dpy, EGLSync sync) ANGLE_CAPTURE_EGL(DestroySync, true, thread, dpyPacked, syncPacked, returnValue); } - ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any()); + egl::Display::GetCurrentThreadUnlockedTailCall()->run(&returnValue); return returnValue; } @@ -1286,7 +1274,7 @@ EGLBoolean EGLAPIENTRY EGL_WaitSync(EGLDisplay dpy, EGLSync sync, EGLint flags) ANGLE_CAPTURE_EGL(WaitSync, true, thread, dpyPacked, syncPacked, flags, returnValue); } - ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any()); + egl::Display::GetCurrentThreadUnlockedTailCall()->run(&returnValue); return returnValue; } diff --git a/src/libGLESv2/entry_points_egl_ext_autogen.cpp b/src/libGLESv2/entry_points_egl_ext_autogen.cpp index 93252ebe4f..405f138781 100644 --- a/src/libGLESv2/entry_points_egl_ext_autogen.cpp +++ b/src/libGLESv2/entry_points_egl_ext_autogen.cpp @@ -1451,7 +1451,7 @@ EGLSyncKHR EGLAPIENTRY EGL_CreateSyncKHR(EGLDisplay dpy, EGLenum type, const EGL ANGLE_CAPTURE_EGL(CreateSyncKHR, true, thread, dpyPacked, type, attrib_listPacked, returnValue); } - ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any()); + egl::Display::GetCurrentThreadUnlockedTailCall()->run(nullptr); return returnValue; } @@ -1478,7 +1478,7 @@ EGLBoolean EGLAPIENTRY EGL_DestroySyncKHR(EGLDisplay dpy, EGLSyncKHR sync) ANGLE_CAPTURE_EGL(DestroySyncKHR, true, thread, dpyPacked, syncPacked, returnValue); } - ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any()); + egl::Display::GetCurrentThreadUnlockedTailCall()->run(&returnValue); return returnValue; } @@ -1549,7 +1549,7 @@ EGLImageKHR EGLAPIENTRY EGL_CreateImageKHR(EGLDisplay dpy, ANGLE_CAPTURE_EGL(CreateImageKHR, true, thread, dpyPacked, ctxPacked, target, buffer, attrib_listPacked, returnValue); } - ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any()); + egl::Display::GetCurrentThreadUnlockedTailCall()->run(&returnValue); return returnValue; } @@ -2018,7 +2018,7 @@ EGLBoolean EGLAPIENTRY EGL_SwapBuffersWithDamageKHR(EGLDisplay dpy, ANGLE_CAPTURE_EGL(SwapBuffersWithDamageKHR, true, thread, dpyPacked, surfacePacked, rects, n_rects, returnValue); } - egl::Display::GetCurrentThreadUnlockedTailCall()->run(nullptr); + egl::Display::GetCurrentThreadUnlockedTailCall()->run(&returnValue); return returnValue; } @@ -2046,7 +2046,7 @@ EGLint EGLAPIENTRY EGL_WaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags ANGLE_CAPTURE_EGL(WaitSyncKHR, true, thread, dpyPacked, syncPacked, flags, returnValue); } - ASSERT(!egl::Display::GetCurrentThreadUnlockedTailCall()->any()); + egl::Display::GetCurrentThreadUnlockedTailCall()->run(&returnValue); return returnValue; } diff --git a/src/tests/angle_end2end_tests_expectations.txt b/src/tests/angle_end2end_tests_expectations.txt index cebad2ca31..9ed33d0ee5 100644 --- a/src/tests/angle_end2end_tests_expectations.txt +++ b/src/tests/angle_end2end_tests_expectations.txt @@ -654,6 +654,8 @@ b/308668391 PIXEL4ORXL VULKAN : ImageTest.SourceYUVAHBTargetExternalRGBSampleNoD 8598 PIXEL6 VULKAN : VulkanPerformanceCounterTest.RenderToTextureDepthStencilRenderbufferShouldNotLoad/* = SKIP 8598 PIXEL6 VULKAN : VulkanPerformanceCounterTest.RenderToTextureDepthStencilTextureShouldNotLoad/* = SKIP 8598 PIXEL6 VULKAN : VulkanPerformanceCounterTest.RenderToTextureUninitializedAndUnusedDepthStencil/* = SKIP +// New failures after AP1A.240405.002 upgrade +b/336847261 PIXEL6 VULKAN : StateChangeTestES3.LineWidth/* = SKIP // ARM drivers cannot support xfb emulation because they lack support for the // vertexPipelineStoresAndAtomics Vulkan feature. The tests that force-enable this feature are diff --git a/src/tests/capture_tests/CapturedTest.cpp b/src/tests/capture_tests/CapturedTest.cpp index bebd6ac648..9fe2cdb38b 100644 --- a/src/tests/capture_tests/CapturedTest.cpp +++ b/src/tests/capture_tests/CapturedTest.cpp @@ -44,6 +44,61 @@ void main(void) { gl_Position = vec4(0.5, 0.5, 0.5, 1.0); })"; + static constexpr char kInactiveDeferredVS[] = R"(attribute vec4 a_position; +attribute vec2 a_texCoord; +varying vec2 v_texCoord; +void main() +{ + gl_Position = a_position; + v_texCoord = a_texCoord; +})"; + + static constexpr char kInactiveDeferredFS[] = R"(precision mediump float; +varying vec2 v_texCoord; +uniform sampler2D s_texture; +void main() +{ + gl_FragColor = vec4(0.4, 0.4, 0.4, 1.0); + gl_FragColor = texture2D(s_texture, v_texCoord); +})"; + + static constexpr char kActiveDeferredVS[] = R"(attribute vec4 a_position; +attribute vec2 a_texCoord; +varying vec2 v_texCoord; +void main() +{ + gl_Position = a_position; + v_texCoord = a_texCoord; +})"; + + // Create shaders, program but defer compiling & linking, use before capture starts + // (Inactive) + lateLinkTestVertShaderInactive = glCreateShader(GL_VERTEX_SHADER); + const char *lateLinkTestVsSourceArrayInactive[1] = {kInactiveDeferredVS}; + glShaderSource(lateLinkTestVertShaderInactive, 1, lateLinkTestVsSourceArrayInactive, 0); + lateLinkTestFragShaderInactive = glCreateShader(GL_FRAGMENT_SHADER); + const char *lateLinkTestFsSourceArrayInactive[1] = {kInactiveDeferredFS}; + glShaderSource(lateLinkTestFragShaderInactive, 1, lateLinkTestFsSourceArrayInactive, 0); + lateLinkTestProgramInactive = glCreateProgram(); + glAttachShader(lateLinkTestProgramInactive, lateLinkTestVertShaderInactive); + glAttachShader(lateLinkTestProgramInactive, lateLinkTestFragShaderInactive); + + // Create inactive program having shader shared with deferred linked program + glCompileShader(lateLinkTestVertShaderInactive); + glCompileShader(lateLinkTestFragShaderInactive); + glLinkProgram(lateLinkTestProgramInactive); + ASSERT_GL_NO_ERROR(); + + // Create vertex shader and program but defer compiling & linking until capture time + // (Active) Use fragment shader attached to inactive program + lateLinkTestVertShaderActive = glCreateShader(GL_VERTEX_SHADER); + const char *lateLinkTestVsSourceArrayActive[1] = {kActiveDeferredVS}; + glShaderSource(lateLinkTestVertShaderActive, 1, lateLinkTestVsSourceArrayActive, 0); + lateLinkTestProgramActive = glCreateProgram(); + glAttachShader(lateLinkTestProgramActive, lateLinkTestVertShaderActive); + glAttachShader(lateLinkTestProgramActive, lateLinkTestFragShaderInactive); + ASSERT_GL_NO_ERROR(); + // Create shader that is unused during capture inactiveProgram = glCreateProgram(); inactiveShader = glCreateShader(GL_VERTEX_SHADER); @@ -108,6 +163,11 @@ void main(void) { glDeleteShader(inactiveShader); glDeleteShader(activeBeforeVertShader); glDeleteShader(activeBeforeFragShader); + glDeleteProgram(lateLinkTestProgramInactive); + glDeleteProgram(lateLinkTestProgramActive); + glDeleteShader(lateLinkTestVertShaderInactive); + glDeleteShader(lateLinkTestFragShaderInactive); + glDeleteShader(lateLinkTestVertShaderActive); } static constexpr char kActiveVS[] = R"(attribute vec4 a_position; @@ -130,9 +190,17 @@ void main() void frame1(); void frame2(); void frame3(); + void frame4(); std::vector<GLuint> mFBOs; + // For testing deferred compile/link + GLuint lateLinkTestVertShaderInactive; + GLuint lateLinkTestFragShaderInactive; + GLuint lateLinkTestProgramInactive; + GLuint lateLinkTestVertShaderActive; + GLuint lateLinkTestProgramActive; + GLuint inactiveProgram; GLuint inactiveShader; @@ -226,6 +294,7 @@ void CapturedTest::frame2() 0, 255, 0, // Green 255, 0, 0, // Red }; + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, pixels); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); @@ -297,6 +366,67 @@ void main(void) { // Note: RAII destructors called here causing additional GL calls. } +void CapturedTest::frame4() +{ + GLuint positionLoc; + GLuint texCoordLoc; + GLuint lateLinkTestTexture; + GLint samplerLoc; + + // Deferred compile/link + glCompileShader(lateLinkTestVertShaderActive); + glLinkProgram(lateLinkTestProgramActive); + ASSERT_GL_NO_ERROR(); + + // Get the attr/sampler locations + positionLoc = glGetAttribLocation(lateLinkTestProgramActive, "a_position"); + texCoordLoc = glGetAttribLocation(lateLinkTestProgramActive, "a_texCoord"); + samplerLoc = glGetUniformLocation(lateLinkTestProgramActive, "s_texture"); + glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + + // Bind the texture object during capture + glGenTextures(1, &lateLinkTestTexture); + glBindTexture(GL_TEXTURE_2D, lateLinkTestTexture); + ASSERT_GL_NO_ERROR(); + + const size_t width = 2; + const size_t height = 2; + GLubyte pixels[width * height * 3] = { + 255, 255, 0, // Yellow + 0, 0, 255, // Blue + 0, 255, 0, // Green + 255, 0, 0, // Red + }; + + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, pixels); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + + GLfloat vertices[] = { + -0.25f, 0.75f, 0.0f, // Position 0 + 0.0f, 0.0f, // TexCoord 0 + -0.25f, -0.25f, 0.0f, // Position 1 + 0.0f, 1.0f, // TexCoord 1 + 0.75f, -0.25f, 0.0f, // Position 2 + 1.0f, 1.0f, // TexCoord 2 + 0.75f, 0.75f, 0.0f, // Position 3 + 1.0f, 0.0f // TexCoord 3 + }; + GLushort indices[] = {0, 1, 2, 0, 2, 3}; + + glClear(GL_COLOR_BUFFER_BIT); + glUseProgram(lateLinkTestProgramActive); + glVertexAttribPointer(positionLoc, 3, GL_FLOAT, GL_FALSE, 5 * sizeof(GLfloat), vertices); + glVertexAttribPointer(texCoordLoc, 2, GL_FLOAT, GL_FALSE, 5 * sizeof(GLfloat), vertices + 3); + glEnableVertexAttribArray(positionLoc); + glEnableVertexAttribArray(texCoordLoc); + glUniform1i(samplerLoc, 0); + + // Draw shaders & program created before capture + glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, indices); + EXPECT_PIXEL_EQ(108, 108, 0, 0, 255, 255); +} + // Test captured by capture_tests.py TEST_P(CapturedTest, MultiFrame) { @@ -310,6 +440,9 @@ TEST_P(CapturedTest, MultiFrame) swapBuffers(); frame3(); + swapBuffers(); + frame4(); + // Empty frames to reach capture end. for (int i = 0; i < 10; i++) { diff --git a/src/tests/capture_tests/expected/CapturedTest_MultiFrame_ES3_Vulkan.angledata b/src/tests/capture_tests/expected/CapturedTest_MultiFrame_ES3_Vulkan.angledata Binary files differindex 7803deae6b..88493659a7 100644 --- a/src/tests/capture_tests/expected/CapturedTest_MultiFrame_ES3_Vulkan.angledata +++ b/src/tests/capture_tests/expected/CapturedTest_MultiFrame_ES3_Vulkan.angledata diff --git a/src/tests/capture_tests/expected/CapturedTest_MultiFrame_ES3_Vulkan.cpp b/src/tests/capture_tests/expected/CapturedTest_MultiFrame_ES3_Vulkan.cpp index 269c55fc71..28cd88229d 100644 --- a/src/tests/capture_tests/expected/CapturedTest_MultiFrame_ES3_Vulkan.cpp +++ b/src/tests/capture_tests/expected/CapturedTest_MultiFrame_ES3_Vulkan.cpp @@ -23,14 +23,14 @@ void InitReplay(void) // maxRenderbuffer = 0 // maxSampler = 0 // maxSemaphore = 0 - // maxShaderProgram = 11 + // maxShaderProgram = 16 // maxSurface = 1 // maxSync = 0 // maxTexture = 3 // maxTransformFeedback = 0 // maxVertexArray = 1 // maxegl_Sync = 0 - InitializeReplay4("CapturedTest_MultiFrame_ES3_Vulkan.angledata", 72, 32, 1, 1, 1, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 11, 1, 0, 3, 0, 1, 0); + InitializeReplay4("CapturedTest_MultiFrame_ES3_Vulkan.angledata", 72, 32, 1, 1, 1, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 16, 1, 0, 3, 0, 1, 0); } // Public Functions diff --git a/src/tests/capture_tests/expected/CapturedTest_MultiFrame_ES3_Vulkan.h b/src/tests/capture_tests/expected/CapturedTest_MultiFrame_ES3_Vulkan.h index 935550145b..50d3cc61d9 100644 --- a/src/tests/capture_tests/expected/CapturedTest_MultiFrame_ES3_Vulkan.h +++ b/src/tests/capture_tests/expected/CapturedTest_MultiFrame_ES3_Vulkan.h @@ -25,3 +25,4 @@ extern const char *const glShaderSource_string_1[]; extern const char *const glShaderSource_string_2[]; extern const char *const glShaderSource_string_3[]; extern const char *const glShaderSource_string_4[]; +extern const char *const glShaderSource_string_5[]; diff --git a/src/tests/capture_tests/expected/CapturedTest_MultiFrame_ES3_Vulkan.json b/src/tests/capture_tests/expected/CapturedTest_MultiFrame_ES3_Vulkan.json index ccb5ac4508..18a6dc9792 100644 --- a/src/tests/capture_tests/expected/CapturedTest_MultiFrame_ES3_Vulkan.json +++ b/src/tests/capture_tests/expected/CapturedTest_MultiFrame_ES3_Vulkan.json @@ -1,7 +1,7 @@ { "TraceMetadata": { "AreClientArraysEnabled": true, - "CaptureRevision": 22116, + "CaptureRevision": 22823, "ConfigAlphaBits": 8, "ConfigBlueBits": 8, "ConfigDepthBits": 24, diff --git a/src/tests/capture_tests/expected/CapturedTest_MultiFrame_ES3_Vulkan_001.cpp b/src/tests/capture_tests/expected/CapturedTest_MultiFrame_ES3_Vulkan_001.cpp index 265589c3ad..0d41659e4d 100644 --- a/src/tests/capture_tests/expected/CapturedTest_MultiFrame_ES3_Vulkan_001.cpp +++ b/src/tests/capture_tests/expected/CapturedTest_MultiFrame_ES3_Vulkan_001.cpp @@ -55,8 +55,8 @@ void ReplayFrame1(void) glReadPixels(0, 0, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, (void *)gReadBuffer); glGetError(); glClear(GL_COLOR_BUFFER_BIT); - glUseProgram(gShaderProgramMap[3]); - UpdateCurrentProgram(3); + glUseProgram(gShaderProgramMap[8]); + UpdateCurrentProgram(8); glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 20, gClientArrays[0]); glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, 20, gClientArrays[1]); glEnableVertexAttribArray(0); @@ -76,20 +76,20 @@ glDeleteVertexArrays(1, gResourceIDBuffer); void ReplayFrame2(void) { eglGetError(); - CreateProgram(6); - CreateShader(GL_VERTEX_SHADER, 7); - CreateShader(GL_FRAGMENT_SHADER, 8); - glShaderSource(gShaderProgramMap[7], 1, glShaderSource_string_0, (const GLint *)&gBinaryData[176]); - glCompileShader(gShaderProgramMap[7]); - glAttachShader(gShaderProgramMap[6], gShaderProgramMap[7]); - glShaderSource(gShaderProgramMap[8], 1, glShaderSource_string_1, (const GLint *)&gBinaryData[192]); - glCompileShader(gShaderProgramMap[8]); - glAttachShader(gShaderProgramMap[6], gShaderProgramMap[8]); - glLinkProgram(gShaderProgramMap[6]); - UpdateUniformLocation(6, "s_texture", 0, 1); - glGetAttribLocation(gShaderProgramMap[6], "a_position"); - glGetAttribLocation(gShaderProgramMap[6], "a_texCoord"); - glGetUniformLocation(gShaderProgramMap[6], "s_texture"); + CreateProgram(11); + CreateShader(GL_VERTEX_SHADER, 12); + CreateShader(GL_FRAGMENT_SHADER, 13); + glShaderSource(gShaderProgramMap[12], 1, glShaderSource_string_0, (const GLint *)&gBinaryData[176]); + glCompileShader(gShaderProgramMap[12]); + glAttachShader(gShaderProgramMap[11], gShaderProgramMap[12]); + glShaderSource(gShaderProgramMap[13], 1, glShaderSource_string_1, (const GLint *)&gBinaryData[192]); + glCompileShader(gShaderProgramMap[13]); + glAttachShader(gShaderProgramMap[11], gShaderProgramMap[13]); + glLinkProgram(gShaderProgramMap[11]); + UpdateUniformLocation(11, "s_texture", 0, 1); + glGetAttribLocation(gShaderProgramMap[11], "a_position"); + glGetAttribLocation(gShaderProgramMap[11], "a_texCoord"); + glGetUniformLocation(gShaderProgramMap[11], "s_texture"); glPixelStorei(GL_UNPACK_ALIGNMENT, 1); glGenTextures(1, (GLuint *)gReadBuffer); UpdateTextureID(3, 0); @@ -99,8 +99,8 @@ void ReplayFrame2(void) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, 9728); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, 9728); glClear(GL_COLOR_BUFFER_BIT); - glUseProgram(gShaderProgramMap[6]); - UpdateCurrentProgram(6); + glUseProgram(gShaderProgramMap[11]); + UpdateCurrentProgram(11); glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 20, gClientArrays[0]); glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, 20, gClientArrays[1]); glEnableVertexAttribArray(0); @@ -117,10 +117,10 @@ glDeleteTextures(1, gResourceIDBuffer); glDeleteVertexArrays(1, gResourceIDBuffer); UpdateResourceIDBuffer(0, gVertexArrayMap[1]); glDeleteVertexArrays(1, gResourceIDBuffer); - glDeleteProgram(gShaderProgramMap[6]); - DeleteUniformLocations(gShaderProgramMap[6]); - glDeleteShader(gShaderProgramMap[7]); - glDeleteShader(gShaderProgramMap[8]); + glDeleteProgram(gShaderProgramMap[11]); + DeleteUniformLocations(gShaderProgramMap[11]); + glDeleteShader(gShaderProgramMap[12]); + glDeleteShader(gShaderProgramMap[13]); } void ReplayFrame3(void) @@ -129,44 +129,42 @@ void ReplayFrame3(void) glGenBuffers(1, (GLuint *)gReadBuffer); UpdateBufferID(1, 0); glBindBuffer(GL_ARRAY_BUFFER, gBufferMap[1]); - CreateProgram(9); - CreateShader(GL_VERTEX_SHADER, 10); - glShaderSource(gShaderProgramMap[10], 1, glShaderSource_string_2, (const GLint *)&gBinaryData[400]); - glCompileShader(gShaderProgramMap[10]); - glGetShaderiv(gShaderProgramMap[10], GL_COMPILE_STATUS, (GLint *)gReadBuffer); - CreateShader(GL_FRAGMENT_SHADER, 11); - glShaderSource(gShaderProgramMap[11], 1, glShaderSource_string_3, (const GLint *)&gBinaryData[416]); - glCompileShader(gShaderProgramMap[11]); - glGetShaderiv(gShaderProgramMap[11], GL_COMPILE_STATUS, (GLint *)gReadBuffer); - glAttachShader(gShaderProgramMap[9], gShaderProgramMap[10]); - glDeleteShader(gShaderProgramMap[10]); - glAttachShader(gShaderProgramMap[9], gShaderProgramMap[11]); - glDeleteShader(gShaderProgramMap[11]); - glLinkProgram(gShaderProgramMap[9]); + CreateProgram(14); + CreateShader(GL_VERTEX_SHADER, 15); + glShaderSource(gShaderProgramMap[15], 1, glShaderSource_string_2, (const GLint *)&gBinaryData[400]); + glCompileShader(gShaderProgramMap[15]); + glGetShaderiv(gShaderProgramMap[15], GL_COMPILE_STATUS, (GLint *)gReadBuffer); + CreateShader(GL_FRAGMENT_SHADER, 16); + glShaderSource(gShaderProgramMap[16], 1, glShaderSource_string_3, (const GLint *)&gBinaryData[416]); + glCompileShader(gShaderProgramMap[16]); + glGetShaderiv(gShaderProgramMap[16], GL_COMPILE_STATUS, (GLint *)gReadBuffer); + glAttachShader(gShaderProgramMap[14], gShaderProgramMap[15]); + glDeleteShader(gShaderProgramMap[15]); + glAttachShader(gShaderProgramMap[14], gShaderProgramMap[16]); + glDeleteShader(gShaderProgramMap[16]); + glLinkProgram(gShaderProgramMap[14]); glGetError(); - glGetProgramiv(gShaderProgramMap[9], GL_LINK_STATUS, (GLint *)gReadBuffer); - glBindAttribLocation(gShaderProgramMap[9], 0, "attr1"); - glLinkProgram(gShaderProgramMap[9]); + glGetProgramiv(gShaderProgramMap[14], GL_LINK_STATUS, (GLint *)gReadBuffer); + glBindAttribLocation(gShaderProgramMap[14], 0, "attr1"); + glLinkProgram(gShaderProgramMap[14]); glGetError(); - glGetProgramiv(gShaderProgramMap[9], GL_LINK_STATUS, (GLint *)gReadBuffer); - glUseProgram(gShaderProgramMap[9]); - UpdateCurrentProgram(9); + glGetProgramiv(gShaderProgramMap[14], GL_LINK_STATUS, (GLint *)gReadBuffer); + glUseProgram(gShaderProgramMap[14]); + UpdateCurrentProgram(14); glEnableVertexAttribArray(1); glVertexAttribPointer(1, 3, GL_UNSIGNED_BYTE, GL_FALSE, 1, 0); glDrawArrays(GL_TRIANGLES, 0, 3); glGetError(); - glDeleteProgram(gShaderProgramMap[9]); - DeleteUniformLocations(gShaderProgramMap[9]); + glDeleteProgram(gShaderProgramMap[14]); + DeleteUniformLocations(gShaderProgramMap[14]); UpdateResourceIDBuffer(0, gBufferMap[1]); glDeleteBuffers(1, gResourceIDBuffer); } void ResetReplayContextShared(void) { - glUseProgram(gShaderProgramMap[3]); - UpdateCurrentProgram(3); - glUniform1iv(gUniformLocations[gCurrentProgram][0], 1, (const GLint *)&gBinaryData[432]); - glUniform1iv(gUniformLocations[gCurrentProgram][0], 1, (const GLint *)&gBinaryData[448]); + UpdateResourceIDBuffer(0, gTextureMap[3]); + glDeleteTextures(1, gResourceIDBuffer); } void ResetReplayContext1(void) @@ -176,6 +174,34 @@ void ResetReplayContext1(void) void ReplayFrame4(void) { eglGetError(); + glCompileShader(gShaderProgramMap[4]); + glLinkProgram(gShaderProgramMap[5]); + UpdateUniformLocation(5, "s_texture", 0, 1); + glGetError(); + glGetAttribLocation(gShaderProgramMap[5], "a_position"); + glGetAttribLocation(gShaderProgramMap[5], "a_texCoord"); + glGetUniformLocation(gShaderProgramMap[5], "s_texture"); + glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + glGenTextures(1, (GLuint *)gReadBuffer); + UpdateTextureID(3, 0); + glBindTexture(GL_TEXTURE_2D, gTextureMap[3]); + glGetError(); + glTexImage2D(GL_TEXTURE_2D, 0, 6407, 2, 2, 0, GL_RGB, GL_UNSIGNED_BYTE, (const GLubyte *)&gBinaryData[432]); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, 9728); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, 9728); + glClear(GL_COLOR_BUFFER_BIT); + glUseProgram(gShaderProgramMap[5]); + UpdateCurrentProgram(5); + glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 20, gClientArrays[0]); + glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, 20, gClientArrays[1]); + glEnableVertexAttribArray(0); + glEnableVertexAttribArray(1); + glUniform1i(gUniformLocations[gCurrentProgram][0], 0); + UpdateClientArrayPointer(0, (const GLubyte *)&gBinaryData[448], 72); + UpdateClientArrayPointer(1, (const GLubyte *)&gBinaryData[528], 68); + glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, (const GLubyte *)&gBinaryData[608]); + glReadPixels(108, 108, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, (void *)gReadBuffer); + glGetError(); } // Public Functions diff --git a/src/tests/capture_tests/expected/CapturedTest_MultiFrame_ES3_Vulkan_shared.cpp b/src/tests/capture_tests/expected/CapturedTest_MultiFrame_ES3_Vulkan_shared.cpp index bc172bb746..57e666241b 100644 --- a/src/tests/capture_tests/expected/CapturedTest_MultiFrame_ES3_Vulkan_shared.cpp +++ b/src/tests/capture_tests/expected/CapturedTest_MultiFrame_ES3_Vulkan_shared.cpp @@ -2,6 +2,16 @@ #include "CapturedTest_MultiFrame_ES3_Vulkan.h" const char *const glShaderSource_string_4[] = { +"precision mediump float;\n" +"varying vec2 v_texCoord;\n" +"uniform sampler2D s_texture;\n" +"void main()\n" +"{\n" +" gl_FragColor = vec4(0.4, 0.4, 0.4, 1.0);\n" +" gl_FragColor = texture2D(s_texture, v_texCoord);\n" +"}", +}; +const char *const glShaderSource_string_5[] = { "precision highp float;\n" "void main(void) {\n" " gl_Position = vec4(0.5, 0.5, 0.5, 1.0);\n" @@ -18,38 +28,69 @@ void SetupReplayContextShared(void) glBindTexture(GL_TEXTURE_2D, gTextureMap[2]); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, 9728); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, 9728); - glTexImage2D(GL_TEXTURE_2D, 0, 6407, 2, 2, 0, GL_RGB, GL_UNSIGNED_BYTE, (const GLubyte *)&gBinaryData[464]); - CreateProgram(3); - CreateShader(GL_VERTEX_SHADER, 6); - glShaderSource(gShaderProgramMap[6], 1, glShaderSource_string_0, 0); - glCompileShader(gShaderProgramMap[6]); - glAttachShader(gShaderProgramMap[3], gShaderProgramMap[6]); - CreateShader(GL_FRAGMENT_SHADER, 7); - glShaderSource(gShaderProgramMap[7], 1, glShaderSource_string_1, 0); + glTexImage2D(GL_TEXTURE_2D, 0, 6407, 2, 2, 0, GL_RGB, GL_UNSIGNED_BYTE, (const GLubyte *)&gBinaryData[624]); + CreateProgram(5); + CreateProgram(6); + CreateProgram(8); + CreateShader(GL_VERTEX_SHADER, 11); + glShaderSource(gShaderProgramMap[11], 1, glShaderSource_string_0, 0); + glCompileShader(gShaderProgramMap[11]); + glAttachShader(gShaderProgramMap[8], gShaderProgramMap[11]); + CreateShader(GL_FRAGMENT_SHADER, 12); + glShaderSource(gShaderProgramMap[12], 1, glShaderSource_string_1, 0); + glCompileShader(gShaderProgramMap[12]); + glAttachShader(gShaderProgramMap[8], gShaderProgramMap[12]); + glBindAttribLocation(gShaderProgramMap[8], 0, "a_position"); + glBindAttribLocation(gShaderProgramMap[8], 1, "a_texCoord"); + glLinkProgram(gShaderProgramMap[8]); + UpdateUniformLocation(8, "s_texture", 0, 1); + glUseProgram(gShaderProgramMap[8]); + UpdateCurrentProgram(8); + glUniform1iv(gUniformLocations[gCurrentProgram][0], 1, (const GLint *)&gBinaryData[640]); + glDeleteShader(gShaderProgramMap[11]); + glDeleteShader(gShaderProgramMap[12]); + CreateShader(GL_FRAGMENT_SHADER, 2); + glAttachShader(gShaderProgramMap[5], gShaderProgramMap[2]); + glShaderSource(gShaderProgramMap[2], 1, glShaderSource_string_4, 0); + glCompileShader(gShaderProgramMap[2]); + CreateShader(GL_VERTEX_SHADER, 4); + glAttachShader(gShaderProgramMap[5], gShaderProgramMap[4]); + glShaderSource(gShaderProgramMap[4], 1, glShaderSource_string_0, 0); + CreateShader(GL_VERTEX_SHADER, 7); + glAttachShader(gShaderProgramMap[6], gShaderProgramMap[7]); + glShaderSource(gShaderProgramMap[7], 1, glShaderSource_string_5, 0); glCompileShader(gShaderProgramMap[7]); - glAttachShader(gShaderProgramMap[3], gShaderProgramMap[7]); +} + +void SetupReplayContextSharedInactive(void) +{ + CreateProgram(3); + CreateShader(GL_VERTEX_SHADER, 11); + glShaderSource(gShaderProgramMap[11], 1, glShaderSource_string_0, 0); + glCompileShader(gShaderProgramMap[11]); + glAttachShader(gShaderProgramMap[3], gShaderProgramMap[11]); + CreateShader(GL_FRAGMENT_SHADER, 12); + glShaderSource(gShaderProgramMap[12], 1, glShaderSource_string_4, 0); + glCompileShader(gShaderProgramMap[12]); + glAttachShader(gShaderProgramMap[3], gShaderProgramMap[12]); glBindAttribLocation(gShaderProgramMap[3], 0, "a_position"); glBindAttribLocation(gShaderProgramMap[3], 1, "a_texCoord"); glLinkProgram(gShaderProgramMap[3]); UpdateUniformLocation(3, "s_texture", 0, 1); glUseProgram(gShaderProgramMap[3]); UpdateCurrentProgram(3); - glUniform1iv(gUniformLocations[gCurrentProgram][0], 1, (const GLint *)&gBinaryData[480]); - glDeleteShader(gShaderProgramMap[6]); - glDeleteShader(gShaderProgramMap[7]); -} - -void SetupReplayContextSharedInactive(void) -{ - CreateShader(GL_VERTEX_SHADER, 2); - glShaderSource(gShaderProgramMap[2], 1, glShaderSource_string_4, 0); - glCompileShader(gShaderProgramMap[2]); - CreateShader(GL_VERTEX_SHADER, 4); - glShaderSource(gShaderProgramMap[4], 1, glShaderSource_string_0, 0); - glCompileShader(gShaderProgramMap[4]); - CreateShader(GL_FRAGMENT_SHADER, 5); - glShaderSource(gShaderProgramMap[5], 1, glShaderSource_string_1, 0); - glCompileShader(gShaderProgramMap[5]); + glUniform1iv(gUniformLocations[gCurrentProgram][0], 1, (const GLint *)&gBinaryData[656]); + glDeleteShader(gShaderProgramMap[11]); + glDeleteShader(gShaderProgramMap[12]); + CreateShader(GL_VERTEX_SHADER, 1); + glShaderSource(gShaderProgramMap[1], 1, glShaderSource_string_0, 0); + glCompileShader(gShaderProgramMap[1]); + CreateShader(GL_VERTEX_SHADER, 9); + glShaderSource(gShaderProgramMap[9], 1, glShaderSource_string_0, 0); + glCompileShader(gShaderProgramMap[9]); + CreateShader(GL_FRAGMENT_SHADER, 10); + glShaderSource(gShaderProgramMap[10], 1, glShaderSource_string_1, 0); + glCompileShader(gShaderProgramMap[10]); } // Public Functions diff --git a/src/tests/gl_tests/ImageTestMetal.mm b/src/tests/gl_tests/ImageTestMetal.mm index 4dfdc169df..d33a42ef90 100644 --- a/src/tests/gl_tests/ImageTestMetal.mm +++ b/src/tests/gl_tests/ImageTestMetal.mm @@ -49,6 +49,8 @@ class ScopedMetalObjectRef : angle::NonCopyable T get() const { return mObject; } + operator bool() const { return !!mObject; } + // auto cast to T operator T() const { return mObject; } ScopedMetalObjectRef(const ScopedMetalObjectRef &other) @@ -110,6 +112,24 @@ using ScopedMetalCommandQueueRef = ScopedMetalObjectRef<id<MTLCommandQueue>>; } // anonymous namespace +bool IsDepthOrStencil(MTLPixelFormat format) +{ + switch (format) + { + case MTLPixelFormatDepth16Unorm: + case MTLPixelFormatDepth32Float: + case MTLPixelFormatStencil8: + case MTLPixelFormatDepth24Unorm_Stencil8: + case MTLPixelFormatDepth32Float_Stencil8: + case MTLPixelFormatX32_Stencil8: + case MTLPixelFormatX24_Stencil8: + return true; + + default: + return false; + } +} + ScopedMetalTextureRef CreateMetalTexture2D(id<MTLDevice> deviceMtl, int width, int height, @@ -123,6 +143,10 @@ ScopedMetalTextureRef CreateMetalTexture2D(id<MTLDevice> deviceMtl, height:width mipmapped:NO]; desc.usage = MTLTextureUsageShaderRead | MTLTextureUsageRenderTarget; + if (IsDepthOrStencil(format)) + { + desc.storageMode = MTLStorageModePrivate; + } if (arrayLength) { desc.arrayLength = arrayLength; @@ -211,6 +235,7 @@ class ImageTestMetal : public ANGLETest<> return CreateMetalTexture2D(device, width, height, format, arrayLength); } + void getTextureSliceBytes(id<MTLTexture> texture, unsigned bytesPerRow, MTLRegion region, @@ -282,6 +307,12 @@ class ImageTestMetal : public ANGLETest<> glUseProgram(0); } + bool hasDepth24Stencil8PixelFormat() + { + id<MTLDevice> device = getMtlDevice(); + return device.depth24Stencil8PixelFormatSupported; + } + bool hasImageNativeMetalTextureExt() const { if (!IsMetal()) @@ -670,9 +701,310 @@ TEST_P(ImageTestMetal, BlitMetalTarget2DArray) getTextureSliceBytes(textureMtl, 4, MTLRegionMake2D(0, 0, 1, 1), 0, 1, {result.data(), 4}); EXPECT_EQ(result, GLColor::yellow); } + +// Tests that OpenGL can override the internal format for a texture bound with +// Metal texture. +TEST_P(ImageTestMetal, OverrideMetalTextureInternalFormat) +{ + ANGLE_SKIP_TEST_IF(!hasOESExt() || !hasBaseExt()); + ANGLE_SKIP_TEST_IF(!hasImageNativeMetalTextureExt()); + ANGLE_SKIP_TEST_IF(hasDepth24Stencil8PixelFormat()); + + EGLDisplay display = getEGLWindow()->getDisplay(); + + // On iOS devices, GL_DEPTH24_STENCIL8 is unavailable and is interally converted into + // GL_DEPTH32F_STENCIL8. This tests the ability to attach MTLPixelFormatDepth32Float_Stencil8 + // and have GL treat it as GL_DEPTH24_STENCIL8 instead of GL_DEPTH32F_STENCIL8. + ScopedMetalTextureRef textureMtl = + createMtlTexture2DArray(1, 1, 1, MTLPixelFormatDepth32Float_Stencil8); + const EGLint attribs[] = {EGL_TEXTURE_INTERNAL_FORMAT_ANGLE, GL_DEPTH24_STENCIL8, EGL_NONE}; + EGLImageKHR image = + eglCreateImageKHR(display, EGL_NO_CONTEXT, EGL_METAL_TEXTURE_ANGLE, + reinterpret_cast<EGLClientBuffer>(textureMtl.get()), attribs); + EXPECT_EGL_SUCCESS(); + EXPECT_NE(image, nullptr); +} + +// Tests that OpenGL can override the internal format for a texture bound with +// Metal texture and that rendering to the texture is successful. +TEST_P(ImageTestMetal, RenderingTest) +{ + ANGLE_SKIP_TEST_IF(!hasOESExt() || !hasBaseExt()); + ANGLE_SKIP_TEST_IF(!hasImageNativeMetalTextureExt()); + ANGLE_SKIP_TEST_IF(hasDepth24Stencil8PixelFormat()); + + EGLDisplay display = getEGLWindow()->getDisplay(); + + const int bufferSize = 32; + ScopedMetalTextureRef textureMtl = + createMtlTexture2DArray(bufferSize, bufferSize, 1, MTLPixelFormatDepth32Float_Stencil8); + const EGLint attribs[] = {EGL_TEXTURE_INTERNAL_FORMAT_ANGLE, GL_DEPTH24_STENCIL8, EGL_NONE}; + EGLImageKHR image = + eglCreateImageKHR(display, EGL_NO_CONTEXT, EGL_METAL_TEXTURE_ANGLE, + reinterpret_cast<EGLClientBuffer>(textureMtl.get()), attribs); + EXPECT_EGL_SUCCESS(); + EXPECT_NE(image, nullptr); + + GLRenderbuffer colorBuffer; + glBindRenderbuffer(GL_RENDERBUFFER, colorBuffer); + glRenderbufferStorage(GL_RENDERBUFFER, GL_RGBA8, bufferSize, bufferSize); + EXPECT_GL_NO_ERROR(); + + GLRenderbuffer depthStencilBuffer; + glBindRenderbuffer(GL_RENDERBUFFER, depthStencilBuffer); + glEGLImageTargetRenderbufferStorageOES(GL_RENDERBUFFER, image); + EXPECT_GL_NO_ERROR(); + + GLFramebuffer fb; + glBindFramebuffer(GL_FRAMEBUFFER, fb); + glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, colorBuffer); + if (getClientMajorVersion() >= 3) + { + glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER, + depthStencilBuffer); + } + else + { + glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, + depthStencilBuffer); + glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, + depthStencilBuffer); + } + + EXPECT_GL_NO_ERROR(); + ASSERT_GL_FRAMEBUFFER_COMPLETE(GL_FRAMEBUFFER); + + glClearColor(1.f, 0.f, 0.f, 1.f); + glClearDepthf(1.f); + glClearStencil(0x55); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); + EXPECT_GL_NO_ERROR(); + + glEnable(GL_DEPTH_TEST); + glDepthFunc(GL_LESS); + + glEnable(GL_STENCIL_TEST); + glStencilFunc(GL_EQUAL, 0x55, 0xFF); + glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP); + glStencilMask(0xFF); + + // Draw green. + ANGLE_GL_PROGRAM(drawGreen, essl1_shaders::vs::Simple(), essl1_shaders::fs::Green()); + drawQuad(drawGreen, essl1_shaders::PositionAttrib(), 0.95f); + + // Verify that green was drawn. + EXPECT_PIXEL_COLOR_EQ(0, 0, GLColor::green); + EXPECT_PIXEL_COLOR_EQ(0, bufferSize - 1, GLColor::green); + EXPECT_PIXEL_COLOR_EQ(bufferSize - 1, 0, GLColor::green); + EXPECT_PIXEL_COLOR_EQ(bufferSize - 1, bufferSize - 1, GLColor::green); + + eglDestroyImageKHR(display, image); +} + +// Tests that OpenGL override the with a bad internal format for a texture bound +// with Metal texture fails. +TEST_P(ImageTestMetal, OverrideMetalTextureInternalFormatBadFormat) +{ + ANGLE_SKIP_TEST_IF(!hasOESExt() || !hasBaseExt()); + ANGLE_SKIP_TEST_IF(!hasImageNativeMetalTextureExt()); + + EGLDisplay display = getEGLWindow()->getDisplay(); + + // On iOS devices, GL_DEPTH24_STENCIL8 is unavailable and is interally converted into + // GL_DEPTH32F_STENCIL8. This tests the ability to attach MTLPixelFormatDepth32Float_Stencil8 + // and have GL treat it as GL_DEPTH24_STENCIL8 instead of GL_DEPTH32F_STENCIL8. + ScopedMetalTextureRef textureMtl = + createMtlTexture2DArray(1, 1, 1, MTLPixelFormatDepth32Float_Stencil8); + const EGLint attribs[] = {EGL_TEXTURE_INTERNAL_FORMAT_ANGLE, GL_TRIANGLES, EGL_NONE}; + EGLImageKHR image = + eglCreateImageKHR(display, EGL_NO_CONTEXT, EGL_METAL_TEXTURE_ANGLE, + reinterpret_cast<EGLClientBuffer>(textureMtl.get()), attribs); + EXPECT_EGL_ERROR(EGL_BAD_ATTRIBUTE); + EXPECT_EQ(image, nullptr); +} + +// Tests that OpenGL override the with an incompatible internal format for a texture bound +// with Metal texture fails. +TEST_P(ImageTestMetal, OverrideMetalTextureInternalFormatIncompatibleFormat) +{ + ANGLE_SKIP_TEST_IF(!hasOESExt() || !hasBaseExt()); + ANGLE_SKIP_TEST_IF(!hasImageNativeMetalTextureExt()); + + EGLDisplay display = getEGLWindow()->getDisplay(); + + // On iOS devices, GL_DEPTH24_STENCIL8 is unavailable and is interally converted into + // GL_DEPTH32F_STENCIL8. This tests the ability to attach MTLPixelFormatDepth32Float_Stencil8 + // and have GL treat it as GL_DEPTH24_STENCIL8 instead of GL_DEPTH32F_STENCIL8. + ScopedMetalTextureRef textureMtl = + createMtlTexture2DArray(1, 1, 1, MTLPixelFormatDepth32Float_Stencil8); + const EGLint attribs[] = {EGL_TEXTURE_INTERNAL_FORMAT_ANGLE, GL_RGBA8, EGL_NONE}; + EGLImageKHR image = + eglCreateImageKHR(display, EGL_NO_CONTEXT, EGL_METAL_TEXTURE_ANGLE, + reinterpret_cast<EGLClientBuffer>(textureMtl.get()), attribs); + EXPECT_EGL_ERROR(EGL_BAD_ATTRIBUTE); + EXPECT_EQ(image, nullptr); +} + +class ImageClearTestMetal : public ImageTestMetal +{ + protected: + ImageClearTestMetal() : ImageTestMetal() {} + + void RunUnsizedClearTest(MTLPixelFormat format) + { + ANGLE_SKIP_TEST_IF(!hasOESExt() || !hasBaseExt()); + ANGLE_SKIP_TEST_IF(!hasImageNativeMetalTextureExt()); + + EGLWindow *window = getEGLWindow(); + EGLDisplay display = window->getDisplay(); + + window->makeCurrent(); + + const GLint bufferSize = 32; + ScopedMetalTextureRef textureMtl = + createMtlTexture2DArray(bufferSize, bufferSize, 1, format); + EXPECT_TRUE(textureMtl); + + EGLint internalFormat = GL_NONE; + switch (format) + { + case MTLPixelFormatR8Unorm: + case MTLPixelFormatR16Unorm: + internalFormat = GL_RED_EXT; + break; + case MTLPixelFormatRG8Unorm: + case MTLPixelFormatRG16Unorm: + internalFormat = GL_RG_EXT; + break; + case MTLPixelFormatRGBA8Unorm: + case MTLPixelFormatRGBA16Float: + case MTLPixelFormatRGB10A2Unorm: + internalFormat = GL_RGBA; + break; + case MTLPixelFormatRGBA8Unorm_sRGB: + internalFormat = GL_SRGB_ALPHA_EXT; + break; + case MTLPixelFormatBGRA8Unorm: + internalFormat = GL_BGRA_EXT; + break; + default: + break; + } + + const EGLint attribs[] = {EGL_TEXTURE_INTERNAL_FORMAT_ANGLE, internalFormat, EGL_NONE}; + + EGLImageKHR image = + eglCreateImageKHR(display, EGL_NO_CONTEXT, EGL_METAL_TEXTURE_ANGLE, + reinterpret_cast<EGLClientBuffer>(textureMtl.get()), attribs); + ASSERT_EGL_SUCCESS(); + ASSERT_NE(image, EGL_NO_IMAGE_KHR); + + GLTexture texture; + glBindTexture(GL_TEXTURE_2D, texture); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + EXPECT_GL_NO_ERROR(); + + glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, image); + EXPECT_GL_NO_ERROR(); + + GLFramebuffer fbo; + glBindFramebuffer(GL_FRAMEBUFFER, fbo); + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture, 0); + EXPECT_EQ(glCheckFramebufferStatus(GL_FRAMEBUFFER), + static_cast<unsigned>(GL_FRAMEBUFFER_COMPLETE)); + EXPECT_GL_NO_ERROR(); + + glViewport(0, 0, static_cast<GLsizei>(bufferSize), static_cast<GLsizei>(bufferSize)); + glClearColor(1.0f, 1.0f, 1.0f, 1.0f); + glClear(GL_COLOR_BUFFER_BIT); + ASSERT_GL_NO_ERROR(); + + if (format == MTLPixelFormatRGBA16Float) + { + EXPECT_PIXEL_32F_EQ(bufferSize / 2, bufferSize / 2, 1.0f, 1.0f, 1.0f, 1.0f); + } + else + { + GLuint readColor[4] = {0, 0, 0, 255}; + switch (format) + { + case MTLPixelFormatR8Unorm: + case MTLPixelFormatR16Unorm: + readColor[0] = 255; + break; + case MTLPixelFormatRG8Unorm: + case MTLPixelFormatRG16Unorm: + readColor[0] = readColor[1] = 255; + break; + case MTLPixelFormatRGBA8Unorm: + case MTLPixelFormatRGB10A2Unorm: + case MTLPixelFormatRGBA16Float: + case MTLPixelFormatRGBA8Unorm_sRGB: + case MTLPixelFormatBGRA8Unorm: + readColor[0] = readColor[1] = readColor[2] = 255; + break; + default: + break; + } + // Read back as GL_UNSIGNED_BYTE even though the texture might have more than 8bpc. + EXPECT_PIXEL_EQ(bufferSize / 2, bufferSize / 2, readColor[0], readColor[1], + readColor[2], readColor[3]); + } + } +}; + +TEST_P(ImageClearTestMetal, ClearUnsizedRGBA8) +{ + RunUnsizedClearTest(MTLPixelFormatRGBA8Unorm); +} + +TEST_P(ImageClearTestMetal, ClearUnsizedsRGBA8) +{ + RunUnsizedClearTest(MTLPixelFormatRGBA8Unorm_sRGB); +} + +TEST_P(ImageClearTestMetal, ClearUnsizedBGRA8) +{ + RunUnsizedClearTest(MTLPixelFormatBGRA8Unorm); +} + +TEST_P(ImageClearTestMetal, ClearUnsizedR8) +{ + RunUnsizedClearTest(MTLPixelFormatR8Unorm); +} + +TEST_P(ImageClearTestMetal, ClearUnsizedRG8) +{ + RunUnsizedClearTest(MTLPixelFormatRG8Unorm); +} + +TEST_P(ImageClearTestMetal, ClearUnsizedRGB10A2) +{ + RunUnsizedClearTest(MTLPixelFormatRGB10A2Unorm); +} + +TEST_P(ImageClearTestMetal, ClearUnsizedRGBAF16) +{ + RunUnsizedClearTest(MTLPixelFormatRGBA16Float); +} + +TEST_P(ImageClearTestMetal, ClearUnsizedR16) +{ + RunUnsizedClearTest(MTLPixelFormatR16Unorm); +} + +TEST_P(ImageClearTestMetal, ClearUnsizedRG16) +{ + RunUnsizedClearTest(MTLPixelFormatRG16Unorm); +} + // Use this to select which configurations (e.g. which renderer, which GLES major version) these // tests should be run against. ANGLE_INSTANTIATE_TEST(ImageTestMetal, ES2_METAL(), ES3_METAL()); - +ANGLE_INSTANTIATE_TEST(ImageClearTestMetal, ES2_METAL(), ES3_METAL()); GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(ImageTestMetal); +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(ImageClearTestMetal); } // namespace angle diff --git a/src/tests/gl_tests/RobustResourceInitTest.cpp b/src/tests/gl_tests/RobustResourceInitTest.cpp index 245455f4a8..f38a0f99f4 100644 --- a/src/tests/gl_tests/RobustResourceInitTest.cpp +++ b/src/tests/gl_tests/RobustResourceInitTest.cpp @@ -2009,6 +2009,65 @@ TEST_P(RobustResourceInitTestES3, CompressedSubImage) } } +// Test drawing to a framebuffer with not all draw buffers enabled +TEST_P(RobustResourceInitTestES3, SparseDrawBuffers) +{ + constexpr char kVS[] = R"(#version 300 es +void main() { + gl_PointSize = 100.0; + gl_Position = vec4(0, 0, 0, 1); +})"; + + constexpr char kFS[] = R"(#version 300 es +precision highp float; +layout(location = 1) out vec4 output1; +layout(location = 3) out vec4 output2; +void main() +{ + output1 = vec4(0.0, 1.0, 0.0, 1.0); + output2 = vec4(0.0, 0.0, 1.0, 1.0); +})"; + + ANGLE_GL_PROGRAM(program, kVS, kFS); + glUseProgram(program); + + GLFramebuffer fbo; + glBindFramebuffer(GL_FRAMEBUFFER, fbo); + + std::vector<GLTexture> textures(4); + for (size_t i = 0; i < textures.size(); i++) + { + glBindTexture(GL_TEXTURE_2D, textures[i]); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr); + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + i, GL_TEXTURE_2D, textures[i], + 0); + } + + glViewport(0, 0, 1, 1); + + constexpr GLenum drawBuffers[4] = { + GL_NONE, + GL_COLOR_ATTACHMENT1, + GL_NONE, + GL_COLOR_ATTACHMENT3, + }; + glDrawBuffers(4, drawBuffers); + + glDrawArrays(GL_POINTS, 0, 1); + + const GLColor expectedColors[4] = { + GLColor::transparentBlack, + GLColor::green, + GLColor::transparentBlack, + GLColor::blue, + }; + for (size_t i = 0; i < textures.size(); i++) + { + glReadBuffer(GL_COLOR_ATTACHMENT0 + i); + EXPECT_PIXEL_COLOR_EQ(0, 0, expectedColors[i]) << " at attachment " << i; + } +} + // Tests that a partial scissor still initializes contents as expected. TEST_P(RobustResourceInitTest, ClearWithScissor) { diff --git a/third_party/abseil-cpp/README.chromium b/third_party/abseil-cpp/README.chromium index a138dfb34b..f24402ecdd 100644 --- a/third_party/abseil-cpp/README.chromium +++ b/third_party/abseil-cpp/README.chromium @@ -4,7 +4,7 @@ URL: https://github.com/abseil/abseil-cpp License: Apache 2.0 License File: LICENSE Version: N/A -Revision: 8f9e5f0203c8a708c71f4498bf59355d1d7bbf87 +Revision: e022c806b07c661932967a2680e32cafdf572895 Security Critical: yes Shipped: yes diff --git a/third_party/abseil-cpp/absl/base/attributes.h b/third_party/abseil-cpp/absl/base/attributes.h index 38086a82e4..a6c40a76c8 100644 --- a/third_party/abseil-cpp/absl/base/attributes.h +++ b/third_party/abseil-cpp/absl/base/attributes.h @@ -702,6 +702,11 @@ _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") #define ABSL_INTERNAL_RESTORE_DEPRECATED_DECLARATION_WARNING \ _Pragma("GCC diagnostic pop") +#elif defined(_MSC_VER) +#define ABSL_INTERNAL_DISABLE_DEPRECATED_DECLARATION_WARNING \ + _Pragma("warning(push)") _Pragma("warning(disable: 4996)") +#define ABSL_INTERNAL_RESTORE_DEPRECATED_DECLARATION_WARNING \ + _Pragma("warning(pop)") #else #define ABSL_INTERNAL_DISABLE_DEPRECATED_DECLARATION_WARNING #define ABSL_INTERNAL_RESTORE_DEPRECATED_DECLARATION_WARNING diff --git a/third_party/abseil-cpp/absl/container/BUILD.bazel b/third_party/abseil-cpp/absl/container/BUILD.bazel index 12e27c21fd..2eaece6966 100644 --- a/third_party/abseil-cpp/absl/container/BUILD.bazel +++ b/third_party/abseil-cpp/absl/container/BUILD.bazel @@ -126,6 +126,7 @@ cc_library( linkopts = ABSL_DEFAULT_LINKOPTS, deps = [ ":compressed_tuple", + "//absl/base:base_internal", "//absl/base:config", "//absl/base:core_headers", "//absl/memory", diff --git a/third_party/abseil-cpp/absl/container/BUILD.gn b/third_party/abseil-cpp/absl/container/BUILD.gn index 7cc29a66c8..f0ba1252ad 100644 --- a/third_party/abseil-cpp/absl/container/BUILD.gn +++ b/third_party/abseil-cpp/absl/container/BUILD.gn @@ -39,6 +39,7 @@ absl_source_set("inlined_vector_internal") { public = [ "internal/inlined_vector.h" ] deps = [ ":compressed_tuple", + "//third_party/abseil-cpp/absl/base:base_internal", "//third_party/abseil-cpp/absl/base:config", "//third_party/abseil-cpp/absl/base:core_headers", "//third_party/abseil-cpp/absl/memory", diff --git a/third_party/abseil-cpp/absl/container/CMakeLists.txt b/third_party/abseil-cpp/absl/container/CMakeLists.txt index 04055816cd..576e83e280 100644 --- a/third_party/abseil-cpp/absl/container/CMakeLists.txt +++ b/third_party/abseil-cpp/absl/container/CMakeLists.txt @@ -176,6 +176,7 @@ absl_cc_library( COPTS ${ABSL_DEFAULT_COPTS} DEPS + absl::base_internal absl::compressed_tuple absl::config absl::core_headers diff --git a/third_party/abseil-cpp/absl/container/internal/inlined_vector.h b/third_party/abseil-cpp/absl/container/internal/inlined_vector.h index a157532813..2f24e4616f 100644 --- a/third_party/abseil-cpp/absl/container/internal/inlined_vector.h +++ b/third_party/abseil-cpp/absl/container/internal/inlined_vector.h @@ -27,6 +27,7 @@ #include "absl/base/attributes.h" #include "absl/base/config.h" +#include "absl/base/internal/identity.h" #include "absl/base/macros.h" #include "absl/container/internal/compressed_tuple.h" #include "absl/memory/memory.h" @@ -82,16 +83,6 @@ using IsMoveAssignOk = std::is_move_assignable<ValueType<A>>; template <typename A> using IsSwapOk = absl::type_traits_internal::IsSwappable<ValueType<A>>; -template <typename T> -struct TypeIdentity { - using type = T; -}; - -// Used for function arguments in template functions to prevent ADL by forcing -// callers to explicitly specify the template parameter. -template <typename T> -using NoTypeDeduction = typename TypeIdentity<T>::type; - template <typename A, bool IsTriviallyDestructible = absl::is_trivially_destructible<ValueType<A>>::value> struct DestroyAdapter; @@ -139,7 +130,7 @@ struct MallocAdapter { }; template <typename A, typename ValueAdapter> -void ConstructElements(NoTypeDeduction<A>& allocator, +void ConstructElements(absl::internal::type_identity_t<A>& allocator, Pointer<A> construct_first, ValueAdapter& values, SizeType<A> construct_size) { for (SizeType<A> i = 0; i < construct_size; ++i) { diff --git a/third_party/abseil-cpp/absl/crc/internal/crc_memcpy_x86_arm_combined.cc b/third_party/abseil-cpp/absl/crc/internal/crc_memcpy_x86_arm_combined.cc index 24353f2ab6..38f61e9b1f 100644 --- a/third_party/abseil-cpp/absl/crc/internal/crc_memcpy_x86_arm_combined.cc +++ b/third_party/abseil-cpp/absl/crc/internal/crc_memcpy_x86_arm_combined.cc @@ -130,8 +130,8 @@ ABSL_ATTRIBUTE_NO_SANITIZE_UNDEFINED inline void LargeTailCopy( size_t data_index = i * kIntLoadsPerVec + j; int_data[data_index] = *(usrc + j); - crcs[region] = crc32c_t{static_cast<uint32_t>(CRC32_u64( - static_cast<uint32_t>(crcs[region]), int_data[data_index]))}; + crcs[region] = crc32c_t{CRC32_u64(static_cast<uint32_t>(crcs[region]), + int_data[data_index])}; *(udst + j) = int_data[data_index]; } @@ -299,8 +299,8 @@ AcceleratedCrcMemcpyEngine<vec_regions, int_regions>::Compute( // Load and CRC the data. int_data[data_index] = *(usrc + i * kIntLoadsPerVec + k); - crcs[region] = crc32c_t{static_cast<uint32_t>(CRC32_u64( - static_cast<uint32_t>(crcs[region]), int_data[data_index]))}; + crcs[region] = crc32c_t{CRC32_u64(static_cast<uint32_t>(crcs[region]), + int_data[data_index])}; // Store the data. *(udst + i * kIntLoadsPerVec + k) = int_data[data_index]; diff --git a/third_party/abseil-cpp/absl/functional/overload.h b/third_party/abseil-cpp/absl/functional/overload.h index 732795fc9e..34ffa689a4 100644 --- a/third_party/abseil-cpp/absl/functional/overload.h +++ b/third_party/abseil-cpp/absl/functional/overload.h @@ -16,33 +16,26 @@ // File: overload.h // ----------------------------------------------------------------------------- // -// `absl::Overload()` returns a functor that provides overloads based on the -// functors passed to it. +// `absl::Overload` is a functor that provides overloads based on the functors +// with which it is created. This can, for example, be used to locally define an +// anonymous visitor type for `std::visit` inside a function using lambdas. +// // Before using this function, consider whether named function overloads would // be a better design. -// One use case for this is locally defining visitors for `std::visit` inside a -// function using lambdas. - -// Example: Using `absl::Overload` to define a visitor for `std::variant`. -// -// std::variant<int, std::string, double> v(int{1}); // -// assert(std::visit(absl::Overload( -// [](int) -> absl::string_view { return "int"; }, -// [](const std::string&) -> absl::string_view { -// return "string"; -// }, -// [](double) -> absl::string_view { return "double"; }), -// v) == "int"); +// Note: absl::Overload requires C++17. // -// One of the lambda may specify overload for several types via generic lambda. +// Example: // -// absl::variant<std::string, int32_t, int64_t> v(int32_t{1}); -// assert(std::visit(absl::Overload( -// [](const std::string& s) { return s.size(); }, -// [](const auto& s) { return sizeof(s); }), v) == 4); +// std::variant<std::string, int32_t, int64_t> v(int32_t{1}); +// const size_t result = +// std::visit(absl::Overload{ +// [](const std::string& s) { return s.size(); }, +// [](const auto& s) { return sizeof(s); }, +// }, +// v); +// assert(result == 4); // -// Note: absl::Overload requires C++17. #ifndef ABSL_FUNCTIONAL_OVERLOAD_H_ #define ABSL_FUNCTIONAL_OVERLOAD_H_ @@ -56,14 +49,30 @@ ABSL_NAMESPACE_BEGIN #if defined(ABSL_INTERNAL_CPLUSPLUS_LANG) && \ ABSL_INTERNAL_CPLUSPLUS_LANG >= 201703L -template <int&... ExplicitArgumentBarrier, typename... T> -auto Overload(T&&... ts) { - struct OverloadImpl : absl::remove_cvref_t<T>... { - using absl::remove_cvref_t<T>::operator()...; - }; - return OverloadImpl{std::forward<T>(ts)...}; -} +template <typename... T> +struct Overload final : T... { + using T::operator()...; + + // For historical reasons we want to support use that looks like a function + // call: + // + // absl::Overload(lambda_1, lambda_2) + // + // This works automatically in C++20 because we have support for parenthesized + // aggregate initialization. Before then we must provide a constructor that + // makes this work. + // + explicit Overload(T... ts) : T(std::move(ts))... {} +}; + +// Before C++20, which added support for CTAD for aggregate types, we must also +// teach the compiler how to deduce the template arguments for Overload. +// +template <typename... T> +Overload(T...) -> Overload<T...>; + #else + namespace functional_internal { template <typename T> constexpr bool kDependentFalse = false; @@ -76,6 +85,7 @@ auto Overload(T&&...) { } #endif + ABSL_NAMESPACE_END } // namespace absl diff --git a/third_party/abseil-cpp/absl/functional/overload_test.cc b/third_party/abseil-cpp/absl/functional/overload_test.cc index 040bf83fcd..a2e87674c6 100644 --- a/third_party/abseil-cpp/absl/functional/overload_test.cc +++ b/third_party/abseil-cpp/absl/functional/overload_test.cc @@ -31,14 +31,15 @@ namespace { TEST(OverloadTest, DispatchConsidersTypeWithAutoFallback) { - auto overloaded = absl::Overload( - [](int v) -> std::string { return absl::StrCat("int ", v); }, // - [](double v) -> std::string { return absl::StrCat("double ", v); }, // - [](const char* v) -> std::string { // - return absl::StrCat("const char* ", v); // - }, // - [](auto v) -> std::string { return absl::StrCat("auto ", v); } // - ); + auto overloaded = absl::Overload{ + [](int v) -> std::string { return absl::StrCat("int ", v); }, + [](double v) -> std::string { return absl::StrCat("double ", v); }, + [](const char* v) -> std::string { + return absl::StrCat("const char* ", v); + }, + [](auto v) -> std::string { return absl::StrCat("auto ", v); }, + }; + EXPECT_EQ("int 1", overloaded(1)); EXPECT_EQ("double 2.5", overloaded(2.5)); EXPECT_EQ("const char* hello", overloaded("hello")); @@ -46,32 +47,34 @@ TEST(OverloadTest, DispatchConsidersTypeWithAutoFallback) { } TEST(OverloadTest, DispatchConsidersNumberOfArguments) { - auto overloaded = absl::Overload( // - [](int a) { return a + 1; }, // - [](int a, int b) { return a * b; }, // - []() -> absl::string_view { return "none"; } // - ); + auto overloaded = absl::Overload{ + [](int a) { return a + 1; }, + [](int a, int b) { return a * b; }, + []() -> absl::string_view { return "none"; }, + }; + EXPECT_EQ(3, overloaded(2)); EXPECT_EQ(21, overloaded(3, 7)); EXPECT_EQ("none", overloaded()); } TEST(OverloadTest, SupportsConstantEvaluation) { - auto overloaded = absl::Overload( // - [](int a) { return a + 1; }, // - [](int a, int b) { return a * b; }, // - []() -> absl::string_view { return "none"; } // - ); + auto overloaded = absl::Overload{ + [](int a) { return a + 1; }, + [](int a, int b) { return a * b; }, + []() -> absl::string_view { return "none"; }, + }; + static_assert(overloaded() == "none"); static_assert(overloaded(2) == 3); static_assert(overloaded(3, 7) == 21); } TEST(OverloadTest, PropogatesDefaults) { - auto overloaded = absl::Overload( // - [](int a, int b = 5) { return a * b; }, // - [](double c) { return c; } // - ); + auto overloaded = absl::Overload{ + [](int a, int b = 5) { return a * b; }, + [](double c) { return c; }, + }; EXPECT_EQ(21, overloaded(3, 7)); EXPECT_EQ(35, overloaded(7)); @@ -79,53 +82,59 @@ TEST(OverloadTest, PropogatesDefaults) { } TEST(OverloadTest, AmbiguousWithDefaultsNotInvocable) { - auto overloaded = absl::Overload( // - [](int a, int b = 5) { return a * b; }, // - [](int c) { return c; } // - ); + auto overloaded = absl::Overload{ + [](int a, int b = 5) { return a * b; }, + [](int c) { return c; }, + }; + static_assert(!std::is_invocable_v<decltype(overloaded), int>); static_assert(std::is_invocable_v<decltype(overloaded), int, int>); } TEST(OverloadTest, AmbiguousDuplicatesNotInvocable) { - auto overloaded = absl::Overload( // - [](int a) { return a; }, // - [](int c) { return c; } // - ); + auto overloaded = absl::Overload{ + [](int a) { return a; }, + [](int c) { return c; }, + }; + static_assert(!std::is_invocable_v<decltype(overloaded), int>); } TEST(OverloadTest, AmbiguousConversionNotInvocable) { - auto overloaded = absl::Overload( // - [](uint16_t a) { return a; }, // - [](uint64_t c) { return c; } // - ); + auto overloaded = absl::Overload{ + [](uint16_t a) { return a; }, + [](uint64_t c) { return c; }, + }; + static_assert(!std::is_invocable_v<decltype(overloaded), int>); } TEST(OverloadTest, AmbiguousConversionWithAutoNotInvocable) { - auto overloaded = absl::Overload( // - [](auto a) { return a; }, // - [](auto c) { return c; } // - ); + auto overloaded = absl::Overload{ + [](auto a) { return a; }, + [](auto c) { return c; }, + }; + static_assert(!std::is_invocable_v<decltype(overloaded), int>); } #if ABSL_INTERNAL_CPLUSPLUS_LANG >= 202002L TEST(OverloadTest, AmbiguousConversionWithAutoAndTemplateNotInvocable) { - auto overloaded = absl::Overload( // - [](auto a) { return a; }, // - []<class T>(T c) { return c; } // - ); + auto overloaded = absl::Overload{ + [](auto a) { return a; }, + []<class T>(T c) { return c; }, + }; + static_assert(!std::is_invocable_v<decltype(overloaded), int>); } TEST(OverloadTest, DispatchConsidersTypeWithTemplateFallback) { - auto overloaded = absl::Overload( // - [](int a) { return a; }, // - []<class T>(T c) { return c * 2; } // - ); + auto overloaded = absl::Overload{ + [](int a) { return a; }, + []<class T>(T c) { return c * 2; }, + }; + EXPECT_EQ(7, overloaded(7)); EXPECT_EQ(14.0, overloaded(7.0)); } @@ -133,20 +142,22 @@ TEST(OverloadTest, DispatchConsidersTypeWithTemplateFallback) { #endif // ABSL_INTERNAL_CPLUSPLUS_LANG >= 202002L TEST(OverloadTest, DispatchConsidersSfinae) { - auto overloaded = absl::Overload( // - [](auto a) -> decltype(a + 1) { return a + 1; } // - ); + auto overloaded = absl::Overload{ + [](auto a) -> decltype(a + 1) { return a + 1; }, + }; + static_assert(std::is_invocable_v<decltype(overloaded), int>); static_assert(!std::is_invocable_v<decltype(overloaded), std::string>); } TEST(OverloadTest, VariantVisitDispatchesCorrectly) { absl::variant<int, double, std::string> v(1); - auto overloaded = absl::Overload( - [](int) -> absl::string_view { return "int"; }, // - [](double) -> absl::string_view { return "double"; }, // - [](const std::string&) -> absl::string_view { return "string"; } // - ); + auto overloaded = absl::Overload{ + [](int) -> absl::string_view { return "int"; }, + [](double) -> absl::string_view { return "double"; }, + [](const std::string&) -> absl::string_view { return "string"; }, + }; + EXPECT_EQ("int", absl::visit(overloaded, v)); v = 1.1; EXPECT_EQ("double", absl::visit(overloaded, v)); @@ -156,10 +167,11 @@ TEST(OverloadTest, VariantVisitDispatchesCorrectly) { TEST(OverloadTest, VariantVisitWithAutoFallbackDispatchesCorrectly) { absl::variant<std::string, int32_t, int64_t> v(int32_t{1}); - auto overloaded = absl::Overload( - [](const std::string& s) { return s.size(); }, // - [](const auto& s) { return sizeof(s); } // - ); + auto overloaded = absl::Overload{ + [](const std::string& s) { return s.size(); }, + [](const auto& s) { return sizeof(s); }, + }; + EXPECT_EQ(4, absl::visit(overloaded, v)); v = int64_t{1}; EXPECT_EQ(8, absl::visit(overloaded, v)); @@ -167,6 +179,23 @@ TEST(OverloadTest, VariantVisitWithAutoFallbackDispatchesCorrectly) { EXPECT_EQ(5, absl::visit(overloaded, v)); } +// This API used to be exported as a function, so it should also work fine to +// use parantheses when initializing it. +TEST(OverloadTest, UseWithParentheses) { + const auto overloaded = + absl::Overload([](const std::string& s) { return s.size(); }, + [](const auto& s) { return sizeof(s); }); + + absl::variant<std::string, int32_t, int64_t> v(int32_t{1}); + EXPECT_EQ(4, absl::visit(overloaded, v)); + + v = int64_t{1}; + EXPECT_EQ(8, absl::visit(overloaded, v)); + + v = std::string("hello"); + EXPECT_EQ(5, absl::visit(overloaded, v)); +} + } // namespace #endif diff --git a/third_party/abseil-cpp/absl/log/BUILD.bazel b/third_party/abseil-cpp/absl/log/BUILD.bazel index 0f17239804..dd192a10ad 100644 --- a/third_party/abseil-cpp/absl/log/BUILD.bazel +++ b/third_party/abseil-cpp/absl/log/BUILD.bazel @@ -664,6 +664,7 @@ cc_test( ":log_entry", ":log_sink", ":log_sink_registry", + ":vlog_is_on", "//absl/base:core_headers", "//absl/base:log_severity", "//absl/flags:flag", diff --git a/third_party/abseil-cpp/absl/log/CMakeLists.txt b/third_party/abseil-cpp/absl/log/CMakeLists.txt index acf89720b1..59aa19f3bd 100644 --- a/third_party/abseil-cpp/absl/log/CMakeLists.txt +++ b/third_party/abseil-cpp/absl/log/CMakeLists.txt @@ -290,6 +290,7 @@ absl_cc_library( LINKOPTS ${ABSL_DEFAULT_LINKOPTS} DEPS + absl::core_headers absl::log_internal_message absl::log_internal_nullstream absl::log_severity diff --git a/third_party/abseil-cpp/absl/log/internal/BUILD.bazel b/third_party/abseil-cpp/absl/log/internal/BUILD.bazel index 21958f7e07..2dbf337a14 100644 --- a/third_party/abseil-cpp/absl/log/internal/BUILD.bazel +++ b/third_party/abseil-cpp/absl/log/internal/BUILD.bazel @@ -266,6 +266,7 @@ cc_library( deps = [ ":log_message", ":nullstream", + "//absl/base:core_headers", "//absl/base:log_severity", ], ) diff --git a/third_party/abseil-cpp/absl/log/internal/BUILD.gn b/third_party/abseil-cpp/absl/log/internal/BUILD.gn index 2ce376b5fe..a6282135e4 100644 --- a/third_party/abseil-cpp/absl/log/internal/BUILD.gn +++ b/third_party/abseil-cpp/absl/log/internal/BUILD.gn @@ -183,6 +183,7 @@ absl_source_set("strip") { deps = [ ":log_message", ":nullstream", + "//third_party/abseil-cpp/absl/base:core_headers", "//third_party/abseil-cpp/absl/base:log_severity", ] } diff --git a/third_party/abseil-cpp/absl/log/internal/check_op.h b/third_party/abseil-cpp/absl/log/internal/check_op.h index 53760fd527..0d24f4d157 100644 --- a/third_party/abseil-cpp/absl/log/internal/check_op.h +++ b/third_party/abseil-cpp/absl/log/internal/check_op.h @@ -58,12 +58,13 @@ #endif #define ABSL_LOG_INTERNAL_CHECK_OP(name, op, val1, val1_text, val2, val2_text) \ - while (::std::string* absl_log_internal_check_op_result = \ - ::absl::log_internal::name##Impl( \ - ::absl::log_internal::GetReferenceableValue(val1), \ - ::absl::log_internal::GetReferenceableValue(val2), \ - ABSL_LOG_INTERNAL_STRIP_STRING_LITERAL( \ - val1_text " " #op " " val2_text))) \ + while (::std::string* absl_log_internal_check_op_result \ + ABSL_LOG_INTERNAL_ATTRIBUTE_UNUSED_IF_STRIP_LOG = \ + ::absl::log_internal::name##Impl( \ + ::absl::log_internal::GetReferenceableValue(val1), \ + ::absl::log_internal::GetReferenceableValue(val2), \ + ABSL_LOG_INTERNAL_STRIP_STRING_LITERAL( \ + val1_text " " #op " " val2_text))) \ ABSL_LOG_INTERNAL_CONDITION_FATAL(STATELESS, true) \ ABSL_LOG_INTERNAL_CHECK(*absl_log_internal_check_op_result).InternalStream() #define ABSL_LOG_INTERNAL_QCHECK_OP(name, op, val1, val1_text, val2, \ diff --git a/third_party/abseil-cpp/absl/log/internal/strip.h b/third_party/abseil-cpp/absl/log/internal/strip.h index dfde578667..3e5501040c 100644 --- a/third_party/abseil-cpp/absl/log/internal/strip.h +++ b/third_party/abseil-cpp/absl/log/internal/strip.h @@ -20,6 +20,7 @@ #ifndef ABSL_LOG_INTERNAL_STRIP_H_ #define ABSL_LOG_INTERNAL_STRIP_H_ +#include "absl/base/attributes.h" // IWYU pragma: keep #include "absl/base/log_severity.h" #include "absl/log/internal/log_message.h" #include "absl/log/internal/nullstream.h" @@ -29,6 +30,16 @@ // of defines comes in three flavors: vanilla, plus two variants that strip some // logging in subtly different ways for subtly different reasons (see below). #if defined(STRIP_LOG) && STRIP_LOG + +// Attribute for marking variables used in implementation details of logging +// macros as unused, but only when `STRIP_LOG` is defined. +// With `STRIP_LOG` on, not marking them triggers `-Wunused-but-set-variable`, +// With `STRIP_LOG` off, marking them triggers `-Wused-but-marked-unused`. +// +// TODO(b/290784225): Replace this macro with attribute [[maybe_unused]] when +// Abseil stops supporting C++14. +#define ABSL_LOG_INTERNAL_ATTRIBUTE_UNUSED_IF_STRIP_LOG ABSL_ATTRIBUTE_UNUSED + #define ABSL_LOGGING_INTERNAL_LOG_INFO ::absl::log_internal::NullStream() #define ABSL_LOGGING_INTERNAL_LOG_WARNING ::absl::log_internal::NullStream() #define ABSL_LOGGING_INTERNAL_LOG_ERROR ::absl::log_internal::NullStream() @@ -48,7 +59,11 @@ #define ABSL_LOG_INTERNAL_CHECK(failure_message) ABSL_LOGGING_INTERNAL_LOG_FATAL #define ABSL_LOG_INTERNAL_QCHECK(failure_message) \ ABSL_LOGGING_INTERNAL_LOG_QFATAL + #else // !defined(STRIP_LOG) || !STRIP_LOG + +#define ABSL_LOG_INTERNAL_ATTRIBUTE_UNUSED_IF_STRIP_LOG + #define ABSL_LOGGING_INTERNAL_LOG_INFO \ ::absl::log_internal::LogMessage( \ __FILE__, __LINE__, ::absl::log_internal::LogMessage::InfoTag{}) diff --git a/third_party/abseil-cpp/absl/log/log_benchmark.cc b/third_party/abseil-cpp/absl/log/log_benchmark.cc index 45d9a5d6fd..60c0fd637e 100644 --- a/third_party/abseil-cpp/absl/log/log_benchmark.cc +++ b/third_party/abseil-cpp/absl/log/log_benchmark.cc @@ -17,10 +17,12 @@ #include "absl/flags/flag.h" #include "absl/log/check.h" #include "absl/log/globals.h" +#include "absl/log/internal/flags.h" #include "absl/log/log.h" #include "absl/log/log_entry.h" #include "absl/log/log_sink.h" #include "absl/log/log_sink_registry.h" +#include "absl/log/vlog_is_on.h" #include "benchmark/benchmark.h" namespace { @@ -93,5 +95,70 @@ static void BM_EnabledLogOverhead(benchmark::State& state) { } BENCHMARK(BM_EnabledLogOverhead); +static void BM_VlogIsOnOverhead(benchmark::State& state) { + // It would make sense to do this only when state.thread_index == 0, + // but thread_index is an int on some platforms (e.g. Android) and a + // function returning an int on others. So we just do it on all threads. + // TODO(b/152609127): set only if thread_index == 0. + absl::SetFlag(&FLAGS_v, 0); + + while (state.KeepRunningBatch(10)) { + benchmark::DoNotOptimize(VLOG_IS_ON(0)); // 1 + benchmark::DoNotOptimize(VLOG_IS_ON(0)); // 2 + benchmark::DoNotOptimize(VLOG_IS_ON(0)); // 3 + benchmark::DoNotOptimize(VLOG_IS_ON(0)); // 4 + benchmark::DoNotOptimize(VLOG_IS_ON(0)); // 5 + benchmark::DoNotOptimize(VLOG_IS_ON(0)); // 6 + benchmark::DoNotOptimize(VLOG_IS_ON(0)); // 7 + benchmark::DoNotOptimize(VLOG_IS_ON(0)); // 8 + benchmark::DoNotOptimize(VLOG_IS_ON(0)); // 9 + benchmark::DoNotOptimize(VLOG_IS_ON(0)); // 10 + } +} +BENCHMARK(BM_VlogIsOnOverhead)->ThreadRange(1, 64); + +static void BM_VlogIsNotOnOverhead(benchmark::State& state) { + // It would make sense to do this only when state.thread_index == 0, + // but thread_index is an int on some platforms (e.g. Android) and a + // function returning an int on others. So we just do it on all threads. + // TODO(b/152609127): set only if thread_index == 0. + absl::SetFlag(&FLAGS_v, 0); + + while (state.KeepRunningBatch(10)) { + benchmark::DoNotOptimize(VLOG_IS_ON(1)); // 1 + benchmark::DoNotOptimize(VLOG_IS_ON(1)); // 2 + benchmark::DoNotOptimize(VLOG_IS_ON(1)); // 3 + benchmark::DoNotOptimize(VLOG_IS_ON(1)); // 4 + benchmark::DoNotOptimize(VLOG_IS_ON(1)); // 5 + benchmark::DoNotOptimize(VLOG_IS_ON(1)); // 6 + benchmark::DoNotOptimize(VLOG_IS_ON(1)); // 7 + benchmark::DoNotOptimize(VLOG_IS_ON(1)); // 8 + benchmark::DoNotOptimize(VLOG_IS_ON(1)); // 9 + benchmark::DoNotOptimize(VLOG_IS_ON(1)); // 10 + } +} +BENCHMARK(BM_VlogIsNotOnOverhead)->ThreadRange(1, 64); + +static void BM_LogEveryNOverhead(benchmark::State& state) { + absl::ScopedStderrThreshold disable_stderr_logging( + absl::LogSeverityAtLeast::kInfinity); + absl::SetMinLogLevel(absl::LogSeverityAtLeast::kInfinity); + ABSL_ATTRIBUTE_UNUSED NullLogSink null_sink; + + while (state.KeepRunningBatch(10)) { + LOG_EVERY_N_SEC(INFO, 10); + LOG_EVERY_N_SEC(INFO, 20); + LOG_EVERY_N_SEC(INFO, 30); + LOG_EVERY_N_SEC(INFO, 40); + LOG_EVERY_N_SEC(INFO, 50); + LOG_EVERY_N_SEC(INFO, 60); + LOG_EVERY_N_SEC(INFO, 70); + LOG_EVERY_N_SEC(INFO, 80); + LOG_EVERY_N_SEC(INFO, 90); + LOG_EVERY_N_SEC(INFO, 100); + } +} +BENCHMARK(BM_LogEveryNOverhead)->ThreadRange(1, 64); + } // namespace diff --git a/third_party/abseil-cpp/absl/numeric/BUILD.bazel b/third_party/abseil-cpp/absl/numeric/BUILD.bazel index 41c015db89..f202c6e06f 100644 --- a/third_party/abseil-cpp/absl/numeric/BUILD.bazel +++ b/third_party/abseil-cpp/absl/numeric/BUILD.bazel @@ -89,6 +89,7 @@ cc_library( ":bits", "//absl/base:config", "//absl/base:core_headers", + "//absl/types:compare", ], ) @@ -107,6 +108,7 @@ cc_test( "//absl/hash:hash_testing", "//absl/meta:type_traits", "//absl/strings", + "//absl/types:compare", "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", ], diff --git a/third_party/abseil-cpp/absl/numeric/BUILD.gn b/third_party/abseil-cpp/absl/numeric/BUILD.gn index ce74204b18..ef02c97610 100644 --- a/third_party/abseil-cpp/absl/numeric/BUILD.gn +++ b/third_party/abseil-cpp/absl/numeric/BUILD.gn @@ -26,6 +26,7 @@ absl_source_set("int128") { ":bits", "//third_party/abseil-cpp/absl/base:config", "//third_party/abseil-cpp/absl/base:core_headers", + "//third_party/abseil-cpp/absl/types:compare", ] } @@ -40,6 +41,7 @@ absl_test("int128_test") { "//third_party/abseil-cpp/absl/hash:hash_testing", "//third_party/abseil-cpp/absl/meta:type_traits", "//third_party/abseil-cpp/absl/strings", + "//third_party/abseil-cpp/absl/types:compare", ] } diff --git a/third_party/abseil-cpp/absl/numeric/CMakeLists.txt b/third_party/abseil-cpp/absl/numeric/CMakeLists.txt index 7181b91ab5..da3b6efe61 100644 --- a/third_party/abseil-cpp/absl/numeric/CMakeLists.txt +++ b/third_party/abseil-cpp/absl/numeric/CMakeLists.txt @@ -53,6 +53,7 @@ absl_cc_library( COPTS ${ABSL_DEFAULT_COPTS} DEPS + absl::compare absl::config absl::core_headers absl::bits @@ -70,6 +71,7 @@ absl_cc_test( DEPS absl::int128 absl::base + absl::compare absl::hash_testing absl::type_traits absl::strings diff --git a/third_party/abseil-cpp/absl/numeric/int128.h b/third_party/abseil-cpp/absl/numeric/int128.h index a17d0e1b64..5a067d17b3 100644 --- a/third_party/abseil-cpp/absl/numeric/int128.h +++ b/third_party/abseil-cpp/absl/numeric/int128.h @@ -38,6 +38,7 @@ #include "absl/base/config.h" #include "absl/base/macros.h" #include "absl/base/port.h" +#include "absl/types/compare.h" #if defined(_MSC_VER) // In very old versions of MSVC and when the /Zc:wchar_t flag is off, wchar_t is @@ -269,7 +270,9 @@ class numeric_limits<absl::uint128> { static constexpr bool has_infinity = false; static constexpr bool has_quiet_NaN = false; static constexpr bool has_signaling_NaN = false; + ABSL_INTERNAL_DISABLE_DEPRECATED_DECLARATION_WARNING static constexpr float_denorm_style has_denorm = denorm_absent; + ABSL_INTERNAL_RESTORE_DEPRECATED_DECLARATION_WARNING static constexpr bool has_denorm_loss = false; static constexpr float_round_style round_style = round_toward_zero; static constexpr bool is_iec559 = false; @@ -512,7 +515,9 @@ class numeric_limits<absl::int128> { static constexpr bool has_infinity = false; static constexpr bool has_quiet_NaN = false; static constexpr bool has_signaling_NaN = false; + ABSL_INTERNAL_DISABLE_DEPRECATED_DECLARATION_WARNING static constexpr float_denorm_style has_denorm = denorm_absent; + ABSL_INTERNAL_RESTORE_DEPRECATED_DECLARATION_WARNING static constexpr bool has_denorm_loss = false; static constexpr float_round_style round_style = round_toward_zero; static constexpr bool is_iec559 = false; @@ -819,6 +824,36 @@ constexpr bool operator<=(uint128 lhs, uint128 rhs) { return !(rhs < lhs); } constexpr bool operator>=(uint128 lhs, uint128 rhs) { return !(lhs < rhs); } +#ifdef __cpp_impl_three_way_comparison +constexpr absl::strong_ordering operator<=>(uint128 lhs, uint128 rhs) { +#if defined(ABSL_HAVE_INTRINSIC_INT128) + if (auto lhs_128 = static_cast<unsigned __int128>(lhs), + rhs_128 = static_cast<unsigned __int128>(rhs); + lhs_128 < rhs_128) { + return absl::strong_ordering::less; + } else if (lhs_128 > rhs_128) { + return absl::strong_ordering::greater; + } else { + return absl::strong_ordering::equal; + } +#else + if (uint64_t lhs_high = Uint128High64(lhs), rhs_high = Uint128High64(rhs); + lhs_high < rhs_high) { + return absl::strong_ordering::less; + } else if (lhs_high > rhs_high) { + return absl::strong_ordering::greater; + } else if (uint64_t lhs_low = Uint128Low64(lhs), rhs_low = Uint128Low64(rhs); + lhs_low < rhs_low) { + return absl::strong_ordering::less; + } else if (lhs_low > rhs_low) { + return absl::strong_ordering::greater; + } else { + return absl::strong_ordering::equal; + } +#endif +} +#endif + // Unary operators. constexpr inline uint128 operator+(uint128 val) { return val; } diff --git a/third_party/abseil-cpp/absl/numeric/int128_have_intrinsic.inc b/third_party/abseil-cpp/absl/numeric/int128_have_intrinsic.inc index 6f1ac64414..51e4b9d485 100644 --- a/third_party/abseil-cpp/absl/numeric/int128_have_intrinsic.inc +++ b/third_party/abseil-cpp/absl/numeric/int128_have_intrinsic.inc @@ -220,6 +220,20 @@ constexpr bool operator>=(int128 lhs, int128 rhs) { return static_cast<__int128>(lhs) >= static_cast<__int128>(rhs); } +#ifdef __cpp_impl_three_way_comparison +constexpr absl::strong_ordering operator<=>(int128 lhs, int128 rhs) { + if (auto lhs_128 = static_cast<__int128>(lhs), + rhs_128 = static_cast<__int128>(rhs); + lhs_128 < rhs_128) { + return absl::strong_ordering::less; + } else if (lhs_128 > rhs_128) { + return absl::strong_ordering::greater; + } else { + return absl::strong_ordering::equal; + } +} +#endif + // Unary operators. constexpr int128 operator-(int128 v) { return -static_cast<__int128>(v); } diff --git a/third_party/abseil-cpp/absl/numeric/int128_no_intrinsic.inc b/third_party/abseil-cpp/absl/numeric/int128_no_intrinsic.inc index 6f5d83777c..195b7452ea 100644 --- a/third_party/abseil-cpp/absl/numeric/int128_no_intrinsic.inc +++ b/third_party/abseil-cpp/absl/numeric/int128_no_intrinsic.inc @@ -186,6 +186,24 @@ constexpr bool operator<=(int128 lhs, int128 rhs) { return !(lhs > rhs); } constexpr bool operator>=(int128 lhs, int128 rhs) { return !(lhs < rhs); } +#ifdef __cpp_impl_three_way_comparison +constexpr absl::strong_ordering operator<=>(int128 lhs, int128 rhs) { + if (int64_t lhs_high = Int128High64(lhs), rhs_high = Int128High64(rhs); + lhs_high < rhs_high) { + return absl::strong_ordering::less; + } else if (lhs_high > rhs_high) { + return absl::strong_ordering::greater; + } else if (uint64_t lhs_low = Uint128Low64(lhs), rhs_low = Uint128Low64(rhs); + lhs_low < rhs_low) { + return absl::strong_ordering::less; + } else if (lhs_low > rhs_low) { + return absl::strong_ordering::greater; + } else { + return absl::strong_ordering::equal; + } +} +#endif + // Unary operators. constexpr int128 operator-(int128 v) { diff --git a/third_party/abseil-cpp/absl/numeric/int128_test.cc b/third_party/abseil-cpp/absl/numeric/int128_test.cc index f17a5f6b29..3f16e054c6 100644 --- a/third_party/abseil-cpp/absl/numeric/int128_test.cc +++ b/third_party/abseil-cpp/absl/numeric/int128_test.cc @@ -25,6 +25,7 @@ #include "absl/base/internal/cycleclock.h" #include "absl/hash/hash_testing.h" #include "absl/meta/type_traits.h" +#include "absl/types/compare.h" #define MAKE_INT128(HI, LO) absl::MakeInt128(static_cast<int64_t>(HI), LO) @@ -784,6 +785,13 @@ TEST(Int128, ComparisonTest) { EXPECT_FALSE(pair.smaller >= pair.larger); // NOLINT(readability/check) EXPECT_TRUE(pair.smaller >= pair.smaller); // NOLINT(readability/check) EXPECT_TRUE(pair.larger >= pair.larger); // NOLINT(readability/check) + +#ifdef __cpp_impl_three_way_comparison + EXPECT_EQ(pair.smaller <=> pair.larger, absl::strong_ordering::less); + EXPECT_EQ(pair.larger <=> pair.smaller, absl::strong_ordering::greater); + EXPECT_EQ(pair.smaller <=> pair.smaller, absl::strong_ordering::equal); + EXPECT_EQ(pair.larger <=> pair.larger, absl::strong_ordering::equal); +#endif } } diff --git a/third_party/abseil-cpp/absl/strings/cord.cc b/third_party/abseil-cpp/absl/strings/cord.cc index ea84e44618..025904c10e 100644 --- a/third_party/abseil-cpp/absl/strings/cord.cc +++ b/third_party/abseil-cpp/absl/strings/cord.cc @@ -1062,6 +1062,15 @@ void CopyCordToString(const Cord& src, absl::Nonnull<std::string*> dst) { } } +void AppendCordToString(const Cord& src, absl::Nonnull<std::string*> dst) { + const size_t cur_dst_size = dst->size(); + const size_t new_dst_size = cur_dst_size + src.size(); + absl::strings_internal::STLStringResizeUninitializedAmortized(dst, + new_dst_size); + char* append_ptr = &(*dst)[cur_dst_size]; + src.CopyToArrayImpl(append_ptr); +} + void Cord::CopyToArraySlowPath(absl::Nonnull<char*> dst) const { assert(contents_.is_tree()); absl::string_view fragment; diff --git a/third_party/abseil-cpp/absl/strings/cord.h b/third_party/abseil-cpp/absl/strings/cord.h index c9f6767b4c..0d8d7007d9 100644 --- a/third_party/abseil-cpp/absl/strings/cord.h +++ b/third_party/abseil-cpp/absl/strings/cord.h @@ -105,6 +105,7 @@ class CordTestPeer; template <typename Releaser> Cord MakeCordFromExternal(absl::string_view, Releaser&&); void CopyCordToString(const Cord& src, absl::Nonnull<std::string*> dst); +void AppendCordToString(const Cord& src, absl::Nonnull<std::string*> dst); // Cord memory accounting modes enum class CordMemoryAccounting { @@ -421,6 +422,18 @@ class Cord { friend void CopyCordToString(const Cord& src, absl::Nonnull<std::string*> dst); + // AppendCordToString() + // + // Appends the contents of a `src` Cord to a `*dst` string. + // + // This function optimizes the case of appending to a non-empty destination + // string. If `*dst` already has capacity to store the contents of the cord, + // this function does not invalidate pointers previously returned by + // `dst->data()`. If `*dst` is a new object, prefer to simply use the + // conversion operator to `std::string`. + friend void AppendCordToString(const Cord& src, + absl::Nonnull<std::string*> dst); + class CharIterator; //---------------------------------------------------------------------------- @@ -1066,6 +1079,8 @@ class Cord { const; CharIterator FindImpl(CharIterator it, absl::string_view needle) const; + + void CopyToArrayImpl(absl::Nonnull<char*> dst) const; }; ABSL_NAMESPACE_END @@ -1104,8 +1119,8 @@ absl::Nonnull<CordRep*> NewExternalRep(absl::string_view data, // Overload for function reference types that dispatches using a function // pointer because there are no `alignof()` or `sizeof()` a function reference. // NOLINTNEXTLINE - suppress clang-tidy raw pointer return. -inline absl::Nonnull<CordRep*> NewExternalRep(absl::string_view data, - void (&releaser)(absl::string_view)) { +inline absl::Nonnull<CordRep*> NewExternalRep( + absl::string_view data, void (&releaser)(absl::string_view)) { return NewExternalRep(data, &releaser); } @@ -1450,6 +1465,14 @@ inline bool Cord::StartsWith(absl::string_view rhs) const { return EqualsImpl(rhs, rhs_size); } +inline void Cord::CopyToArrayImpl(absl::Nonnull<char*> dst) const { + if (!contents_.is_tree()) { + if (!empty()) contents_.CopyToArray(dst); + } else { + CopyToArraySlowPath(dst); + } +} + inline void Cord::ChunkIterator::InitTree( absl::Nonnull<cord_internal::CordRep*> tree) { tree = cord_internal::SkipCrcNode(tree); diff --git a/third_party/abseil-cpp/absl/strings/cord_test.cc b/third_party/abseil-cpp/absl/strings/cord_test.cc index cdd5246389..658ad55bcc 100644 --- a/third_party/abseil-cpp/absl/strings/cord_test.cc +++ b/third_party/abseil-cpp/absl/strings/cord_test.cc @@ -703,6 +703,38 @@ TEST_P(CordTest, CopyToString) { "copying ", "to ", "a ", "string."}))); } +static void VerifyAppendCordToString(const absl::Cord& cord) { + std::string initially_empty; + absl::AppendCordToString(cord, &initially_empty); + EXPECT_EQ(initially_empty, cord); + + const absl::string_view kInitialContents = "initial contents."; + std::string expected_after_append = + absl::StrCat(kInitialContents, std::string(cord)); + + std::string no_reserve(kInitialContents); + absl::AppendCordToString(cord, &no_reserve); + EXPECT_EQ(no_reserve, expected_after_append); + + std::string has_reserved_capacity(kInitialContents); + has_reserved_capacity.reserve(has_reserved_capacity.size() + cord.size()); + const char* address_before_copy = has_reserved_capacity.data(); + absl::AppendCordToString(cord, &has_reserved_capacity); + EXPECT_EQ(has_reserved_capacity, expected_after_append); + EXPECT_EQ(has_reserved_capacity.data(), address_before_copy) + << "AppendCordToString allocated new string storage; " + "has_reserved_capacity = \"" + << has_reserved_capacity << "\""; +} + +TEST_P(CordTest, AppendToString) { + VerifyAppendCordToString(absl::Cord()); // empty cords cannot carry CRCs + VerifyAppendCordToString(MaybeHardened(absl::Cord("small cord"))); + VerifyAppendCordToString(MaybeHardened( + absl::MakeFragmentedCord({"fragmented ", "cord ", "to ", "test ", + "appending ", "to ", "a ", "string."}))); +} + TEST_P(CordTest, AppendEmptyBuffer) { absl::Cord cord; cord.Append(absl::CordBuffer()); diff --git a/third_party/abseil-cpp/absl/strings/internal/str_format/convert_test.cc b/third_party/abseil-cpp/absl/strings/internal/str_format/convert_test.cc index 7f22277877..3e761373f5 100644 --- a/third_party/abseil-cpp/absl/strings/internal/str_format/convert_test.cc +++ b/third_party/abseil-cpp/absl/strings/internal/str_format/convert_test.cc @@ -946,32 +946,9 @@ TEST_F(FormatConvertTest, Double) { } } - // Workaround libc bug. - // https://sourceware.org/bugzilla/show_bug.cgi?id=22142 - const bool gcc_bug_22142 = - StrPrint("%f", std::numeric_limits<double>::max()) != - "1797693134862315708145274237317043567980705675258449965989174768031" - "5726078002853876058955863276687817154045895351438246423432132688946" - "4182768467546703537516986049910576551282076245490090389328944075868" - "5084551339423045832369032229481658085593321233482747978262041447231" - "68738177180919299881250404026184124858368.000000"; - for (int exp = -300; exp <= 300; ++exp) { const double all_ones_mantissa = 0x1fffffffffffff; doubles.push_back(std::ldexp(all_ones_mantissa, exp)); - if (gcc_bug_22142) { - skip_verify.insert(doubles.back()); - } - } - - if (gcc_bug_22142) { - using L = std::numeric_limits<double>; - skip_verify.insert(L::max()); - skip_verify.insert(L::min()); // NOLINT - skip_verify.insert(L::denorm_min()); - skip_verify.insert(-L::max()); - skip_verify.insert(-L::min()); // NOLINT - skip_verify.insert(-L::denorm_min()); } // Remove duplicates to speed up the logic below. diff --git a/third_party/abseil-cpp/symbols_arm64_dbg.def b/third_party/abseil-cpp/symbols_arm64_dbg.def index 7a540ca187..5a02fa6002 100644 --- a/third_party/abseil-cpp/symbols_arm64_dbg.def +++ b/third_party/abseil-cpp/symbols_arm64_dbg.def @@ -2805,6 +2805,7 @@ EXPORTS ?Append@StringifySink@strings_internal@absl@@QEAAXV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@Z ?Append@StringifySink@strings_internal@absl@@QEAAX_KD@Z ?AppendArray@InlineRep@Cord@absl@@QEAAXV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@W4MethodIdentifier@CordzUpdateTracker@cord_internal@3@@Z + ?AppendCordToString@absl@@YAXAEBVCord@1@PEAV?$basic_string@DU?$char_traits@D@__Cr@std@@V?$allocator@D@23@@__Cr@std@@@Z ?AppendPack@str_format_internal@absl@@YAAEAV?$basic_string@DU?$char_traits@D@__Cr@std@@V?$allocator@D@23@@__Cr@std@@PEAV345@VUntypedFormatSpecImpl@12@V?$Span@$$CBVFormatArgImpl@str_format_internal@absl@@@2@@Z ?AppendPieces@strings_internal@absl@@YAXPEAV?$basic_string@DU?$char_traits@D@__Cr@std@@V?$allocator@D@23@@__Cr@std@@V?$initializer_list@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@5@@Z ?AppendPrecise@Cord@absl@@AEAAXV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@W4MethodIdentifier@CordzUpdateTracker@cord_internal@2@@Z @@ -2940,6 +2941,8 @@ EXPORTS ?CopyRaw@CordRepBtree@cord_internal@absl@@AEBAPEAV123@_K@Z ?CopySuffix@CordRepBtree@cord_internal@absl@@AEAA?AUCopyResult@123@_K@Z ?CopyTo@InlineRep@Cord@absl@@QEBAXPEAV?$basic_string@DU?$char_traits@D@__Cr@std@@V?$allocator@D@23@@__Cr@std@@@Z + ?CopyToArray@InlineRep@Cord@absl@@QEBAXPEAD@Z + ?CopyToArrayImpl@Cord@absl@@AEBAXPEAD@Z ?CopyToArraySlowPath@Cord@absl@@AEBAXPEAD@Z ?CopyToEndFrom@CordRepBtree@cord_internal@absl@@AEBAPEAV123@_K0@Z ?CountLeadingEmptyOrDeleted@GroupPortableImpl@container_internal@absl@@QEBAIXZ diff --git a/third_party/abseil-cpp/symbols_arm64_rel.def b/third_party/abseil-cpp/symbols_arm64_rel.def index 6970c32370..fffdca4005 100644 --- a/third_party/abseil-cpp/symbols_arm64_rel.def +++ b/third_party/abseil-cpp/symbols_arm64_rel.def @@ -378,6 +378,7 @@ EXPORTS ?Append@StringifySink@strings_internal@absl@@QEAAXV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@Z ?Append@StringifySink@strings_internal@absl@@QEAAX_KD@Z ?AppendArray@InlineRep@Cord@absl@@QEAAXV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@W4MethodIdentifier@CordzUpdateTracker@cord_internal@3@@Z + ?AppendCordToString@absl@@YAXAEBVCord@1@PEAV?$basic_string@DU?$char_traits@D@__Cr@std@@V?$allocator@D@23@@__Cr@std@@@Z ?AppendPack@str_format_internal@absl@@YAAEAV?$basic_string@DU?$char_traits@D@__Cr@std@@V?$allocator@D@23@@__Cr@std@@PEAV345@VUntypedFormatSpecImpl@12@V?$Span@$$CBVFormatArgImpl@str_format_internal@absl@@@2@@Z ?AppendPieces@strings_internal@absl@@YAXPEAV?$basic_string@DU?$char_traits@D@__Cr@std@@V?$allocator@D@23@@__Cr@std@@V?$initializer_list@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@5@@Z ?AppendPrecise@Cord@absl@@AEAAXV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@W4MethodIdentifier@CordzUpdateTracker@cord_internal@2@@Z diff --git a/third_party/abseil-cpp/symbols_x64_dbg.def b/third_party/abseil-cpp/symbols_x64_dbg.def index c44d0f7165..0c4cfe5916 100644 --- a/third_party/abseil-cpp/symbols_x64_dbg.def +++ b/third_party/abseil-cpp/symbols_x64_dbg.def @@ -2804,6 +2804,7 @@ EXPORTS ?Append@StringifySink@strings_internal@absl@@QEAAXV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@Z ?Append@StringifySink@strings_internal@absl@@QEAAX_KD@Z ?AppendArray@InlineRep@Cord@absl@@QEAAXV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@W4MethodIdentifier@CordzUpdateTracker@cord_internal@3@@Z + ?AppendCordToString@absl@@YAXAEBVCord@1@PEAV?$basic_string@DU?$char_traits@D@__Cr@std@@V?$allocator@D@23@@__Cr@std@@@Z ?AppendPack@str_format_internal@absl@@YAAEAV?$basic_string@DU?$char_traits@D@__Cr@std@@V?$allocator@D@23@@__Cr@std@@PEAV345@VUntypedFormatSpecImpl@12@V?$Span@$$CBVFormatArgImpl@str_format_internal@absl@@@2@@Z ?AppendPieces@strings_internal@absl@@YAXPEAV?$basic_string@DU?$char_traits@D@__Cr@std@@V?$allocator@D@23@@__Cr@std@@V?$initializer_list@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@5@@Z ?AppendPrecise@Cord@absl@@AEAAXV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@W4MethodIdentifier@CordzUpdateTracker@cord_internal@2@@Z @@ -2939,6 +2940,8 @@ EXPORTS ?CopyRaw@CordRepBtree@cord_internal@absl@@AEBAPEAV123@_K@Z ?CopySuffix@CordRepBtree@cord_internal@absl@@AEAA?AUCopyResult@123@_K@Z ?CopyTo@InlineRep@Cord@absl@@QEBAXPEAV?$basic_string@DU?$char_traits@D@__Cr@std@@V?$allocator@D@23@@__Cr@std@@@Z + ?CopyToArray@InlineRep@Cord@absl@@QEBAXPEAD@Z + ?CopyToArrayImpl@Cord@absl@@AEBAXPEAD@Z ?CopyToArraySlowPath@Cord@absl@@AEBAXPEAD@Z ?CopyToEndFrom@CordRepBtree@cord_internal@absl@@AEBAPEAV123@_K0@Z ?CountLeadingEmptyOrDeleted@GroupSse2Impl@container_internal@absl@@QEBAIXZ diff --git a/third_party/abseil-cpp/symbols_x64_rel.def b/third_party/abseil-cpp/symbols_x64_rel.def index 4f63f3be8f..724814dac2 100644 --- a/third_party/abseil-cpp/symbols_x64_rel.def +++ b/third_party/abseil-cpp/symbols_x64_rel.def @@ -379,6 +379,7 @@ EXPORTS ?Append@StringifySink@strings_internal@absl@@QEAAXV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@Z ?Append@StringifySink@strings_internal@absl@@QEAAX_KD@Z ?AppendArray@InlineRep@Cord@absl@@QEAAXV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@W4MethodIdentifier@CordzUpdateTracker@cord_internal@3@@Z + ?AppendCordToString@absl@@YAXAEBVCord@1@PEAV?$basic_string@DU?$char_traits@D@__Cr@std@@V?$allocator@D@23@@__Cr@std@@@Z ?AppendPack@str_format_internal@absl@@YAAEAV?$basic_string@DU?$char_traits@D@__Cr@std@@V?$allocator@D@23@@__Cr@std@@PEAV345@VUntypedFormatSpecImpl@12@V?$Span@$$CBVFormatArgImpl@str_format_internal@absl@@@2@@Z ?AppendPieces@strings_internal@absl@@YAXPEAV?$basic_string@DU?$char_traits@D@__Cr@std@@V?$allocator@D@23@@__Cr@std@@V?$initializer_list@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@5@@Z ?AppendPrecise@Cord@absl@@AEAAXV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@W4MethodIdentifier@CordzUpdateTracker@cord_internal@2@@Z diff --git a/third_party/abseil-cpp/symbols_x64_rel_asan.def b/third_party/abseil-cpp/symbols_x64_rel_asan.def index 18c8ba732f..ba6c3f8f2b 100644 --- a/third_party/abseil-cpp/symbols_x64_rel_asan.def +++ b/third_party/abseil-cpp/symbols_x64_rel_asan.def @@ -414,6 +414,7 @@ EXPORTS ?Append@StringifySink@strings_internal@absl@@QEAAXV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@Z ?Append@StringifySink@strings_internal@absl@@QEAAX_KD@Z ?AppendArray@InlineRep@Cord@absl@@QEAAXV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@W4MethodIdentifier@CordzUpdateTracker@cord_internal@3@@Z + ?AppendCordToString@absl@@YAXAEBVCord@1@PEAV?$basic_string@DU?$char_traits@D@__Cr@std@@V?$allocator@D@23@@__Cr@std@@@Z ?AppendPack@str_format_internal@absl@@YAAEAV?$basic_string@DU?$char_traits@D@__Cr@std@@V?$allocator@D@23@@__Cr@std@@PEAV345@VUntypedFormatSpecImpl@12@V?$Span@$$CBVFormatArgImpl@str_format_internal@absl@@@2@@Z ?AppendPieces@strings_internal@absl@@YAXPEAV?$basic_string@DU?$char_traits@D@__Cr@std@@V?$allocator@D@23@@__Cr@std@@V?$initializer_list@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@5@@Z ?AppendPrecise@Cord@absl@@AEAAXV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@W4MethodIdentifier@CordzUpdateTracker@cord_internal@2@@Z diff --git a/third_party/abseil-cpp/symbols_x86_dbg.def b/third_party/abseil-cpp/symbols_x86_dbg.def index 8d9dab0ab0..7f58192d42 100644 --- a/third_party/abseil-cpp/symbols_x86_dbg.def +++ b/third_party/abseil-cpp/symbols_x86_dbg.def @@ -2804,6 +2804,7 @@ EXPORTS ?Append@StringifySink@strings_internal@absl@@QAEXID@Z ?Append@StringifySink@strings_internal@absl@@QAEXV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@Z ?AppendArray@InlineRep@Cord@absl@@QAEXV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@W4MethodIdentifier@CordzUpdateTracker@cord_internal@3@@Z + ?AppendCordToString@absl@@YAXABVCord@1@PAV?$basic_string@DU?$char_traits@D@__Cr@std@@V?$allocator@D@23@@__Cr@std@@@Z ?AppendPack@str_format_internal@absl@@YAAAV?$basic_string@DU?$char_traits@D@__Cr@std@@V?$allocator@D@23@@__Cr@std@@PAV345@VUntypedFormatSpecImpl@12@V?$Span@$$CBVFormatArgImpl@str_format_internal@absl@@@2@@Z ?AppendPieces@strings_internal@absl@@YAXPAV?$basic_string@DU?$char_traits@D@__Cr@std@@V?$allocator@D@23@@__Cr@std@@V?$initializer_list@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@5@@Z ?AppendPrecise@Cord@absl@@AAEXV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@W4MethodIdentifier@CordzUpdateTracker@cord_internal@2@@Z @@ -2939,6 +2940,8 @@ EXPORTS ?CopyRaw@CordRepBtree@cord_internal@absl@@ABEPAV123@I@Z ?CopySuffix@CordRepBtree@cord_internal@absl@@AAE?AUCopyResult@123@I@Z ?CopyTo@InlineRep@Cord@absl@@QBEXPAV?$basic_string@DU?$char_traits@D@__Cr@std@@V?$allocator@D@23@@__Cr@std@@@Z + ?CopyToArray@InlineRep@Cord@absl@@QBEXPAD@Z + ?CopyToArrayImpl@Cord@absl@@ABEXPAD@Z ?CopyToArraySlowPath@Cord@absl@@ABEXPAD@Z ?CopyToEndFrom@CordRepBtree@cord_internal@absl@@ABEPAV123@II@Z ?CountLeadingEmptyOrDeleted@GroupSse2Impl@container_internal@absl@@QBEIXZ diff --git a/third_party/abseil-cpp/symbols_x86_rel.def b/third_party/abseil-cpp/symbols_x86_rel.def index 69ea18d83a..d924074a18 100644 --- a/third_party/abseil-cpp/symbols_x86_rel.def +++ b/third_party/abseil-cpp/symbols_x86_rel.def @@ -384,6 +384,7 @@ EXPORTS ?Append@StringifySink@strings_internal@absl@@QAEXID@Z ?Append@StringifySink@strings_internal@absl@@QAEXV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@Z ?AppendArray@InlineRep@Cord@absl@@QAEXV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@W4MethodIdentifier@CordzUpdateTracker@cord_internal@3@@Z + ?AppendCordToString@absl@@YAXABVCord@1@PAV?$basic_string@DU?$char_traits@D@__Cr@std@@V?$allocator@D@23@@__Cr@std@@@Z ?AppendPack@str_format_internal@absl@@YAAAV?$basic_string@DU?$char_traits@D@__Cr@std@@V?$allocator@D@23@@__Cr@std@@PAV345@VUntypedFormatSpecImpl@12@V?$Span@$$CBVFormatArgImpl@str_format_internal@absl@@@2@@Z ?AppendPieces@strings_internal@absl@@YAXPAV?$basic_string@DU?$char_traits@D@__Cr@std@@V?$allocator@D@23@@__Cr@std@@V?$initializer_list@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@5@@Z ?AppendPrecise@Cord@absl@@AAEXV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@W4MethodIdentifier@CordzUpdateTracker@cord_internal@2@@Z diff --git a/third_party/vulkan-deps/DEPS b/third_party/vulkan-deps/DEPS index 68f0aec33e..cb01befb49 100644 --- a/third_party/vulkan-deps/DEPS +++ b/third_party/vulkan-deps/DEPS @@ -10,7 +10,7 @@ vars = { 'chromium_git': 'https://chromium.googlesource.com', # Current revision of glslang, the Khronos SPIRV compiler. - 'glslang_revision': 'b5672e8e8d42b0278d1765ab3d24c97b0e746bd0', + 'glslang_revision': 'f857417c991d178e90670385e31fee6d30394076', # Current revision of spirv-cross, the Khronos SPIRV cross compiler. 'spirv_cross_revision': 'b8fcf307f1f347089e3c46eb4451d27f32ebc8d3', @@ -25,16 +25,16 @@ vars = { 'vulkan_headers_revision': 'eaa319dade959cb61ed2229c8ea42e307cc8f8b3', # Current revision of Khronos Vulkan-Loader. - 'vulkan_loader_revision': 'e94cd2e354123fc5c92cb7d843dd30f95349539d', + 'vulkan_loader_revision': 'fa3b7bdefadef01ee9af593245c47ca1a33212f4', # Current revision of Khronos Vulkan-Tools. - 'vulkan_tools_revision': '9aec60c387fb0cd065d3ba921b56c3ef19ad958e', + 'vulkan_tools_revision': 'd21838aeaafbeb57cbed3a8072e26b7b15cc533e', # Current revision of Khronos Vulkan-Utility-Libraries. - 'vulkan_utility_libraries_revision': 'd0ffc68fe796ffd5752b7a2cba7c4f1d80ed7283', + 'vulkan_utility_libraries_revision': '68780d9b8c4dd256e55a3df60969970cb29911ce', # Current revision of Khronos Vulkan-ValidationLayers. - 'vulkan_validation_revision': 'a9ec5ff4306020781074a059e73ebf772ad5688d', + 'vulkan_validation_revision': '397d8fbc0ed892e470d24208c199a014b7d5fabe', } deps = { diff --git a/third_party/vulkan-deps/glslang/src/.github/workflows/continuous_integration.yml b/third_party/vulkan-deps/glslang/src/.github/workflows/continuous_integration.yml index 33d0dd9016..4d30698857 100644 --- a/third_party/vulkan-deps/glslang/src/.github/workflows/continuous_integration.yml +++ b/third_party/vulkan-deps/glslang/src/.github/workflows/continuous_integration.yml @@ -23,7 +23,7 @@ jobs: with: python-version: '3.7' - name: Setup ccache - uses: hendrikmuhs/ccache-action@faf867a11c028c0b483fb2ae72b6fc8f7d842714 # v1.2.12 + uses: hendrikmuhs/ccache-action@c92f40bee50034e84c763e33b317c77adaa81c92 # v1.2.13 with: key: ubuntu-22-${{ matrix.cmake_build_type }}-${{ matrix.compiler.cc }}-${{matrix.compiler.cxx}} - run: ./update_glslang_sources.py @@ -59,7 +59,7 @@ jobs: with: python-version: '3.7' - name: Setup ccache - uses: hendrikmuhs/ccache-action@faf867a11c028c0b483fb2ae72b6fc8f7d842714 # v1.2.12 + uses: hendrikmuhs/ccache-action@c92f40bee50034e84c763e33b317c77adaa81c92 # v1.2.13 with: key: ubuntu-22-${{ matrix.cmake_build_type }}-${{ matrix.compiler.cc }}-${{matrix.compiler.cxx}}-${{matrix.flags}} # This is to combat a bug when using 6.6 linux kernels with thread/address sanitizer @@ -99,7 +99,7 @@ jobs: with: cmakeVersion: 3.17.2 - name: Setup ccache - uses: hendrikmuhs/ccache-action@faf867a11c028c0b483fb2ae72b6fc8f7d842714 # v1.2.12 + uses: hendrikmuhs/ccache-action@c92f40bee50034e84c763e33b317c77adaa81c92 # v1.2.13 with: key: linux_backcompat - run: ./update_glslang_sources.py @@ -171,7 +171,7 @@ jobs: - uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3 - uses: lukka/get-cmake@4931ab1fc1604964c055eb330edb3f6b26ba0cfa # v3.29.2 - name: Setup ccache - uses: hendrikmuhs/ccache-action@faf867a11c028c0b483fb2ae72b6fc8f7d842714 # v1.2.12 + uses: hendrikmuhs/ccache-action@c92f40bee50034e84c763e33b317c77adaa81c92 # v1.2.13 with: key: IOS - run: ./update_glslang_sources.py @@ -200,7 +200,7 @@ jobs: - uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3 - uses: lukka/get-cmake@4931ab1fc1604964c055eb330edb3f6b26ba0cfa # v3.29.2 - name: Setup ccache - uses: hendrikmuhs/ccache-action@faf867a11c028c0b483fb2ae72b6fc8f7d842714 # v1.2.12 + uses: hendrikmuhs/ccache-action@c92f40bee50034e84c763e33b317c77adaa81c92 # v1.2.13 with: key: android-${{ matrix.LEGACY }} - run: ./update_glslang_sources.py @@ -226,7 +226,7 @@ jobs: python-version: '3.7' - uses: lukka/get-cmake@4931ab1fc1604964c055eb330edb3f6b26ba0cfa # v3.29.2 - name: Setup ccache - uses: hendrikmuhs/ccache-action@faf867a11c028c0b483fb2ae72b6fc8f7d842714 # v1.2.12 + uses: hendrikmuhs/ccache-action@c92f40bee50034e84c763e33b317c77adaa81c92 # v1.2.13 with: key: ubuntu-emscripten - uses: mymindstorm/setup-emsdk@6ab9eb1bda2574c4ddb79809fc9247783eaf9021 # v14 diff --git a/third_party/vulkan-deps/glslang/src/.github/workflows/scorecard.yml b/third_party/vulkan-deps/glslang/src/.github/workflows/scorecard.yml index adcfa76773..0560839b17 100644 --- a/third_party/vulkan-deps/glslang/src/.github/workflows/scorecard.yml +++ b/third_party/vulkan-deps/glslang/src/.github/workflows/scorecard.yml @@ -40,7 +40,7 @@ jobs: # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF # format to the repository Actions tab. - name: "Upload artifact" - uses: actions/upload-artifact@1746f4ab65b179e0ea60a494b83293b640dd5bba # v4.3.2 + uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 with: name: SARIF file path: results.sarif @@ -48,6 +48,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@c7f9125735019aa87cfc361530512d50ea439c71 # v3.25.1 + uses: github/codeql-action/upload-sarif@d39d31e687223d841ef683f52467bd88e9b21c14 # v3.25.3 with: sarif_file: results.sarif diff --git a/third_party/vulkan-deps/glslang/src/Test/baseResults/440.frag.out b/third_party/vulkan-deps/glslang/src/Test/baseResults/440.frag.out index 7ea19262de..9de029a21b 100644 --- a/third_party/vulkan-deps/glslang/src/Test/baseResults/440.frag.out +++ b/third_party/vulkan-deps/glslang/src/Test/baseResults/440.frag.out @@ -1,7 +1,7 @@ 440.frag ERROR: 0:11: 'location' : overlapping use of location 4 ERROR: 0:13: 'component' : type overflows the available 4 components -ERROR: 0:22: 'location' : fragment outputs or tileImageEXTs sharing the same location 30 must be the same basic type +ERROR: 0:22: 'location' : the aliases sharing the location 30 must be the same basic type and interpolation qualification ERROR: 0:24: 'qualifier' : cannot use auxiliary, memory, interpolation, or precision qualifier in a default qualifier declaration (declaration with no type) ERROR: 0:25: 'qualifier' : cannot use auxiliary, memory, interpolation, or precision qualifier in a default qualifier declaration (declaration with no type) ERROR: 0:26: 'qualifier' : cannot use auxiliary, memory, interpolation, or precision qualifier in a default qualifier declaration (declaration with no type) diff --git a/third_party/vulkan-deps/glslang/src/Test/baseResults/440.vert.out b/third_party/vulkan-deps/glslang/src/Test/baseResults/440.vert.out index 6c975c09a6..f341548523 100644 --- a/third_party/vulkan-deps/glslang/src/Test/baseResults/440.vert.out +++ b/third_party/vulkan-deps/glslang/src/Test/baseResults/440.vert.out @@ -10,16 +10,21 @@ ERROR: 0:39: 'component' : type overflows the available 4 components ERROR: 0:40: 'component' : type overflows the available 4 components ERROR: 0:42: 'component' : cannot apply to a matrix, structure, or block ERROR: 0:43: 'component' : cannot apply to a matrix, structure, or block +ERROR: 0:43: 'location' : the aliases sharing the location 33 must be the same basic type and interpolation qualification ERROR: 0:44: 'component' : cannot apply to a matrix, structure, or block +ERROR: 0:44: 'location' : the aliases sharing the location 34 must be the same basic type and interpolation qualification ERROR: 0:46: 'component' : must specify 'location' to use 'component' ERROR: 0:52: 'location' : overlapping use of location 40 ERROR: 0:54: 'component' : type overflows the available 4 components ERROR: 0:55: 'component' : type overflows the available 4 components ERROR: 0:57: 'component' : cannot apply to a matrix, structure, or block ERROR: 0:58: 'component' : cannot apply to a matrix, structure, or block +ERROR: 0:58: 'location' : the aliases sharing the location 43 must be the same basic type and interpolation qualification ERROR: 0:61: 'location/component/index' : cannot declare a default, use a full declaration +ERROR: 0:64: 'location' : the aliases sharing the location 50 must be the same basic type and interpolation qualification ERROR: 0:66: 'component' : doubles cannot start on an odd-numbered component ERROR: 0:67: 'component' : type overflows the available 4 components +ERROR: 0:69: 'location' : the aliases sharing the location 53 must be the same basic type and interpolation qualification ERROR: 0:71: 'location' : overlapping use of location 55 ERROR: 0:75: 'location' : overlapping use of location 57 ERROR: 0:78: 'location' : overlapping use of location 59 @@ -56,7 +61,7 @@ ERROR: 0:193: 'assign' : l-value required "gl_BaseVertexARB" (can't modify shad ERROR: 0:194: 'assign' : l-value required "gl_BaseInstanceARB" (can't modify shader input) ERROR: 0:195: 'assign' : l-value required "gl_DrawIDARB" (can't modify shader input) ERROR: 0:196: 'glBaseInstanceARB' : undeclared identifier -ERROR: 57 compilation errors. No code generated. +ERROR: 62 compilation errors. No code generated. Shader version: 440 diff --git a/third_party/vulkan-deps/glslang/src/Test/baseResults/location_aliasing.tesc.out b/third_party/vulkan-deps/glslang/src/Test/baseResults/location_aliasing.tesc.out new file mode 100644 index 0000000000..54263d25df --- /dev/null +++ b/third_party/vulkan-deps/glslang/src/Test/baseResults/location_aliasing.tesc.out @@ -0,0 +1,33 @@ +location_aliasing.tesc +ERROR: 0:7: 'location' : the aliases sharing the location 1 must be the same basic type and interpolation qualification +ERROR: 1 compilation errors. No code generated. + + +Shader version: 430 +Requested GL_ARB_enhanced_layouts +vertices = 1 +ERROR: node is still EOpNull! +0:13 Function Definition: main( ( global void) +0:13 Function Parameters: +0:? Linker Objects +0:? 'gohan' (layout( location=1 component=0) in 32-element array of double) +0:? 'goten' (layout( location=1 component=2) in 32-element array of float) +0:? 'vs_tcs' ( in 32-element array of 4-component vector of float) +0:? 'tcs_tes' ( out 1-element array of 4-component vector of float) + + +Linked tessellation control stage: + + +Shader version: 430 +Requested GL_ARB_enhanced_layouts +vertices = 1 +ERROR: node is still EOpNull! +0:13 Function Definition: main( ( global void) +0:13 Function Parameters: +0:? Linker Objects +0:? 'gohan' (layout( location=1 component=0) in 32-element array of double) +0:? 'goten' (layout( location=1 component=2) in 32-element array of float) +0:? 'vs_tcs' ( in 32-element array of 4-component vector of float) +0:? 'tcs_tes' ( out 1-element array of 4-component vector of float) + diff --git a/third_party/vulkan-deps/glslang/src/Test/baseResults/location_aliasing1.frag.out b/third_party/vulkan-deps/glslang/src/Test/baseResults/location_aliasing1.frag.out new file mode 100644 index 0000000000..3a1e1a24b5 --- /dev/null +++ b/third_party/vulkan-deps/glslang/src/Test/baseResults/location_aliasing1.frag.out @@ -0,0 +1,27 @@ +location_aliasing1.frag +ERROR: 0:6: 'location' : the aliases sharing the location 1 must be the same basic type and interpolation qualification +ERROR: 1 compilation errors. No code generated. + + +Shader version: 430 +Requested GL_ARB_enhanced_layouts +ERROR: node is still EOpNull! +0:8 Function Definition: main( ( global void) +0:8 Function Parameters: +0:? Linker Objects +0:? 'in1' (layout( location=1 component=0) smooth in float) +0:? 'in2' (layout( location=1 component=2) flat in float) + + +Linked fragment stage: + + +Shader version: 430 +Requested GL_ARB_enhanced_layouts +ERROR: node is still EOpNull! +0:8 Function Definition: main( ( global void) +0:8 Function Parameters: +0:? Linker Objects +0:? 'in1' (layout( location=1 component=0) smooth in float) +0:? 'in2' (layout( location=1 component=2) flat in float) + diff --git a/third_party/vulkan-deps/glslang/src/Test/baseResults/spv.ext.ShaderTileImage.typemismatch.frag.out b/third_party/vulkan-deps/glslang/src/Test/baseResults/spv.ext.ShaderTileImage.typemismatch.frag.out index e91ffb73f3..057e5e1d58 100644 --- a/third_party/vulkan-deps/glslang/src/Test/baseResults/spv.ext.ShaderTileImage.typemismatch.frag.out +++ b/third_party/vulkan-deps/glslang/src/Test/baseResults/spv.ext.ShaderTileImage.typemismatch.frag.out @@ -1,5 +1,5 @@ spv.ext.ShaderTileImage.typemismatch.frag -ERROR: 0:7: 'location' : fragment outputs or tileImageEXTs sharing the same location 0 must be the same basic type +ERROR: 0:7: 'location' : the aliases sharing the location 0 must be the same basic type and interpolation qualification ERROR: 1 compilation errors. No code generated. diff --git a/third_party/vulkan-deps/glslang/src/Test/location_aliasing.tesc b/third_party/vulkan-deps/glslang/src/Test/location_aliasing.tesc new file mode 100644 index 0000000000..624396519c --- /dev/null +++ b/third_party/vulkan-deps/glslang/src/Test/location_aliasing.tesc @@ -0,0 +1,15 @@ +#version 430 core
+#extension GL_ARB_enhanced_layouts : require
+
+layout(vertices = 1) out;
+
+layout (location = 1, component = 0) in double gohan[];
+layout (location = 1, component = 2) in float goten[];
+
+
+in vec4 vs_tcs[];
+out vec4 tcs_tes[];
+
+void main()
+{
+}
\ No newline at end of file diff --git a/third_party/vulkan-deps/glslang/src/Test/location_aliasing1.frag b/third_party/vulkan-deps/glslang/src/Test/location_aliasing1.frag new file mode 100644 index 0000000000..c8c7d264da --- /dev/null +++ b/third_party/vulkan-deps/glslang/src/Test/location_aliasing1.frag @@ -0,0 +1,10 @@ +#version 430 core
+#extension GL_ARB_enhanced_layouts : require
+
+
+layout (location = 1, component = 0) in smooth float in1;
+layout (location = 1, component = 2) in flat float in2;
+
+void main()
+{
+}
\ No newline at end of file diff --git a/third_party/vulkan-deps/glslang/src/glslang/MachineIndependent/ParseHelper.cpp b/third_party/vulkan-deps/glslang/src/glslang/MachineIndependent/ParseHelper.cpp index f157d15b2b..cb19b2d434 100644 --- a/third_party/vulkan-deps/glslang/src/glslang/MachineIndependent/ParseHelper.cpp +++ b/third_party/vulkan-deps/glslang/src/glslang/MachineIndependent/ParseHelper.cpp @@ -6568,10 +6568,10 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type) int repeated = intermediate.addUsedLocation(qualifier, type, typeCollision); if (repeated >= 0 && ! typeCollision) error(loc, "overlapping use of location", "location", "%d", repeated); - // "fragment-shader outputs/tileImageEXT ... if two variables are placed within the same - // location, they must have the same underlying type (floating-point or integer)" - if (typeCollision && language == EShLangFragment && (qualifier.isPipeOutput() || qualifier.storage == EvqTileImageEXT)) - error(loc, "fragment outputs or tileImageEXTs sharing the same location", "location", "%d must be the same basic type", repeated); + // When location aliasing, the aliases sharing the location must have the same underlying numerical type and bit width( + // floating - point or integer, 32 - bit versus 64 - bit,etc.) + if (typeCollision && (qualifier.isPipeInput() || qualifier.isPipeOutput() || qualifier.storage == EvqTileImageEXT)) + error(loc, "the aliases sharing the location", "location", "%d must be the same basic type and interpolation qualification", repeated); } if (qualifier.hasXfbOffset() && qualifier.hasXfbBuffer()) { diff --git a/third_party/vulkan-deps/glslang/src/glslang/MachineIndependent/linkValidate.cpp b/third_party/vulkan-deps/glslang/src/glslang/MachineIndependent/linkValidate.cpp index 3b5add9de5..62e24426e3 100644 --- a/third_party/vulkan-deps/glslang/src/glslang/MachineIndependent/linkValidate.cpp +++ b/third_party/vulkan-deps/glslang/src/glslang/MachineIndependent/linkValidate.cpp @@ -1689,7 +1689,7 @@ int TIntermediate::addUsedLocation(const TQualifier& qualifier, const TType& typ // First range: TRange locationRange(qualifier.layoutLocation, qualifier.layoutLocation); TRange componentRange(0, 3); - TIoRange range(locationRange, componentRange, type.getBasicType(), 0); + TIoRange range(locationRange, componentRange, type.getBasicType(), 0, qualifier.centroid, qualifier.smooth, qualifier.flat); // check for collisions collision = checkLocationRange(set, range, type, typeCollision); @@ -1699,7 +1699,7 @@ int TIntermediate::addUsedLocation(const TQualifier& qualifier, const TType& typ // Second range: TRange locationRange2(qualifier.layoutLocation + 1, qualifier.layoutLocation + 1); TRange componentRange2(0, 1); - TIoRange range2(locationRange2, componentRange2, type.getBasicType(), 0); + TIoRange range2(locationRange2, componentRange2, type.getBasicType(), 0, qualifier.centroid, qualifier.smooth, qualifier.flat); // check for collisions collision = checkLocationRange(set, range2, type, typeCollision); @@ -1725,7 +1725,7 @@ int TIntermediate::addUsedLocation(const TQualifier& qualifier, const TType& typ TBasicType basicTy = type.getBasicType(); if (basicTy == EbtSampler && type.getSampler().isAttachmentEXT()) basicTy = type.getSampler().type; - TIoRange range(locationRange, componentRange, basicTy, qualifier.hasIndex() ? qualifier.getIndex() : 0); + TIoRange range(locationRange, componentRange, basicTy, qualifier.hasIndex() ? qualifier.getIndex() : 0, qualifier.centroid, qualifier.smooth, qualifier.flat); // check for collisions, except for vertex inputs on desktop targeting OpenGL if (! (!isEsProfile() && language == EShLangVertex && qualifier.isPipeInput()) || spvVersion.vulkan > 0) @@ -1748,7 +1748,11 @@ int TIntermediate::checkLocationRange(int set, const TIoRange& range, const TTyp if (range.overlap(usedIo[set][r])) { // there is a collision; pick one return std::max(range.location.start, usedIo[set][r].location.start); - } else if (range.location.overlap(usedIo[set][r].location) && type.getBasicType() != usedIo[set][r].basicType) { + } else if (range.location.overlap(usedIo[set][r].location) && + (type.getBasicType() != usedIo[set][r].basicType || + type.getQualifier().centroid != usedIo[set][r].centroid || + type.getQualifier().smooth != usedIo[set][r].smooth || + type.getQualifier().flat != usedIo[set][r].flat)) { // aliased-type mismatch typeCollision = true; return std::max(range.location.start, usedIo[set][r].location.start); diff --git a/third_party/vulkan-deps/glslang/src/glslang/MachineIndependent/localintermediate.h b/third_party/vulkan-deps/glslang/src/glslang/MachineIndependent/localintermediate.h index b453b14648..5e97147802 100644 --- a/third_party/vulkan-deps/glslang/src/glslang/MachineIndependent/localintermediate.h +++ b/third_party/vulkan-deps/glslang/src/glslang/MachineIndependent/localintermediate.h @@ -123,8 +123,10 @@ struct TRange { // within the same location range, component range, and index value. Locations don't alias unless // all other dimensions of their range overlap. struct TIoRange { - TIoRange(TRange location, TRange component, TBasicType basicType, int index) - : location(location), component(component), basicType(basicType), index(index) { } + TIoRange(TRange location, TRange component, TBasicType basicType, int index, bool centroid, bool smooth, bool flat) + : location(location), component(component), basicType(basicType), index(index), centroid(centroid), smooth(smooth), flat(flat) + { + } bool overlap(const TIoRange& rhs) const { return location.overlap(rhs.location) && component.overlap(rhs.component) && index == rhs.index; @@ -133,6 +135,9 @@ struct TIoRange { TRange component; TBasicType basicType; int index; + bool centroid; + bool smooth; + bool flat; }; // An offset range is a 2-D rectangle; the set of (binding, offset) pairs all lying @@ -1251,7 +1256,7 @@ protected: std::unordered_set<int> usedConstantId; // specialization constant ids used std::vector<TOffsetRange> usedAtomics; // sets of bindings used by atomic counters - std::vector<TIoRange> usedIo[4]; // sets of used locations, one for each of in, out, uniform, and buffers + std::vector<TIoRange> usedIo[5]; // sets of used locations, one for each of in, out, uniform, and buffers std::vector<TRange> usedIoRT[4]; // sets of used location, one for rayPayload/rayPayloadIN, // one for callableData/callableDataIn, one for hitObjectAttributeNV and // one for shaderrecordhitobjectNV diff --git a/third_party/vulkan-deps/glslang/src/gtests/AST.FromFile.cpp b/third_party/vulkan-deps/glslang/src/gtests/AST.FromFile.cpp index 7410f6ce14..6067e9b83c 100644 --- a/third_party/vulkan-deps/glslang/src/gtests/AST.FromFile.cpp +++ b/third_party/vulkan-deps/glslang/src/gtests/AST.FromFile.cpp @@ -306,6 +306,8 @@ INSTANTIATE_TEST_SUITE_P( "coord_conventions.frag", "gl_FragCoord.frag", "glsl.interpOp.error.frag", + "location_aliasing.tesc", + "location_aliasing1.frag", "GL_EXT_draw_instanced.vert", "overflow_underflow_toinf_0.frag", "GL_EXT_texture_array.frag", diff --git a/util/autogen/angle_features_autogen.cpp b/util/autogen/angle_features_autogen.cpp index e5c1e191f0..173269fbbb 100644 --- a/util/autogen/angle_features_autogen.cpp +++ b/util/autogen/angle_features_autogen.cpp @@ -68,6 +68,7 @@ constexpr PackedEnumMap<Feature, const char *> kFeatureNames = {{ {Feature::ClearsWithGapsNeedFlush, "clearsWithGapsNeedFlush"}, {Feature::ClearToZeroOrOneBroken, "clearToZeroOrOneBroken"}, {Feature::ClipSrcRegionForBlitFramebuffer, "clipSrcRegionForBlitFramebuffer"}, + {Feature::CombineAllShadersInPipelineLibrary, "combineAllShadersInPipelineLibrary"}, {Feature::CompileJobIsThreadSafe, "compileJobIsThreadSafe"}, {Feature::CompileMetalShaders, "compileMetalShaders"}, {Feature::CompressVertexData, "compressVertexData"}, @@ -279,6 +280,13 @@ constexpr PackedEnumMap<Feature, const char *> kFeatureNames = {{ {Feature::SkipVSConstantRegisterZero, "skipVSConstantRegisterZero"}, {Feature::SlowAsyncCommandQueueForTesting, "slowAsyncCommandQueueForTesting"}, {Feature::SlowDownMonolithicPipelineCreationForTesting, "slowDownMonolithicPipelineCreationForTesting"}, + {Feature::Supports16BitInputOutput, "supports16BitInputOutput"}, + {Feature::Supports16BitPushConstant, "supports16BitPushConstant"}, + {Feature::Supports16BitStorageBuffer, "supports16BitStorageBuffer"}, + {Feature::Supports16BitUniformAndStorageBuffer, "supports16BitUniformAndStorageBuffer"}, + {Feature::Supports8BitPushConstant, "supports8BitPushConstant"}, + {Feature::Supports8BitStorageBuffer, "supports8BitStorageBuffer"}, + {Feature::Supports8BitUniformAndStorageBuffer, "supports8BitUniformAndStorageBuffer"}, {Feature::SupportsAndroidHardwareBuffer, "supportsAndroidHardwareBuffer"}, {Feature::SupportsAndroidNativeFenceSync, "supportsAndroidNativeFenceSync"}, {Feature::SupportsBindMemory2, "supportsBindMemory2"}, @@ -397,6 +405,7 @@ constexpr PackedEnumMap<Feature, const char *> kFeatureNames = {{ {Feature::UseSystemMemoryForConstantBuffers, "useSystemMemoryForConstantBuffers"}, {Feature::UseUnusedBlocksWithStandardOrSharedLayout, "useUnusedBlocksWithStandardOrSharedLayout"}, {Feature::UseVertexInputBindingStrideDynamicState, "useVertexInputBindingStrideDynamicState"}, + {Feature::UseVkEventForImageBarrier, "useVkEventForImageBarrier"}, {Feature::UseVmaForImageSuballocation, "useVmaForImageSuballocation"}, {Feature::VaryingsRequireMatchingPrecisionInSpirv, "varyingsRequireMatchingPrecisionInSpirv"}, {Feature::VertexIDDoesNotIncludeBaseVertex, "vertexIDDoesNotIncludeBaseVertex"}, diff --git a/util/autogen/angle_features_autogen.h b/util/autogen/angle_features_autogen.h index 0d969f7213..ec9ac8e00b 100644 --- a/util/autogen/angle_features_autogen.h +++ b/util/autogen/angle_features_autogen.h @@ -68,6 +68,7 @@ enum class Feature ClearsWithGapsNeedFlush, ClearToZeroOrOneBroken, ClipSrcRegionForBlitFramebuffer, + CombineAllShadersInPipelineLibrary, CompileJobIsThreadSafe, CompileMetalShaders, CompressVertexData, @@ -279,6 +280,13 @@ enum class Feature SkipVSConstantRegisterZero, SlowAsyncCommandQueueForTesting, SlowDownMonolithicPipelineCreationForTesting, + Supports16BitInputOutput, + Supports16BitPushConstant, + Supports16BitStorageBuffer, + Supports16BitUniformAndStorageBuffer, + Supports8BitPushConstant, + Supports8BitStorageBuffer, + Supports8BitUniformAndStorageBuffer, SupportsAndroidHardwareBuffer, SupportsAndroidNativeFenceSync, SupportsBindMemory2, @@ -397,6 +405,7 @@ enum class Feature UseSystemMemoryForConstantBuffers, UseUnusedBlocksWithStandardOrSharedLayout, UseVertexInputBindingStrideDynamicState, + UseVkEventForImageBarrier, UseVmaForImageSuballocation, VaryingsRequireMatchingPrecisionInSpirv, VertexIDDoesNotIncludeBaseVertex, |