From fb9c4e5a616d7397e2453a456ade722894fa4589 Mon Sep 17 00:00:00 2001 From: "gregory.hainaut" Date: Mon, 14 Jan 2013 09:25:16 +0000 Subject: [PATCH] gsdx-ogl-wnd: * add a new config define ENABLE_OGL_MT_HACK to replace the define OGL_MT_HACK git-svn-id: http://pcsx2.googlecode.com/svn/branches/gsdx-ogl-wnd@5511 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/GSdx/CMakeLists.txt | 1 - plugins/GSdx/GS.cpp | 12 ++++++------ plugins/GSdx/GSState.cpp | 6 +++--- plugins/GSdx/config.h | 2 ++ 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/plugins/GSdx/CMakeLists.txt b/plugins/GSdx/CMakeLists.txt index 40a1876e57..6117a0adf1 100644 --- a/plugins/GSdx/CMakeLists.txt +++ b/plugins/GSdx/CMakeLists.txt @@ -10,7 +10,6 @@ endif(NOT TOP_CMAKE_WAS_SOURCED) set(Output GSdx-0.1.16) set(CommonFlags - -DOGL_MT_HACK -D_LINUX -fno-operator-names -mpreferred-stack-boundary=2 diff --git a/plugins/GSdx/GS.cpp b/plugins/GSdx/GS.cpp index e401d35767..22ca8f36bd 100644 --- a/plugins/GSdx/GS.cpp +++ b/plugins/GSdx/GS.cpp @@ -57,7 +57,7 @@ extern bool RunLinuxDialog(); #define PS2E_X86 0x01 // 32 bit #define PS2E_X86_64 0x02 // 64 bit -#ifdef OGL_MT_HACK +#ifdef ENABLE_OGL_MT_HACK GSRenderer* s_gs = NULL; #else static GSRenderer* s_gs = NULL; @@ -457,7 +457,7 @@ EXPORT_C GSreadFIFO(uint8* mem) { try { -#ifdef OGL_MT_HACK +#ifdef ENABLE_OGL_MT_HACK // FIXME: double check which thread call this function // See fifo2 issue below #ifdef OGL_DEBUG @@ -468,7 +468,7 @@ EXPORT_C GSreadFIFO(uint8* mem) s_gs->ReadFIFO(mem, 1); -#ifdef OGL_MT_HACK +#ifdef ENABLE_OGL_MT_HACK s_gs->m_wnd->DetachContext(); #endif } @@ -481,7 +481,7 @@ EXPORT_C GSreadFIFO2(uint8* mem, uint32 size) { try { -#ifdef OGL_MT_HACK +#ifdef ENABLE_OGL_MT_HACK // FIXME called from EE core thread not MTGS which cause // invalidate data for opengl #ifdef OGL_DEBUG @@ -492,7 +492,7 @@ EXPORT_C GSreadFIFO2(uint8* mem, uint32 size) s_gs->ReadFIFO(mem, size); -#ifdef OGL_MT_HACK +#ifdef ENABLE_OGL_MT_HACK s_gs->m_wnd->DetachContext(); #endif } @@ -566,7 +566,7 @@ EXPORT_C GSvsync(int field) #endif -#ifdef OGL_MT_HACK +#ifdef ENABLE_OGL_MT_HACK s_gs->m_wnd->AttachContext(); #endif s_gs->VSync(field); diff --git a/plugins/GSdx/GSState.cpp b/plugins/GSdx/GSState.cpp index c6292e116b..94e7113e60 100644 --- a/plugins/GSdx/GSState.cpp +++ b/plugins/GSdx/GSState.cpp @@ -23,7 +23,7 @@ #include "GSState.h" #include "GSdx.h" -#ifdef OGL_MT_HACK +#ifdef ENABLE_OGL_MT_HACK #include "GSRendererOGL.h" extern GSRenderer* s_gs; @@ -1260,7 +1260,7 @@ void GSState::GIFRegHandlerTRXDIR(const GIFReg* RESTRICT r) break; case 1: // local -> host m_tr.Init(m_env.TRXPOS.SSAX, m_env.TRXPOS.SSAY); -#ifdef OGL_MT_HACK +#ifdef ENABLE_OGL_MT_HACK s_gs->m_wnd->DetachContext(); #endif break; @@ -1767,7 +1767,7 @@ static hash_map s_tags; template void GSState::Transfer(const uint8* mem, uint32 size) { GSPerfMonAutoTimer pmat(&m_perfmon); -#ifdef OGL_MT_HACK +#ifdef ENABLE_OGL_MT_HACK s_gs->m_wnd->AttachContext(); #endif diff --git a/plugins/GSdx/config.h b/plugins/GSdx/config.h index 7b5661fbc0..a60e9fa440 100644 --- a/plugins/GSdx/config.h +++ b/plugins/GSdx/config.h @@ -37,3 +37,5 @@ //#define DISABLE_COLCLAMP //#define DISABLE_DATE + +#define ENABLE_OGL_MT_HACK // OpenGL doesn't allow to access the same bound context from multiple threads. This hack changes context binding for GSreadFIFO* access