mirror of
https://git.mirrors.martin98.com/https://github.com/bambulab/BambuStudio.git
synced 2025-08-05 22:16:19 +08:00
FIX:Less than 5 GB of free memory will not apply for lod
and ban lod in mac 15 jira: STUDIO-12063 Change-Id: Ibbf2960d8b61f07710fcd96aef175e067f02778f
This commit is contained in:
parent
0a0e76ec95
commit
852816f8d0
@ -42,7 +42,9 @@
|
||||
#if ENABLE_RETINA_GL
|
||||
#include "slic3r/Utils/RetinaHelper.hpp"
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include "libslic3r/MacUtils.hpp"
|
||||
#endif
|
||||
#include <GL/glew.h>
|
||||
|
||||
#include <wx/glcanvas.h>
|
||||
@ -2997,7 +2999,7 @@ void GLCanvas3D::reload_scene(bool refresh_immediately, bool force_full_scene_re
|
||||
}
|
||||
}
|
||||
m_volumes.volumes = std::move(glvolumes_new);
|
||||
bool enable_lod = GUI::wxGetApp().app_config->get_bool("enable_lod") && CpuMemory::cur_free_memory_less_than_specify_size_gb(LOD_FREE_MEMORY_SIZE);
|
||||
bool enable_lod = GUI::wxGetApp().app_config->get_bool("enable_lod") ;
|
||||
for (unsigned int obj_idx = 0; obj_idx < (unsigned int)m_model->objects.size(); ++ obj_idx) {
|
||||
const ModelObject &model_object = *m_model->objects[obj_idx];
|
||||
for (int volume_idx = 0; volume_idx < (int)model_object.volumes.size(); ++ volume_idx) {
|
||||
@ -3018,6 +3020,14 @@ void GLCanvas3D::reload_scene(bool refresh_immediately, bool force_full_scene_re
|
||||
// Note the index of the loaded volume, so that we can reload the main model GLVolume with the hollowed mesh
|
||||
// later in this function.
|
||||
it->volume_idx = m_volumes.volumes.size();
|
||||
if (enable_lod && CpuMemory::cur_free_memory_less_than_specify_size_gb(LOD_FREE_MEMORY_SIZE)) {
|
||||
enable_lod = false;
|
||||
}
|
||||
#ifdef __APPLE__
|
||||
if (Slic3r::is_mac_version_15()) {
|
||||
enable_lod = false;
|
||||
}
|
||||
#endif
|
||||
m_volumes.load_object_volume(&model_object, obj_idx, volume_idx, instance_idx, m_color_by, m_initialized, m_canvas_type == ECanvasType::CanvasAssembleView, false, enable_lod);
|
||||
m_volumes.volumes.back()->geometry_id = key.geometry_id;
|
||||
update_object_list = true;
|
||||
|
@ -63,11 +63,16 @@ bool CpuMemory::cur_free_memory_less_than_specify_size_gb(int size)
|
||||
unsigned long long free_mem = get_free_memory();
|
||||
auto cur_size = free_mem / (1024.0 * 1024.0 * 1024.0);
|
||||
static bool first_debug_free_memory = true;
|
||||
static bool first_meet_size_gb = true;
|
||||
if (first_debug_free_memory) {
|
||||
first_debug_free_memory = false;
|
||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " cur_size = " << cur_size << "GB";
|
||||
}
|
||||
if (cur_size > size) {
|
||||
if (cur_size < size) {
|
||||
if (first_meet_size_gb) {
|
||||
first_meet_size_gb = false;
|
||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " cur_size = " << cur_size << "GB" << "first_meet_size_gb ";
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user