Add the other three YUV formats to the shader

This commit is contained in:
Martijn Braam
2024-12-24 22:38:56 +01:00
parent f5248b388e
commit 541dd2f9c3
2 changed files with 17 additions and 3 deletions

View File

@@ -13,7 +13,17 @@ void
main()
{
// Sample format: Y,U,Y,V
vec4 samples = texture2D(texture, texture_coord);
vec4 raw = texture2D(texture, texture_coord);
#if defined(FMT_YUYV)
vec4 samples = raw.xyzw;
#elif defined(FMT_YVYU)
vec4 samples = raw.xwzy;
#elif defined(FMT_UYVY)
vec4 samples = raw.yzwx;
#elif defined(FMT_VYUY)
vec4 samples = raw.wzyx;
#endif
float y = samples.x;
float u = samples.y-0.5;
float v = samples.w-0.5;