[ANDROID] Add two new DriverDetails bugs for Adreno. V45 of the driver has broken shader compilation with UBOs in the shaders, this is most likely fixed with V53 found in the Nexus 5. Add a bug for issue surrounding on screentext and doing a glClear after swap causes screen swizzling and zero frames rendered respectively. On the Java side, pass in the dimensions of the screen swapped since there is an issue with Adreno where it rotates the output 90 degrees for some reason. Disable the GLSL shader cache on Android for now due to the inability to cleanly exit the emulator, this tends to cause the cache to get corrupted. All this together fixes rendering with Adreno 3xx GPUs with driver version v14 and above. In particular my Galaxy S4 still resets with this without the root commands, but my HTC Droid DNA and LG G2 is fine. This must be due to particular 'enhancements' that the Samsung kernel has over the other ones. The speed on Adreno has yet to be optimized, so it will most likely be slow still. Faster than the software rasterizer in any case. The ARMJIT is still broken in at this point, so not much fun can be had.

This commit is contained in:
Ryan Houdek
2013-09-18 02:36:48 -05:00
parent db7f8697ba
commit 24a44ecfb8
5 changed files with 69 additions and 31 deletions

View File

@ -3,13 +3,16 @@ package org.dolphinemu.dolphinemu;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.util.DisplayMetrics;
import android.view.*;
import android.view.WindowManager.LayoutParams;
import org.dolphinemu.dolphinemu.settings.InputConfigFragment;
import org.dolphinemu.dolphinemu.settings.VideoSettingsFragment;
import java.util.List;
@ -52,7 +55,18 @@ public final class EmulationActivity extends Activity
// and set on the native side of the code so the emulator can actually
// load the game.
Intent gameToEmulate = getIntent();
NativeLibrary.SetDimensions((int)screenWidth, (int)screenHeight);
// Due to a bug in Adreno, it renders the screen rotated 90 degrees when using OpenGL
// Flip the width and height when on Adreno to work around this.
// Mali isn't affected by this bug.
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
if (prefs.getString("gpuPref", "Software Rendering").equals("OGL")
&& VideoSettingsFragment.SupportsGLES3()
&& VideoSettingsFragment.m_GLVendor.equals("Qualcomm"))
NativeLibrary.SetDimensions((int)screenHeight, (int)screenWidth);
else
NativeLibrary.SetDimensions((int)screenWidth, (int)screenHeight);
NativeLibrary.SetFilename(gameToEmulate.getStringExtra("SelectedGame"));
Running = true;

View File

@ -6,15 +6,6 @@
package org.dolphinemu.dolphinemu.settings;
import javax.microedition.khronos.egl.EGL10;
import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.egl.EGLContext;
import javax.microedition.khronos.egl.EGLDisplay;
import javax.microedition.khronos.egl.EGLSurface;
import javax.microedition.khronos.opengles.GL10;
import org.dolphinemu.dolphinemu.R;
import android.app.Activity;
import android.content.SharedPreferences;
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
@ -23,12 +14,19 @@ import android.preference.ListPreference;
import android.preference.PreferenceFragment;
import android.preference.PreferenceManager;
import android.preference.PreferenceScreen;
import org.dolphinemu.dolphinemu.R;
import javax.microedition.khronos.egl.*;
import javax.microedition.khronos.opengles.GL10;
/**
* Responsible for handling the loading of the video preferences.
*/
public final class VideoSettingsFragment extends PreferenceFragment
{
public static String m_GLVersion;
public static String m_GLVendor;
public static String m_GLRenderer;
private Activity m_activity;
/**
@ -138,9 +136,9 @@ public final class VideoSettingsFragment extends PreferenceFragment
public static boolean SupportsGLES3()
{
VersionCheck mbuffer = new VersionCheck();
String m_GLVersion = mbuffer.getVersion();
String m_GLVendor = mbuffer.getVendor();
String m_GLRenderer = mbuffer.getRenderer();
m_GLVersion = mbuffer.getVersion();
m_GLVendor = mbuffer.getVendor();
m_GLRenderer = mbuffer.getRenderer();
boolean mSupportsGLES3 = false;