From 29e05c5ff854c87b79ae06bd71161d0ec2468ac8 Mon Sep 17 00:00:00 2001 From: Jules Blok Date: Mon, 29 Dec 2014 11:18:14 +0100 Subject: [PATCH] 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 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"