GPU: forward BG0HOFS to internal rendering engine register for 3D layer scroll (only when the rendering engine is enabled).

fixes #840

thank you RSDuck and Hydr8gon for your insight into this.
This commit is contained in:
Arisotura
2020-12-10 19:12:08 +01:00
parent 1dbe69c6be
commit 66cec85a9a
6 changed files with 81 additions and 37 deletions

View File

@ -40,6 +40,7 @@ void main()
const char* kCompositorFS_Nearest = R"(#version 140
uniform uint u3DScale;
uniform int u3DXPos;
uniform usampler2D ScreenTex;
uniform sampler2D _3DTex;
@ -52,6 +53,8 @@ void main()
{
ivec4 pixel = ivec4(texelFetch(ScreenTex, ivec2(fTexcoord), 0));
float _3dxpos = float(u3DXPos);
ivec4 mbright = ivec4(texelFetch(ScreenTex, ivec2(256*3, int(fTexcoord.y)), 0));
int dispmode = mbright.b & 0x3;
@ -68,7 +71,7 @@ void main()
{
// 3D on top, blending
float xpos = val3.r + fract(fTexcoord.x);
float xpos = fTexcoord.x + _3dxpos;
float ypos = mod(fTexcoord.y, 192);
ivec4 _3dpix = ivec4(texelFetch(_3DTex, ivec2(vec2(xpos, ypos)*u3DScale), 0).bgra
* vec4(63,63,63,31));
@ -89,7 +92,7 @@ void main()
{
// 3D on bottom, blending
float xpos = val3.r + fract(fTexcoord.x);
float xpos = fTexcoord.x + _3dxpos;
float ypos = mod(fTexcoord.y, 192);
ivec4 _3dpix = ivec4(texelFetch(_3DTex, ivec2(vec2(xpos, ypos)*u3DScale), 0).bgra
* vec4(63,63,63,31));
@ -109,7 +112,7 @@ void main()
{
// 3D on top, normal/fade
float xpos = val3.r + fract(fTexcoord.x);
float xpos = fTexcoord.x + _3dxpos;
float ypos = mod(fTexcoord.y, 192);
ivec4 _3dpix = ivec4(texelFetch(_3DTex, ivec2(vec2(xpos, ypos)*u3DScale), 0).bgra
* vec4(63,63,63,31));