mirror of https://github.com/mgba-emu/mgba.git
GBA Video: Improve speed of window texture generation on AMD
This commit is contained in:
parent
80054994c3
commit
e0ef6a51de
2
CHANGES
2
CHANGES
|
@ -24,6 +24,8 @@ Other fixes:
|
|||
- mGUI: Fix closing down a game if an exit is signalled
|
||||
- mVL: Fix injecting accidentally draining non-injection buffer
|
||||
- VFS: Fix directory node listing on some filesystems
|
||||
Misc:
|
||||
- GBA Video: Improve speed of window texture generation on AMD
|
||||
|
||||
0.8.3: (2020-08-03)
|
||||
Emulation fixes:
|
||||
|
|
|
@ -513,7 +513,7 @@ static const char* const _renderWindow =
|
|||
"uniform ivec4 win1[160];\n"
|
||||
"OUT(0) out ivec4 window;\n"
|
||||
|
||||
"void crop(vec4 windowParams, int flags, inout ivec3 windowFlags) {\n"
|
||||
"bool crop(vec4 windowParams) {\n"
|
||||
" bvec4 compare = lessThan(texCoord.xxyy, windowParams);\n"
|
||||
" compare = equal(compare, bvec4(true, false, true, false));\n"
|
||||
" if (any(compare)) {\n"
|
||||
|
@ -521,25 +521,23 @@ static const char* const _renderWindow =
|
|||
" vec2 v = windowParams.zw;\n"
|
||||
" if (v.x > v.y) {\n"
|
||||
" if (compare.z && compare.w) {\n"
|
||||
" return;\n"
|
||||
" return false;\n"
|
||||
" }\n"
|
||||
" } else if (compare.z || compare.w) {\n"
|
||||
" return;\n"
|
||||
" return false;\n"
|
||||
" }\n"
|
||||
" if (h.x > h.y) {\n"
|
||||
" if (compare.x && compare.y) {\n"
|
||||
" return;\n"
|
||||
" return false;\n"
|
||||
" }\n"
|
||||
" } else if (compare.x || compare.y) {\n"
|
||||
" return;\n"
|
||||
" return false;\n"
|
||||
" }\n"
|
||||
" }\n"
|
||||
" windowFlags.x = flags;\n"
|
||||
" return true;\n"
|
||||
"}\n"
|
||||
|
||||
"vec4 interpolate(ivec4 win[160]) {\n"
|
||||
" vec4 bottom = vec4(win[int(texCoord.y) - 1]);\n"
|
||||
" vec4 top = vec4(win[int(texCoord.y)]);\n"
|
||||
"vec4 interpolate(vec4 top, vec4 bottom) {\n"
|
||||
" if (distance(top, bottom) > 40.) {\n"
|
||||
" return top;\n"
|
||||
" }\n"
|
||||
|
@ -551,14 +549,15 @@ static const char* const _renderWindow =
|
|||
" if ((dispcnt & 0xE0) == 0) {\n"
|
||||
" window = ivec4(dispflags, blend, 0);\n"
|
||||
" } else {\n"
|
||||
" ivec3 windowFlags = ivec3(flags.z, blend);\n"
|
||||
" if ((dispcnt & 0x40) != 0) { \n"
|
||||
" crop(interpolate(win1), flags.y, windowFlags);\n"
|
||||
" ivec4 windowFlags = ivec4(flags.z, blend, 0);\n"
|
||||
" int top = int(texCoord.y);\n"
|
||||
" int bottom = max(top - 1, 0);\n"
|
||||
" if ((dispcnt & 0x20) != 0 && crop(interpolate(vec4(win0[top]), vec4(win0[bottom])))) { \n"
|
||||
" windowFlags.x = flags.x;\n"
|
||||
" } else if ((dispcnt & 0x40) != 0 && crop(interpolate(vec4(win1[top]), vec4(win1[bottom])))) {\n"
|
||||
" windowFlags.x = flags.y;\n"
|
||||
" }\n"
|
||||
" if ((dispcnt & 0x20) != 0) { \n"
|
||||
" crop(interpolate(win0), flags.x, windowFlags);\n"
|
||||
" }\n"
|
||||
" window = ivec4(windowFlags, 0);\n"
|
||||
" window = windowFlags;\n"
|
||||
" }\n"
|
||||
"}\n";
|
||||
|
||||
|
|
Loading…
Reference in New Issue