Rewrite YUV processing pipeline.

Use a 4-channel texture instead for packed YUV data so
every pixel in the texture has all the 4:2:2 color data
available.
This commit is contained in:
Martijn Braam
2024-12-23 17:29:46 +01:00
parent 1b5a871641
commit 8fbea82b2b
5 changed files with 55 additions and 37 deletions

View File

@@ -8,18 +8,11 @@ attribute vec2 tex_coord;
uniform mat3 transform;
uniform vec2 pixel_size;
varying vec2 top_left_uv;
varying vec2 top_right_uv;
varying vec2 bottom_left_uv;
varying vec2 bottom_right_uv;
varying vec2 texture_coord;
void
main()
{
top_left_uv = tex_coord - pixel_size / 2.0;
bottom_right_uv = tex_coord + pixel_size / 2.0;
top_right_uv = vec2(top_left_uv.x, bottom_right_uv.y);
bottom_left_uv = vec2(bottom_right_uv.x, top_left_uv.y);
texture_coord = vert.xy * vec2(0.5, 0.5) + vec2(0.5, 0.5);
gl_Position = vec4(transform * vec3(vert, 1), 1);
}