diff --git a/Source/Core/VideoCommon/Src/VideoConfig.cpp b/Source/Core/VideoCommon/Src/VideoConfig.cpp index d422c3d01d..e8c87774d4 100644 --- a/Source/Core/VideoCommon/Src/VideoConfig.cpp +++ b/Source/Core/VideoCommon/Src/VideoConfig.cpp @@ -96,6 +96,7 @@ void VideoConfig::Load(const char *ini_file) iniFile.Get("Hacks", "EFBScaledCopy", &bCopyEFBScaled, true); iniFile.Get("Hacks", "EFBCopyCacheEnable", &bEFBCopyCacheEnable, false); iniFile.Get("Hacks", "EFBEmulateFormatChanges", &bEFBEmulateFormatChanges, false); + iniFile.Get("Hacks", "ForceDualSourceBlend", &bForceDualSourceBlend, false); iniFile.Get("Hardware", "Adapter", &iAdapter, 0); @@ -251,6 +252,7 @@ void VideoConfig::Save(const char *ini_file) iniFile.Set("Hacks", "EFBScaledCopy", bCopyEFBScaled); iniFile.Set("Hacks", "EFBCopyCacheEnable", bEFBCopyCacheEnable); iniFile.Set("Hacks", "EFBEmulateFormatChanges", bEFBEmulateFormatChanges); + iniFile.Set("Hacks", "ForceDualSourceBlend", bForceDualSourceBlend); iniFile.Set("Hardware", "Adapter", iAdapter); diff --git a/Source/Core/VideoCommon/Src/VideoConfig.h b/Source/Core/VideoCommon/Src/VideoConfig.h index a0a5cabacf..dff1beb77f 100644 --- a/Source/Core/VideoCommon/Src/VideoConfig.h +++ b/Source/Core/VideoCommon/Src/VideoConfig.h @@ -123,7 +123,8 @@ struct VideoConfig bool bEnablePixelLighting; bool bHackedBufferUpload; bool bFastDepthCalc; - + //for dx9-backend + bool bForceDualSourceBlend; int iLog; // CONF_ bits int iSaveTargetId; // TODO: Should be dropped diff --git a/Source/Plugins/Plugin_VideoDX9/Src/main.cpp b/Source/Plugins/Plugin_VideoDX9/Src/main.cpp index 1a4e1bf84d..9170713e51 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/main.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/main.cpp @@ -93,7 +93,21 @@ void InitBackendInfo() g_Config.backend_info.bSupportsPrimitiveRestart = false; // TODO: figure out if it does g_Config.backend_info.bSupportsSeparateAlphaFunction = device_caps.PrimitiveMiscCaps & D3DPMISCCAPS_SEPARATEALPHABLEND; // Dual source blend disabled by default until a proper method to test for support is found - g_Config.backend_info.bSupportsDualSourceBlend = false; + g_Config.backend_info.bSupports3DVision = true; + OSVERSIONINFO info; + ZeroMemory(&info, sizeof(OSVERSIONINFO)); + info.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + if (GetVersionEx(&info)) + { + // dual source blending is only supported in windows 7 o newer. sorry xp users + // we cannot test for device caps because most drivers just declare the minimun caps + // and don't expose their support for some functionalities + g_Config.backend_info.bSupportsDualSourceBlend = info.dwPlatformId == VER_PLATFORM_WIN32_NT && ((info.dwMajorVersion > 6) || ((info.dwMajorVersion == 6) && info.dwMinorVersion >= 1)); + } + else + { + g_Config.backend_info.bSupportsDualSourceBlend = false; + } g_Config.backend_info.bSupportsFormatReinterpretation = true; g_Config.backend_info.bSupportsPixelLighting = C_PLIGHTS + 40 <= maxConstants && C_PMATERIALS + 4 <= maxConstants; g_Config.backend_info.bSupportsEarlyZ = false; @@ -139,6 +153,9 @@ bool VideoBackend::Initialize(void *&window_handle) g_Config.GameIniLoad(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strGameIni.c_str()); g_Config.UpdateProjectionHack(); g_Config.VerifyValidity(); + // as only some driver/hardware configurations support dual source blending only enable it if is + // configured by user + g_Config.backend_info.bSupportsDualSourceBlend &= g_Config.bForceDualSourceBlend; UpdateActiveConfig(); window_handle = (void*)EmuWindow::Create((HWND)window_handle, GetModuleHandle(0), _T("Loading - Please wait."));