From d89b09427f0797d14ac671f8ec4f49e6905bdeb3 Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Thu, 22 Sep 2016 17:54:44 +0200 Subject: [PATCH] gsdx: gl logging is only available in MTGS thread Fix crash in debug build --- plugins/GSdx/GSState.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/GSdx/GSState.cpp b/plugins/GSdx/GSState.cpp index 3fb7d2db49..69852da404 100644 --- a/plugins/GSdx/GSState.cpp +++ b/plugins/GSdx/GSState.cpp @@ -1669,8 +1669,11 @@ void GSState::Read(uint8* mem, int len) int h = m_env.TRXREG.RRH; GSVector4i r(sx, sy, sx + w, sy + h); - GL_CACHE("Read! len=%d SBP=%05x SBW=%d SPSM=%s SSAX=%d SSAY=%d RRW=%d RRH=%d", - len, (int)m_env.BITBLTBUF.SBP, (int)m_env.BITBLTBUF.SBW, psm_str(m_env.BITBLTBUF.SPSM), sx, sy, w, h); + // Function is called from the EE thread. Unforunately gl stuff can only be used from a single thread (AKA MTGS) + if (GLLoader::in_replayer) { + GL_CACHE("Read! len=%d SBP=%05x SBW=%d SPSM=%s SSAX=%d SSAY=%d RRW=%d RRH=%d", + len, (int)m_env.BITBLTBUF.SBP, (int)m_env.BITBLTBUF.SBW, psm_str(m_env.BITBLTBUF.SPSM), sx, sy, w, h); + } if(!m_tr.Update(w, h, GSLocalMemory::m_psm[m_env.BITBLTBUF.SPSM].trbpp, len)) {