From 437453d32be075bd5542aadcebc4700ae39e9c7c Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 1 May 2020 06:10:30 -0400 Subject: [PATCH] gl_rasterizer: Amend missing return value in branch in SetupGeometryShader() Previously undefined behavior was being invoked in the case that geometry shaders weren't supported. --- src/video_core/renderer_opengl/gl_rasterizer.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index b2fd23ff7d..048c9dbbbe 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -390,12 +390,14 @@ bool RasterizerOpenGL::SetupVertexShader() { bool RasterizerOpenGL::SetupGeometryShader() { MICROPROFILE_SCOPE(OpenGL_GS); const auto& regs = Pica::g_state.regs; - if (regs.pipeline.use_gs == Pica::PipelineRegs::UseGS::No) { - shader_program_manager->UseFixedGeometryShader(regs); - return true; - } else { + + if (regs.pipeline.use_gs != Pica::PipelineRegs::UseGS::No) { LOG_ERROR(Render_OpenGL, "Accelerate draw doesn't support geometry shader"); + return false; } + + shader_program_manager->UseFixedGeometryShader(regs); + return true; } bool RasterizerOpenGL::AccelerateDrawBatch(bool is_indexed) {