Windows specific: Added "--sw-renderer" to load the MESA SW rasterizer.

This commit is contained in:
bubnikv 2019-04-12 11:43:29 +02:00
parent 360e741462
commit 9f53123204
2 changed files with 17 additions and 2 deletions

View file

@ -3117,6 +3117,13 @@ CLIMiscConfigDef::CLIMiscConfigDef()
def->label = L("Logging level");
def->tooltip = L("Messages with severity lower or eqal to the loglevel will be printed out. 0:trace, 1:debug, 2:info, 3:warning, 4:error, 5:fatal");
def->min = 0;
#ifdef _MSC_VER
def = this->add("sw_renderer", coBool);
def->label = L("Render with a software renderer");
def->tooltip = L("Render with a software renderer. The bundled MESA software renderer is loaded instead of the default OpenGL driver.");
def->min = 0;
#endif /* _MSC_VER */
}
const CLIActionsConfigDef cli_actions_config_def;

View file

@ -207,12 +207,20 @@ int wmain(int argc, wchar_t **argv)
std::vector<wchar_t*> argv_extended;
argv_extended.emplace_back(argv[0]);
// Here one may push some additional parameters based on the wrapper type.
for (int i = 1; i < argc; ++ i)
bool force_mesa = false;
for (int i = 1; i < argc; ++ i) {
if (wcscmp(argv[i], L"--sw-renderer") == 0)
force_mesa = true;
else if (wcscmp(argv[i], L"--no-sw-renderer") == 0)
force_mesa = false;
argv_extended.emplace_back(argv[i]);
}
argv_extended.emplace_back(nullptr);
OpenGLVersionCheck opengl_version_check;
bool load_mesa =
// Forced from the command line.
force_mesa ||
// Running over a rempote desktop, and the RemoteFX is not enabled, therefore Windows will only provide SW OpenGL 1.1 context.
// In that case, use Mesa.
::GetSystemMetrics(SM_REMOTESESSION) ||
@ -267,5 +275,5 @@ int wmain(int argc, wchar_t **argv)
return -1;
}
// argc minus the trailing nullptr of the argv
return slic3r_main(argv_extended.size() - 1, argv_extended.data());
return slic3r_main((int)argv_extended.size() - 1, argv_extended.data());
}