Edit

kc3-lang/angle/src/tests/angle_unittests.gni

Branch :

  • Show log

    Commit

  • Author : Shahbaz Youssefi
    Date : 2024-04-15 00:24:47
    Hash : d9d583bf
    Message : Implement a lock/unlock-only mutex based on futex Pthread mutexes are expensive due to their numerous features. When a mutex only needs to support lock and unlock, its implementation can be much simpler. The implementation in this change is "inspired" by a similar mutex in mesa. Expected uses of this mutex are: - Allowing some OpenGL calls to avoid the share group lock and instead lock the specific shared object they operate on. - Replacing SpinLock in the OpenCL implementation (spin-lock in user space is a bad idea [1]) - Generally anywhere we use std::mutex just to do lock/unlock Tests based on patch authored by Igor Nazarov <i.nazarov@samsung.com> [1]:https://www.realworldtech.com/forum/?threadid=189711&curpostid=189723 Bug: angleproject:8667 Change-Id: I52278c9d19616338c499bbcef6684746caead6ca Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5446558 Reviewed-by: Roman Lavrov <romanl@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>

  • src/tests/angle_unittests.gni
  • # Copyright 2015 The ANGLE Project Authors. All rights reserved.
    # Use of this source code is governed by a BSD-style license that can be
    # found in the LICENSE file.
    
    import("../../gni/angle.gni")
    
    angle_unittests_sources = [
      "../../util/test_utils_unittest.cpp",
      "../../util/test_utils_unittest_helper.h",
      "../common/BinaryStream_unittest.cpp",
      "../common/CircularBuffer_unittest.cpp",
      "../common/FastVector_unittest.cpp",
      "../common/FixedQueue_unittest.cpp",
      "../common/FixedVector_unittest.cpp",
      "../common/Optional_unittest.cpp",
      "../common/PoolAlloc_unittest.cpp",
      "../common/SimpleMutex_unittest.cpp",
      "../common/WorkerThread_unittest.cpp",
      "../common/aligned_memory_unittest.cpp",
      "../common/angleutils_unittest.cpp",
      "../common/bitset_utils_unittest.cpp",
      "../common/hash_utils_unittest.cpp",
      "../common/mathutil_unittest.cpp",
      "../common/matrix_utils_unittest.cpp",
      "../common/string_utils_unittest.cpp",
      "../common/system_utils_unittest.cpp",
      "../common/utilities_unittest.cpp",
      "../common/vector_utils_unittest.cpp",
      "../compiler/translator/span_unittest.cpp",
      "../feature_support_util/feature_support_util_unittest.cpp",
      "../gpu_info_util/SystemInfo_unittest.cpp",
      "../image_util/AstcDecompressorTestUtils.h",
      "../image_util/AstcDecompressor_unittest.cpp",
      "../image_util/LoadToNative_unittest.cpp",
      "../libANGLE/BlendStateExt_unittest.cpp",
      "../libANGLE/BlobCache_unittest.cpp",
      "../libANGLE/Config_unittest.cpp",
      "../libANGLE/ContextMutex_unittest.cpp",
      "../libANGLE/Fence_unittest.cpp",
      "../libANGLE/GlobalMutex_unittest.cpp",
      "../libANGLE/HandleAllocator_unittest.cpp",
      "../libANGLE/ImageIndexIterator_unittest.cpp",
      "../libANGLE/Image_unittest.cpp",
      "../libANGLE/Observer_unittest.cpp",
      "../libANGLE/Program_unittest.cpp",
      "../libANGLE/ResourceManager_unittest.cpp",
      "../libANGLE/ResourceMap_unittest.cpp",
      "../libANGLE/SizedMRUCache_unittest.cpp",
      "../libANGLE/Surface_unittest.cpp",
      "../libANGLE/TransformFeedback_unittest.cpp",
      "../libANGLE/UnlockedTailCall_unittest.cpp",
      "../libANGLE/VaryingPacking_unittest.cpp",
      "../libANGLE/VertexArray_unittest.cpp",
      "../libANGLE/renderer/BufferImpl_mock.h",
      "../libANGLE/renderer/FramebufferImpl_mock.h",
      "../libANGLE/renderer/ImageImpl_mock.h",
      "../libANGLE/renderer/ProgramImpl_mock.h",
      "../libANGLE/renderer/RenderbufferImpl_mock.h",
      "../libANGLE/renderer/TextureImpl_mock.h",
      "../libANGLE/renderer/TransformFeedbackImpl_mock.h",
      "../libANGLE/renderer/serial_utils_unittest.cpp",
      "angle_unittests_utils.h",
      "preprocessor_tests/MockDiagnostics.h",
      "preprocessor_tests/MockDirectiveHandler.h",
      "preprocessor_tests/PreprocessorTest.cpp",
      "preprocessor_tests/PreprocessorTest.h",
      "preprocessor_tests/char_test.cpp",
      "preprocessor_tests/comment_test.cpp",
      "preprocessor_tests/define_test.cpp",
      "preprocessor_tests/error_test.cpp",
      "preprocessor_tests/extension_test.cpp",
      "preprocessor_tests/identifier_test.cpp",
      "preprocessor_tests/if_test.cpp",
      "preprocessor_tests/input_test.cpp",
      "preprocessor_tests/location_test.cpp",
      "preprocessor_tests/number_test.cpp",
      "preprocessor_tests/operator_test.cpp",
      "preprocessor_tests/pragma_test.cpp",
      "preprocessor_tests/space_test.cpp",
      "preprocessor_tests/token_test.cpp",
      "preprocessor_tests/version_test.cpp",
      "test_expectations/GPUTestExpectationsParser_unittest.cpp",
      "test_utils/ShaderExtensionTest.h",
      "test_utils/angle_test_instantiate.h",
      "test_utils/compiler_test.cpp",
      "test_utils/compiler_test.h",
    ]
    
    angle_unittests_compiler_tests_sources = [
      "compiler_tests/API_test.cpp",
      "compiler_tests/APPLE_clip_distance_test.cpp",
      "compiler_tests/ARB_texture_rectangle_test.cpp",
      "compiler_tests/AppendixALimitations_test.cpp",
      "compiler_tests/AtomicCounter_test.cpp",
      "compiler_tests/BufferVariables_test.cpp",
      "compiler_tests/CollectVariables_test.cpp",
      "compiler_tests/ConstantFoldingNaN_test.cpp",
      "compiler_tests/ConstantFoldingOverflow_test.cpp",
      "compiler_tests/ConstantFolding_test.cpp",
      "compiler_tests/ConstructCompiler_test.cpp",
      "compiler_tests/EXT_YUV_target_test.cpp",
      "compiler_tests/EXT_blend_func_extended_test.cpp",
      "compiler_tests/EXT_clip_cull_distance_test.cpp",
      "compiler_tests/EXT_frag_depth_test.cpp",
      "compiler_tests/EXT_shader_framebuffer_fetch_test.cpp",
      "compiler_tests/EXT_shader_texture_lod_test.cpp",
      "compiler_tests/EXT_shadow_samplers_test.cpp",
      "compiler_tests/EmulateGLBaseVertexBaseInstance_test.cpp",
      "compiler_tests/EmulateGLDrawID_test.cpp",
      "compiler_tests/EmulateGLFragColorBroadcast_test.cpp",
      "compiler_tests/ExpressionLimit_test.cpp",
      "compiler_tests/ExtensionDirective_test.cpp",
      "compiler_tests/FloatLex_test.cpp",
      "compiler_tests/FragDepth_test.cpp",
      "compiler_tests/GLSLCompatibilityOutput_test.cpp",
      "compiler_tests/GeometryShader_test.cpp",
      "compiler_tests/GlFragDataNotModified_test.cpp",
      "compiler_tests/ImmutableString_test.cpp",
      "compiler_tests/InitOutputVariables_test.cpp",
      "compiler_tests/IntermNode_test.cpp",
      "compiler_tests/KHR_blend_equation_advanced_test.cpp",
      "compiler_tests/NV_draw_buffers_test.cpp",
      "compiler_tests/OES_sample_variables_test.cpp",
      "compiler_tests/OES_standard_derivatives_test.cpp",
      "compiler_tests/OES_texture_cube_map_array_test.cpp",
      "compiler_tests/OVR_multiview2_test.cpp",
      "compiler_tests/OVR_multiview_test.cpp",
      "compiler_tests/Pack_Unpack_test.cpp",
      "compiler_tests/Parse_test.cpp",
      "compiler_tests/PruneEmptyCases_test.cpp",
      "compiler_tests/PruneEmptyDeclarations_test.cpp",
      "compiler_tests/PrunePureLiteralStatements_test.cpp",
      "compiler_tests/PruneUnusedFunctions_test.cpp",
      "compiler_tests/QualificationOrderESSL31_test.cpp",
      "compiler_tests/QualificationOrder_test.cpp",
      "compiler_tests/RecordConstantPrecision_test.cpp",
      "compiler_tests/RegenerateStructNames_test.cpp",
      "compiler_tests/RemoveUnreferencedVariables_test.cpp",
      "compiler_tests/SamplerMultisample_test.cpp",
      "compiler_tests/SamplerVideoWEBGL_test.cpp",
      "compiler_tests/ShCompile_test.cpp",
      "compiler_tests/ShaderImage_test.cpp",
      "compiler_tests/ShaderValidation_test.cpp",
      "compiler_tests/ShaderVariable_test.cpp",
      "compiler_tests/TextureFunction_test.cpp",
      "compiler_tests/TypeTracking_test.cpp",
      "compiler_tests/Type_test.cpp",
      "compiler_tests/VariablePacker_test.cpp",
      "compiler_tests/WorkGroupSize_test.cpp",
      "test_utils/ConstantFoldingTest.cpp",
      "test_utils/ConstantFoldingTest.h",
      "test_utils/ShaderCompileTreeTest.cpp",
      "test_utils/ShaderCompileTreeTest.h",
    ]
    
    angle_unittests_glsl_mac_sources = [
      "compiler_tests/RewriteDoWhile_test.cpp",
      "compiler_tests/UnfoldShortCircuitAST_test.cpp",
    ]
    
    # TODO(jmadill): should probably call this windows sources
    angle_unittests_hlsl_sources = [
      "compiler_tests/HLSLOutput_test.cpp",
      "compiler_tests/UnrollFlatten_test.cpp",
    ]
    
    angle_unittests_gl_sources =
        [ "../libANGLE/renderer/gl/DisplayGL_unittest.cpp" ]
    
    angle_unittests_msl_sources = [ "../tests/compiler_tests/MSLOutput_test.cpp" ]
    
    if (!angle_enable_desktop_glsl) {
      angle_unittests_sources +=
          [ "compiler_tests/ImmutableString_test_ESSL_autogen.cpp" ]
    } else {
      angle_unittests_sources +=
          [ "compiler_tests/ImmutableString_test_autogen.cpp" ]
    }
    
    if (!is_android && !is_fuchsia && !is_ios) {
      angle_unittests_sources += [ "test_utils/runner/TestSuite_unittest.cpp" ]
    }