Browse files

OpenGL: Disable the mapped buffer strategy for Adreno (Qualcomm).

It's a race during shutdown between the EmuThread writing commands, and
the render thread which just lost the buffer.
  • Loading branch information...
hrydgard committed Feb 10, 2019
1 parent 3e1197f commit c509650bec3ff15094378d026741352f500d4e0b
Showing with 8 additions and 3 deletions.
  1. +8 −3 ext/native/thin3d/GLRenderManager.cpp
@@ -112,9 +112,14 @@ void GLRenderManager::ThreadStart(Draw::DrawContext *draw) {
bufferStrategy_ = GLBufferStrategy::FRAME_UNMAP;

bufferStrategy_ = GLBufferStrategy::FLUSH_INVALIDATE_UNMAP;
// Temporarily disabled because it doesn't work with task switching on Android.
// The mapped buffer seems to just be pulled out like a rug from under us, crashing
// as soon as any write happens, which can happen during shutdown since we write from the
// Emu thread which may not yet have shut down. There may be solutions to this, but for now,
// disable this strategy to avoid crashing.
// bufferStrategy_ = GLBufferStrategy::FLUSH_INVALIDATE_UNMAP;
// break;

bufferStrategy_ = GLBufferStrategy::SUBDATA;

0 comments on commit c509650

Please sign in to comment.