1// 2// Copyright 2019 The ANGLE Project Authors. All rights reserved. 3// Use of this source code is governed by a BSD-style license that can be 4// found in the LICENSE file. 5// 6// This file includes APIs to detect whether certain Apple renderer is available for testing. 7// 8 9#include "test_utils/angle_test_instantiate_apple.h" 10 11#include "common/apple_platform_utils.h" 12#include "test_utils/angle_test_instantiate.h" 13 14namespace angle 15{ 16 17bool IsMetalTextureSwizzleAvailable() 18{ 19 // NOTE(hqle): This might not be accurate, since the capabilities also depend on underlying 20 // hardwares, however, it is OK for testing. 21 if (ANGLE_APPLE_AVAILABLE_XCI(10.15, 13.1, 13)) 22 { 23 // All NVIDIA and older Intel don't support swizzle because they are GPU family 1. 24 // We don't have a way to detect Metal family here, so skip all Intel for now. 25 return !IsIntel() && !IsNVIDIA(); 26 } 27 return false; 28} 29 30bool IsMetalCompressedTexture3DAvailable() 31{ 32 if (ANGLE_APPLE_AVAILABLE_XCI(10.15, 13.1, 13.0)) 33 { 34 return true; 35 } 36 return false; 37} 38 39} // namespace angle 40