mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-16 19:05:59 +08:00
Added some debug output to help finding the reason of crash at startup on Mac OS
This commit is contained in:
parent
4b6d2a58b0
commit
a10495f132
@ -192,6 +192,10 @@ int CLI::run(int argc, char **argv)
|
|||||||
m_actions.erase(it);
|
m_actions.erase(it);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
std::cout << "CLI::run(): required OpenGL version: " << opengl_version.first << "." << opengl_version.second << "\n";
|
||||||
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
|
||||||
#if ENABLE_OPENGL_DEBUG_OPTION
|
#if ENABLE_OPENGL_DEBUG_OPTION
|
||||||
it = std::find(m_actions.begin(), m_actions.end(), "opengl-debug");
|
it = std::find(m_actions.begin(), m_actions.end(), "opengl-debug");
|
||||||
if (it != m_actions.end()) {
|
if (it != m_actions.end()) {
|
||||||
|
@ -847,6 +847,11 @@ std::string GUI_App::get_gl_info(bool for_github)
|
|||||||
|
|
||||||
wxGLContext* GUI_App::init_glcontext(wxGLCanvas& canvas)
|
wxGLContext* GUI_App::init_glcontext(wxGLCanvas& canvas)
|
||||||
{
|
{
|
||||||
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
if (init_params != nullptr)
|
||||||
|
std::cout << "GUI_App::init_glcontext(): required OpenGL version: " << init_params->opengl_version.first << "." << init_params->opengl_version.second << "\n";
|
||||||
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
|
||||||
#if ENABLE_GL_CORE_PROFILE
|
#if ENABLE_GL_CORE_PROFILE
|
||||||
#if ENABLE_OPENGL_DEBUG_OPTION
|
#if ENABLE_OPENGL_DEBUG_OPTION
|
||||||
return m_opengl_mgr.init_glcontext(canvas, init_params != nullptr ? init_params->opengl_version : std::make_pair(0, 0),
|
return m_opengl_mgr.init_glcontext(canvas, init_params != nullptr ? init_params->opengl_version : std::make_pair(0, 0),
|
||||||
|
@ -54,6 +54,10 @@ int GUI_Run(GUI_InitParams ¶ms)
|
|||||||
GUI::GUI_App::SetInstance(gui);
|
GUI::GUI_App::SetInstance(gui);
|
||||||
gui->init_params = ¶ms;
|
gui->init_params = ¶ms;
|
||||||
|
|
||||||
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
std::cout << "GUI_Run(): required OpenGL version: " << gui->init_params->opengl_version.first << "." << gui->init_params->opengl_version.second << "\n";
|
||||||
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
|
||||||
return wxEntry(params.argc, params.argv);
|
return wxEntry(params.argc, params.argv);
|
||||||
} catch (const Slic3r::Exception &ex) {
|
} catch (const Slic3r::Exception &ex) {
|
||||||
boost::nowide::cerr << ex.what() << std::endl;
|
boost::nowide::cerr << ex.what() << std::endl;
|
||||||
|
@ -420,21 +420,24 @@ wxGLContext* OpenGLManager::init_glcontext(wxGLCanvas& canvas)
|
|||||||
m_debug_enabled = enable_debug;
|
m_debug_enabled = enable_debug;
|
||||||
#endif // ENABLE_OPENGL_DEBUG_OPTION
|
#endif // ENABLE_OPENGL_DEBUG_OPTION
|
||||||
|
|
||||||
if (required_opengl_version != std::make_pair(0, 0)) { // the user specified a required version in the command line using --opengl=M.m
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
m_required_version = required_opengl_version;
|
std::cout << "OpenGLManager::init_glcontext(): required OpenGL version: " << required_opengl_version.first << "." << required_opengl_version.second << "\n";
|
||||||
const bool supports_core_profile = (m_required_version.first < 3) ? false :
|
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
(m_required_version.first > 3) ? true : m_required_version.second >= 2;
|
|
||||||
|
if (required_opengl_version != std::make_pair(0, 0)) { // the user specified a required version in the command line using --opengl-core=M.m
|
||||||
|
const bool supports_core_profile = (required_opengl_version.first < 3) ? false :
|
||||||
|
(required_opengl_version.first > 3) ? true : required_opengl_version.second >= 2;
|
||||||
if (supports_core_profile) {
|
if (supports_core_profile) {
|
||||||
// disable wxWidgets logging to avoid showing the log dialog in case the following code fails generating a valid gl context
|
// disable wxWidgets logging to avoid showing the log dialog in case the following code fails generating a valid gl context
|
||||||
wxLogNull logNo;
|
wxLogNull logNo;
|
||||||
wxGLContextAttrs attrs;
|
wxGLContextAttrs attrs;
|
||||||
#if ENABLE_OPENGL_DEBUG_OPTION
|
#if ENABLE_OPENGL_DEBUG_OPTION
|
||||||
attrs.MajorVersion(m_required_version.first).MinorVersion(m_required_version.second).CoreProfile().ForwardCompatible();
|
attrs.MajorVersion(required_opengl_version.first).MinorVersion(required_opengl_version.second).CoreProfile().ForwardCompatible();
|
||||||
if (m_debug_enabled)
|
if (m_debug_enabled)
|
||||||
attrs.DebugCtx();
|
attrs.DebugCtx();
|
||||||
attrs.EndList();
|
attrs.EndList();
|
||||||
#else
|
#else
|
||||||
attrs.MajorVersion(m_required_version.first).MinorVersion(m_required_version.second).CoreProfile().ForwardCompatible().EndList();
|
attrs.MajorVersion(required_opengl_version.first).MinorVersion(required_opengl_version.second).CoreProfile().ForwardCompatible().EndList();
|
||||||
#endif // ENABLE_OPENGL_DEBUG_OPTION
|
#endif // ENABLE_OPENGL_DEBUG_OPTION
|
||||||
m_context = new wxGLContext(&canvas, nullptr, &attrs);
|
m_context = new wxGLContext(&canvas, nullptr, &attrs);
|
||||||
if (!m_context->IsOK()) {
|
if (!m_context->IsOK()) {
|
||||||
@ -446,7 +449,7 @@ wxGLContext* OpenGLManager::init_glcontext(wxGLCanvas& canvas)
|
|||||||
}
|
}
|
||||||
//else {
|
//else {
|
||||||
// // try to get the highest supported OpenGL version with core profile
|
// // try to get the highest supported OpenGL version with core profile
|
||||||
// static const std::vector<std::pair<int, int>> valid_core_versions = { {4,6}, {4,5}, {4,4}, {4,3}, {4,2}, {4,1}, {4,0}, {3,3} };
|
// static const std::vector<std::pair<int, int>> valid_core_versions = { {4,6}, {4,5}, {4,4}, {4,3}, {4,2}, {4,1}, {4,0}, {3,3}, {3,2} };
|
||||||
// // disable wxWidgets logging to avoid showing the log dialog in case the following code fails generating a valid gl context
|
// // disable wxWidgets logging to avoid showing the log dialog in case the following code fails generating a valid gl context
|
||||||
// wxLogNull logNo;
|
// wxLogNull logNo;
|
||||||
// for (const auto& [major, minor] : valid_core_versions) {
|
// for (const auto& [major, minor] : valid_core_versions) {
|
||||||
|
@ -84,12 +84,9 @@ private:
|
|||||||
|
|
||||||
bool m_gl_initialized{ false };
|
bool m_gl_initialized{ false };
|
||||||
wxGLContext* m_context{ nullptr };
|
wxGLContext* m_context{ nullptr };
|
||||||
#if ENABLE_GL_CORE_PROFILE
|
|
||||||
std::pair<int, int> m_required_version{ 0, 0 };
|
|
||||||
#if ENABLE_OPENGL_DEBUG_OPTION
|
#if ENABLE_OPENGL_DEBUG_OPTION
|
||||||
bool m_debug_enabled{ false };
|
bool m_debug_enabled{ false };
|
||||||
#endif // ENABLE_OPENGL_DEBUG_OPTION
|
#endif // ENABLE_OPENGL_DEBUG_OPTION
|
||||||
#endif // ENABLE_GL_CORE_PROFILE
|
|
||||||
GLShadersManager m_shaders_manager;
|
GLShadersManager m_shaders_manager;
|
||||||
static GLInfo s_gl_info;
|
static GLInfo s_gl_info;
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
|
Loading…
x
Reference in New Issue
Block a user