From 5b3266be345e12baaa9227faf944c40dae232170 Mon Sep 17 00:00:00 2001 From: wheremyfoodat Date: Sat, 17 Jun 2023 02:22:19 +0300 Subject: [PATCH] Fix merge conflict --- src/core/renderer_gl/renderer_gl.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/core/renderer_gl/renderer_gl.cpp b/src/core/renderer_gl/renderer_gl.cpp index e6e956fa..789c3e1b 100644 --- a/src/core/renderer_gl/renderer_gl.cpp +++ b/src/core/renderer_gl/renderer_gl.cpp @@ -237,15 +237,6 @@ void Renderer::initGraphicsContext() { reset(); } -// TODO: Maybe merge this with drawVertices -void Renderer::getGraphicsContext() { - OpenGL::disableScissor(); - - vbo.bind(); - vao.bind(); - triangleProgram.use(); -} - // Set up the OpenGL blending context to match the emulated PICA void Renderer::setupBlending() { const bool blendingEnabled = (regs[PICAInternalRegs::ColourOperation] & (1 << 8)) != 0; @@ -292,6 +283,15 @@ void Renderer::setupBlending() { } void Renderer::drawVertices(OpenGL::Primitives primType, std::span vertices) { + // TODO: We should implement a GL state tracker that tracks settings like scissor, blending, bound program, etc + // This way if we attempt to eg do multiple glEnable(GL_BLEND) calls in a row, it will say "Oh blending is already enabled" + // And not actually perform the very expensive driver call for it + OpenGL::disableScissor(); + + vbo.bind(); + vao.bind(); + triangleProgram.use(); + // Adjust alpha test if necessary const u32 alphaControl = regs[PICAInternalRegs::AlphaTestConfig]; if (alphaControl != oldAlphaControl) {