diff --git a/plugins/GSdx/GSDevice11.cpp b/plugins/GSdx/GSDevice11.cpp index 968f3d51c8..2596e4ee76 100644 --- a/plugins/GSdx/GSDevice11.cpp +++ b/plugins/GSdx/GSDevice11.cpp @@ -740,15 +740,10 @@ void GSDevice11::DoInterlace(GSTexture* st, GSTexture* dt, int shader, bool line StretchRect(st, sr, dt, dr, m_interlace.ps[shader], m_interlace.cb, linear); } -void GSDevice11::DoFXAA(GSTexture* st, GSTexture* dt) +// This shouldn't be necessary, we have some bug corrupting memory +// and for some reason isolating this code makes the plugin not crash +void GSDevice11::InitFXAA() { - GSVector2i s = dt->GetSize(); - - GSVector4 sr(0, 0, 1, 1); - GSVector4 dr(0, 0, s.x, s.y); - - FXAAConstantBuffer cb; - if (!FFXA_Compiled) { #if EXTERNAL_SHADER_LOADING @@ -763,6 +758,18 @@ void GSDevice11::DoFXAA(GSTexture* st, GSTexture* dt) #endif FFXA_Compiled = true; } +} + +void GSDevice11::DoFXAA(GSTexture* st, GSTexture* dt) +{ + GSVector2i s = dt->GetSize(); + + GSVector4 sr(0, 0, 1, 1); + GSVector4 dr(0, 0, s.x, s.y); + + FXAAConstantBuffer cb; + + InitFXAA(); cb.rcpFrame = GSVector4(1.0f / s.x, 1.0f / s.y, 0.0f, 0.0f); cb.rcpFrameOpt = GSVector4::zero(); diff --git a/plugins/GSdx/GSDevice11.h b/plugins/GSdx/GSDevice11.h index eb61922c29..ce2574bfad 100644 --- a/plugins/GSdx/GSDevice11.h +++ b/plugins/GSdx/GSDevice11.h @@ -39,6 +39,8 @@ class GSDevice11 : public GSDeviceDX void DoFXAA(GSTexture* st, GSTexture* dt); void DoShadeBoost(GSTexture* st, GSTexture* dt); + void InitFXAA(); // Bug workaround! Stack corruption? Heap corruption? No idea + // CComPtr m_dev; diff --git a/plugins/GSdx/GSdx.vcxproj b/plugins/GSdx/GSdx.vcxproj index 2169b72ae2..85817e5480 100644 --- a/plugins/GSdx/GSdx.vcxproj +++ b/plugins/GSdx/GSdx.vcxproj @@ -302,7 +302,6 @@ Use - Disabled .\GSdx.def @@ -321,7 +320,6 @@ Use - Disabled .\GSdx.def @@ -400,7 +398,6 @@ Use - Disabled .\GSdx.def @@ -410,7 +407,6 @@ Use - Disabled .\GSdx.def @@ -1719,4 +1715,4 @@ - \ No newline at end of file +