Edit

kc3-lang/angle/src/tests/angle_end2end_tests_main.cpp

Branch :

  • Show log

    Commit

  • Author : Doug Horn
    Date : 2021-03-31 12:52:00
    Hash : fdba40fe
    Message : Reland "Fix multithreaded crash on draw commands on D3D11 backend." This is a reland of 8b9889bf62272fea2495331b622bde1f7c781bd0 The previous CL relied on a define which now only exists in a specific gn configuration. This reland removes D3D11 as a multithread-supported platform in the test configuration. Original change's description: > Fix multithreaded crash on draw commands on D3D11 backend. > > A crash can occur if thread A is executing eglDestroyContext while > thread B issues a draw call, if the threads are interleaved in such a > manner that a makeCurrent occurs without triggering a change to the > global context and a dirtyAllState call. We handle that case by > explicitly making current the proper contexts in the eglDestroyContext > call. > > A test has been added that triggers a crash without this fix when > running on the D3D11 backend. In addition, all of MultithreadingTest > is enabled for the D3D11 backend. > > Test: Ran MultithreadingTest. Test exhibits a crash before this > change, and does not after this change. Also ran: > dEQP-EGL.functional.sharing.gles2.multithread.* > dEQP-EGL.functional.multithread.* > > Bug: b/183756357 > Change-Id: Ic6f76a062868b2f3b4e60d29dc087ec180bfb7cd > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2798591 > Reviewed-by: Geoff Lang <geofflang@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Commit-Queue: Doug Horn <doughorn@google.com> Bug: b/183756357 Change-Id: I5be9a011ea99a69730eddc9e4da23bcf92ed3bf2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2815243 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Doug Horn <doughorn@google.com>

  • src/tests/angle_end2end_tests_main.cpp
  • //
    // Copyright 2013 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.
    //
    
    #include "gtest/gtest.h"
    #include "test_utils/runner/TestSuite.h"
    
    void ANGLEProcessTestArgs(int *argc, char *argv[]);
    
    // Register* functions handle setting up special tests that need complex parameterization.
    // GoogleTest relies heavily on static initialization to register test functions. This can
    // cause all sorts of issues if the right variables aren't initialized in the right order.
    // This register function needs to be called explicitly after static initialization and
    // before the test launcher starts. This is a safer and generally better way to initialize
    // tests. It's also more similar to how the dEQP Test harness works. In the future we should
    // likely specialize more register functions more like dEQP instead of relying on static init.
    void RegisterContextCompatibilityTests();
    
    // If we ever move to a text-based expectations format, we should move this list in that file.
    namespace
    {
    const char *kSlowTests[] = {"GLSLTest.VerifyMaxVertexUniformVectors*",
                                "MultiThreadingTest.MultiContextDeleteDraw*"};
    }  // namespace
    
    int main(int argc, char **argv)
    {
        angle::TestSuite testSuite(&argc, argv);
        ANGLEProcessTestArgs(&argc, argv);
        RegisterContextCompatibilityTests();
        testSuite.registerSlowTests(kSlowTests, ArraySize(kSlowTests));
        return testSuite.run();
    }