This page lists the requirements for using Metal as well as the features that Metal is compatible with.
Unity supports Metal for the Unity Player on iOS, tvOS, and macOS. Unity also supports Metal for the Unity Editor on macOS.
Unity supports Metal for all Apple devices that Unity supports.
기능 | 빌트인 렌더 파이프라인 | 유니버설 렌더 파이프라인(URP) | 고해상도 렌더 파이프라인(HDRP) | 커스텀 스크립터블 렌더 파이프라인(SRP) |
---|---|---|---|---|
Metal | 지원 | 지원 | Yes (macOS only) | 지원 |
Some Metal devices don’t support the 16-bit half
data type. On these devices, Unity shaders represent half
as a 32-bit float
. Similarly, Unity shaders represent the real
data type as a half
on mobile devices and as a float
on desktop platforms. This section of the documentation is relevant if you want to use the half
data type and want to deploy your application to a device that doesn’t support half
.
Using half
in the correct places can speed up operations, save memory, and save battery power on mobile devices. It’s best practice to use half
for values that don’t need high precision and use the information in this section of the documentation to make sure your code handles devices that don’t support half
.
For more information about shader data types and the precision they support, see Shader data types and precision.
16-bit floating point numbers have low precision compared to 32-bit floating point numbers. If you use half
and test your application on a device that supports it, you can often see any issues caused by low precision and then fix them. However, if you test your application on a device that doesn’t support half
(and substitutes float
for half
), this can hide precision issues which will appear later when the application runs on a device that supports half
.
If you want to deploy your Unity application to devices that don’t support half
, make sure that your code works when float
is substituted for half
. Metal GPUs that support half
, also expect buffers, including constant buffers, to contain 16-bit values. GPUs that don’t support half
expect these buffers to contain 32-bit values. Your CPU-side code needs to consider this when you write values to buffers.