mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-10-15 03:48:09 +00:00
[client] egl: convert desktop to use desktop_rects
This commit is contained in:
@@ -1,20 +1,13 @@
|
||||
#version 300 es
|
||||
|
||||
layout(location = 0) in vec3 vertexPosition_modelspace;
|
||||
layout(location = 1) in vec2 vertexUV;
|
||||
|
||||
uniform vec4 position;
|
||||
|
||||
layout(location = 0) in vec2 vertex;
|
||||
out highp vec2 uv;
|
||||
|
||||
uniform highp vec2 uvScale;
|
||||
uniform mat3x2 transform;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position.xyz = vertexPosition_modelspace;
|
||||
gl_Position.w = 1.0;
|
||||
gl_Position.x -= position.x;
|
||||
gl_Position.y -= position.y;
|
||||
gl_Position.x *= position.z;
|
||||
gl_Position.y *= position.w;
|
||||
|
||||
uv = vertexUV;
|
||||
gl_Position = vec4(transform * vec3(vertex, 1.0), 0.0, 1.0);
|
||||
uv = vertex * uvScale;
|
||||
}
|
||||
|
@@ -12,7 +12,6 @@ uniform sampler2D sampler1;
|
||||
|
||||
uniform int scaleAlgo;
|
||||
uniform highp vec2 size;
|
||||
uniform int rotate;
|
||||
|
||||
uniform int nv;
|
||||
uniform highp float nvGain;
|
||||
@@ -20,35 +19,14 @@ uniform int cbMode;
|
||||
|
||||
void main()
|
||||
{
|
||||
highp vec2 ruv;
|
||||
if (rotate == 0) // 0
|
||||
{
|
||||
ruv = uv;
|
||||
}
|
||||
else if (rotate == 1) // 90
|
||||
{
|
||||
ruv.x = uv.y;
|
||||
ruv.y = -uv.x + 1.0f;
|
||||
}
|
||||
else if (rotate == 2) // 180
|
||||
{
|
||||
ruv.x = -uv.x + 1.0f;
|
||||
ruv.y = -uv.y + 1.0f;
|
||||
}
|
||||
else if (rotate == 3) // 270
|
||||
{
|
||||
ruv.x = -uv.y + 1.0f;
|
||||
ruv.y = uv.x;
|
||||
}
|
||||
|
||||
switch (scaleAlgo)
|
||||
{
|
||||
case EGL_SCALE_NEAREST:
|
||||
color = texelFetch(sampler1, ivec2(ruv * size), 0);
|
||||
color = texelFetch(sampler1, ivec2(uv * size), 0);
|
||||
break;
|
||||
|
||||
case EGL_SCALE_LINEAR:
|
||||
color = texture(sampler1, ruv);
|
||||
color = texture(sampler1, uv);
|
||||
break;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user