Skip to content

Commit

Permalink
fix libOSMesa loading
Browse files Browse the repository at this point in the history
reverts convenience name change
  • Loading branch information
SolDev69 committed Jan 2, 2024
1 parent d6c0dd9 commit 87c5194
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ public static void setJavaEnvironment(Activity activity, String jreHome) throws
envMap.put("POJAVEXEC_OSMESA", "libOSMesa_pan.so");
}
if(LOCAL_RENDERER.equals("adrhw_freedreno") || LOCAL_RENDERER.equals("swrast") || LOCAL_RENDERER.equals("virgl")) {
envMap.put("POJAVEXEC_OSMESA", "libOSMesa.so.8.0.0");
envMap.put("POJAVEXEC_OSMESA", "libOSMesa.so");
}
}
if(LauncherPreferences.PREF_BIG_CORE_AFFINITY) envMap.put("POJAV_BIG_CORE_AFFINITY", "1");
Expand Down Expand Up @@ -463,7 +463,7 @@ public static String loadGraphicsLibrary(){
case "swrast":
case "virgl":
case "adrhw_freedreno":
renderLibrary = "libOSMesa.so.8.0.0"; break;
renderLibrary = "libOSMesa.so"; break;
case "opengles3_desktopgl_angle_vulkan" : renderLibrary = "libtinywrapper.so"; break;
case "opengles3_desktopgl_angle_vulkan_new" : renderLibrary = "libtinywrapper_new_angle.so"; break;
default:
Expand Down
6 changes: 3 additions & 3 deletions app_pojavlauncher/src/main/jni/ctxbridges/osmesa_loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ void (*glReadPixels_p) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum

void dlsym_OSMesa() {
char* main_osm_libname = getenv("POJAVEXEC_OSMESA");
if(main_osm_libname == NULL) main_osm_libname = "libOSMesa.so.8.0.0";
if(main_osm_libname == NULL) main_osm_libname = "libOSMesa.so";
char* main_path = NULL;
char* alt_path = NULL;
if(asprintf(&main_path, "%s/%s", getenv("POJAV_NATIVEDIR"), main_osm_libname) == -1 ||
asprintf(&alt_path, "%s/libOSMesa.so.8.0.0.8", getenv("POJAV_NATIVEDIR")) == -1) {
asprintf(&alt_path, "%s/libOSMesa.so.8", getenv("POJAV_NATIVEDIR")) == -1) {
abort();
}
void* dl_handle = NULL;
Expand All @@ -43,4 +43,4 @@ void dlsym_OSMesa() {
glClear_p = dlsym(dl_handle,"glClear");
glFinish_p = dlsym(dl_handle,"glFinish");
glReadPixels_p = dlsym(dl_handle,"glReadPixels");
}
}

0 comments on commit 87c5194

Please sign in to comment.