From c530858df33147ab2fe4d33b243d538213618a86 Mon Sep 17 00:00:00 2001 From: refractionpcsx2 Date: Mon, 6 Jun 2016 20:45:30 +0100 Subject: [PATCH] GSdx: Move "isNative" check to DX11 context creation. Resolves speed regression in games that constantly change the viewport size. --- plugins/GSdx/GSDevice11.cpp | 5 +++-- plugins/GSdx/GSDevice11.h | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/GSdx/GSDevice11.cpp b/plugins/GSdx/GSDevice11.cpp index 1ed8893929..9dfdccd688 100644 --- a/plugins/GSdx/GSDevice11.cpp +++ b/plugins/GSdx/GSDevice11.cpp @@ -111,6 +111,9 @@ bool GSDevice11::Create(GSWnd* wnd) scd.Windowed = TRUE; spritehack = theApp.GetConfigB("UserHacks") ? theApp.GetConfigI("UserHacks_SpriteHack") : 0; + + isNative = theApp.GetConfigI("upscale_multiplier") == 1; + // NOTE : D3D11_CREATE_DEVICE_SINGLETHREADED // This flag is safe as long as the DXGI's internal message pump is disabled or is on the // same thread as the GS window (which the emulator makes sure of, if it utilizes a @@ -1265,11 +1268,9 @@ void GSDevice11::OMSetRenderTargets(GSTexture* rt, GSTexture* ds, const GSVector GSVector2i size = rt ? rt->GetSize() : ds->GetSize(); if(m_state.viewport != size) { - bool isNative = theApp.GetConfigI("upscale_multiplier") == 1; m_state.viewport = size; D3D11_VIEWPORT vp; - memset(&vp, 0, sizeof(vp)); vp.TopLeftX = (spritehack > 0 || isNative) ? 0.0f : -0.01f; diff --git a/plugins/GSdx/GSDevice11.h b/plugins/GSdx/GSDevice11.h index 06ef75f230..31b155713a 100644 --- a/plugins/GSdx/GSDevice11.h +++ b/plugins/GSdx/GSDevice11.h @@ -55,6 +55,7 @@ class GSDevice11 : public GSDeviceDX bool m_srv_changed, m_ss_changed; int spritehack; + bool isNative; struct {