mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-01-29 19:55:37 +00:00
Fixed multiple issues with the postprocessing shaders.
This commit is contained in:
parent
b335901ee6
commit
a6b95fdea4
|
@ -664,16 +664,19 @@ void RendererOpenGL::shaderPostprocessing(unsigned int shaders,
|
|||
mTrans = getProjectionMatrixNormal() * getIdentity();
|
||||
}
|
||||
else {
|
||||
if ((shaderCalls + (textureRGBA ? 1 : 0)) % 2 == 0)
|
||||
if ((shaderCalls + (textureRGBA ? 1 : 0)) % 2 == 0 && !(textureRGBA && shaderCalls == 1))
|
||||
GL_CHECK_ERROR(glBlitFramebuffer(0, 0, width + mPaddingWidth, height - mScreenOffsetY,
|
||||
-mScreenOffsetX - mPaddingWidth, mScreenOffsetY,
|
||||
width - mScreenOffsetX, height, GL_COLOR_BUFFER_BIT,
|
||||
GL_NEAREST));
|
||||
else
|
||||
GL_CHECK_ERROR(glBlitFramebuffer(
|
||||
0, 0, width + mPaddingWidth, height + (mPaddingHeight / 2),
|
||||
width + mScreenOffsetX + mPaddingWidth, height - mScreenOffsetY, mScreenOffsetX,
|
||||
-(mPaddingHeight / 2) - mScreenOffsetY, GL_COLOR_BUFFER_BIT, GL_NEAREST));
|
||||
GL_CHECK_ERROR(glBlitFramebuffer(0, 0, width + mPaddingWidth, height - mScreenOffsetY,
|
||||
width + mScreenOffsetX + mPaddingWidth,
|
||||
height - mScreenOffsetY, mScreenOffsetX, 0,
|
||||
GL_COLOR_BUFFER_BIT, GL_NEAREST));
|
||||
// For correct rendering if the blurred background is disabled when opening menus.
|
||||
if (textureRGBA && shaderCalls == 1)
|
||||
mTrans = getProjectionMatrixNormal() * getIdentity();
|
||||
}
|
||||
|
||||
if (shaderCalls > 1)
|
||||
|
@ -704,6 +707,9 @@ void RendererOpenGL::shaderPostprocessing(unsigned int shaders,
|
|||
drawTriangleStrips(vertices, 4, BlendFactor::SRC_ALPHA,
|
||||
BlendFactor::ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
if (shaderCalls == 1)
|
||||
break;
|
||||
|
||||
if (firstFBO) {
|
||||
bindTexture(mPostProcTexture2);
|
||||
GL_CHECK_ERROR(glBindFramebuffer(GL_READ_FRAMEBUFFER, mShaderFBO2));
|
||||
|
|
Loading…
Reference in a new issue