Skip to content
Snippets Groups Projects
Commit 6df25e9c authored by ReinUsesLisp's avatar ReinUsesLisp
Browse files

gl_rasterizer: Apply just the needed state on Clear

parent 97648f48
No related branches found
No related tags found
No related merge requests found
...@@ -582,9 +582,6 @@ std::pair<bool, bool> RasterizerOpenGL::ConfigureFramebuffers( ...@@ -582,9 +582,6 @@ std::pair<bool, bool> RasterizerOpenGL::ConfigureFramebuffers(
} }
void RasterizerOpenGL::Clear() { void RasterizerOpenGL::Clear() {
const auto prev_state{state};
SCOPE_EXIT({ prev_state.Apply(); });
const auto& regs = system.GPU().Maxwell3D().regs; const auto& regs = system.GPU().Maxwell3D().regs;
bool use_color{}; bool use_color{};
bool use_depth{}; bool use_depth{};
...@@ -656,7 +653,10 @@ void RasterizerOpenGL::Clear() { ...@@ -656,7 +653,10 @@ void RasterizerOpenGL::Clear() {
clear_state.EmulateViewportWithScissor(); clear_state.EmulateViewportWithScissor();
} }
clear_state.Apply(); clear_state.ApplyColorMask();
clear_state.ApplyDepth();
clear_state.ApplyStencilTest();
clear_state.ApplyViewport();
if (use_color) { if (use_color) {
glClearBufferfv(GL_COLOR, regs.clear_buffers.RT, regs.clear_color); glClearBufferfv(GL_COLOR, regs.clear_buffers.RT, regs.clear_color);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment