[client] egl: move rotation into the fragment shader

This commit is contained in:
Geoffrey McRae
2021-01-15 13:13:39 +11:00
parent 72c86d7125
commit cbeae46c0b
3 changed files with 32 additions and 68 deletions

View File

@@ -2,36 +2,15 @@
in highp vec2 uv;
out highp vec4 color;
uniform int rotate;
uniform sampler2D sampler1;
uniform lowp int rotate;
uniform int cbMode;
void main()
{
highp vec2 ruv;
if (rotate == 0) // up
{
ruv = uv;
}
else if (rotate == 1) // down
{
ruv.x = -uv.x + 1.0f;
ruv.y = -uv.y + 1.0f;
}
else if (rotate == 2) // left
{
ruv.x = -uv.y + 1.0f;
ruv.y = uv.x;
}
else if (rotate == 3) // right
{
ruv.x = uv.y;
ruv.y = -uv.x + 1.0f;
}
color = texture(sampler1, ruv);
color = texture(sampler1, uv);
if (cbMode > 0)
{