From 02cbcc8ec49676739315223b8d2b0867867f7352 Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Tue, 18 Jun 2013 12:44:06 -0500 Subject: [PATCH] [Android] When running OpenGL ES 3 backend, we've got to switch the screen coordinates or bad things happen. Adds a Driver bug that causes swap every single flush. Hard requirement currently to see /anything/ on screen. --- Source/Android/.idea/workspace.xml | 322 ++++++++++-------- Source/Android/res/values/prefvalues.xml | 2 +- .../dolphinemu/DolphinEmulator.java | 6 +- .../dolphinemu/dolphinemu/GameListView.java | 2 - Source/Core/VideoCommon/Src/DriverDetails.cpp | 1 + Source/Core/VideoCommon/Src/DriverDetails.h | 10 + .../Plugin_VideoOGL/Src/VertexManager.cpp | 3 + 7 files changed, 203 insertions(+), 143 deletions(-) diff --git a/Source/Android/.idea/workspace.xml b/Source/Android/.idea/workspace.xml index dee70dcfd4..f21f574f72 100644 --- a/Source/Android/.idea/workspace.xml +++ b/Source/Android/.idea/workspace.xml @@ -54,6 +54,7 @@ + - @@ -103,21 +103,27 @@ - + - + + + + + + + + + + - + - - - @@ -126,7 +132,7 @@ - + @@ -135,10 +141,8 @@ - - - - + + @@ -167,7 +171,6 @@ @@ -235,49 +239,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -316,46 +277,119 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - + - + + - + - - - @@ -674,9 +718,7 @@ - - - + @@ -696,31 +738,33 @@ - - - - - - - - - - + - - - + + + + + + + + + + + + + + diff --git a/Source/Android/res/values/prefvalues.xml b/Source/Android/res/values/prefvalues.xml index 77354f76a4..3ba1f1a09a 100644 --- a/Source/Android/res/values/prefvalues.xml +++ b/Source/Android/res/values/prefvalues.xml @@ -12,7 +12,7 @@ Software Renderer - OpenGL + OpenGL ES 3 diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/DolphinEmulator.java b/Source/Android/src/org/dolphinemu/dolphinemu/DolphinEmulator.java index d8432b7e22..3c11ed76c6 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/DolphinEmulator.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/DolphinEmulator.java @@ -129,7 +129,11 @@ public class DolphinEmulator extends Activity String FileName = data.getStringExtra("Select"); GLview = new NativeGLSurfaceView(this); this.getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); - GLview.SetDimensions(screenWidth, screenHeight); + String backend = NativeLibrary.GetConfig("Dolphin.ini", "Core", "GFXBackend", "OGL"); + if (backend.equals("OGL")) + GLview.SetDimensions(screenHeight, screenWidth); + else + GLview.SetDimensions(screenWidth, screenHeight); GLview.SetFileName(FileName); setContentView(GLview); Running = true; diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/GameListView.java b/Source/Android/src/org/dolphinemu/dolphinemu/GameListView.java index ac1329f6a9..4a88977a5b 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/GameListView.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/GameListView.java @@ -161,8 +161,6 @@ public class GameListView extends ListActivity { me = this; mDrawer = MenuDrawer.attach(this, MenuDrawer.MENU_DRAG_CONTENT); - - Fill(); Listdir = new ArrayList(); diff --git a/Source/Core/VideoCommon/Src/DriverDetails.cpp b/Source/Core/VideoCommon/Src/DriverDetails.cpp index 51b5275a5f..41f22be55c 100644 --- a/Source/Core/VideoCommon/Src/DriverDetails.cpp +++ b/Source/Core/VideoCommon/Src/DriverDetails.cpp @@ -29,6 +29,7 @@ namespace DriverDetails {BUG_NODYNUBOACCESS, 300, 14.0, -1.0}, {BUG_BROKENCENTROID, 300, 14.0, -1.0}, {BUG_BROKENINFOLOG, 300, -1.0, -1.0}, + {BUG_BROKENBUFFERS, 300, 14.0, -1.0}, }; std::map, BugInfo> m_bugs; diff --git a/Source/Core/VideoCommon/Src/DriverDetails.h b/Source/Core/VideoCommon/Src/DriverDetails.h index c3bfc25ec5..bf831e29b9 100644 --- a/Source/Core/VideoCommon/Src/DriverDetails.h +++ b/Source/Core/VideoCommon/Src/DriverDetails.h @@ -52,6 +52,16 @@ namespace DriverDetails // Adreno devices /always/ return 0 when querying GL_INFO_LOG_LENGTH // They also max out at 1024 bytes(1023 characters + null terminator) for the log BUG_BROKENINFOLOG, + // Bug: Uploading data with rendering causes issues + // Affected devices: Qualcomm/Adreno + // Started Version: 14 + // Ended Version: -1 + // When drawing our elements, the instruction buffer on Adreno devices + // becomes too long, causing the device to quickly run out of RAM + // I've watched the kernel module go up to ~700MB of RAM in a few seconds + // The "workaround" is calling swapbuffers every single time we flush + // This causes flickering, but it is the only known way to work around it + BUG_BROKENBUFFERS, }; // Initializes our internal vendor, device family, and driver version diff --git a/Source/Plugins/Plugin_VideoOGL/Src/VertexManager.cpp b/Source/Plugins/Plugin_VideoOGL/Src/VertexManager.cpp index 2f34723e58..eafe16736c 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/VertexManager.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/VertexManager.cpp @@ -9,6 +9,7 @@ #include "Fifo.h" +#include "DriverDetails.h" #include "VideoConfig.h" #include "Statistics.h" #include "MemoryUtil.h" @@ -267,6 +268,8 @@ void VertexManager::vFlush() g_perf_query->EnableQuery(bpmem.zcontrol.early_ztest ? PQG_ZCOMP_ZCOMPLOC : PQG_ZCOMP); Draw(stride); + if (DriverDetails::HasBug(DriverDetails::BUG_BROKENBUFFERS)) + GLInterface->Swap(); g_perf_query->DisableQuery(bpmem.zcontrol.early_ztest ? PQG_ZCOMP_ZCOMPLOC : PQG_ZCOMP); //ERROR_LOG(VIDEO, "PerfQuery result: %d", g_perf_query->GetQueryResult(bpmem.zcontrol.early_ztest ? PQ_ZCOMP_OUTPUT_ZCOMPLOC : PQ_ZCOMP_OUTPUT));