diff --git a/drivers/metal/metal_device_properties.mm b/drivers/metal/metal_device_properties.mm index 2c7ff576f4bf..9016f9495da9 100644 --- a/drivers/metal/metal_device_properties.mm +++ b/drivers/metal/metal_device_properties.mm @@ -316,14 +316,17 @@ limits.maxDrawIndexedIndexValue = std::numeric_limits::max() - 1; + // Use default values to avoid compilation issues with missing methods in older SDKs + limits.temporalScalerInputContentMinScale = 1.0; + limits.temporalScalerInputContentMaxScale = 3.0; + +#if (__MAC_OS_X_VERSION_MAX_ALLOWED >= 140000) || (__IPHONE_OS_VERSION_MAX_ALLOWED >= 170000) || (__TV_OS_VERSION_MAX_ALLOWED >= 170000) if (@available(macOS 14.0, iOS 17.0, tvOS 17.0, *)) { limits.temporalScalerInputContentMinScale = (double)[MTLFXTemporalScalerDescriptor supportedInputContentMinScaleForDevice:p_device]; limits.temporalScalerInputContentMaxScale = (double)[MTLFXTemporalScalerDescriptor supportedInputContentMaxScaleForDevice:p_device]; - } else { - // Defaults taken from macOS 14+ - limits.temporalScalerInputContentMinScale = 1.0; - limits.temporalScalerInputContentMaxScale = 3.0; - } + } +#endif + } MetalDeviceProperties::MetalDeviceProperties(id p_device) { diff --git a/drivers/metal/pixel_formats.mm b/drivers/metal/pixel_formats.mm index c784faa8397b..11f4d7d521f9 100644 --- a/drivers/metal/pixel_formats.mm +++ b/drivers/metal/pixel_formats.mm @@ -97,6 +97,17 @@ #define MTLVertexFormatFloatRGB9E5 MTLVertexFormatInvalid #endif +// define +#define MTLGPUFamilyApple1 (MTLGPUFamily)1001 +#define MTLGPUFamilyApple2 (MTLGPUFamily)1002 +#define MTLGPUFamilyApple3 (MTLGPUFamily)1003 +#define MTLGPUFamilyApple4 (MTLGPUFamily)1004 +#define MTLGPUFamilyApple5 (MTLGPUFamily)1005 +#define MTLGPUFamilyApple6 (MTLGPUFamily)1006 +#define MTLGPUFamilyApple7 (MTLGPUFamily)1007 +#define MTLGPUFamilyApple8 (MTLGPUFamily)1008 +#define MTLGPUFamilyApple9 (MTLGPUFamily)1009 + template void clear(T *p_val, size_t p_count = 1) { memset(p_val, 0, sizeof(T) * p_count); diff --git a/drivers/metal/rendering_device_driver_metal.mm b/drivers/metal/rendering_device_driver_metal.mm index 5cf3dab94fdb..395ba00b9caa 100644 --- a/drivers/metal/rendering_device_driver_metal.mm +++ b/drivers/metal/rendering_device_driver_metal.mm @@ -314,7 +314,9 @@ _FORCE_INLINE_ MTLSize mipmapLevelSizeFromSize(MTLSize p_size, NSUInteger p_leve if (@available(macOS 14.0, iOS 17.0, tvOS 17.0, *)) { if (format_caps & kMTLFmtCapsAtomic) { +#if (__MAC_OS_X_VERSION_MAX_ALLOWED >= 140000) || (__IPHONE_OS_VERSION_MAX_ALLOWED >= 170000) || (__TV_OS_VERSION_MAX_ALLOWED >= 170000) desc.usage |= MTLTextureUsageShaderAtomic; +#endif } }