Hash :
47279c72
Author :
Date :
2021-08-15T23:20:32
Adjust compressed texture validation; add test - Format check happens before target check to accommodate for unknown / disabled format enums. - PVRTC1 and ETC1 enums are not allowed for 2D Array and 3D targets. - PVRTC1 sRGB formats require enabling two extensions. - New noCompressedTexture3D limitation for older Metal versions. The test checks that only the appropriate entry points are affected after enabling compressed texture extensions. Bug: angleproject:5731, angleproject:6280 Change-Id: I4943cd3a82f60f9348215caa8639e0bc3e8b45db Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3094018 Reviewed-by: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
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 42 43 44 45 46 47 48 49 50
//
// 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;
}
bool IsMetalCompressedTexture3DAvailable()
{
if (ANGLE_APPLE_AVAILABLE_XCI(10.15, 13.0, 13.0))
{
return true;
}
return false;
}
} // namespace angle