diff --git a/Source/Core/VideoBackends/D3D/main.cpp b/Source/Core/VideoBackends/D3D/main.cpp index 88e33a5119..bdf30230b3 100644 --- a/Source/Core/VideoBackends/D3D/main.cpp +++ b/Source/Core/VideoBackends/D3D/main.cpp @@ -83,7 +83,7 @@ void InitBackendInfo() g_Config.backend_info.bSupports3DVision = true; g_Config.backend_info.bSupportsPostProcessing = false; g_Config.backend_info.bSupportsPaletteConversion = true; - g_Config.backend_info.bSupportsClipControl = true; + g_Config.backend_info.bSupportsClipControl = false; IDXGIFactory* factory; IDXGIAdapter* ad; diff --git a/Source/Core/VideoBackends/OGL/Render.cpp b/Source/Core/VideoBackends/OGL/Render.cpp index 008437a7cb..f09bd75663 100644 --- a/Source/Core/VideoBackends/OGL/Render.cpp +++ b/Source/Core/VideoBackends/OGL/Render.cpp @@ -1245,7 +1245,7 @@ void Renderer::SetViewport() }; glViewport(iceilf(X), iceilf(Y), iceilf(Width), iceilf(Height)); } - glDepthRangef(GLNear, GLFar); + glDepthRangef(GLFar, GLNear); } void Renderer::ClearScreen(const EFBRectangle& rc, bool colorEnable, bool alphaEnable, bool zEnable, u32 color, u32 z) diff --git a/Source/Core/VideoCommon/VertexShaderGen.cpp b/Source/Core/VideoCommon/VertexShaderGen.cpp index 45bd8d71f3..d4715a1f34 100644 --- a/Source/Core/VideoCommon/VertexShaderGen.cpp +++ b/Source/Core/VideoCommon/VertexShaderGen.cpp @@ -380,6 +380,10 @@ static inline void GenerateVertexShader(T& out, u32 components, API_TYPE api_typ //write the true depth value, if the game uses depth textures pixel shaders will override with the correct values //if not early z culling will improve speed if (g_ActiveConfig.backend_info.bSupportsClipControl) + { + out.Write("o.pos.z = -o.pos.z;\n"); + } + else if (api_type == API_D3D) { out.Write("o.pos.z = o.pos.w + o.pos.z;\n"); } @@ -387,7 +391,7 @@ static inline void GenerateVertexShader(T& out, u32 components, API_TYPE api_typ { // this results in a scale from -1..0 to -1..1 after perspective // divide - out.Write("o.pos.z = o.pos.w + o.pos.z * 2.0;\n"); + out.Write("o.pos.z = o.pos.z * -2.0 - o.pos.w;\n"); // the next steps of the OGL pipeline are: // (x_c,y_c,z_c,w_c) = o.pos //switch to OGL spec terminology