[Android] Fix the check for the Qualcomm graphics driver version for v53 drivers with the screen being rotated 90 degrees. Initialize the OpenGL information grabbing only once. Check for v14 Qualcomm drivers and spit out an error if the user tries selecting OpenGL ES 3.

This commit is contained in:
Ryan Houdek 2013-11-24 22:45:48 -06:00
parent da3eef1019
commit 7ed8e6a29c
3 changed files with 47 additions and 11 deletions

View File

@ -29,6 +29,7 @@
<!-- Game List Activity - Device Compatibility AlertDialog -->
<string name="device_compat_warning">デバイスの互換性の警告</string>
<string name="device_compat_warning_msg">この電話は、NEON拡張をサポートしていません。 おそらくDolphinを実行することはできません。\nあなたはとにかくそれを実行してみますか</string>
<string name="device_gles3compat_warning_msg">デバイスはOpenGLES3のビデオドライバのバグがあります。\nあなたはとにかくそれを使用してみたいのですか</string>
<!-- Game List Fragment -->
<string name="file_clicked">クリックされたファイル: %1$s</string>

View File

@ -29,6 +29,7 @@
<!-- Game List Activity - Device Compatibility AlertDialog -->
<string name="device_compat_warning">Device Compatibility Warning</string>
<string name="device_compat_warning_msg">Your phone doesn\'t support NEON which makes it incapable of running Dolphin Mobile?\nDo you want to try anyway?</string>
<string name="device_gles3compat_warning_msg">Your device has known buggy video drivers for OpenGL ES 3.\nDo you want to try anyway?</string>
<!-- Game List Fragment -->
<string name="file_clicked">File clicked: %1$s</string>

View File

@ -7,6 +7,8 @@
package org.dolphinemu.dolphinemu.settings;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
import android.os.Bundle;
@ -29,6 +31,7 @@ public final class VideoSettingsFragment extends PreferenceFragment
public static String m_GLRenderer;
public static String m_GLExtensions;
public static float m_QualcommVersion;
public static boolean m_Inited = false;
private Activity m_activity;
/**
@ -147,20 +150,24 @@ public final class VideoSettingsFragment extends PreferenceFragment
*/
public static boolean SupportsGLES3()
{
VersionCheck mbuffer = new VersionCheck();
m_GLVersion = mbuffer.getVersion();
m_GLVendor = mbuffer.getVendor();
m_GLRenderer = mbuffer.getRenderer();
m_GLExtensions = mbuffer.getExtensions();
boolean mSupportsGLES3 = false;
if (!m_Inited)
{
VersionCheck mbuffer = new VersionCheck();
m_GLVersion = mbuffer.getVersion();
m_GLVendor = mbuffer.getVendor();
m_GLRenderer = mbuffer.getRenderer();
m_GLExtensions = mbuffer.getExtensions();
m_Inited = true;
}
// Check for OpenGL ES 3 support (General case).
if (m_GLVersion != null && m_GLVersion.contains("OpenGL ES 3.0"))
mSupportsGLES3 = true;
// Checking for OpenGL ES 3 support for certain Qualcomm devices.
if (!mSupportsGLES3 && m_GLVendor != null && m_GLVendor.equals("Qualcomm"))
if (m_GLVendor != null && m_GLVendor.equals("Qualcomm"))
{
if (m_GLRenderer.contains("Adreno (TM) 3"))
{
@ -182,6 +189,7 @@ public final class VideoSettingsFragment extends PreferenceFragment
mSupportsGLES3 = true;
}
}
return mSupportsGLES3;
}
@ -253,10 +261,36 @@ public final class VideoSettingsFragment extends PreferenceFragment
}
else if (preference.getString(key, "Software Renderer").equals("OGL"))
{
mainScreen.getPreference(0).setEnabled(true);
mainScreen.getPreference(1).setEnabled(true);
mainScreen.getPreference(3).setEnabled(true);
//mainScreen.getPreference(4).setEnabled(false);
// Create an alert telling them that their phone sucks
if (VideoSettingsFragment.SupportsGLES3()
&& VideoSettingsFragment.m_GLVendor != null
&& VideoSettingsFragment.m_GLVendor.equals("Qualcomm")
&& VideoSettingsFragment.m_QualcommVersion == 14.0f)
{
AlertDialog.Builder builder = new AlertDialog.Builder(m_activity);
builder.setTitle(R.string.device_compat_warning);
builder.setMessage(R.string.device_gles3compat_warning_msg);
builder.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
mainScreen.getPreference(0).setEnabled(true);
mainScreen.getPreference(1).setEnabled(true);
mainScreen.getPreference(3).setEnabled(true);
//mainScreen.getPreference(4).setEnabled(false);
}
});
builder.setNegativeButton(R.string.no, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which)
{
// Get an editor.
SharedPreferences.Editor editor = sPrefs.edit();
editor.putString("gpuPref", "Software Renderer");
editor.commit();
videoBackends.setValue("Software Renderer");
videoBackends.setSummary("Software Renderer");
}
});
builder.show();
}
}
}
}