summaryrefslogtreecommitdiff
path: root/servers/rendering/rendering_device.cpp
diff options
context:
space:
mode:
authorHugo Locurcio <hugo.locurcio@hugo.pro>2021-12-10 17:01:51 +0100
committerHugo Locurcio <hugo.locurcio@hugo.pro>2021-12-10 17:10:47 +0100
commitb3174e7af93e9840698bba53a5d866a61c37d2da (patch)
tree794c5807f2a043bdc57ee7d1c66d2070cb484536 /servers/rendering/rendering_device.cpp
parent85380c52073d679c088d61fc663ec62cbd85b453 (diff)
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.
Diffstat (limited to 'servers/rendering/rendering_device.cpp')
-rw-r--r--servers/rendering/rendering_device.cpp7
1 files changed, 7 insertions, 0 deletions
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);