2023-11-02 20:03:32 +00:00
|
|
|
#version 300 es
|
|
|
|
#extension GL_OES_EGL_image_external_essl3 : enable
|
|
|
|
|
|
|
|
precision highp float;
|
|
|
|
|
|
|
|
in vec2 fragCoord;
|
|
|
|
out vec4 fragColor;
|
|
|
|
|
|
|
|
uniform sampler2D sampler1;
|
|
|
|
uniform vec2 outputSize;
|
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
2023-11-06 02:04:58 +00:00
|
|
|
uvec2 inputSize = uvec2(textureSize(sampler1, 0));
|
|
|
|
uvec2 outputPos = uvec2(fragCoord * outputSize);
|
2023-11-02 20:03:32 +00:00
|
|
|
|
2023-11-06 02:04:58 +00:00
|
|
|
uint fst = outputPos.x * 3u / 4u;
|
|
|
|
vec4 color_0 = texelFetch(sampler1, ivec2(fst, outputPos.y), 0);
|
2023-11-02 20:03:32 +00:00
|
|
|
|
2023-11-06 02:04:58 +00:00
|
|
|
uint snd = (outputPos.x * 3u + 1u) / 4u;
|
|
|
|
vec4 color_1 = texelFetch(sampler1, ivec2(snd, outputPos.y), 0);
|
2023-11-02 20:03:32 +00:00
|
|
|
|
2023-11-06 02:04:58 +00:00
|
|
|
uint trd = (outputPos.x * 3u + 2u) / 4u;
|
|
|
|
vec4 color_2 = texelFetch(sampler1, ivec2(trd, outputPos.y), 0);
|
2023-11-02 20:03:32 +00:00
|
|
|
|
|
|
|
fragColor.bgra = vec4(
|
2023-11-06 02:04:58 +00:00
|
|
|
color_0.barg[outputPos.x % 4u],
|
|
|
|
color_1.gbar[outputPos.x % 4u],
|
|
|
|
color_2.rgba[outputPos.x % 4u],
|
2023-11-02 20:03:32 +00:00
|
|
|
1.0
|
|
|
|
);
|
|
|
|
}
|