Skip to content

Instantly share code, notes, and snippets.

@jamie-pate
jamie-pate / fragment_shader_YUV420P_to_RGB.frag
Created November 23, 2020 23:44 — forked from crearo/fragment_shader_YUV420P_to_RGB.frag
A fragment shader to convert YUV420P to RGB.
/** A fragment shader to convert YUV420P to RGB.
* Input textures Y - is a block of size w*h.
* texture U is of size w/2*h/2.
* texture V is of size w/2*h/2.
* In this case, the layout looks like the following :
* __________
* | |
* | Y | size = w*h
* | |
* |________|