diff --git a/src/main/cpp/config/gpu_utils.c b/src/main/cpp/config/gpu_utils.c index 2266413..1b560e3 100644 --- a/src/main/cpp/config/gpu_utils.c +++ b/src/main/cpp/config/gpu_utils.c @@ -66,15 +66,15 @@ const char* getGPUInfo() { return renderer; } -int isAdreno740() { - const char* gpu = getGPUInfo(); +int isAdreno740(const char* gpu) { +// const char* gpu = getGPUInfo(); if (!gpu) return 0; return strstr(gpu, "Adreno") && strstr(gpu, "740"); } -int isAdreno830() { - const char* gpu = getGPUInfo(); +int isAdreno830(const char* gpu) { +// const char* gpu = getGPUInfo(); if (!gpu) return 0; return strstr(gpu, "Adreno") && strstr(gpu, "830"); diff --git a/src/main/cpp/config/gpu_utils.h b/src/main/cpp/config/gpu_utils.h index 9a02a8b..0f79161 100644 --- a/src/main/cpp/config/gpu_utils.h +++ b/src/main/cpp/config/gpu_utils.h @@ -5,9 +5,11 @@ #ifndef MOBILEGLUES_PLUGIN_GPU_UTILS_H #define MOBILEGLUES_PLUGIN_GPU_UTILS_H -int isAdreno740(); +const char* getGPUInfo(); -int isAdreno830(); +int isAdreno740(const char* gpu); + +int isAdreno830(const char* gpu); int hasVulkan13(); diff --git a/src/main/cpp/config/settings.c b/src/main/cpp/config/settings.c index e58a917..50766f1 100644 --- a/src/main/cpp/config/settings.c +++ b/src/main/cpp/config/settings.c @@ -53,12 +53,17 @@ void init_settings() { enableExtComputeShader = 0; } + const char* gpu = getGPUInfo(); + LOG_D("GPU: %s", gpu); + if (enableANGLE == 1) { - global_settings.angle = (isAdreno740() || !hasVulkan13()) ? 0 : 1; + global_settings.angle = (isAdreno740(gpu) || !hasVulkan13()) ? 0 : 1; } else if (enableANGLE == 2 || enableANGLE == 3) { global_settings.angle = enableANGLE - 2; } else { - global_settings.angle = isAdreno830() ? 1 : 0; + int is830 = isAdreno830(gpu); + LOG_D("Is Adreno 830? = %s", is830 ? "true" : "false") + global_settings.angle = is830 ? 1 : 0; } if (global_settings.angle) { setenv("LIBGL_GLES", "libGLESv2_angle.so", 1); diff --git a/src/main/cpp/main.c b/src/main/cpp/main.c index 8957158..04c079a 100644 --- a/src/main/cpp/main.c +++ b/src/main/cpp/main.c @@ -57,10 +57,12 @@ void show_copyright() { void load_libs(); void proc_init() { init_config(); - init_settings(); clear_log(); start_log(); + + init_settings(); + LOG_V("Initializing %s ...", RENDERERNAME); show_copyright();