Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


GraphicsDeviceType

Graphics device underlying backend API type.
Read time 1 minuteLast updated 5 days ago

Definition

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

Direct3D11Direct3D 11 graphics API.
Direct3D12Direct3D 12 graphics API.
GameCoreXboxOneGame Core Xbox One graphics API using Direct3D 12.
GameCoreXboxSeriesGame Core XboxSeries graphics API using Direct3D 12.
MetaliOS Metal graphics API.
NullNo graphics API.
OpenGLCoreOpenGL (Core profile - GL3 or later) graphics API.
OpenGLES3OpenGL ES 3.0 graphics API. (deprecated on iOS and tvOS).
VulkanVulkan.
WebGPUWebGPU.
XboxOneXbox One graphics API using Direct3D 11.
XboxOneD3D12Xbox One graphics API using Direct3D 12.