summaryrefslogtreecommitdiffstats
path: root/servers/rendering/rendering_context_driver.h
diff options
context:
space:
mode:
authorMatias N. Goldberg <dark_sylinc@yahoo.com.ar>2024-08-24 17:39:46 -0300
committerMatias N. Goldberg <dark_sylinc@yahoo.com.ar>2024-08-24 20:52:39 -0300
commit59d0422dcd59686689d915000a800ed6c7753f00 (patch)
tree42af809efbd1bf3f8b87cee9832ca16d32a66f74 /servers/rendering/rendering_context_driver.h
parente3550cb20f5d6a61befaafb7d9cbdb57b24870e4 (diff)
downloadredot-engine-59d0422dcd59686689d915000a800ed6c7753f00.tar.gz
Disable extra memory tracking by default
PR #90993 added several debugging utilities. Among them, advanced memory tracking through the use of custom allocators and VK_EXT_device_memory_report. However as issue #95967 reveals, it is dangerous to leave it on by default because drivers (or even the Vulkan loader) can too easily accidentally break custom allocators by allocating memory through std malloc but then request us to deallocate it (or viceversa). This PR fixes the following problems: - Adds --extra-gpu-memory-tracking cmd line argument - Adds missing enum entries to RenderingContextDriverVulkan::VkTrackedObjectType - Adds RenderingDevice::get_driver_and_device_memory_report - GDScript users can easily check via print( RenderingServer.get_rendering_device().get_driver_and_device_memory_report() ) - Uses get_driver_and_device_memory_report on device lost for appending further info. Fixes #95967
Diffstat (limited to 'servers/rendering/rendering_context_driver.h')
-rw-r--r--servers/rendering/rendering_context_driver.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/servers/rendering/rendering_context_driver.h b/servers/rendering/rendering_context_driver.h
index 8449db442c..2e5951ae4f 100644
--- a/servers/rendering/rendering_context_driver.h
+++ b/servers/rendering/rendering_context_driver.h
@@ -102,6 +102,8 @@ public:
virtual void surface_destroy(SurfaceID p_surface) = 0;
virtual bool is_debug_utils_enabled() const = 0;
+ String get_driver_and_device_memory_report() const;
+
virtual const char *get_tracked_object_name(uint32_t p_type_index) const;
virtual uint64_t get_tracked_object_type_count() const;