From bae4b0c9525d1a885e75e77fb8ecf29425e92a28 Mon Sep 17 00:00:00 2001 From: Ev1lbl0w Date: Tue, 9 Mar 2021 09:51:17 +0000 Subject: [PATCH] Fix negative VRAM values --- core/bind/core_bind.cpp | 2 +- drivers/dummy/rasterizer_dummy.h | 2 +- drivers/gles2/rasterizer_storage_gles2.cpp | 2 +- drivers/gles2/rasterizer_storage_gles2.h | 2 +- drivers/gles3/rasterizer_storage_gles3.cpp | 2 +- drivers/gles3/rasterizer_storage_gles3.h | 2 +- editor/script_editor_debugger.cpp | 2 +- servers/visual/rasterizer.h | 2 +- servers/visual/visual_server_raster.cpp | 2 +- servers/visual/visual_server_raster.h | 2 +- servers/visual/visual_server_wrap_mt.h | 2 +- servers/visual_server.h | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index 58fb44d2cce..3443496ba9f 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -1021,7 +1021,7 @@ struct _OSCoreBindImg { void _OS::print_all_textures_by_size() { List<_OSCoreBindImg> imgs; - int total = 0; + uint64_t total = 0; { List > rsrc; ResourceCache::get_cached_resources(&rsrc); diff --git a/drivers/dummy/rasterizer_dummy.h b/drivers/dummy/rasterizer_dummy.h index c56354a3c05..7cd7e96ec0b 100644 --- a/drivers/dummy/rasterizer_dummy.h +++ b/drivers/dummy/rasterizer_dummy.h @@ -763,7 +763,7 @@ public: void render_info_end_capture() {} int get_captured_render_info(VS::RenderInfo p_info) { return 0; } - int get_render_info(VS::RenderInfo p_info) { return 0; } + uint64_t get_render_info(VS::RenderInfo p_info) { return 0; } String get_video_adapter_name() const { return String(); } String get_video_adapter_vendor() const { return String(); } diff --git a/drivers/gles2/rasterizer_storage_gles2.cpp b/drivers/gles2/rasterizer_storage_gles2.cpp index d296826601f..e312ef6e74b 100644 --- a/drivers/gles2/rasterizer_storage_gles2.cpp +++ b/drivers/gles2/rasterizer_storage_gles2.cpp @@ -5946,7 +5946,7 @@ int RasterizerStorageGLES2::get_captured_render_info(VS::RenderInfo p_info) { } } -int RasterizerStorageGLES2::get_render_info(VS::RenderInfo p_info) { +uint64_t RasterizerStorageGLES2::get_render_info(VS::RenderInfo p_info) { switch (p_info) { case VS::INFO_OBJECTS_IN_FRAME: return info.render_final.object_count; diff --git a/drivers/gles2/rasterizer_storage_gles2.h b/drivers/gles2/rasterizer_storage_gles2.h index 3c18715885c..23823026b84 100644 --- a/drivers/gles2/rasterizer_storage_gles2.h +++ b/drivers/gles2/rasterizer_storage_gles2.h @@ -1345,7 +1345,7 @@ public: virtual void render_info_end_capture(); virtual int get_captured_render_info(VS::RenderInfo p_info); - virtual int get_render_info(VS::RenderInfo p_info); + virtual uint64_t get_render_info(VS::RenderInfo p_info); virtual String get_video_adapter_name() const; virtual String get_video_adapter_vendor() const; diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp index 9d852a072e3..a0aa79f890a 100644 --- a/drivers/gles3/rasterizer_storage_gles3.cpp +++ b/drivers/gles3/rasterizer_storage_gles3.cpp @@ -8294,7 +8294,7 @@ int RasterizerStorageGLES3::get_captured_render_info(VS::RenderInfo p_info) { } } -int RasterizerStorageGLES3::get_render_info(VS::RenderInfo p_info) { +uint64_t RasterizerStorageGLES3::get_render_info(VS::RenderInfo p_info) { switch (p_info) { case VS::INFO_OBJECTS_IN_FRAME: diff --git a/drivers/gles3/rasterizer_storage_gles3.h b/drivers/gles3/rasterizer_storage_gles3.h index 1101d25ee0c..db51ead8026 100644 --- a/drivers/gles3/rasterizer_storage_gles3.h +++ b/drivers/gles3/rasterizer_storage_gles3.h @@ -1507,7 +1507,7 @@ public: virtual void render_info_end_capture(); virtual int get_captured_render_info(VS::RenderInfo p_info); - virtual int get_render_info(VS::RenderInfo p_info); + virtual uint64_t get_render_info(VS::RenderInfo p_info); virtual String get_video_adapter_name() const; virtual String get_video_adapter_vendor() const; diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp index 23b79ee856d..828845e2a22 100644 --- a/editor/script_editor_debugger.cpp +++ b/editor/script_editor_debugger.cpp @@ -717,7 +717,7 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da vmem_tree->clear(); TreeItem *root = vmem_tree->create_item(); - int total = 0; + uint64_t total = 0; for (int i = 0; i < p_data.size(); i += 4) { diff --git a/servers/visual/rasterizer.h b/servers/visual/rasterizer.h index 894b782f5b3..c2ec9649c26 100644 --- a/servers/visual/rasterizer.h +++ b/servers/visual/rasterizer.h @@ -601,7 +601,7 @@ public: virtual void render_info_end_capture() = 0; virtual int get_captured_render_info(VS::RenderInfo p_info) = 0; - virtual int get_render_info(VS::RenderInfo p_info) = 0; + virtual uint64_t get_render_info(VS::RenderInfo p_info) = 0; virtual String get_video_adapter_name() const = 0; virtual String get_video_adapter_vendor() const = 0; diff --git a/servers/visual/visual_server_raster.cpp b/servers/visual/visual_server_raster.cpp index 2cbf9ac537e..ac277416848 100644 --- a/servers/visual/visual_server_raster.cpp +++ b/servers/visual/visual_server_raster.cpp @@ -148,7 +148,7 @@ void VisualServerRaster::finish() { /* STATUS INFORMATION */ -int VisualServerRaster::get_render_info(RenderInfo p_info) { +uint64_t VisualServerRaster::get_render_info(RenderInfo p_info) { return VSG::storage->get_render_info(p_info); } diff --git a/servers/visual/visual_server_raster.h b/servers/visual/visual_server_raster.h index cf6d6f7d729..e1ad2f19078 100644 --- a/servers/visual/visual_server_raster.h +++ b/servers/visual/visual_server_raster.h @@ -685,7 +685,7 @@ public: /* STATUS INFORMATION */ - virtual int get_render_info(RenderInfo p_info); + virtual uint64_t get_render_info(RenderInfo p_info); virtual String get_video_adapter_name() const; virtual String get_video_adapter_vendor() const; diff --git a/servers/visual/visual_server_wrap_mt.h b/servers/visual/visual_server_wrap_mt.h index e4e6dd0da15..eefec8f79ae 100644 --- a/servers/visual/visual_server_wrap_mt.h +++ b/servers/visual/visual_server_wrap_mt.h @@ -605,7 +605,7 @@ public: /* RENDER INFO */ //this passes directly to avoid stalling - virtual int get_render_info(RenderInfo p_info) { + virtual uint64_t get_render_info(RenderInfo p_info) { return visual_server->get_render_info(p_info); } diff --git a/servers/visual_server.h b/servers/visual_server.h index 5d177c5e738..f85f9c2867a 100644 --- a/servers/visual_server.h +++ b/servers/visual_server.h @@ -1038,7 +1038,7 @@ public: INFO_VERTEX_MEM_USED, }; - virtual int get_render_info(RenderInfo p_info) = 0; + virtual uint64_t get_render_info(RenderInfo p_info) = 0; virtual String get_video_adapter_name() const = 0; virtual String get_video_adapter_vendor() const = 0;