VERY experimental Nintendo Switch 2 emulator
C++
gl_state: Remove alpha test tracking
ReinUsesLispcbc174ce6fec
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cppindex a080c3e81e..d1034c2a22 100644--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp@@ -1225,12 +1225,10 @@ void RasterizerOpenGL::SyncAlphaTest() {UNIMPLEMENTED_IF_MSG(regs.alpha_test_enabled != 0 && regs.rt_control.count > 1,"Alpha Testing is enabled with more than one rendertarget");- state.alpha_test.enabled = regs.alpha_test_enabled;- if (!state.alpha_test.enabled) {- return;+ oglEnable(GL_ALPHA_TEST, regs.alpha_test_enabled);+ if (regs.alpha_test_enabled) {+ glAlphaFunc(MaxwellToGL::ComparisonOp(regs.alpha_test_func), regs.alpha_test_ref);}- state.alpha_test.func = MaxwellToGL::ComparisonOp(regs.alpha_test_func);- state.alpha_test.ref = regs.alpha_test_ref;}} // namespace OpenGLdiff --git a/src/video_core/renderer_opengl/gl_state.cpp b/src/video_core/renderer_opengl/gl_state.cppindex 08e86b5999..59fd8e4219 100644--- a/src/video_core/renderer_opengl/gl_state.cpp+++ b/src/video_core/renderer_opengl/gl_state.cpp@@ -368,14 +368,6 @@ void OpenGLState::ApplyPolygonOffset() {}}-void OpenGLState::ApplyAlphaTest() {- Enable(GL_ALPHA_TEST, cur_state.alpha_test.enabled, alpha_test.enabled);- if (UpdateTie(std::tie(cur_state.alpha_test.func, cur_state.alpha_test.ref),- std::tie(alpha_test.func, alpha_test.ref))) {- glAlphaFunc(alpha_test.func, alpha_test.ref);- }-}-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))) {@@ -441,7 +433,6 @@ void OpenGLState::Apply() {ApplySamplers();ApplyImages();ApplyPolygonOffset();- ApplyAlphaTest();ApplyClipControl();ApplyRenderBuffer();}diff --git a/src/video_core/renderer_opengl/gl_state.h b/src/video_core/renderer_opengl/gl_state.hindex ae30b95655..f0e02e717d 100644--- a/src/video_core/renderer_opengl/gl_state.h+++ b/src/video_core/renderer_opengl/gl_state.h@@ -133,12 +133,6 @@ public:GLfloat clamp = 0.0f;} polygon_offset;- struct {- bool enabled = false; // GL_ALPHA_TEST- GLenum func = GL_ALWAYS; // GL_ALPHA_TEST_FUNC- GLfloat ref = 0.0f; // GL_ALPHA_TEST_REF- } alpha_test;-std::array<bool, 8> clip_distance = {}; // GL_CLIP_DISTANCEstruct {@@ -182,7 +176,6 @@ public:void ApplyImages();void ApplyDepthClamp();void ApplyPolygonOffset();- void ApplyAlphaTest();void ApplyClipControl();void ApplyRenderBuffer();diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cppindex 3d6125dc1f..0879a5fb12 100644--- a/src/video_core/renderer_opengl/renderer_opengl.cpp+++ b/src/video_core/renderer_opengl/renderer_opengl.cpp@@ -573,6 +573,7 @@ void RendererOpenGL::DrawScreenTriangles(const ScreenInfo& screen_info, float x,state.Apply();// TODO: Signal state tracker about these changes+ glDisable(GL_ALPHA_TEST);glEnable(GL_CULL_FACE);glCullFace(GL_BACK);glFrontFace(GL_CW);