From 743296f1c4bbc19a43e473f3907d6bd1e21f2c0e Mon Sep 17 00:00:00 2001 From: Jules Blok Date: Wed, 24 Jun 2015 22:28:36 +0200 Subject: [PATCH 1/3] OGL: Allow inverted depth ranges. --- Source/Core/VideoBackends/OGL/Render.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/VideoBackends/OGL/Render.cpp b/Source/Core/VideoBackends/OGL/Render.cpp index 6efdd7fd40..8a1a6b8a35 100644 --- a/Source/Core/VideoBackends/OGL/Render.cpp +++ b/Source/Core/VideoBackends/OGL/Render.cpp @@ -1197,7 +1197,7 @@ void Renderer::SetViewport() float Y = EFBToScaledYf((float)EFB_HEIGHT - xfmem.viewport.yOrig + xfmem.viewport.ht + (float)scissorYOff); float Width = EFBToScaledXf(2.0f * xfmem.viewport.wd); float Height = EFBToScaledYf(-2.0f * xfmem.viewport.ht); - float GLNear = MathUtil::Clamp(xfmem.viewport.farZ - MathUtil::Clamp(xfmem.viewport.zRange, 0.0f, 16777215.0f), 0.0f, 16777215.0f) / 16777216.0f; + float GLNear = MathUtil::Clamp(xfmem.viewport.farZ - MathUtil::Clamp(xfmem.viewport.zRange, -16777215.0f, 16777215.0f), 0.0f, 16777215.0f) / 16777216.0f; float GLFar = MathUtil::Clamp(xfmem.viewport.farZ, 0.0f, 16777215.0f) / 16777216.0f; if (Width < 0) { From dbfdbf7dbdbb2740f55d37b4514700c27ee8894b Mon Sep 17 00:00:00 2001 From: Jules Blok Date: Wed, 24 Jun 2015 23:16:53 +0200 Subject: [PATCH 2/3] D3D: Cosmetics. Merge two cases which should've already been merged. --- Source/Core/VideoBackends/D3D/main.cpp | 2 +- Source/Core/VideoCommon/VertexShaderGen.cpp | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/Source/Core/VideoBackends/D3D/main.cpp b/Source/Core/VideoBackends/D3D/main.cpp index e6f0074f1b..c172d81127 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 = false; + g_Config.backend_info.bSupportsClipControl = true; IDXGIFactory* factory; IDXGIAdapter* ad; diff --git a/Source/Core/VideoCommon/VertexShaderGen.cpp b/Source/Core/VideoCommon/VertexShaderGen.cpp index 084ac48aaf..97ac15e887 100644 --- a/Source/Core/VideoCommon/VertexShaderGen.cpp +++ b/Source/Core/VideoCommon/VertexShaderGen.cpp @@ -383,10 +383,6 @@ static inline void GenerateVertexShader(T& out, u32 components, API_TYPE api_typ { out.Write("o.pos.z = -o.pos.z;\n"); } - else if (api_type == API_D3D) - { - out.Write("o.pos.z = -o.pos.z;\n"); - } else // OGL { // this results in a scale from -1..0 to -1..1 after perspective From 0034492151f1294098eae4206fb40ea7aa2e7912 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 24 Jun 2015 21:44:38 -0400 Subject: [PATCH 3/3] Add an OSD notification for screenshot saving --- Source/Core/VideoBackends/OGL/Render.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/Core/VideoBackends/OGL/Render.cpp b/Source/Core/VideoBackends/OGL/Render.cpp index 6efdd7fd40..42fce1ab37 100644 --- a/Source/Core/VideoBackends/OGL/Render.cpp +++ b/Source/Core/VideoBackends/OGL/Render.cpp @@ -1506,7 +1506,10 @@ void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight, co if (s_bScreenshot) { std::lock_guard lk(s_criticalScreenshot); - SaveScreenshot(s_sScreenshotName, flipped_trc); + + if (SaveScreenshot(s_sScreenshotName, flipped_trc)) + OSD::AddMessage("Screenshot saved to " + s_sScreenshotName); + // Reset settings s_sScreenshotName.clear(); s_bScreenshot = false;