remove(Settings/MobileGlues): Multidraw emulation option

I cannot be bothered to add in the benchmarker the plugin has nor the
options for it. We're deprecating this soon anyway for MobileGL
This commit is contained in:
tomikun committed 2026-09-02 12:32:02 +08:00
1 parent 90668f7838
commit 6b7bedeb48
5 files changed
+28 -85

No files matched your search

@@ -253,9 +253,6 @@ public class LauncherPreferences {
MGConfigJson.put("angleDepthClearFixMode", angleDepthClearFixMode);
MGConfigJson.put("enableExtTimerQuery", timerQueryExt);
MGConfigJson.put("enableExtDirectStateAccess", dsaExt);
if (DEFAULT_PREF.getBoolean("mg_renderer_multidrawCompute", false)) {
MGConfigJson.put("multidrawMode", 5); // Special handling for the (special mayhaps) compute emulation
} else MGConfigJson.put("multidrawMode", Integer.parseInt(DEFAULT_PREF.getString("mg_renderer_setting_multidraw", "0")));
MGConfigJson.put("maxGlslCacheSize", Integer.parseInt(DEFAULT_PREF.getString("mg_renderer_setting_glsl_cache_size", "128")));
File configFile = new File(Tools.DIR_DATA + "/MobileGlues", "config.json");
FileUtils.ensureParentDirectory(configFile);
@@ -8,9 +8,6 @@ import android.text.Editable;
import android.text.TextWatcher;
import androidx.preference.EditTextPreference;
import androidx.preference.ListPreference;
import androidx.preference.Preference;
import androidx.preference.SwitchPreference;
import net.kdt.pojavlaunch.R;
@@ -18,69 +15,48 @@ import java.util.Objects;
public class LauncherPreferenceRendererSettingsFragment extends LauncherPreferenceFragment {
EditTextPreference GLSLCachePreference;
ListPreference MultiDrawEmulationPreference;
SwitchPreference ComputeMultiDrawPreference;
Preference.SummaryProvider MultiDrawSummaryProvider;
@Override
public void onCreatePreferences(Bundle b, String str) {
addPreferencesFromResource(R.xml.pref_renderer);
GLSLCachePreference = findPreference("mg_renderer_setting_glsl_cache_size");
ComputeMultiDrawPreference = findPreference("mg_renderer_multidrawCompute");
MultiDrawEmulationPreference = findPreference("mg_renderer_setting_multidraw");
GLSLCachePreference.setOnBindEditTextListener((editText) -> {
editText.setInputType(TYPE_CLASS_NUMBER);
editText.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
// Nothing, its boilerplate
}
@Override
public void afterTextChanged(Editable editable) {
// Nothing, its boilerplate
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
// This is just to handle the summary not updating when its above max int value
// Horrible I know.
if (editText.getText().toString().isEmpty()) {
editText.setText("0");
if (GLSLCachePreference != null) {
GLSLCachePreference.setOnBindEditTextListener((editText) -> {
editText.setInputType(TYPE_CLASS_NUMBER);
editText.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
// Nothing, its boilerplate
}
try {
if (Long.parseLong(editText.getText().toString()) <= Integer.MAX_VALUE) return;
} catch (NumberFormatException ignored) {}
editText.setError(requireContext().getText(R.string.error_invalid_value));
editText.setText(String.valueOf(Integer.MAX_VALUE));
}
@Override
public void afterTextChanged(Editable editable) {
// Nothing, its boilerplate
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
// This is just to handle the summary not updating when its above max int value
// Horrible I know.
if (editText.getText().toString().isEmpty()) {
editText.setText("0");
}
try {
if (Long.parseLong(editText.getText().toString()) <= Integer.MAX_VALUE) return;
} catch (NumberFormatException ignored) {}
editText.setError(requireContext().getText(R.string.error_invalid_value));
editText.setText(String.valueOf(Integer.MAX_VALUE));
}
});
});
});
}
updateGLSLCacheSummary(); // Just updates the summary with the value when user opens the menu. Yes it's out of place.
updateMultiDrawSummary(); // Same as above
}
@Override
public void onSharedPreferenceChanged(SharedPreferences p, String s) {
GLSLCachePreference = findPreference("mg_renderer_setting_glsl_cache_size");
updateGLSLCacheSummary();
updateMultiDrawSummary();
}
private void updateMultiDrawSummary() {
if (MultiDrawEmulationPreference != null) {
if (MultiDrawEmulationPreference.getSummaryProvider() != null) {
MultiDrawSummaryProvider = MultiDrawEmulationPreference.getSummaryProvider();
}
if (ComputeMultiDrawPreference.isChecked()) {
MultiDrawEmulationPreference.setEnabled(false);
MultiDrawEmulationPreference.setSummaryProvider(null);
MultiDrawEmulationPreference.setSummary("(Experimental) Compute");
} else if (MultiDrawEmulationPreference != null) {
MultiDrawEmulationPreference.setEnabled(true);
MultiDrawEmulationPreference.setSummaryProvider(MultiDrawSummaryProvider);
}
}
}
private void updateGLSLCacheSummary() {
@@ -64,21 +64,6 @@
<item>2</item>
<item>3</item>
</string-array>
<!--TODO: Make this translatable-->
<string-array name="mg_renderer_names_multidraw">
<item>Auto</item>
<item>Prefer Indirect</item>
<item>Prefer BaseVertex</item>
<item>Prefer MultiDraw Indirect</item>
<item>Force DrawElements</item>
</string-array>
<string-array name="mg_renderer_values_multidraw">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
</string-array>
<string-array name="mg_renderer_names_errorSetting">
<item>Auto</item>
<item>Don\'t ignore</item>
@@ -444,7 +444,6 @@
<string name="preference_renderer_mobileglues_settings">MobileGlues Renderer Settings</string>
<string name="mg_renderer_glsl_cache">Max GLSL cache size</string>
<string name="mg_renderer_angle">Use ANGLE as driver</string>
<string name="mg_renderer_multidraw">Multidraw emulation mode</string>
<string name="mg_renderer_title_errorSetting">Error Filtering</string>
<string name="mg_renderer_title_timerQueryExt">Disable GPU Utilization in F3 menu</string>
<string name="mg_renderer_summary_timerQueryExt">Fixes random crashes when F3 is open on some Mali devices</string>
@@ -456,8 +455,6 @@
<string name="mg_renderer_summary_gl43exts">May help with mod crashes. Disable if not needed, can cause crashes.</string>
<string name="mg_renderer_title_computeShaderext">Advertise Experimental Compute Shader extension</string>
<string name="mg_renderer_summary_computeShaderext">May help with shaderpack glitches. Disable if not needed, can cause crashes.</string>
<string name="mg_renderer_title_multidrawCompute">Use Compute Multidraw Emulation</string>
<string name="mg_renderer_summary_multidrawCompute">Uses compute shaders for multidraw emulation</string>
<string name="app_short_name" translatable="false">Amethyst</string>
<string name="demo_versions_supported">Only Vanilla 1.3.1 and above are supported on demo accounts</string>
<string name="demo_unsupported">Demo Profile not supported</string>
@@ -17,13 +17,6 @@
android:entries="@array/mg_renderer_names_angle"
android:entryValues="@array/mg_renderer_values_angle"
app2:useSimpleSummaryProvider="true"/>
<androidx.preference.ListPreference
android:title="@string/mg_renderer_multidraw"
android:key="mg_renderer_setting_multidraw"
android:defaultValue="0"
android:entries="@array/mg_renderer_names_multidraw"
android:entryValues="@array/mg_renderer_values_multidraw"
app2:useSimpleSummaryProvider="true"/>
<androidx.preference.ListPreference
android:title="@string/mg_renderer_title_errorSetting"
android:key="mg_renderer_setting_errorSetting"
@@ -54,11 +47,6 @@
android:summary="@string/mg_renderer_summary_dsaExt"
android:key="mg_renderer_dsaExt"
android:defaultValue="false" />
<SwitchPreference
android:title="@string/mg_renderer_title_multidrawCompute"
android:summary="@string/mg_renderer_summary_multidrawCompute"
android:key="mg_renderer_multidrawCompute"
android:defaultValue="false" />
</PreferenceCategory>
</PreferenceCategory>
</PreferenceScreen>