From 22bf124631e85fccfcc01989b9523981116ef052 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Thu, 18 Jan 2018 21:16:06 -0800 Subject: [PATCH] GLES: Document stencil clearing bug. --- GPU/GLES/StencilBufferGLES.cpp | 1 + ext/native/thin3d/GLQueueRunner.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/GPU/GLES/StencilBufferGLES.cpp b/GPU/GLES/StencilBufferGLES.cpp index 4345f1b14f..980c3d4406 100644 --- a/GPU/GLES/StencilBufferGLES.cpp +++ b/GPU/GLES/StencilBufferGLES.cpp @@ -113,6 +113,7 @@ bool FramebufferManagerGLES::NotifyStencilUpload(u32 addr, int size, bool skipZe if (dstBuffer->fbo) { draw_->BindFramebufferAsRenderTarget(dstBuffer->fbo, { Draw::RPAction::KEEP, Draw::RPAction::KEEP, Draw::RPAction::CLEAR }); } + // TODO: This incorrectly does not apply to the clear currently. render_->SetNoBlendAndMask(0x8); render_->Clear(0, 0, 0, GL_STENCIL_BUFFER_BIT | GL_COLOR_BUFFER_BIT); render_->SetNoBlendAndMask(0xF); diff --git a/ext/native/thin3d/GLQueueRunner.cpp b/ext/native/thin3d/GLQueueRunner.cpp index 4b6bedada7..0434a997f8 100644 --- a/ext/native/thin3d/GLQueueRunner.cpp +++ b/ext/native/thin3d/GLQueueRunner.cpp @@ -498,6 +498,8 @@ void GLQueueRunner::PerformRenderPass(const GLRStep &step) { break; case GLRRenderCommand::CLEAR: glDisable(GL_SCISSOR_TEST); + // TODO: We sometimes pass a color mask in that we want to respect (StencilBufferGLES.) + // We want to clear to only clear alpha, in that case. glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); colorMask = 0xF; if (c.clear.clearMask & GL_COLOR_BUFFER_BIT) {