GBA Video: Fix mosaic in modes 1-5 in OpenGL (fixes #1620)

This commit is contained in:
Vicki Pfau 2020-01-20 18:09:26 -08:00
parent 97e2cf08ab
commit 84bddfad69
2 changed files with 7 additions and 6 deletions

View File

@ -102,6 +102,7 @@ Other fixes:
- Core: Fix uninitialized memory issues with graphics caches - Core: Fix uninitialized memory issues with graphics caches
- Core: Return null for out of bounds cached tile VRAM querying - Core: Return null for out of bounds cached tile VRAM querying
- GBA Video: Fix OpenGL fragment data binding - GBA Video: Fix OpenGL fragment data binding
- GBA Video: Fix mosaic in modes 1-5 in OpenGL (fixes mgba.io/i/1620)
- Debugger: Fix tracing skipping instructions (fixes mgba.io/i/1614) - Debugger: Fix tracing skipping instructions (fixes mgba.io/i/1614)
- OpenGL: Only invalidate texture if dimensions change (fixes mgba.io/i/1612) - OpenGL: Only invalidate texture if dimensions change (fixes mgba.io/i/1612)
- Qt: Fix fast forward mute being reset (fixes mgba.io/i/1574) - Qt: Fix fast forward mute being reset (fixes mgba.io/i/1574)

View File

@ -268,10 +268,10 @@ static const char* const _renderMode2 =
" ivec2 offset[4];\n" " ivec2 offset[4];\n"
" vec2 incoord = texCoord;\n" " vec2 incoord = texCoord;\n"
" if (mosaic.x > 1) {\n" " if (mosaic.x > 1) {\n"
" incoord.x = float(int(incoord.x) % mosaic.x);\n" " incoord.x = floor(incoord.x - float(int(incoord.x) % mosaic.x));\n"
" }\n" " }\n"
" if (mosaic.y > 1) {\n" " if (mosaic.y > 1) {\n"
" incoord.y = float(int(incoord.y) % mosaic.y);\n" " incoord.y = floor(incoord.y - float(int(incoord.y) % mosaic.y));\n"
" }\n" " }\n"
" loadAffine(int(incoord.y), mat, offset);\n" " loadAffine(int(incoord.y), mat, offset);\n"
" float y = fract(incoord.y);\n" " float y = fract(incoord.y);\n"
@ -321,10 +321,10 @@ static const char* const _renderMode35 =
" ivec2 offset[4];\n" " ivec2 offset[4];\n"
" vec2 incoord = texCoord;\n" " vec2 incoord = texCoord;\n"
" if (mosaic.x > 1) {\n" " if (mosaic.x > 1) {\n"
" incoord.x = float(int(incoord.x) % mosaic.x);\n" " incoord.x = floor(incoord.x - float(int(incoord.x) % mosaic.x));\n"
" }\n" " }\n"
" if (mosaic.y > 1) {\n" " if (mosaic.y > 1) {\n"
" incoord.y = float(int(incoord.y) % mosaic.y);\n" " incoord.y = floor(incoord.y - float(int(incoord.y) % mosaic.y));\n"
" }\n" " }\n"
" loadAffine(int(incoord.y), mat, offset);\n" " loadAffine(int(incoord.y), mat, offset);\n"
" float y = fract(incoord.y);\n" " float y = fract(incoord.y);\n"
@ -386,10 +386,10 @@ static const char* const _renderMode4 =
" ivec2 offset[4];\n" " ivec2 offset[4];\n"
" vec2 incoord = texCoord;\n" " vec2 incoord = texCoord;\n"
" if (mosaic.x > 1) {\n" " if (mosaic.x > 1) {\n"
" incoord.x = float(int(incoord.x) % mosaic.x);\n" " incoord.x = floor(incoord.x - float(int(incoord.x) % mosaic.x));\n"
" }\n" " }\n"
" if (mosaic.y > 1) {\n" " if (mosaic.y > 1) {\n"
" incoord.y = float(int(incoord.y) % mosaic.y);\n" " incoord.y = floor(incoord.y - float(int(incoord.y) % mosaic.y));\n"
" }\n" " }\n"
" loadAffine(int(incoord.y), mat, offset);\n" " loadAffine(int(incoord.y), mat, offset);\n"
" float y = fract(incoord.y);\n" " float y = fract(incoord.y);\n"