From 29e05c5ff854c87b79ae06bd71161d0ec2468ac8 Mon Sep 17 00:00:00 2001 From: Jules Blok <jules.blok@gmail.com> Date: Mon, 29 Dec 2014 11:18:14 +0100 Subject: [PATCH 1/3] Stereo3D: Don't rely on GetEFBLayers() when dealing with shaders. Shaders may be compiled before the FramebufferManager is initialized. --- Source/Core/VideoBackends/D3D/GeometryShaderCache.cpp | 4 ++-- Source/Core/VideoBackends/OGL/TextureCache.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Core/VideoBackends/D3D/GeometryShaderCache.cpp b/Source/Core/VideoBackends/D3D/GeometryShaderCache.cpp index ab4a26368e..ed96d49034 100644 --- a/Source/Core/VideoBackends/D3D/GeometryShaderCache.cpp +++ b/Source/Core/VideoBackends/D3D/GeometryShaderCache.cpp @@ -36,8 +36,8 @@ ID3D11GeometryShader* CopyGeometryShader = nullptr; LinearDiskCache<GeometryShaderUid, u8> g_gs_disk_cache; -ID3D11GeometryShader* GeometryShaderCache::GetClearGeometryShader() { return (FramebufferManager::GetEFBLayers() > 1) ? ClearGeometryShader: nullptr; } -ID3D11GeometryShader* GeometryShaderCache::GetCopyGeometryShader() { return (FramebufferManager::GetEFBLayers() > 1) ? CopyGeometryShader : nullptr; } +ID3D11GeometryShader* GeometryShaderCache::GetClearGeometryShader() { return (g_ActiveConfig.iStereoMode > 0) ? ClearGeometryShader: nullptr; } +ID3D11GeometryShader* GeometryShaderCache::GetCopyGeometryShader() { return (g_ActiveConfig.iStereoMode > 0) ? CopyGeometryShader : nullptr; } ID3D11Buffer* gscbuf = nullptr; diff --git a/Source/Core/VideoBackends/OGL/TextureCache.cpp b/Source/Core/VideoBackends/OGL/TextureCache.cpp index 0adb078cd5..4199604cd0 100644 --- a/Source/Core/VideoBackends/OGL/TextureCache.cpp +++ b/Source/Core/VideoBackends/OGL/TextureCache.cpp @@ -400,7 +400,7 @@ void TextureCache::CompileShaders() " gl_Position = vec4(rawpos*2.0-1.0, 0.0, 1.0);\n" "}\n"; - const char *GProgram = FramebufferManager::GetEFBLayers() > 1 ? + const char *GProgram = g_ActiveConfig.iStereoMode > 0 ? "layout(triangles) in;\n" "layout(triangle_strip, max_vertices = 6) out;\n" "in vec3 v_uv0[3];\n" From 813b3808a763daa48610c016efab3db68f1afd4f Mon Sep 17 00:00:00 2001 From: Jules Blok <jules.blok@gmail.com> Date: Mon, 29 Dec 2014 00:46:47 +0100 Subject: [PATCH 2/3] VideoConfigDiag: Remove double space. --- Source/Core/DolphinWX/VideoConfigDiag.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/DolphinWX/VideoConfigDiag.cpp b/Source/Core/DolphinWX/VideoConfigDiag.cpp index c474d0199d..b8c68cc452 100644 --- a/Source/Core/DolphinWX/VideoConfigDiag.cpp +++ b/Source/Core/DolphinWX/VideoConfigDiag.cpp @@ -149,7 +149,7 @@ static wxString crop_desc = wxTRANSLATE("Crop the picture from 4:3 to 5:4 or fro static wxString ppshader_desc = wxTRANSLATE("Apply a post-processing effect after finishing a frame.\n\nIf unsure, select (off)."); static wxString cache_efb_copies_desc = wxTRANSLATE("Slightly speeds up EFB to RAM copies by sacrificing emulation accuracy.\nSometimes also increases visual quality.\nIf you're experiencing any issues, try raising texture cache accuracy or disable this option.\n\nIf unsure, leave this unchecked."); static wxString shader_errors_desc = wxTRANSLATE("Usually if shader compilation fails, an error message is displayed.\nHowever, one may skip the popups to allow interruption free gameplay by checking this option.\n\nIf unsure, leave this unchecked."); -static wxString stereo_3d_desc = wxTRANSLATE("Select the stereoscopic 3D mode, stereoscopy allows you to get a better feeling of depth if you have the necessary hardware.\nSide-by-Side and Top-and-Bottom are used by most 3D TVs.\nAnaglyph is used for Red-Cyan colored glasses.\nHeavily decreases emulation speed and sometimes causes issues.\n\nIf unsure, select Off."); +static wxString stereo_3d_desc = wxTRANSLATE("Select the stereoscopic 3D mode, stereoscopy allows you to get a better feeling of depth if you have the necessary hardware.\nSide-by-Side and Top-and-Bottom are used by most 3D TVs.\nAnaglyph is used for Red-Cyan colored glasses.\nHeavily decreases emulation speed and sometimes causes issues.\n\nIf unsure, select Off."); static wxString stereo_depth_desc = wxTRANSLATE("Control the distance between the virtual cameras.\nA higher value creates a stronger feeling of depth while a lower value is more comfortable."); static wxString stereo_convergence_desc = wxTRANSLATE("Control the distance of the convergence plane, this is the distance at which objects will appear to be in front of the screen.\nA higher value creates stronger out-of-screen effects while a lower value is more comfortable."); static wxString stereo_swap_desc = wxTRANSLATE("Swap the left and right eye, mostly useful if you want to view side-by-side cross-eyed.\n\nIf unsure, leave this unchecked."); From da058b3078b19e3d46ff28af18a76104e56cfe59 Mon Sep 17 00:00:00 2001 From: Jules Blok <jules.blok@gmail.com> Date: Mon, 29 Dec 2014 12:00:51 +0100 Subject: [PATCH 3/3] VideoConfig: Fix convergence parameter. Looks like a rebase failed somewhere. --- Source/Core/VideoCommon/GeometryShaderManager.cpp | 2 +- Source/Core/VideoCommon/VideoConfig.h | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/Source/Core/VideoCommon/GeometryShaderManager.cpp b/Source/Core/VideoCommon/GeometryShaderManager.cpp index c9bbd3c482..1d7d5ec029 100644 --- a/Source/Core/VideoCommon/GeometryShaderManager.cpp +++ b/Source/Core/VideoCommon/GeometryShaderManager.cpp @@ -56,7 +56,7 @@ void GeometryShaderManager::SetConstants() float offset = (g_ActiveConfig.iStereoDepth / 1000.0f) * (g_ActiveConfig.iStereoDepthPercentage / 100.0f); constants.stereoparams[0] = g_ActiveConfig.bStereoSwapEyes ? offset : -offset; constants.stereoparams[1] = g_ActiveConfig.bStereoSwapEyes ? -offset : offset; - constants.stereoparams[2] = g_ActiveConfig.iStereoConvergence * (g_ActiveConfig.iStereoConvergencePercent / 100.0f); + constants.stereoparams[2] = g_ActiveConfig.iStereoConvergence * (g_ActiveConfig.iStereoConvergencePercentage / 100.0f); } else { diff --git a/Source/Core/VideoCommon/VideoConfig.h b/Source/Core/VideoCommon/VideoConfig.h index 83807538dc..d868ae5293 100644 --- a/Source/Core/VideoCommon/VideoConfig.h +++ b/Source/Core/VideoCommon/VideoConfig.h @@ -127,8 +127,6 @@ struct VideoConfig final // Stereoscopy bool bStereoEFBMonoDepth; - int iStereoSeparationPercent; - int iStereoConvergencePercent; int iStereoDepthPercentage; int iStereoConvergencePercentage;