Skip to content

Commit

Permalink
PostProcessing: Don't use GS expansion shader for quad buffering w/ O…
Browse files Browse the repository at this point in the history
…penGL

OpenGL doesn't render to a 2-layer backbuffer like D3D/Vulkan for quad-buffered
stereo, instead drawing twice with the eye selected by glDrawBuffer()
(see OGL::Renderer::RenderXFBToScreen).
  • Loading branch information
stenzek committed Oct 2, 2019
1 parent e6ae204 commit e88c269
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Source/Core/VideoCommon/PostProcessing.cpp
Expand Up @@ -714,11 +714,15 @@ bool PostProcessing::CompilePixelShader()

bool PostProcessing::CompilePipeline()
{
// OpenGL doesn't render to a 2-layer backbuffer like D3D/Vulkan for quad-buffered stereo, instead
// drawing twice and the eye selected by glDrawBuffer() (see OGL::Renderer::RenderXFBToScreen).
const bool use_quad_buffer_gs = g_ActiveConfig.stereo_mode == StereoMode::QuadBuffer &&
g_ActiveConfig.backend_info.api_type != APIType::OpenGL;

AbstractPipelineConfig config = {};
config.vertex_shader = m_vertex_shader.get();
config.geometry_shader = g_ActiveConfig.stereo_mode == StereoMode::QuadBuffer ?
g_shader_cache->GetTexcoordGeometryShader() :
nullptr;
config.geometry_shader =
use_quad_buffer_gs ? g_shader_cache->GetTexcoordGeometryShader() : nullptr;
config.pixel_shader = m_pixel_shader.get();
config.rasterization_state = RenderState::GetNoCullRasterizationState(PrimitiveType::Triangles);
config.depth_state = RenderState::GetNoDepthTestingDepthState();
Expand Down

0 comments on commit e88c269

Please sign in to comment.