8#ifndef GrMtlTypesPriv_DEFINED
9#define GrMtlTypesPriv_DEFINED
18#include <TargetConditionals.h>
20#if defined(SK_BUILD_FOR_MAC)
21#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 130000
22#define GR_METAL_SDK_VERSION 300
23#elif __MAC_OS_X_VERSION_MAX_ALLOWED >= 120000
24#define GR_METAL_SDK_VERSION 240
25#elif __MAC_OS_X_VERSION_MAX_ALLOWED >= 110000
26#define GR_METAL_SDK_VERSION 230
27#elif __MAC_OS_X_VERSION_MAX_ALLOWED >= 101500
28#define GR_METAL_SDK_VERSION 220
29#elif __MAC_OS_X_VERSION_MAX_ALLOWED >= 101400
30#define GR_METAL_SDK_VERSION 210
32#error Must use at least 10.14 SDK to build Metal backend for MacOS
35#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 160000 || __TV_OS_VERSION_MAX_ALLOWED >= 160000
36#define GR_METAL_SDK_VERSION 300
37#elif __IPHONE_OS_VERSION_MAX_ALLOWED >= 150000 || __TV_OS_VERSION_MAX_ALLOWED >= 150000
38#define GR_METAL_SDK_VERSION 240
39#elif __IPHONE_OS_VERSION_MAX_ALLOWED >= 140000 || __TV_OS_VERSION_MAX_ALLOWED >= 140000
40#define GR_METAL_SDK_VERSION 230
41#elif __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000 || __TV_OS_VERSION_MAX_ALLOWED >= 130000
42#define GR_METAL_SDK_VERSION 220
43#elif __IPHONE_OS_VERSION_MAX_ALLOWED >= 120000 || __TV_OS_VERSION_MAX_ALLOWED >= 120000
44#define GR_METAL_SDK_VERSION 210
46#error Must use at least 12.00 SDK to build Metal backend for iOS
50#if __has_feature(objc_arc) && __has_attribute(objc_externally_retained)
51#define GR_NORETAIN __attribute__((objc_externally_retained))
52#define GR_NORETAIN_BEGIN \
53 _Pragma("clang attribute push (__attribute__((objc_externally_retained)), apply_to=any(function,objc_method))")
54#define GR_NORETAIN_END _Pragma("clang attribute pop")
57#define GR_NORETAIN_BEGIN
58#define GR_NORETAIN_END
61struct GrMtlTextureSpec {
66 GrMtlTextureSpec(
const GrMtlSurfaceInfo&
info)
67 : fFormat(
info.fFormat)
69 , fStorageMode(
info.fStorageMode) {}
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
GrMtlSurfaceInfo GrMtlTextureSpecToSurfaceInfo(const GrMtlTextureSpec &mtlSpec, uint32_t sampleCount, uint32_t levelCount, GrProtected isProtected)
unsigned int GrMTLStorageMode
unsigned int GrMTLPixelFormat
unsigned int GrMTLTextureUsage