Skip to content
Permalink
Browse files

GLES: Fix stencil buffer upload at > 1x PSP.

Also fixes crashes on ATI.  See #6627.
  • Loading branch information...
unknownbrackets committed Mar 10, 2019
1 parent c77af18 commit 271389b8e5556d7531107be209d920b72e65df0a
Showing with 5 additions and 2 deletions.
  1. +2 −1 GPU/Common/FramebufferCommon.cpp
  2. +2 −0 GPU/Common/FramebufferCommon.h
  3. +1 −1 GPU/GLES/StencilBufferGLES.cpp
@@ -1863,7 +1863,8 @@ Draw::Framebuffer *FramebufferManagerCommon::GetTempFBO(TempFBO reason, u16 w, u
}

textureCache_->ForgetLastTexture();
Draw::Framebuffer *fbo = draw_->CreateFramebuffer({ w, h, 1, 1, false, depth });
bool z_stencil = reason == TempFBO::STENCIL;
Draw::Framebuffer *fbo = draw_->CreateFramebuffer({ w, h, 1, 1, z_stencil, depth });
if (!fbo)
return fbo;

@@ -162,6 +162,8 @@ enum class TempFBO {
BLIT,
// For copies of framebuffers (e.g. shader blending.)
COPY,
// Used to copy stencil data, means we need a stencil backing.
STENCIL,
};

inline Draw::DataFormat GEFormatToThin3D(int geFormat) {
@@ -168,7 +168,7 @@ bool FramebufferManagerGLES::NotifyStencilUpload(u32 addr, int size, bool skipZe

Draw::Framebuffer *blitFBO = nullptr;
if (useBlit) {
blitFBO = GetTempFBO(TempFBO::COPY, w, h, Draw::FBO_8888);
blitFBO = GetTempFBO(TempFBO::STENCIL, w, h, Draw::FBO_8888);
draw_->BindFramebufferAsRenderTarget(blitFBO, { Draw::RPAction::DONT_CARE, Draw::RPAction::DONT_CARE, Draw::RPAction::DONT_CARE });
} else if (dstBuffer->fbo) {
draw_->BindFramebufferAsRenderTarget(dstBuffer->fbo, { Draw::RPAction::KEEP, Draw::RPAction::KEEP, Draw::RPAction::DONT_CARE });

0 comments on commit 271389b

Please sign in to comment.
You can’t perform that action at this time.