StencilBufferGLES: Move SetNoBlendAndMask to the right places.

This commit is contained in:
Henrik Rydgård 2018-01-10 11:13:51 +01:00
parent a642c1a990
commit 58854adb80

View File

@ -110,7 +110,9 @@ bool FramebufferManagerGLES::NotifyStencilUpload(u32 addr, int size, bool skipZe
}
// Let's not bother with the shader if it's just zero.
render_->SetNoBlendAndMask(0x8);
render_->Clear(0, 0, 0, GL_STENCIL_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
render_->SetNoBlendAndMask(0xF);
gstate_c.Dirty(DIRTY_BLEND_STATE | DIRTY_VIEWPORTSCISSOR_STATE);
return true;
}
@ -143,7 +145,6 @@ bool FramebufferManagerGLES::NotifyStencilUpload(u32 addr, int size, bool skipZe
shaderManagerGL_->DirtyLastShader();
DisableState();
render_->SetNoBlendAndMask(0x8);
bool useBlit = gstate_c.Supports(GPU_SUPPORTS_ARB_FRAMEBUFFER_BLIT | GPU_SUPPORTS_NV_FRAMEBUFFER_BLIT);
@ -169,6 +170,7 @@ bool FramebufferManagerGLES::NotifyStencilUpload(u32 addr, int size, bool skipZe
MakePixelTexture(src, dstBuffer->format, dstBuffer->fb_stride, dstBuffer->bufferWidth, dstBuffer->bufferHeight, u1, v1);
textureCacheGL_->ForgetLastTexture();
render_->SetNoBlendAndMask(0x8);
render_->Clear(0, 0, 0, GL_STENCIL_BUFFER_BIT);
render_->SetStencilFunc(GL_TRUE, GL_ALWAYS, 0xFF, 0xFF);
@ -194,8 +196,8 @@ bool FramebufferManagerGLES::NotifyStencilUpload(u32 addr, int size, bool skipZe
draw_->BlitFramebuffer(blitFBO, 0, 0, w, h, dstBuffer->fbo, 0, 0, dstBuffer->renderWidth, dstBuffer->renderHeight, Draw::FB_STENCIL_BIT, Draw::FB_BLIT_NEAREST);
}
render_->SetNoBlendAndMask(0xF);
gstate_c.Dirty(DIRTY_BLEND_STATE | DIRTY_DEPTHSTENCIL_STATE | DIRTY_VIEWPORTSCISSOR_STATE);
RebindFramebuffer();
return true;
}