Edit

kc3-lang/angle/src/libANGLE/Workarounds.h

Branch :

  • Show log

    Commit

  • Author : Kenneth Russell
    Date : 2016-10-05 19:53:23
    Hash : f2f6f65f
    Message : Add cross-platform Workarounds to Context. These are distinct from the renderer-level workarounds. Add the first workaround, loseContextOnOutOfMemory. This is enabled when the application enables reset notifications via KHR_robustness, and is intended for more robust handling of errors in key APIs for Chromium's correctness (in particular, sync objects). Change Context::getResetStatus to persistently return the "lost" status if it was set by calling Context::markContextLost. Previously, if markContextLost was called but the implementation hadn't actually received an error like a lost device, the "lost" reset status would be dropped. Returning it only once to the caller is also fragile. Tested this by manually injecting a failure in FenceSync11::clientWait and ensuring that Chromium detected it as expected. BUG=chromium:650138 Change-Id: Ie53069eacd1754ad5d64936e3fef315af24605fa Reviewed-on: https://chromium-review.googlesource.com/394233 Commit-Queue: Kenneth Russell <kbr@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>

  • src/libANGLE/Workarounds.h
  • //
    // Copyright (c) 2016 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.
    //
    
    // Workarounds.h: Workarounds for driver bugs and other behaviors seen
    // on all platforms.
    
    #ifndef LIBANGLE_WORKAROUNDS_H_
    #define LIBANGLE_WORKAROUNDS_H_
    
    namespace gl
    {
    
    struct Workarounds
    {
        // Force the context to be lost (via KHR_robustness) if a GL_OUT_OF_MEMORY error occurs. The
        // driver may be in an inconsistent state if this happens, and some users of ANGLE rely on this
        // notification to prevent further execution.
        bool loseContextOnOutOfMemory = false;
    };
    }  // namespace gl
    
    #endif  // LIBANGLE_WORKAROUNDS_H_