all repos — mgba @ ac7ae74822d2740f82b62a644e88fbed789ad2be

mGBA Game Boy Advance Emulator

GBA Video: Fix GL sprite window blending
Vicki Pfau vi@endrift.com
Thu, 16 May 2019 09:59:49 -0700
commit

ac7ae74822d2740f82b62a644e88fbed789ad2be

parent

b92a08e6f1fddee946c93030fceab0af83aea7a0

1 files changed, 7 insertions(+), 8 deletions(-)

jump to
M src/gba/renderers/gl.csrc/gba/renderers/gl.c

@@ -317,11 +317,6 @@ " vec4 topPixel = backdrop;\n"

" vec4 bottomPixel = backdrop;\n" " ivec4 topFlags = ivec4(backdropFlags * flagCoeff);\n" " ivec4 bottomFlags = ivec4(backdropFlags * flagCoeff);\n" - " if ((layerWindow & 16) == 0) {\n" - " vec4 pix = texelFetch(layers[4], ivec2(texCoord * scale), 0);\n" - " ivec4 inflags = ivec4(texelFetch(flags[4], ivec2(texCoord * scale), 0) * flagCoeff);\n" - " composite(pix, inflags, topPixel, topFlags, bottomPixel, bottomFlags);\n" - " }\n" " if ((layerWindow & 1) == 0) {\n" " vec4 pix = texelFetch(layers[0], ivec2(texCoord * scale), 0);\n" " ivec4 inflags = ivec4(texelFetch(flags[0], ivec2(texCoord * scale), 0) * flagCoeff);\n"

@@ -343,7 +338,12 @@ " ivec4 inflags = ivec4(texelFetch(flags[3], ivec2(texCoord * scale), 0) * flagCoeff);\n"

" composite(pix, inflags, topPixel, topFlags, bottomPixel, bottomFlags);\n" " }\n" " if ((layerWindow & 32) != 0) {\n" - " topFlags.y = 0;\n" + " topFlags.y &= ~1;\n" + " }\n" + " if ((layerWindow & 16) == 0) {\n" + " vec4 pix = texelFetch(layers[4], ivec2(texCoord * scale), 0);\n" + " ivec4 inflags = ivec4(texelFetch(flags[4], ivec2(texCoord * scale), 0) * flagCoeff);\n" + " composite(pix, inflags, topPixel, topFlags, bottomPixel, bottomFlags);\n" " }\n" " if ((topFlags.y & 13) == 5) {\n" " if ((bottomFlags.y & 2) == 2) {\n"

@@ -827,9 +827,8 @@ glDrawBuffers(2, (GLenum[]) { GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1 });

glClear(GL_COLOR_BUFFER_BIT); } glDrawBuffers(1, (GLenum[]) { GL_COLOR_ATTACHMENT0 }); - glEnable(GL_SCISSOR_TEST); } - glBindFramebuffer(GL_FRAMEBUFFER, 0); + glEnable(GL_SCISSOR_TEST); if (GBARegisterDISPCNTGetMode(glRenderer->dispcnt) != 0) { if (glRenderer->firstAffine < 0) {