Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Snapdragon launch with 1.17+ forge loader crash on Zink renderer #5905

Open
wants to merge 2 commits into
base: v3_openjdk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ public static void setJavaEnvironment(Activity activity, String jreHome) throws
envMap.put("allow_higher_compat_version", "true");
envMap.put("allow_glsl_extension_directive_midshader", "true");
envMap.put("MESA_LOADER_DRIVER_OVERRIDE", "zink");
envMap.put("VTEST_SOCKET_NAME", new File(Tools.DIR_CACHE, ".virgl_test").getAbsolutePath());

envMap.put("LD_LIBRARY_PATH", LD_LIBRARY_PATH);
envMap.put("PATH", jreHome + "/bin:" + Os.getenv("PATH"));
Expand Down
9 changes: 7 additions & 2 deletions app_pojavlauncher/src/main/jni/ctxbridges/osm_bridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ static const char* g_LogTag = "GLBridge";
static __thread osm_render_window_t* currentBundle;
// a tiny buffer for rendering when there's nowhere t render
static char no_render_buffer[4];
static bool hasSetNoRendererBuffer = false;

// Its not in a .h file because it is not supposed to be used outsife of this file.
void setNativeWindowSwapInterval(struct ANativeWindow* nativeWindow, int swapInterval);
Expand Down Expand Up @@ -105,7 +106,11 @@ void osm_make_current(osm_render_window_t* bundle) {
osm_swap_surfaces(bundle);
if(hasSetMainWindow) pojav_environ->mainWindowBundle->state = STATE_RENDERER_ALIVE;
}
osm_set_no_render_buffer(&bundle->buffer);
if (!hasSetNoRendererBuffer)
{
osm_set_no_render_buffer(&bundle->buffer);
hasSetNoRendererBuffer = true;
}
osm_apply_current_ll();
OSMesaPixelStore_p(OSMESA_Y_UP,0);
}
Expand Down Expand Up @@ -140,4 +145,4 @@ void osm_swap_interval(int swapInterval) {
if(pojav_environ->mainWindowBundle != NULL && pojav_environ->mainWindowBundle->nativeSurface != NULL) {
setNativeWindowSwapInterval(pojav_environ->mainWindowBundle->nativeSurface, swapInterval);
}
}
}