diff --git a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp
index e3797ff886..87aa9480b3 100644
--- a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp
+++ b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp
@@ -511,6 +511,7 @@ const char *GeneratePixelShaderCode(u32 texture_mask, bool dstAlphaEnable, u32 H
// alpha test will always fail, so restart the shader and just make it an empty function
p = pmainstart;
WRITE(p, "ocol0 = 0;\n");
+ WRITE(p, "depth = 1.f;\n");
WRITE(p, "discard;return;\n");
}
else
@@ -952,7 +953,7 @@ static bool WriteAlphaTest(char *&p, u32 HLSL)
compindex = bpmem.alphaFunc.comp1 % 8;
WRITE(p, tevAlphaFuncsTable[compindex],alphaRef[1]);//lookup the second component from the alpha function table
- WRITE(p, ")){ocol0 = 0;discard;return;}\n");
+ WRITE(p, ")){ocol0 = 0;depth = 1.f;discard;return;}\n");
return true;
}
diff --git a/Source/Dolphin.sln b/Source/Dolphin.sln
index 0e37aca610..746d3579fe 100644
--- a/Source/Dolphin.sln
+++ b/Source/Dolphin.sln
@@ -198,6 +198,14 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin_WiimoteNew", "Plugin
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "InputUICommon", "Core\InputUICommon\InputUICommon.vcproj", "{374E2DB7-42DF-4E59-8474-62B6687F4978}"
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin_VideoDX11", "Plugins\Plugin_VideoDX11\Plugin_VideoDX11.vcproj", "{21DBE606-2958-43AC-A14E-B6B798D56554}"
+ ProjectSection(ProjectDependencies) = postProject
+ {11F55366-12EC-4C44-A8CB-1D4E315D61ED} = {11F55366-12EC-4C44-A8CB-1D4E315D61ED}
+ {E5D1F0C0-AA07-4841-A4EB-4CF4DAA6B0FA} = {E5D1F0C0-AA07-4841-A4EB-4CF4DAA6B0FA}
+ {1C8436C9-DBAF-42BE-83BC-CF3EC9175ABE} = {1C8436C9-DBAF-42BE-83BC-CF3EC9175ABE}
+ {C573CAF7-EE6A-458E-8049-16C0BF34C2E9} = {C573CAF7-EE6A-458E-8049-16C0BF34C2E9}
+ EndProjectSection
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@@ -570,6 +578,18 @@ Global
{374E2DB7-42DF-4E59-8474-62B6687F4978}.Release|Win32.Build.0 = Release|Win32
{374E2DB7-42DF-4E59-8474-62B6687F4978}.Release|x64.ActiveCfg = Release|x64
{374E2DB7-42DF-4E59-8474-62B6687F4978}.Release|x64.Build.0 = Release|x64
+ {21DBE606-2958-43AC-A14E-B6B798D56554}.Debug|Win32.ActiveCfg = Debug|Win32
+ {21DBE606-2958-43AC-A14E-B6B798D56554}.Debug|Win32.Build.0 = Debug|Win32
+ {21DBE606-2958-43AC-A14E-B6B798D56554}.Debug|x64.ActiveCfg = Debug|x64
+ {21DBE606-2958-43AC-A14E-B6B798D56554}.Debug|x64.Build.0 = Debug|x64
+ {21DBE606-2958-43AC-A14E-B6B798D56554}.DebugFast|Win32.ActiveCfg = DebugFast|Win32
+ {21DBE606-2958-43AC-A14E-B6B798D56554}.DebugFast|Win32.Build.0 = DebugFast|Win32
+ {21DBE606-2958-43AC-A14E-B6B798D56554}.DebugFast|x64.ActiveCfg = DebugFast|x64
+ {21DBE606-2958-43AC-A14E-B6B798D56554}.DebugFast|x64.Build.0 = DebugFast|x64
+ {21DBE606-2958-43AC-A14E-B6B798D56554}.Release|Win32.ActiveCfg = Release|Win32
+ {21DBE606-2958-43AC-A14E-B6B798D56554}.Release|Win32.Build.0 = Release|Win32
+ {21DBE606-2958-43AC-A14E-B6B798D56554}.Release|x64.ActiveCfg = Release|x64
+ {21DBE606-2958-43AC-A14E-B6B798D56554}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/Source/Plugins/Plugin_VideoDX11/Plugin_VideoDX11.vcproj b/Source/Plugins/Plugin_VideoDX11/Plugin_VideoDX11.vcproj
new file mode 100644
index 0000000000..0ad6e9e6d9
--- /dev/null
+++ b/Source/Plugins/Plugin_VideoDX11/Plugin_VideoDX11.vcproj
@@ -0,0 +1,846 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Source/Plugins/Plugin_VideoDX11/Src/BPFunctions.cpp b/Source/Plugins/Plugin_VideoDX11/Src/BPFunctions.cpp
new file mode 100644
index 0000000000..fa6be1f2dd
--- /dev/null
+++ b/Source/Plugins/Plugin_VideoDX11/Src/BPFunctions.cpp
@@ -0,0 +1,139 @@
+// Copyright (C) 2003 Dolphin Project.
+
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, version 2.0.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License 2.0 for more details.
+
+// A copy of the GPL 2.0 should have been included with the program.
+// If not, see http://www.gnu.org/licenses/
+
+// Official SVN repository and contact information can be found at
+// http://code.google.com/p/dolphin-emu/
+
+#include "BPFunctions.h"
+#include "D3DBase.h"
+#include "VideoConfig.h"
+#include "Common.h"
+#include "TextureCache.h"
+#include "VertexManager.h"
+#include "VertexShaderManager.h"
+#include "Render.h"
+
+namespace BPFunctions
+{
+
+void FlushPipeline()
+{
+ VertexManager::Flush();
+}
+
+void SetGenerationMode(const BPCmd &bp)
+{
+ Renderer::SetGenerationMode();
+}
+
+void SetScissor(const BPCmd &bp)
+{
+ Renderer::SetScissorRect();
+}
+
+void SetLineWidth(const BPCmd &bp)
+{
+ Renderer::SetLineWidth();
+}
+
+void SetDepthMode(const BPCmd &bp)
+{
+ Renderer::SetDepthMode();
+}
+
+void SetBlendMode(const BPCmd &bp)
+{
+ Renderer::SetBlendMode(false);
+}
+void SetDitherMode(const BPCmd &bp)
+{
+ Renderer::SetDitherMode();
+}
+void SetLogicOpMode(const BPCmd &bp)
+{
+ Renderer::SetLogicOpMode();
+}
+
+void SetColorMask(const BPCmd &bp)
+{
+ Renderer::SetColorMask();
+}
+
+void CopyEFB(const BPCmd &bp, const EFBRectangle &rc, const u32 &address, const bool &fromZBuffer, const bool &isIntensityFmt, const u32 ©fmt, const int &scaleByHalf)
+{
+ if (!g_ActiveConfig.bEFBCopyDisable)
+ {
+ if (g_ActiveConfig.bCopyEFBToTexture)
+ {
+ TextureCache::CopyRenderTargetToTexture(address, fromZBuffer, isIntensityFmt, copyfmt, scaleByHalf, rc);
+ }
+ else
+ {
+ PanicAlert("TODO: Implement EFB copying to RAM %s %d\n", __FILE__, __LINE__);
+ }
+ }
+}
+
+void ClearScreen(const BPCmd &bp, const EFBRectangle &rc)
+{
+ bool colorEnable = bpmem.blendmode.colorupdate;
+ bool alphaEnable = (bpmem.zcontrol.pixel_format == PIXELFMT_RGBA6_Z24 && bpmem.blendmode.alphaupdate);
+ bool zEnable = bpmem.zmode.updateenable;
+
+ if (colorEnable || alphaEnable || zEnable)
+ {
+ u32 color = (bpmem.clearcolorAR << 16) | bpmem.clearcolorGB;
+ u32 z = bpmem.clearZValue;
+
+ Renderer::ClearScreen(rc, colorEnable, alphaEnable, zEnable, color, z);
+ }
+}
+
+void RestoreRenderState(const BPCmd &bp)
+{
+ Renderer::RestoreAPIState();
+}
+
+bool GetConfig(const int &type)
+{
+ switch (type)
+ {
+ case CONFIG_ISWII:
+ return g_VideoInitialize.bWii;
+ case CONFIG_DISABLEFOG:
+ return g_ActiveConfig.bDisableFog;
+ case CONFIG_SHOWEFBREGIONS:
+ return false;
+ default:
+ PanicAlert("GetConfig Error: Unknown Config Type!");
+ return false;
+ }
+}
+
+u8 *GetPointer(const u32 &address)
+{
+ return g_VideoInitialize.pGetMemoryPointer(address);
+}
+
+void SetTextureMode(const BPCmd &bp)
+{
+ Renderer::SetSamplerState(bp.address & 3, (bp.address & 0xE0) == 0xA0);
+}
+
+void SetInterlacingMode(const BPCmd &bp)
+{
+ // TODO
+}
+
+};
diff --git a/Source/Plugins/Plugin_VideoDX11/Src/D3DBase.cpp b/Source/Plugins/Plugin_VideoDX11/Src/D3DBase.cpp
new file mode 100644
index 0000000000..9766d545c2
--- /dev/null
+++ b/Source/Plugins/Plugin_VideoDX11/Src/D3DBase.cpp
@@ -0,0 +1,391 @@
+// Copyright (C) 2003 Dolphin Project.
+
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, version 2.0.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License 2.0 for more details.
+
+// A copy of the GPL 2.0 should have been included with the program.
+// If not, see http://www.gnu.org/licenses/
+
+// Official SVN repository and contact information can be found at
+// http://code.google.com/p/dolphin-emu/
+
+#include "D3DBase.h"
+#include "D3DTexture.h"
+#include "D3DShader.h"
+#include "D3Dcompiler.h"
+#include "VideoConfig.h"
+#include "Render.h"
+#include "XFStructs.h"
+
+#include