mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-15 15:48:26 -04:00
VirGL: more changes for Android 7.0 support
This commit is contained in:
parent
3ee46f49c4
commit
401e092eee
@ -201,6 +201,7 @@ public class JREUtils {
|
||||
|
||||
public static void setJavaEnvironment(LoggableActivity ctx) throws Throwable {
|
||||
Map<String, String> envMap = new ArrayMap<>();
|
||||
envMap.put("POJAV_NATIVEDIR", ctx.getApplicationInfo().nativeLibraryDir);
|
||||
envMap.put("JAVA_HOME", Tools.DIR_HOME_JRE);
|
||||
envMap.put("HOME", Tools.DIR_GAME_NEW);
|
||||
envMap.put("TMPDIR", ctx.getCacheDir().getAbsolutePath());
|
||||
|
@ -719,17 +719,19 @@ void dlsym_OSMesa(void* dl_handle) {
|
||||
}
|
||||
|
||||
bool loadSymbols() {
|
||||
char* fileName;
|
||||
char* fileNameExt;
|
||||
char* fileName = calloc(1, 1024);
|
||||
char* fileNameExt = calloc(1, 1024);
|
||||
switch (config_renderer) {
|
||||
case RENDERER_VK_ZINK:
|
||||
fileName = "libOSMesa_8.so";
|
||||
fileNameExt = "libOSMesa.so.8";
|
||||
sprintf(fileName, "%s/libOSMesa_8.so", getenv("POJAV_NATIVEDIR"));
|
||||
sprintf(fileNameExt, "%s/libOSMesa.so.8", getenv("POJAV_NATIVEDIR"));
|
||||
break;
|
||||
case RENDERER_GL4ES:
|
||||
fileName = "libEGL.so";
|
||||
sprintf(fileName, "libEGL.so");
|
||||
char* eglLib = getenv("POJAVEXEC_EGL");
|
||||
fileNameExt = eglLib == NULL?"":eglLib;
|
||||
if (eglLib) {
|
||||
sprintf(fileNameExt, eglLib);
|
||||
}
|
||||
break;
|
||||
}
|
||||
void* dl_handle = dlopen(fileNameExt,RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE);
|
||||
@ -758,6 +760,9 @@ bool loadSymbols() {
|
||||
dlsym_EGL(dl_handle);
|
||||
break;
|
||||
}
|
||||
|
||||
free(fileName);
|
||||
free(fileNameExt);
|
||||
}
|
||||
|
||||
bool loadSymbolsVirGL() {
|
||||
@ -766,13 +771,19 @@ bool loadSymbolsVirGL() {
|
||||
config_renderer = RENDERER_VK_ZINK;
|
||||
loadSymbols();
|
||||
config_renderer = RENDERER_VIRGL;
|
||||
void *handle = dlopen("libvirgl_test_server.so", RTLD_LAZY);
|
||||
|
||||
char* fileName = calloc(1, 1024);
|
||||
|
||||
sprintf(fileName, "%s/libvirgl_test_server.so", getenv("POJAV_NATIVEDIR"));
|
||||
void *handle = dlopen(fileName, RTLD_LAZY);
|
||||
printf("VirGL: libvirgl_test_server = %p\n", handle);
|
||||
if (!handle) {
|
||||
printf("VirGL: %s\n", dlerror());
|
||||
}
|
||||
vtest_main_p = dlsym(handle, "vtest_main");
|
||||
vtest_swap_buffers_p = dlsym(handle, "vtest_swap_buffers");
|
||||
|
||||
free(fileName);
|
||||
}
|
||||
|
||||
int pojavInit() {
|
||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user