From 41051f3cfe93f95c635e764cef816f43878c507b Mon Sep 17 00:00:00 2001 From: lightningterror Date: Fri, 24 Nov 2017 14:57:43 +0100 Subject: [PATCH] GSdx: Add hidden option to disable Nvidia hack Add hidden option "UserHacks_DisableNVhack" to disable the Nvidia hack on Direct3D which added black lines on the right and bottom of the screen. Could be useful for Intel and AMD GPUs. A better solution would be to add Vendor Id detection instead, but this will do for now. To disable the Nvidia hack add UserHacks_DisableNVhack=1 in GSdx.ini --- plugins/GSdx/GSDevice11.cpp | 6 ++++-- plugins/GSdx/GSDevice11.h | 1 + plugins/GSdx/GSdx.cpp | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/GSdx/GSDevice11.cpp b/plugins/GSdx/GSDevice11.cpp index bc10fd2393..ab72be937a 100644 --- a/plugins/GSdx/GSDevice11.cpp +++ b/plugins/GSdx/GSDevice11.cpp @@ -41,8 +41,10 @@ GSDevice11::GSDevice11() if (theApp.GetConfigB("UserHacks")) { UserHacks_unscale_pt_ln = theApp.GetConfigB("UserHacks_unscale_point_line"); + UserHacks_disable_NV_hack = theApp.GetConfigB("UserHacks_DisableNVhack"); } else { UserHacks_unscale_pt_ln = false; + UserHacks_disable_NV_hack = false; } } @@ -1296,8 +1298,8 @@ void GSDevice11::OMSetRenderTargets(GSTexture* rt, GSTexture* ds, const GSVector D3D11_VIEWPORT vp; memset(&vp, 0, sizeof(vp)); - vp.TopLeftX = (spritehack > 0 || isNative) ? 0.0f : -0.01f; - vp.TopLeftY = (spritehack > 0 || isNative) ? 0.0f : -0.01f; + vp.TopLeftX = (UserHacks_disable_NV_hack || spritehack > 0 || isNative) ? 0.0f : -0.01f; + vp.TopLeftY = (UserHacks_disable_NV_hack || spritehack > 0 || isNative) ? 0.0f : -0.01f; vp.Width = (float)size.x; vp.Height = (float)size.y; vp.MinDepth = 0.0f; diff --git a/plugins/GSdx/GSDevice11.h b/plugins/GSdx/GSDevice11.h index 02e3629c92..37055ceb70 100644 --- a/plugins/GSdx/GSDevice11.h +++ b/plugins/GSdx/GSDevice11.h @@ -58,6 +58,7 @@ class GSDevice11 : public GSDeviceDX bool isNative; bool UserHacks_unscale_pt_ln; + bool UserHacks_disable_NV_hack; struct { diff --git a/plugins/GSdx/GSdx.cpp b/plugins/GSdx/GSdx.cpp index 00fa98d409..c2926ad8e8 100644 --- a/plugins/GSdx/GSdx.cpp +++ b/plugins/GSdx/GSdx.cpp @@ -434,6 +434,7 @@ void GSdxApp::Init() m_default_configuration["UserHacks_DisableDepthSupport"] = "0"; m_default_configuration["UserHacks_CPU_FB_Conversion"] = "0"; m_default_configuration["UserHacks_DisableGsMemClear"] = "0"; + m_default_configuration["UserHacks_DisableNVhack"] = "0"; m_default_configuration["UserHacks_DisablePartialInvalidation"] = "0"; m_default_configuration["UserHacks_HalfPixelOffset"] = "0"; m_default_configuration["UserHacks_merge_pp_sprite"] = "0";