Skip to content

Commit

Permalink
[Android] When running OpenGL ES 3 backend, we've got to switch the s…
Browse files Browse the repository at this point in the history
…creen coordinates or bad things happen. Adds a Driver bug that causes swap every single flush. Hard requirement currently to see /anything/ on screen.
  • Loading branch information
Sonicadvance1 committed Jun 18, 2013
1 parent 9c32c92 commit 02cbcc8
Show file tree
Hide file tree
Showing 7 changed files with 178 additions and 118 deletions.
272 changes: 158 additions & 114 deletions Source/Android/.idea/workspace.xml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Source/Android/res/values/prefvalues.xml
Expand Up @@ -12,7 +12,7 @@

<string-array name="gpuOptions">
<item>Software Renderer</item>
<item>OpenGL</item>
<item>OpenGL ES 3</item>
</string-array>

<string-array name="gpuValues">
Expand Down
Expand Up @@ -129,7 +129,11 @@ public void onActivityResult(int requestCode, int resultCode, Intent data)
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;
Expand Down
Expand Up @@ -161,8 +161,6 @@ public void onCreate(Bundle savedInstanceState)
me = this;

mDrawer = MenuDrawer.attach(this, MenuDrawer.MENU_DRAG_CONTENT);


Fill();

List<SideMenuItem>dir = new ArrayList<SideMenuItem>();
Expand Down
1 change: 1 addition & 0 deletions Source/Core/VideoCommon/Src/DriverDetails.cpp
Expand Up @@ -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<std::pair<Vendor, Bug>, BugInfo> m_bugs;
Expand Down
10 changes: 10 additions & 0 deletions Source/Core/VideoCommon/Src/DriverDetails.h
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions Source/Plugins/Plugin_VideoOGL/Src/VertexManager.cpp
Expand Up @@ -9,6 +9,7 @@

#include "Fifo.h"

#include "DriverDetails.h"
#include "VideoConfig.h"
#include "Statistics.h"
#include "MemoryUtil.h"
Expand Down Expand Up @@ -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));

Expand Down

0 comments on commit 02cbcc8

Please sign in to comment.