From b3174e7af93e9840698bba53a5d866a61c37d2da Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Fri, 10 Dec 2021 17:01:51 +0100 Subject: Add `RenderingServer.get_video_adapter_type()` method This can be used to distinguish between integrated, dedicated, virtual and software-emulated GPUs. This in turn can be used to automatically adjust graphics settings, or warn users about features that may run slowly on their hardware. --- servers/rendering/rendering_device.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'servers/rendering/rendering_device.cpp') diff --git a/servers/rendering/rendering_device.cpp b/servers/rendering/rendering_device.cpp index 38f57b4624..348a470497 100644 --- a/servers/rendering/rendering_device.cpp +++ b/servers/rendering/rendering_device.cpp @@ -490,6 +490,13 @@ void RenderingDevice::_bind_methods() { BIND_CONSTANT(BARRIER_MASK_ALL); BIND_CONSTANT(BARRIER_MASK_NO_BARRIER); + BIND_ENUM_CONSTANT(DEVICE_TYPE_OTHER); + BIND_ENUM_CONSTANT(DEVICE_TYPE_INTEGRATED_GPU); + BIND_ENUM_CONSTANT(DEVICE_TYPE_DISCRETE_GPU); + BIND_ENUM_CONSTANT(DEVICE_TYPE_VIRTUAL_GPU); + BIND_ENUM_CONSTANT(DEVICE_TYPE_CPU); + BIND_ENUM_CONSTANT(DEVICE_TYPE_MAX); + BIND_ENUM_CONSTANT(DRIVER_RESOURCE_VULKAN_DEVICE); BIND_ENUM_CONSTANT(DRIVER_RESOURCE_VULKAN_PHYSICAL_DEVICE); BIND_ENUM_CONSTANT(DRIVER_RESOURCE_VULKAN_INSTANCE); -- cgit v1.2.3