[Fix] (Init): allow MobileGL initialization with LIBGL_ALWAYS_SOFTWARE

This commit is contained in:
2026-10-05 02:55:35 -04:00
parent f5b8fe48aa
commit 918d40dd4f
2 changed files with 6 additions and 17 deletions
-12
View File
@@ -238,18 +238,6 @@ namespace MobileGL {
#endif
return true;
}
#if defined(__linux__) && !defined(__ANDROID__)
// LIBGL_ALWAYS_SOFTWARE is how a process (or whoever launched it) asks the system's GL for a
// software renderer. MobileGL is a GPU forwarder, so it steps aside and lets the system's
// other implementation give the process what it asked for.
{
String software;
if (MG_ConfigLoader::LookupSetting("LIBGL_ALWAYS_SOFTWARE", software) && !software.empty() &&
software != "0" && software != "false") {
return false;
}
}
#endif
#if MOBILEGL_BUILD_DISAGGREGATED
// Not yet: the bring-up would dial the configured server and wait for it. Ask first.
return MG_Remote::Client::ConfiguredServerAvailable();
+6 -5
View File
@@ -322,12 +322,13 @@ namespace {
EXPECT_EQ(r.glxLoaded, 1);
EXPECT_EQ(r.clientQueries, 1);
// A process that asked for software rendering is left to the system's other GL, server or not.
// Mesa's software-renderer selection must not disable MobileGL's EGL/GLX entry points.
const EntryReport software = RunEntryPoints(server.endpoint, logBase, true);
EXPECT_EQ(software.vendorDisplay, 0);
EXPECT_EQ(software.getDisplay, 0);
EXPECT_EQ(software.vendorDevices, 0);
EXPECT_EQ(software.glxLoaded, 0);
EXPECT_EQ(software.vendorDisplay, 1);
EXPECT_EQ(software.getDisplay, 1);
EXPECT_EQ(software.vendorDevices, 1);
EXPECT_EQ(software.glxLoaded, 1);
EXPECT_EQ(software.clientQueries, 1);
std::error_code ec;
std::filesystem::remove(Debug::RoleLogPath(logBase.c_str(), Debug::LogRole::Client), ec);
}