Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions drivers/metal/metal_device_properties.mm
Original file line number Diff line number Diff line change
Expand Up @@ -316,14 +316,17 @@

limits.maxDrawIndexedIndexValue = std::numeric_limits<uint32_t>::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<MTLDevice> p_device) {
Expand Down
11 changes: 11 additions & 0 deletions drivers/metal/pixel_formats.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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 <typename T>
void clear(T *p_val, size_t p_count = 1) {
memset(p_val, 0, sizeof(T) * p_count);
Expand Down
2 changes: 2 additions & 0 deletions drivers/metal/rendering_device_driver_metal.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down
Loading