virtualx-engine/scene
aaronp64 f81e0fcbf4 Improve memory usage for image import and PortableCompressedTexture2D
When importing images, we store a compressed version of the image to a .ctex file with ResourceImporterTexture::save_to_ctex_format.  When importing many large images at once, this can use a large amount of memory, especially when the .ctex file uses WebP format.

This change is for ResourceImporterTexture::save_to_ctex_format to use the original Image object instead of p_image->get_image_from_mipmap(0), to avoid creating a copy of the full uncompressed image when looping through the base Image and mipmaps.  This reduces the import memory usage for large images by around 10% when using WebP, and 35-40% when Project Settings/Rendering/Textures/Lossless Compression/Force PNG is enabled, may vary depending on the image and number of import threads running.  Same change applied to PortableCompressedTexture2D::create_from_image, which has similar logic.

This helps with #92084, but does not fully resolve the issue on its own, as compressing with WebP on many threads can still use a large amount of memory - this just lowers that amount, and makes it more likely that enabling "Force PNG" will reduce memory usage enough to import the files.
2024-05-20 19:40:39 -04:00
..
2d Merge pull request #91936 from jsjtxietian/body-connect 2024-05-15 12:09:50 +02:00
3d Merge pull request #91601 from lander-vr/lightmap_seams_fix 2024-05-15 13:51:35 +02:00
animation Use Core/Scene stringnames consistently 2024-05-13 23:41:07 +02:00
audio Use Core/Scene stringnames consistently 2024-05-13 23:41:07 +02:00
debugger Reduce and prevent unnecessary random-access to List 2024-05-04 16:08:55 +02:00
gui Merge pull request #92042 from bruvzg/fix_edit_popup 2024-05-17 13:00:38 +02:00
main Cleanup unused/underused singleton StringNames 2024-05-14 18:18:29 +02:00
resources Improve memory usage for image import and PortableCompressedTexture2D 2024-05-20 19:40:39 -04:00
theme [Scene] Add SceneStringNames::pressed 2024-05-14 15:51:28 +02:00
property_list_helper.cpp Fix PropertyListHelper::_get_property returning a valid value even if an index is outside the array valid indices 2024-05-10 10:46:04 +02:00
property_list_helper.h Fix PropertyListHelper::_get_property returning a valid value even if an index is outside the array valid indices 2024-05-10 10:46:04 +02:00
property_utils.cpp Fix inherited scenes produce errors in editor when "editable_children" is true 2024-03-10 07:37:47 +08:00
property_utils.h
register_scene_types.cpp Use Core/Scene stringnames consistently 2024-05-13 23:41:07 +02:00
register_scene_types.h
scene_string_names.cpp Cleanup unused/underused singleton StringNames 2024-05-14 18:18:29 +02:00
scene_string_names.h Cleanup unused/underused singleton StringNames 2024-05-14 18:18:29 +02:00
SCsub