Skip to content

Commit

Permalink
Merge pull request #11873 from unknownbrackets/stencil-upload
Browse files Browse the repository at this point in the history
GLES: Fix stencil buffer upload at > 1x PSP
  • Loading branch information
hrydgard authored Mar 10, 2019
2 parents c77af18 + 271389b commit 335d257
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion GPU/Common/FramebufferCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 2 additions & 0 deletions GPU/Common/FramebufferCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion GPU/GLES/StencilBufferGLES.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand Down

0 comments on commit 335d257

Please sign in to comment.