From 59d0422dcd59686689d915000a800ed6c7753f00 Mon Sep 17 00:00:00 2001 From: "Matias N. Goldberg" <dark_sylinc@yahoo.com.ar> Date: Sat, 24 Aug 2024 17:39:46 -0300 Subject: 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 --- servers/rendering/rendering_context_driver.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'servers/rendering/rendering_context_driver.h') 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; -- cgit v1.2.3