|
82 | 82 |
|
83 | 83 | /* HDR availability gate. |
84 | 84 | * |
85 | | - * Compile-time: the SDK must expose CAMetalLayer's wantsExtendedDynamicRangeContent |
86 | | - * property and the PQ colour space name. The PQ colour space name |
87 | | - * (kCGColorSpaceITUR_2100_PQ) is the binding constraint on macOS — it was |
88 | | - * introduced in 10.15.4 but the symbol is gated to macOS 11.0 in the public |
89 | | - * headers. On iOS / tvOS the whole EDR surface area on CAMetalLayer was |
90 | | - * only exposed in the 16.x SDKs. |
| 85 | + * Compile-time: the SDK must expose CAMetalLayer's |
| 86 | + * wantsExtendedDynamicRangeContent property and the PQ colour space name. |
| 87 | + * The PQ colour space name (kCGColorSpaceITUR_2100_PQ) is the binding |
| 88 | + * constraint on macOS — introduced in 10.15.4 but gated to macOS 11.0 in |
| 89 | + * the public headers. On iOS the EDR surface area on CAMetalLayer was |
| 90 | + * only exposed in the 16.x SDKs. tvOS never got a public EDR path: |
| 91 | + * wantsExtendedDynamicRangeContent / edrMetadata are not part of the |
| 92 | + * public tvOS interface regardless of SDK version, so HDR is unsupported |
| 93 | + * there and the driver stays in SDR. |
91 | 94 | * |
92 | | - * We key the compile gate off the Availability.h __MAC_..., __IPHONE_..., |
93 | | - * __TVOS_... version tokens rather than AvailabilityMacros.h |
94 | | - * MAC_OS_X_VERSION_* constants: the former are defined consistently across |
95 | | - * all recent SDKs, while the latter were phased out for newer point releases |
96 | | - * and checking them fails silently even when the APIs are in fact present. |
| 95 | + * We key the compile gate off the Availability.h __MAC_... / __IPHONE_... |
| 96 | + * version tokens rather than AvailabilityMacros.h MAC_OS_X_VERSION_* |
| 97 | + * constants: the former are defined consistently across all recent SDKs, |
| 98 | + * while the latter were phased out for newer point releases and checking |
| 99 | + * them fails silently even when the APIs are in fact present. |
97 | 100 | * |
98 | 101 | * Runtime: the HDR paths are still guarded with @available(...) checks |
99 | | - * because RetroArch's Apple deployment targets (macOS 10.13, iOS 11, |
100 | | - * tvOS 12.1) are lower than the first HDR-capable OS release on each |
101 | | - * platform. When the runtime gate is false the driver stays in SDR mode. |
| 102 | + * because RetroArch's Apple deployment targets (macOS 10.13, iOS 11) are |
| 103 | + * lower than the first HDR-capable OS release on each platform. When |
| 104 | + * the runtime gate is false the driver stays in SDR mode. |
102 | 105 | * |
103 | 106 | * METAL_HDR_AVAILABLE guards compile-time only. Whenever we touch an HDR-specific |
104 | 107 | * API inside those blocks, an @available check guards runtime dispatch. */ |
105 | 108 | #include <Availability.h> |
106 | | -#if defined(OSX) && defined(__MAC_11_0) |
| 109 | +#include <TargetConditionals.h> |
| 110 | +#if defined(TARGET_OS_TV) && TARGET_OS_TV |
| 111 | +# define METAL_HDR_AVAILABLE 0 |
| 112 | +#elif defined(OSX) && defined(__MAC_11_0) |
107 | 113 | # define METAL_HDR_AVAILABLE 1 |
108 | | -#elif defined(HAVE_COCOATOUCH) && (defined(__IPHONE_16_0) || defined(__TVOS_16_0)) |
| 114 | +#elif defined(HAVE_COCOATOUCH) && defined(__IPHONE_16_0) |
109 | 115 | # define METAL_HDR_AVAILABLE 1 |
110 | 116 | #else |
111 | 117 | # define METAL_HDR_AVAILABLE 0 |
|
0 commit comments