renderer_opengl: Fix edge-case where alpha testing might cull presentation

This commit is contained in:
ReinUsesLisp 2020-02-21 03:29:24 -03:00
parent a6a350ddc3
commit ef7f6eb67d
2 changed files with 7 additions and 0 deletions

View file

@ -190,6 +190,11 @@ public:
flags[OpenGL::Dirty::ClipControl] = true; flags[OpenGL::Dirty::ClipControl] = true;
} }
void NotifyAlphaTest() {
auto& flags = system.GPU().Maxwell3D().dirty.flags;
flags[OpenGL::Dirty::AlphaTest] = true;
}
private: private:
Core::System& system; Core::System& system;

View file

@ -591,6 +591,7 @@ void RendererOpenGL::DrawScreen(const Layout::FramebufferLayout& layout) {
state_tracker.NotifyFramebufferSRGB(); state_tracker.NotifyFramebufferSRGB();
state_tracker.NotifyLogicOp(); state_tracker.NotifyLogicOp();
state_tracker.NotifyClipControl(); state_tracker.NotifyClipControl();
state_tracker.NotifyAlphaTest();
program_manager.UseVertexShader(vertex_program.handle); program_manager.UseVertexShader(vertex_program.handle);
program_manager.UseGeometryShader(0); program_manager.UseGeometryShader(0);
@ -608,6 +609,7 @@ void RendererOpenGL::DrawScreen(const Layout::FramebufferLayout& layout) {
glDisable(GL_STENCIL_TEST); glDisable(GL_STENCIL_TEST);
glDisable(GL_POLYGON_OFFSET_FILL); glDisable(GL_POLYGON_OFFSET_FILL);
glDisable(GL_RASTERIZER_DISCARD); glDisable(GL_RASTERIZER_DISCARD);
glDisable(GL_ALPHA_TEST);
glDisablei(GL_BLEND, 0); glDisablei(GL_BLEND, 0);
glDisablei(GL_SCISSOR_TEST, 0); glDisablei(GL_SCISSOR_TEST, 0);
glCullFace(GL_BACK); glCullFace(GL_BACK);