summaryrefslogtreecommitdiff
path: root/drivers/vulkan
diff options
context:
space:
mode:
authorHugo Locurcio <hugo.locurcio@hugo.pro>2021-07-31 15:39:46 +0200
committerHugo Locurcio <hugo.locurcio@hugo.pro>2022-05-03 01:18:35 +0200
commit31194f5b1c84638267958c8efa9212f362e57ae0 (patch)
tree5311467eadbbf00c1432910df46a1cc738539472 /drivers/vulkan
parent87622861106b4bb06040a603060bedc2835648ba (diff)
Add `get_video_adapter_api_version()` to RenderingServer
This method can be used to get the graphics API version currently in use (such as Vulkan). It can be used by projects for troubleshooting or statistical purposes.
Diffstat (limited to 'drivers/vulkan')
-rw-r--r--drivers/vulkan/rendering_device_vulkan.cpp5
-rw-r--r--drivers/vulkan/rendering_device_vulkan.h1
-rw-r--r--drivers/vulkan/vulkan_context.cpp5
-rw-r--r--drivers/vulkan/vulkan_context.h1
4 files changed, 12 insertions, 0 deletions
diff --git a/drivers/vulkan/rendering_device_vulkan.cpp b/drivers/vulkan/rendering_device_vulkan.cpp
index 59b4c34c3f..5102eab979 100644
--- a/drivers/vulkan/rendering_device_vulkan.cpp
+++ b/drivers/vulkan/rendering_device_vulkan.cpp
@@ -8649,6 +8649,7 @@ void RenderingDeviceVulkan::draw_command_end_label() {
String RenderingDeviceVulkan::get_device_vendor_name() const {
return context->get_device_vendor_name();
}
+
String RenderingDeviceVulkan::get_device_name() const {
return context->get_device_name();
}
@@ -8657,6 +8658,10 @@ RenderingDevice::DeviceType RenderingDeviceVulkan::get_device_type() const {
return context->get_device_type();
}
+String RenderingDeviceVulkan::get_device_api_version() const {
+ return context->get_device_api_version();
+}
+
String RenderingDeviceVulkan::get_device_pipeline_cache_uuid() const {
return context->get_device_pipeline_cache_uuid();
}
diff --git a/drivers/vulkan/rendering_device_vulkan.h b/drivers/vulkan/rendering_device_vulkan.h
index 219d48a9f5..236742c15d 100644
--- a/drivers/vulkan/rendering_device_vulkan.h
+++ b/drivers/vulkan/rendering_device_vulkan.h
@@ -1229,6 +1229,7 @@ public:
virtual String get_device_vendor_name() const;
virtual String get_device_name() const;
virtual RenderingDevice::DeviceType get_device_type() const;
+ virtual String get_device_api_version() const;
virtual String get_device_pipeline_cache_uuid() const;
virtual uint64_t get_driver_resource(DriverResource p_resource, RID p_rid = RID(), uint64_t p_index = 0);
diff --git a/drivers/vulkan/vulkan_context.cpp b/drivers/vulkan/vulkan_context.cpp
index a09a757842..7944057041 100644
--- a/drivers/vulkan/vulkan_context.cpp
+++ b/drivers/vulkan/vulkan_context.cpp
@@ -2364,6 +2364,7 @@ void VulkanContext::set_object_name(VkObjectType p_object_type, uint64_t p_objec
String VulkanContext::get_device_vendor_name() const {
return device_vendor;
}
+
String VulkanContext::get_device_name() const {
return device_name;
}
@@ -2372,6 +2373,10 @@ RenderingDevice::DeviceType VulkanContext::get_device_type() const {
return RenderingDevice::DeviceType(device_type);
}
+String VulkanContext::get_device_api_version() const {
+ return vformat("%d.%d.%d", vulkan_major, vulkan_minor, vulkan_patch);
+}
+
String VulkanContext::get_device_pipeline_cache_uuid() const {
return pipeline_cache_id;
}
diff --git a/drivers/vulkan/vulkan_context.h b/drivers/vulkan/vulkan_context.h
index 365ee3c9b0..6858eb7524 100644
--- a/drivers/vulkan/vulkan_context.h
+++ b/drivers/vulkan/vulkan_context.h
@@ -305,6 +305,7 @@ public:
String get_device_vendor_name() const;
String get_device_name() const;
RenderingDevice::DeviceType get_device_type() const;
+ String get_device_api_version() const;
String get_device_pipeline_cache_uuid() const;
void set_vsync_mode(DisplayServer::WindowID p_window, DisplayServer::VSyncMode p_mode);