Version: 2022.3
언어: 한국어
Introduction to Metal
Debug Metal graphics

Metal requirements and compatibility

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.

Hardware compatibility

Unity supports Metal for all Apple devices that Unity supports.

렌더 파이프라인 호환성

기능 빌트인 렌더 파이프라인 유니버설 렌더 파이프라인(URP) 고해상도 렌더 파이프라인(HDRP) 커스텀 스크립터블 렌더 파이프라인(SRP)
Metal 지원 지원 Yes (macOS only) 지원

Shader compatibility

Shader data types support

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.

Support implications

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.

Introduction to Metal
Debug Metal graphics
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961