GraphicsDeviceType
Graphics device underlying backend API type.
Read time 1 minuteLast updated 5 days ago
Definition
- Type: Enum
- Namespace: UnityEngine.Rendering
- Assembly: UnityEngine.CoreModule
public enum GraphicsDeviceType
Remarks
The GraphicsDeviceType enumeration identifies the specific graphics API (like Direct3D, Vulkan, Metal, OpenGL) that Unity is currently using for rendering. Because Unity supports multiple APIs to run on diverse platforms and hardware, developers can query this type using SystemInfo.graphicsDeviceType. Knowing the active API (e.g., GraphicsDeviceType.Direct3D11, GraphicsDeviceType.Vulkan, GraphicsDeviceType.Metal) enables developers to customize rendering logic, apply platform-specific optimizations, maintain compatibility across different hardware, or debug issues caused by API-specific behaviors or feature differences.
Additional Resources: SystemInfo.graphicsDeviceType.
Examples
using UnityEngine;using UnityEngine.Rendering;public class GraphicsDeviceTypeLog : MonoBehaviour{ void Start() { switch (SystemInfo.graphicsDeviceType) { case GraphicsDeviceType.Direct3D11: Debug.Log("Using DirectX 11."); break; case GraphicsDeviceType.Vulkan: Debug.Log("Using Vulkan."); break; default: Debug.Log("Using another graphics API."); break; } }}
Fields
Value | Description |
|---|---|
| Direct3D11 | Direct3D 11 graphics API. |
| Direct3D12 | Direct3D 12 graphics API. |
| GameCoreXboxOne | Game Core Xbox One graphics API using Direct3D 12. |
| GameCoreXboxSeries | Game Core XboxSeries graphics API using Direct3D 12. |
| Metal | iOS Metal graphics API. |
| Null | No graphics API. |
| OpenGLCore | OpenGL (Core profile - GL3 or later) graphics API. |
| OpenGLES3 | OpenGL ES 3.0 graphics API. (deprecated on iOS and tvOS). |
| Vulkan | Vulkan. |
| WebGPU | WebGPU. |
| XboxOne | Xbox One graphics API using Direct3D 11. |
| XboxOneD3D12 | Xbox One graphics API using Direct3D 12. |