diff options
| author | Jules Blok <jules.blok@gmail.com> | 2014-10-29 13:47:24 +0100 |
|---|---|---|
| committer | Jules Blok <jules.blok@gmail.com> | 2014-11-23 14:24:09 +0100 |
| commit | 0a72cf94cb7a206e07e5c69d69ec88057fa33e2b (patch) | |
| tree | d1dfb52b487396abcd3c2b4b5cedc78daccae364 /Source/Core | |
| parent | fa32f751d37604b7af46e7d9d118aacefbc5df76 (diff) | |
TextureCache: Ignore the geometry shader if stereoscopy is disabled.
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/VideoBackends/OGL/TextureCache.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/Source/Core/VideoBackends/OGL/TextureCache.cpp b/Source/Core/VideoBackends/OGL/TextureCache.cpp index 18e575109f..89de707280 100644 --- a/Source/Core/VideoBackends/OGL/TextureCache.cpp +++ b/Source/Core/VideoBackends/OGL/TextureCache.cpp @@ -364,7 +364,7 @@ TextureCache::TextureCache() " ocol0 = texcol * mat4(colmat[0], colmat[1], colmat[2], colmat[3]) + colmat[4];\n" "}\n"; - const char *VProgram = + const char *VProgram = (g_ActiveConfig.bStereo) ? "out vec2 v_uv0;\n" "SAMPLER_BINDING(9) uniform sampler2DArray samp9;\n" "uniform vec4 copy_position;\n" // left, top, right, bottom @@ -373,9 +373,19 @@ TextureCache::TextureCache() " vec2 rawpos = vec2(gl_VertexID&1, gl_VertexID&2);\n" " v_uv0 = mix(copy_position.xy, copy_position.zw, rawpos) / vec2(textureSize(samp9, 0).xy);\n" " gl_Position = vec4(rawpos*2.0-1.0, 0.0, 1.0);\n" + "}\n" : + "out vec3 f_uv0;\n" + "SAMPLER_BINDING(9) uniform sampler2DArray samp9;\n" + "uniform vec4 copy_position;\n" // left, top, right, bottom + "void main()\n" + "{\n" + " vec2 rawpos = vec2(gl_VertexID&1, gl_VertexID&2);\n" + " f_uv0.xy = mix(copy_position.xy, copy_position.zw, rawpos) / vec2(textureSize(samp9, 0).xy);\n" + " f_uv0.z = 0;\n" + " gl_Position = vec4(rawpos*2.0-1.0, 0.0, 1.0);\n" "}\n"; - const char *GProgram = + const char *GProgram = (g_ActiveConfig.bStereo) ? "layout(triangles) in;\n" "layout(triangle_strip, max_vertices = 6) out;\n" "in vec2 v_uv0[];\n" @@ -393,7 +403,7 @@ TextureCache::TextureCache() " }\n" " EndPrimitive();\n" " }\n" - "}\n"; + "}\n" : nullptr; ProgramShaderCache::CompileShader(s_ColorMatrixProgram, VProgram, pColorMatrixProg, GProgram); ProgramShaderCache::CompileShader(s_DepthMatrixProgram, VProgram, pDepthMatrixProg, GProgram); |
