VERY experimental Nintendo Switch 2 emulator
C++
gl_state: Remove logic op tracker
ReinUsesLisp3144e7be89fa
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cppindex 5c5273b5d8..9d4b351fb4 100644--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp@@ -1156,15 +1156,10 @@ void RasterizerOpenGL::SyncBlendState() {void RasterizerOpenGL::SyncLogicOpState() {const auto& regs = system.GPU().Maxwell3D().regs;- state.logic_op.enabled = regs.logic_op.enable != 0;-- if (!state.logic_op.enabled)- return;-- ASSERT_MSG(regs.blend.enable[0] == 0,- "Blending and logic op can't be enabled at the same time.");-- state.logic_op.operation = MaxwellToGL::LogicOp(regs.logic_op.operation);+ oglEnable(GL_COLOR_LOGIC_OP, regs.logic_op.enable);+ if (regs.logic_op.enable) {+ glLogicOp(MaxwellToGL::LogicOp(regs.logic_op.operation));+ }}void RasterizerOpenGL::SyncScissorTest(OpenGLState& current_state) {diff --git a/src/video_core/renderer_opengl/gl_state.cpp b/src/video_core/renderer_opengl/gl_state.cppindex e8463da7e4..ddc534eb4c 100644--- a/src/video_core/renderer_opengl/gl_state.cpp+++ b/src/video_core/renderer_opengl/gl_state.cpp@@ -332,14 +332,6 @@ void OpenGLState::ApplyBlending() {cur_state.independant_blend.enabled = independant_blend.enabled;}-void OpenGLState::ApplyLogicOp() {- Enable(GL_COLOR_LOGIC_OP, cur_state.logic_op.enabled, logic_op.enabled);-- if (UpdateValue(cur_state.logic_op.operation, logic_op.operation)) {- glLogicOp(logic_op.operation);- }-}-void OpenGLState::ApplyClipControl() {if (UpdateTie(std::tie(cur_state.clip_control.origin, cur_state.clip_control.depth_mode),std::tie(clip_control.origin, clip_control.depth_mode))) {@@ -400,7 +392,6 @@ void OpenGLState::Apply() {ApplyDepth();ApplyPrimitiveRestart();ApplyBlending();- ApplyLogicOp();ApplyTextures();ApplySamplers();ApplyImages();diff --git a/src/video_core/renderer_opengl/gl_state.h b/src/video_core/renderer_opengl/gl_state.hindex b06a88f013..958af57714 100644--- a/src/video_core/renderer_opengl/gl_state.h+++ b/src/video_core/renderer_opengl/gl_state.h@@ -81,11 +81,6 @@ public:bool enabled = false;} independant_blend;- struct {- bool enabled = false; // GL_LOGIC_OP_MODE- GLenum operation = GL_COPY;- } logic_op;-static constexpr std::size_t NumSamplers = 32 * 5;static constexpr std::size_t NumImages = 8 * 5;std::array<GLuint, NumSamplers> textures = {};@@ -154,7 +149,6 @@ public:void ApplyTargetBlending(std::size_t target, bool force);void ApplyGlobalBlending();void ApplyBlending();- void ApplyLogicOp();void ApplyTextures();void ApplySamplers();void ApplyImages();diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cppindex affc6137ac..104b11b0d0 100644--- a/src/video_core/renderer_opengl/renderer_opengl.cpp+++ b/src/video_core/renderer_opengl/renderer_opengl.cpp@@ -574,6 +574,7 @@ void RendererOpenGL::DrawScreenTriangles(const ScreenInfo& screen_info, float x,// TODO: Signal state tracker about these changesglEnable(GL_CULL_FACE);+ glDisable(GL_COLOR_LOGIC_OP);glDisable(GL_ALPHA_TEST);glDisable(GL_POLYGON_OFFSET_FILL);glCullFace(GL_BACK);