mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-21 21:17:19 +00:00
[client] EGL: stop unpacking data across rows
This commit is contained in:
parent
3106d0e3e2
commit
1da50d220e
@ -11,25 +11,22 @@ uniform vec2 outputSize;
|
||||
|
||||
void main()
|
||||
{
|
||||
uvec2 inputSize = uvec2(textureSize(sampler1, 0));
|
||||
uvec2 pos = uvec2(fragCoord * outputSize);
|
||||
uint outputWidth = uint(outputSize.x);
|
||||
uvec2 inputSize = uvec2(textureSize(sampler1, 0));
|
||||
uvec2 outputPos = uvec2(fragCoord * outputSize);
|
||||
|
||||
uint output_idx = pos.y * outputWidth + pos.x;
|
||||
uint fst = outputPos.x * 3u / 4u;
|
||||
vec4 color_0 = texelFetch(sampler1, ivec2(fst, outputPos.y), 0);
|
||||
|
||||
uint fst = output_idx * 3u / 4u;
|
||||
vec4 color_0 = texelFetch(sampler1, ivec2(fst % inputSize.x, fst / inputSize.x), 0);
|
||||
uint snd = (outputPos.x * 3u + 1u) / 4u;
|
||||
vec4 color_1 = texelFetch(sampler1, ivec2(snd, outputPos.y), 0);
|
||||
|
||||
uint snd = (output_idx * 3u + 1u) / 4u;
|
||||
vec4 color_1 = texelFetch(sampler1, ivec2(snd % inputSize.x, snd / inputSize.x), 0);
|
||||
|
||||
uint trd = (output_idx * 3u + 2u) / 4u;
|
||||
vec4 color_2 = texelFetch(sampler1, ivec2(trd % inputSize.x, trd / inputSize.x), 0);
|
||||
uint trd = (outputPos.x * 3u + 2u) / 4u;
|
||||
vec4 color_2 = texelFetch(sampler1, ivec2(trd, outputPos.y), 0);
|
||||
|
||||
fragColor.bgra = vec4(
|
||||
color_0.barg[output_idx % 4u],
|
||||
color_1.gbar[output_idx % 4u],
|
||||
color_2.rgba[output_idx % 4u],
|
||||
color_0.barg[outputPos.x % 4u],
|
||||
color_1.gbar[outputPos.x % 4u],
|
||||
color_2.rgba[outputPos.x % 4u],
|
||||
1.0
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user