GBA Video: Fix sprites with mid-frame palette changes in GL (fixes #2476)

This commit is contained in:
Vicki Pfau 2022-05-29 18:49:40 -07:00
parent 511a12c507
commit 0c02f2798a
2 changed files with 2 additions and 1 deletions

View File

@ -37,6 +37,7 @@ Emulation fixes:
- GBA Video: Ignore horizontally off-screen sprite timing (fixes mgba.io/i/2391)
- GBA Video: Fix Hblank timing (fixes mgba.io/i/2131, mgba.io/i/2310)
- GBA Video: Fix rare crash in modes 3-5
- GBA Video: Fix sprites with mid-frame palette changes in GL (fixes mgba.io/i/2476)
Other fixes:
- Core: Don't attempt to restore rewind diffs past start of rewind
- Core: Fix the runloop resuming after a game has crashed (fixes mgba.io/i/2451)

View File

@ -462,7 +462,7 @@ static const char* const _renderObj =
" discard;\n"
" }\n"
" int paletteEntry = renderTile((coord.x >> 3) + (coord.y >> 3) * stride, localPalette, coord & 7);\n"
" color = texelFetch(palette, ivec2(paletteEntry + 256, coord.y), 0);\n"
" color = texelFetch(palette, ivec2(paletteEntry + 256, int(texCoord.y) + mosaic.w), 0);\n"
" flags = inflags;\n"
" gl_FragDepth = float(flags.x) / 16.;\n"
" window = ivec4(objwin, 0);\n"