summaryrefslogtreecommitdiff
path: root/Source/Android/src
diff options
context:
space:
mode:
authorRyan Houdek <Sonicadvance1@gmail.com>2013-12-12 11:58:38 -0600
committerRyan Houdek <Sonicadvance1@gmail.com>2013-12-12 11:58:38 -0600
commit2a0adc3972f7fba5e1be8c2ff4430c7e2421663d (patch)
tree6f00666de06b3ac81841ac42037738e14d572145 /Source/Android/src
parent40b35343195f9759de703f67375f7af6ca34fc27 (diff)
[Android] Make our OpenGL ES 3 check in the UI less stupid.
Diffstat (limited to 'Source/Android/src')
-rw-r--r--Source/Android/src/org/dolphinemu/dolphinemu/settings/video/VideoSettingsFragment.java60
1 files changed, 31 insertions, 29 deletions
diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/settings/video/VideoSettingsFragment.java b/Source/Android/src/org/dolphinemu/dolphinemu/settings/video/VideoSettingsFragment.java
index 29a87b6fa2..f36a7d3ec7 100644
--- a/Source/Android/src/org/dolphinemu/dolphinemu/settings/video/VideoSettingsFragment.java
+++ b/Source/Android/src/org/dolphinemu/dolphinemu/settings/video/VideoSettingsFragment.java
@@ -29,6 +29,7 @@ public final class VideoSettingsFragment extends PreferenceFragment
public static String m_GLVendor;
public static String m_GLRenderer;
public static String m_GLExtensions;
+ public static boolean m_SupportsGLES3 = false;
public static float m_QualcommVersion;
public static boolean m_Inited = false;
@@ -120,8 +121,6 @@ public final class VideoSettingsFragment extends PreferenceFragment
private EGLConfig chooseConfig()
{
int[] attribList = new int[] {
- EGL10.EGL_DEPTH_SIZE, 0,
- EGL10.EGL_STENCIL_SIZE, 0,
EGL10.EGL_RED_SIZE, 8,
EGL10.EGL_GREEN_SIZE, 8,
EGL10.EGL_BLUE_SIZE, 8,
@@ -129,14 +128,25 @@ public final class VideoSettingsFragment extends PreferenceFragment
EGL10.EGL_NONE
};
- // No error checking performed, minimum required code to elucidate logic
- // Expand on this logic to be more selective in choosing a configuration
+ // Grab how many configs there are
int[] numConfig = new int[1];
mEGL.eglChooseConfig(mEGLDisplay, attribList, null, 0, numConfig);
int configSize = numConfig[0];
mEGLConfigs = new EGLConfig[configSize];
mEGL.eglChooseConfig(mEGLDisplay, attribList, mEGLConfigs, configSize, numConfig);
+ // Check if one config supports GLES3
+ for (int i = 0; i < configSize; ++i)
+ {
+ int[] value = new int[1];
+ boolean retval = mEGL.eglGetConfigAttrib(mEGLDisplay, mEGLConfigs[i], EGL10.EGL_RENDERABLE_TYPE, value);
+ if (retval && (value[0] & (1 << 6)) != 0)
+ {
+ m_SupportsGLES3 = true;
+ break;
+ }
+ }
+
return mEGLConfigs[0]; // Best match is probably the first configuration
}
}
@@ -148,7 +158,6 @@ public final class VideoSettingsFragment extends PreferenceFragment
*/
public static boolean SupportsGLES3()
{
- boolean mSupportsGLES3 = false;
if (!m_Inited)
{
VersionCheck mbuffer = new VersionCheck();
@@ -156,39 +165,32 @@ public final class VideoSettingsFragment extends PreferenceFragment
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 (m_GLVendor != null && m_GLVendor.equals("Qualcomm"))
- {
- if (m_GLRenderer.contains("Adreno (TM) 3"))
+ // Checking for OpenGL ES 3 support for certain Qualcomm devices.
+ if (m_GLVendor != null && m_GLVendor.equals("Qualcomm"))
{
- int mVStart = m_GLVersion.indexOf("V@") + 2;
- int mVEnd = 0;
-
- for (int a = mVStart; a < m_GLVersion.length(); ++a)
+ if (m_GLRenderer.contains("Adreno (TM) 3"))
{
- if (m_GLVersion.charAt(a) == ' ')
+ int mVStart = m_GLVersion.indexOf("V@") + 2;
+ int mVEnd = 0;
+
+ for (int a = mVStart; a < m_GLVersion.length(); ++a)
{
- mVEnd = a;
- break;
+ if (m_GLVersion.charAt(a) == ' ')
+ {
+ mVEnd = a;
+ break;
+ }
}
- }
-
- m_QualcommVersion = Float.parseFloat(m_GLVersion.substring(mVStart, mVEnd));
- if (m_QualcommVersion >= 14.0f)
- mSupportsGLES3 = true;
+ m_QualcommVersion = Float.parseFloat(m_GLVersion.substring(mVStart, mVEnd));
+ }
}
+
+ m_Inited = true;
}
- return mSupportsGLES3;
+ return m_SupportsGLES3;
}
@Override