From a55520b5a2672beabf115b733c461621b4e7e585 Mon Sep 17 00:00:00 2001 From: "jun.zhang" Date: Wed, 16 Apr 2025 16:12:53 +0800 Subject: [PATCH] FIX: windows remote rendering jira: github-6536 Change-Id: I6ddb4aad1a9c7db80258b5fc0d872555c8be2d7c (cherry picked from commit 5492a12310daa014818fb2e9ae0e4493fc6b755e) --- src/BambuStudio_app_msvc.cpp | 18 +++++++----------- src/slic3r/GUI/OpenGLManager.cpp | 2 +- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/BambuStudio_app_msvc.cpp b/src/BambuStudio_app_msvc.cpp index c811f0565..242c6070b 100644 --- a/src/BambuStudio_app_msvc.cpp +++ b/src/BambuStudio_app_msvc.cpp @@ -211,14 +211,13 @@ extern "C" { #ifdef SLIC3R_GUI // Here one may push some additional parameters based on the wrapper type. bool force_mesa = false; - bool force_hw = false;//for rempote desktop, #endif /* SLIC3R_GUI */ for (int i = 1; i < argc; ++i) { #ifdef SLIC3R_GUI if (wcscmp(argv[i], L"--sw-renderer") == 0) force_mesa = true; else if (wcscmp(argv[i], L"--no-sw-renderer") == 0) - force_hw = true; + force_mesa = false; #endif /* SLIC3R_GUI */ argv_extended.emplace_back(argv[i]); } @@ -228,9 +227,6 @@ extern "C" { 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) && !force_hw) || // Try to load the default OpenGL driver and test its context version. !opengl_version_check.load_opengl_dll() || !opengl_version_check.is_version_greater_or_equal_to(3, 2); #endif /* SLIC3R_GUI */ @@ -253,13 +249,13 @@ extern "C" { return -1; } else { - wchar_t path_to_mesa[MAX_PATH + 1] = { 0 }; - wcscpy(path_to_mesa, path_to_exe); - wcscat(path_to_mesa, L"mesa\\opengl32.dll"); - printf("Loading MESA OpenGL library: %S\n", path_to_mesa); - HINSTANCE hInstance_OpenGL = LoadLibraryExW(path_to_mesa, nullptr, 0); + wchar_t path_to_mesa[MAX_PATH + 1] = { 0 }; + wcscpy(path_to_mesa, path_to_exe); + wcscat(path_to_mesa, L"mesa\\opengl32.dll"); + printf("Loading MESA OpenGL library: %S\n", path_to_mesa); + HINSTANCE hInstance_OpenGL = LoadLibraryExW(path_to_mesa, nullptr, 0); if (hInstance_OpenGL == nullptr) - printf("MESA OpenGL library was not loaded\n"); + printf("MESA OpenGL library was not loaded\n"); else printf("MESA OpenGL library was loaded sucessfully\n"); } diff --git a/src/slic3r/GUI/OpenGLManager.cpp b/src/slic3r/GUI/OpenGLManager.cpp index 48602c6d2..13e7d06cf 100644 --- a/src/slic3r/GUI/OpenGLManager.cpp +++ b/src/slic3r/GUI/OpenGLManager.cpp @@ -1,4 +1,4 @@ -#include "libslic3r/libslic3r.h" +#include "libslic3r/libslic3r.h" #include "OpenGLManager.hpp" #include "GUI.hpp"