Hash :
56ea854e
Author :
Date :
2020-10-13T15:57:07
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>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
//
// 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