Revert "[Fix] (...): Skip external libraries loading for MG_Test and MG_Bench."

This reverts commit da0e326534.
This commit is contained in:
BZLZHH
2026-01-01 10:49:01 +08:00
parent e298e5be51
commit 876195de80
10 changed files with 13 additions and 18 deletions
+3 -2
View File
@@ -14,12 +14,13 @@
#include <MG_Impl/GLImpl/Framebuffer/GL_Framebuffer.h> #include <MG_Impl/GLImpl/Framebuffer/GL_Framebuffer.h>
namespace MobileGL { namespace MobileGL {
void MG_Initialize(Bool loadExternalLibraries) { void MG_Initialize() {
MG_Util::Debug::InitFile(); MG_Util::Debug::InitFile();
MGLOG_I("Initializing MobileGL..."); MGLOG_I("Initializing MobileGL...");
MG_State::Init(); MG_State::Init();
MGLOG_D("MobileGL State initialized"); MGLOG_D("MobileGL State initialized");
MG_Backend::Init(loadExternalLibraries); // return;
MG_Backend::Init();
MGLOG_D("MobileGL Backend initialized"); MGLOG_D("MobileGL Backend initialized");
MG_Impl::Init(); MG_Impl::Init();
MGLOG_D("MobileGL Implementation initialized"); MGLOG_D("MobileGL Implementation initialized");
+1 -1
View File
@@ -9,6 +9,6 @@
#include "Includes.h" #include "Includes.h"
namespace MobileGL { namespace MobileGL {
void MG_Initialize(Bool loadExternalLibraries = true); void MG_Initialize();
void MG_Destroy(); void MG_Destroy();
} // namespace MobileGL } // namespace MobileGL
+1 -1
View File
@@ -85,6 +85,6 @@ namespace MobileGL {
}; };
} // namespace DirectGLES } // namespace DirectGLES
void Init(Bool loadExternalLibraries); void Init();
} // namespace MG_Backend } // namespace MG_Backend
} // namespace MobileGL } // namespace MobileGL
+1 -7
View File
@@ -53,7 +53,7 @@ namespace MobileGL {
#endif #endif
} }
void Init(Bool loadExternalLibraries) { void Init() {
MGLOG_D("Initializing MobileGL Backend..."); MGLOG_D("Initializing MobileGL Backend...");
#if MOBILEGL_BACKEND == MOBILEGL_BACKEND_DILIGENT #if MOBILEGL_BACKEND == MOBILEGL_BACKEND_DILIGENT
@@ -73,12 +73,6 @@ namespace MobileGL {
MG_Config::RendererInfoPtr = MakeUnique<RendererInfo>(Unknown::RendererInfoUnknown); MG_Config::RendererInfoPtr = MakeUnique<RendererInfo>(Unknown::RendererInfoUnknown);
#endif #endif
if (!loadExternalLibraries) {
MGLOG_W("Skipping external library loading. Calling functions that call external libraries may cause "
"crashes.");
return;
}
InitSpecificBackendLibs(); InitSpecificBackendLibs();
LogBackendInfo(); LogBackendInfo();
} }
+2 -2
View File
@@ -60,7 +60,7 @@ static void BM_CreateBufferObjectsAndBindBuffer(benchmark::State& state) {
BENCHMARK(BM_CreateBufferObjectsAndBindBuffer)->Unit(benchmark::kMillisecond)->UseRealTime(); BENCHMARK(BM_CreateBufferObjectsAndBindBuffer)->Unit(benchmark::kMillisecond)->UseRealTime();
static void BM_DeleteBufferObjects(benchmark::State& state) { static void BM_DeleteBufferObjects(benchmark::State& state) {
MG_Initialize(false); MG_Initialize();
std::vector<GLuint> buffers(BUFFER_COUNT); std::vector<GLuint> buffers(BUFFER_COUNT);
for (auto _ : state) { for (auto _ : state) {
@@ -178,7 +178,7 @@ static void BM_UpdateDataPartially(benchmark::State& state) {
BENCHMARK(BM_UpdateDataPartially)->Unit(benchmark::kMillisecond)->UseRealTime(); BENCHMARK(BM_UpdateDataPartially)->Unit(benchmark::kMillisecond)->UseRealTime();
int main(int argc, char** argv) { int main(int argc, char** argv) {
MG_Initialize(false); MG_Initialize();
benchmark ::MaybeReenterWithoutASLR(argc, argv); benchmark ::MaybeReenterWithoutASLR(argc, argv);
char arg0_default[] = "benchmark"; char arg0_default[] = "benchmark";
char* args_default = reinterpret_cast<char*>(arg0_default); char* args_default = reinterpret_cast<char*>(arg0_default);
@@ -220,7 +220,7 @@ static void BM_CompileAndLink(benchmark::State& state) {
BENCHMARK(BM_CompileAndLink)->Unit(benchmark::kMillisecond); BENCHMARK(BM_CompileAndLink)->Unit(benchmark::kMillisecond);
int main(int argc, char** argv) { int main(int argc, char** argv) {
MG_Initialize(false); MG_Initialize();
benchmark ::MaybeReenterWithoutASLR(argc, argv); benchmark ::MaybeReenterWithoutASLR(argc, argv);
char arg0_default[] = "benchmark"; char arg0_default[] = "benchmark";
char* args_default = reinterpret_cast<char*>(arg0_default); char* args_default = reinterpret_cast<char*>(arg0_default);
+1 -1
View File
@@ -18,7 +18,7 @@ using namespace MobileGL;
class BufferTest : public ::testing::Test { class BufferTest : public ::testing::Test {
protected: protected:
void SetUp() override { MobileGL::MG_Initialize(false); } void SetUp() override { MobileGL::MG_Initialize(); }
void TearDown() override {} void TearDown() override {}
}; };
+1 -1
View File
@@ -17,7 +17,7 @@ using namespace MobileGL::MG_Impl::GLImpl;
class ProgramTest : public ::testing::Test { class ProgramTest : public ::testing::Test {
protected: protected:
void SetUp() override { MobileGL::MG_Initialize(false); } void SetUp() override { MobileGL::MG_Initialize(); }
void TearDown() override {} void TearDown() override {}
}; };
+1 -1
View File
@@ -18,7 +18,7 @@ using namespace MobileGL;
class ProgramUtilTest : public ::testing::Test { class ProgramUtilTest : public ::testing::Test {
protected: protected:
void SetUp() override { MobileGL::MG_Initialize(false); } void SetUp() override { MobileGL::MG_Initialize(); }
void TearDown() override {} void TearDown() override {}
}; };
@@ -32,7 +32,7 @@ protected:
return vbo; return vbo;
} }
void SetUp() override { MobileGL::MG_Initialize(false); } void SetUp() override { MobileGL::MG_Initialize(); }
void TearDown() override {} void TearDown() override {}
}; };