1
0
Fork 0

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.
This commit is contained in:
Lioncash 2020-05-01 06:10:30 -04:00
parent db5b8b9c88
commit 437453d32b
1 changed files with 6 additions and 4 deletions

View File

@ -390,12 +390,14 @@ bool RasterizerOpenGL::SetupVertexShader() {
bool RasterizerOpenGL::SetupGeometryShader() { bool RasterizerOpenGL::SetupGeometryShader() {
MICROPROFILE_SCOPE(OpenGL_GS); MICROPROFILE_SCOPE(OpenGL_GS);
const auto& regs = Pica::g_state.regs; const auto& regs = Pica::g_state.regs;
if (regs.pipeline.use_gs == Pica::PipelineRegs::UseGS::No) {
shader_program_manager->UseFixedGeometryShader(regs); if (regs.pipeline.use_gs != Pica::PipelineRegs::UseGS::No) {
return true;
} else {
LOG_ERROR(Render_OpenGL, "Accelerate draw doesn't support geometry shader"); 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) { bool RasterizerOpenGL::AccelerateDrawBatch(bool is_indexed) {