Edit

kc3-lang/angle/src/tests/test_utils/angle_test_instantiate_apple.mm

Branch :

  • Show log

    Commit

  • Author : Alexey Knyazev
    Date : 2020-10-13 15:57:07
    Hash : 56ea854e
    Message : Metal: Allow unswizzled BC1 RGB Refine DXT1CompressedTextureTest.DXT1Alpha to pass on more configurations. Fix the test's payload so that all 16 pixels use code 3. Refine texture swizzling detection. Bug: angleproject:2634 Bug: angleproject:5049 Change-Id: If9e1ab63220170a54954234ea205e19583b0df0a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2467896 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Le Hoang Quyen <le.hoang.q@gmail.com> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>

  • src/tests/test_utils/angle_test_instantiate_apple.mm
  • //
    // Copyright 2019 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.
    //
    // This file includes APIs to detect whether certain Apple renderer is availabe for testing.
    //
    
    #include "test_utils/angle_test_instantiate_apple.h"
    
    #include "common/apple_platform_utils.h"
    #include "test_utils/angle_test_instantiate.h"
    
    namespace angle
    {
    
    bool IsMetalRendererAvailable()
    {
        // NOTE(hqle): This code is currently duplicated with rx::IsMetalDisplayAvailable().
        // Consider move it to a common source code accessible to both libANGLE and test apps.
        if (ANGLE_APPLE_AVAILABLE_XCI(10.13, 13.0, 11))
        {
            return true;
        }
        return false;
    }
    
    bool IsMetalTextureSwizzleAvailable()
    {
        // NOTE(hqle): This might not be accurate, since the capabilities also depend on underlying
        // hardwares, however, it is OK for testing.
        if (ANGLE_APPLE_AVAILABLE_XCI(10.15, 13.0, 13))
        {
            // All NVIDIA and older Intel don't support swizzle because they are GPU family 1.
            // We don't have a way to detect Metal family here, so skip all Intel for now.
            return !IsIntel() && !IsNVIDIA();
        }
        return false;
    }
    
    }  // namespace angle