1 uniform sampler2D PREFIX(tex_y);
2 uniform sampler2D PREFIX(tex_cb);
3 uniform sampler2D PREFIX(tex_cr);
5 vec4 FUNCNAME(vec2 tc) {
9 ycbcr_a.rgb = PREFIX(ycbcr_matrix) * rgba.rgb + PREFIX(offset);
12 // If we use limited-range Y'CbCr, the card's usual 0–255 clamping
13 // won't be enough, so we need to clamp ourselves here.
15 // We clamp before dither, which is a bit unfortunate, since
16 // it means dither can take us out of the clamped range again.
17 // However, since DitherEffect never adds enough dither to change
18 // the quantized levels, we will be fine in practice.
19 ycbcr_a.rgb = clamp(ycbcr_a.rgb, PREFIX(ycbcr_min), PREFIX(ycbcr_max));