mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2026-09-21 04:35:21 -04:00
remove(renderer): Krypton Wrapper
Since we have SFPEW now, we can drop gl4es, yayy Replaces all the old fallback logic to gl4es to instead SFPEW/MobileGlues
This commit is contained in:
1 parent
474cbae769
commit
e0daa42b40
5 files changed
+21
-28
No files matched your search
Binary file not shown.
@@ -457,29 +457,17 @@ public class MainActivity extends BaseActivity implements ControlButtonMenuListe
|
||||
// FIXME: Automatic detection should be based on provided hint GLFW_CONTEXT_VERSION_MAJOR and GLFW_CONTEXT_VERSION_MINOR
|
||||
// Autoselect renderer
|
||||
boolean hasAngelica = hasMods("angelica");
|
||||
if (Tools.LOCAL_RENDERER == null) {
|
||||
// Preferably we could detect when it is modded and swap to zink however that would also
|
||||
// cover optifine and vanilla+ configurations which are relatively common, degrading their
|
||||
// experience for no reason. We will compromise with just having users do it themselves.
|
||||
Tools.LOCAL_RENDERER = "opengles2";
|
||||
// MobileGlues becomes available post 1.17. It has superior compatibility with mods
|
||||
// while having fairly similar performance compared to GL4ES-based forks.
|
||||
if(assetVersion.matches("\\d+") || // Should match all digits, which is the modern assetVersioning
|
||||
"1.17".equals(assetVersion) ||
|
||||
"1.18".equals(assetVersion) ||
|
||||
"1.19".equals(assetVersion) ||
|
||||
// Angelica gives us GL3.3core on 1.7.10.
|
||||
hasAngelica) Tools.LOCAL_RENDERER = "opengles_mobileglues";
|
||||
}
|
||||
if (Tools.LOCAL_RENDERER == null) Tools.LOCAL_RENDERER = "opengles_mobileglues";
|
||||
// Angelica IS the FPE emulator
|
||||
if (hasAngelica) Tools.useSFPEW = false;
|
||||
|
||||
// This only happens if an old renderer that was selected is removed. Uses renderer_values
|
||||
// as the list of priority to use, highest to lowest.
|
||||
if(!Tools.checkRendererCompatible(this, Tools.LOCAL_RENDERER)) {
|
||||
Tools.RenderersList renderersList = Tools.getCompatibleRenderers(this);
|
||||
String firstCompatibleRenderer = renderersList.rendererIds.get(0);
|
||||
Log.w("runCraft","Incompatible renderer "+Tools.LOCAL_RENDERER+ " will be replaced with "+firstCompatibleRenderer);
|
||||
Log.i("runCraft","Missing renderer "+Tools.LOCAL_RENDERER+ " will be replaced with "+firstCompatibleRenderer);
|
||||
Tools.LOCAL_RENDERER = firstCompatibleRenderer;
|
||||
runOnUiThread(() -> Toast.makeText(this, R.string.autorendererselectfailed, Toast.LENGTH_LONG).show());
|
||||
Tools.releaseRenderersCache();
|
||||
}
|
||||
|
||||
|
||||
@@ -1754,6 +1754,7 @@ public final class Tools {
|
||||
boolean deviceHasOpenGLES3 = JREUtils.getDetectedVersion() >= 3;
|
||||
// LTW is an optional proprietary dependency
|
||||
boolean appHasLtw = new File(Tools.NATIVE_LIB_DIR, "libltw.so").exists();
|
||||
boolean appHasKw = new File(Tools.NATIVE_LIB_DIR, "libng_gl4es.so").exists();
|
||||
List<String> rendererIds = new ArrayList<>(defaultRenderers.length);
|
||||
List<String> rendererNames = new ArrayList<>(defaultRendererNames.length);
|
||||
for(int i = 0; i < defaultRenderers.length; i++) {
|
||||
@@ -1761,6 +1762,7 @@ public final class Tools {
|
||||
if(rendererId.contains("vulkan") && !deviceHasVulkan) continue;
|
||||
if(rendererId.contains("vulkan_zink") && !deviceHasOSMesaZinkBinary) continue;
|
||||
if(rendererId.contains("ltw") && (!deviceHasOpenGLES3 || !appHasLtw)) continue;
|
||||
if(rendererId.contains("opengles2") && (!deviceHasOpenGLES3 || !appHasKw)) continue;
|
||||
rendererIds.add(rendererId);
|
||||
rendererNames.add(defaultRendererNames[i]);
|
||||
}
|
||||
|
||||
@@ -541,8 +541,8 @@ public class JREUtils {
|
||||
case "opengles3_ltw" : renderLibrary = "libltw.so"; break;
|
||||
case "opengles_nothing" : renderLibrary = "libSimpleFPEWrapper.so"; break; // Literally nothing, so assume SFPEW
|
||||
default:
|
||||
Log.w("RENDER_LIBRARY", "No renderer selected, defaulting to opengles2");
|
||||
renderLibrary = "libng_gl4es.so";
|
||||
Log.w("RENDER_LIBRARY", "No renderer selected, defaulting to opengles_mobileglues");
|
||||
renderLibrary = "libmobileglues.so";
|
||||
break;
|
||||
}
|
||||
// Has to run before dlopening mobileglues
|
||||
@@ -556,14 +556,17 @@ public class JREUtils {
|
||||
}
|
||||
|
||||
if (!dlopen(renderLibrary) && !dlopen(findInLdLibPath(renderLibrary))) {
|
||||
Log.e("RENDER_LIBRARY","Failed to load renderer " + renderLibrary + ". Falling back to Krypton Wrapper");
|
||||
LOCAL_RENDERER = "opengles2";
|
||||
renderLibrary = "libng_gl4es.so";
|
||||
dlopen(NATIVE_LIB_DIR + "/libng_gl4es.so");
|
||||
Log.e("RENDER_LIBRARY","Failed to load renderer " + renderLibrary + ". Falling back to SFPEW/MobileGlues");
|
||||
LOCAL_RENDERER = "opengles_mobileglues";
|
||||
renderLibrary = "libmobileglues.so";
|
||||
dlopen(NATIVE_LIB_DIR + "/libmobileglues.so");
|
||||
}
|
||||
|
||||
// The final switch for using SFPEW. Don't use with gl4es, that's pretty dumb.
|
||||
if (Tools.useSFPEW && !renderLibrary.contains("gl4es")) {
|
||||
// The final switch for using SFPEW.
|
||||
// Don't use with gl4es, they're both doing the same thing.
|
||||
// Don't use with Zink, it also does the same thing.
|
||||
boolean renderLibraryShouldUseSFPEW = !renderLibrary.contains("gl4es") || !LOCAL_RENDERER.contains("zink");
|
||||
if (Tools.useSFPEW && renderLibraryShouldUseSFPEW) {
|
||||
renderLibrary = "libSimpleFPEWrapper.so";
|
||||
}
|
||||
return renderLibrary;
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
<resources>
|
||||
<string-array name="renderer">
|
||||
<item name="0">@string/mcl_setting_renderer_ng_gl4es</item>
|
||||
<item name="0">@string/mcl_setting_renderer_nothing</item>
|
||||
<item name="0">@string/mcl_setting_renderer_mobileglues</item>
|
||||
<item name="1">@string/mcl_setting_renderer_vulkan_kopper_zink</item>
|
||||
<item name="2">@string/mcl_setting_renderer_vulkan_zink</item>
|
||||
<item name="3">@string/mcl_setting_renderer_mobileglues</item>
|
||||
<item name="3">@string/mcl_setting_renderer_nothing</item>
|
||||
<item name="4">@string/mcl_setting_renderer_ltw</item>
|
||||
</string-array>
|
||||
|
||||
@@ -39,10 +39,10 @@
|
||||
|
||||
<string-array name="renderer_values">
|
||||
<item>opengles2</item> <!-- BZLZHH/NG-GL4ES (Krypton Wrapper) -->
|
||||
<item>opengles_nothing</item> <!-- System GLES driver -->
|
||||
<item>opengles_mobileglues</item>
|
||||
<item>opengles3_desktopgl_zink_kopper</item> <!-- Swung's Kopper Zink backport to 23.0.4 -->
|
||||
<item>vulkan_zink</item> <!-- osmesa 23.0.4 -->
|
||||
<item>opengles_mobileglues</item>
|
||||
<item>opengles_nothing</item> <!-- System GLES driver -->
|
||||
<item>opengles3_ltw</item>
|
||||
</string-array>
|
||||
<string-array name="download_source_names">
|
||||
|
||||
Reference in new issue
Block a user